-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up get_grid #66
Comments
I'm fine with getting rid of x/y_name for now. We don't have a use case where this is not applicable currently, and so this is not something we need to support in the near future at least. model top pressure is decided a priori, and The algorithm to calculate the vertical coordinates requires a reference pressure (not necessarily the actual surface pressure) to calculate the coordinates. You will need the actual surface pressure to calculate We will need to put in some thought into the part about getting different grids. Will reply back once we finish submitting the paper ;) I don't think I have the bandwidth to accomplish both in the time remaining. |
This is how I think model top pressure should be defined:
This completely avoids the need for a Sympl constant which may or may not actually be in agreement with the state. |
Nope, any component that modifies the surface pressure should ensure that the other pressure arrays are consistently changed -- When GFS is first called, for instance, there is no guarantee that the arrays have not been already changed to make it inconsistent. There needs to be a reliable way to access such an important constant. |
Look at the modifications I have made to GFS. It does not need the model
top or surface pressures until it is called the first time. At that time,
it gets that information from the state. The user does not need to keep
track of anything. Only get_grid needs the pressures. We can modify Dcmip
to work the same way. I can work on this tomorrow if you like, going to bed
right now.
I'm trying to avoid duplicating information. If we duplicate, we need to do
a lot of work to make sure the two places this info is stored don't become
inconsistent. I think we can do everything we need while only storing the
info in the model state.
…On Mon, Aug 13, 2018, 12:20 AM JoyMonteiro ***@***.***> wrote:
Nope, any component that modifies the surface pressure should ensure that
the other pressure arrays are consistently changed --
DcmipInitialConditions also needs model top pressure. If model top
pressure is not available easily to components, then keeping things
consistent becomes a mess -- you will need the user to remember which
components require model top pressure, which is really unnecessary.
When GFS is first called, for instance, there is no guarantee that the
arrays have not been already changed to make it inconsistent. There needs
to be a reliable way to access such an important constant.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALvMhWNECZTQqMzFbHydnoxltDzAj43wks5uQSiAgaJpZM4V5QR4>
.
|
Yes, I have looked through the GFS code. What I'm pointing out is that if the pressure arrays are modified Sure, we can chat about this once you are awake, but we need to converge on a solution soon. |
If the model top pressure is changed before GFS is called and not changed after, then there's no problem. I'll lay out what I'm thinking in concrete terms. This is what I envision:
If the user changes model top pressure outside of get_grid, one of two things will happen:
I see the above as being pretty air tight against inconsistency. By comparison, this is how I see the constants dictionary approach:
This is similarly tight against inconsistency between the state and the components, where you get exceptions only if you change the model top pressure constant between 2) and 3) (as long as we use step 5). However, there's an additional place the model top pressure is stored - the constants dictionary. If you change it any time after step 3, the constants dictionary model top pressure will be inconsistent with both the state model top pressure (which matters) and the component model top pressure (which doesn't matter as much). The user may believe they've modified the state by setting this constant, when they have done no such thing. It's also uncertain what should actually happen when you change the constants dictionary model top pressure during runtime. Does this mean the defintion of the pressure grid has changed and that the hybrid A and B are actually still valid, so that the state dictionary is inconsistent with itself (assuming it has air pressures stored)? Should GFS not have an internal model top pressure and instead use the updated constant dictionary pressure, and change the pressure arrays when it's passed the state? Or error if the state pressure arrays are inconsistent with the A and B? On top of the potential for inconsistency, I don't like the ambiguities in this way of doing it. On top of that, I think it's very roundabout to pass in configuration of the grid to the constants dictionary, instead of to |
In the end it's a matter of separation of concerns. The state is responsible for storing information about model state (including the grid), and model top pressure is information about the state. Since we can write this to run consistently while only storing model top pressure in |
I'm coming around to your point of view that storing the information in the constants dictionary may not be the best approach. Come to think of it, I think this discussion was not necessary -- a more reliable source of the model top pressure is the hybrid coordinate pair a and b -- the model top pressure is given by Eq. 7 in the Eckermann paper when eta = 0, which is simply This gives the advantage that components don't need to store model top pressure at any point in time, and So, shall we do this? use the coordinates to infer model top pressure for calculations with GFS and Dcmip (for now)? |
Currently GFS will use the coordinates to infer the full pressure profile, and will check the pressure profile in the state against its inferred pressure profile. Dcmip should probably just use It may still be necessary for GFS to check that |
not sure what you mean, but if dcmip uses GFS can check whether the whole of At this point, I'm fine either way. If in the future I see an potential issue, we can take it up then. |
OK, it sounds like Dcmip needs to modify You could add an additional test in GFS to ensure that A and B are the same between time steps. I would still keep the pressure check at each time step (it ensures no other components have made air pressure inconsistent). |
There are some points we should talk about in
get_grid
:x_name
andy_name
be inputs? If those are changed, any components in CliMT that use lat or lon dimensions will break (unexpectedly). I feel like if the user wants to change those for diagnostic reasons, they should do it at the time that they output a netCDF file.get_grid
? The two candidates seem to be setting constants in the constants library, or kwargs. I feel like setting constants is a convoluted way to go about this. There's no reason why the surface pressure should be the reference pressure. And I don't currently understand why model top pressure must be read by a component as a Sympl constant - can't the component just readair_pressure_on_interface_levels
to determine model top pressure? That way would ensure we don't unintentionally develop in consistencies between the model top pressure in the state and the Sympl constant.@JoyMonteiro also brought up a point about e.g. ground schemes wanting to be on separate grids from the atmosphere. The way CliMT is currently set up, I would see that being done by
get_grid
, or by splittingget_grid
into multiple functions (get_atmosphere_grid
,get_land_grid
,get_ocean_grid
, etc.). This also requires couplers. What do you think of this, @JoyMonteiro ?The text was updated successfully, but these errors were encountered: