-
Notifications
You must be signed in to change notification settings - Fork 0
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
Verify global model #315
Verify global model #315
Conversation
add module docstring
- add verification diffusion.init for global experiment
cscs-ci run |
…le for experiment
…le for experiment
enable tests for both experiments in test_diffusion.py and test_velocity_advection.py remove caching in common/grid/base.py
change offset bound in velocity_advection.py
cscs-ci run |
launch jenkins spack |
cscs-ci run |
launch jenkins spack |
cscs-ci run |
launch jenkins spack |
launch jenkins icon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a lot of work! Looks good overall. I mostly have minor comments, but we do need to pay some attention to tolerances.
def test_smagorinski_factor_for_diffusion_type_4(r04b09_diffusion_config): | ||
config = r04b09_diffusion_config | ||
def test_smagorinski_factor_for_diffusion_type_4(experiment): | ||
config = construct_config(experiment, ndyn_substeps=5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the ndyn_substeps
hard-coding here okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is hardcoded? I don't understand what you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought ndyn_substeps=5
should go into the part where the rest of the namelist options are present. But if it's a temporary design thing, that's fine.
interpolation_state=interpolation_state, | ||
edge_params=edge_geometry, | ||
cell_params=cell_geometry, | ||
assert dallclose(diffusion.enh_smag_fac.asnumpy(), savepoint.enh_smag_fac(), rtol=1e-7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tolerances seem a little high. Is it also the case with blue line?
@@ -1834,9 +1900,11 @@ def run_corrector_step( | |||
vertical_end=self.grid.num_levels, | |||
offset_provider={}, | |||
) | |||
# TODO (magdalena) stencil_60 is missing here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what we are doing about stencil 60? Will it be in a later PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is why I added the TODO. Did not want to fix this in the same PR.
exner_incr: Field[[EdgeDim, KDim], float] # exner increment [- ] | ||
exner_incr: Field[[CellDim, KDim], float] # exner increment [- ] | ||
|
||
exner_dyn_incr: Field[[CellDim, KDim], float] = None # exner pressure dynamics increment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need to add a test for IAU mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no IAU mode in greenline. There is no way we are going to do any data assimilation soon in greenline, so I don't see what we should test there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. i meant that we don't have any data assimilation tests at all (blue or greenlines), but we have the stencils. We should think eventually about adding tests for this. Not in this PR ofc.
diagnostic_state_nh.mass_fl_e.asnumpy(), | ||
rtol=1e-10, | ||
savepoint_nonhydro_exit.mass_fl_e().asnumpy(), | ||
rtol=5e-7, # TODO (magdalena) was rtol=1e-10 for local experiment only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems weird. there are no prescribed tolerances for this stencil in the blueline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I agree its weird. I have not been able to locate any possible bug, which of course does not mean its not there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add an issue to track this, if we want to get it merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prep_adv.vn_traj.asnumpy(), | ||
rtol=1e-10, | ||
savepoint_nonhydro_exit.vn_traj().asnumpy(), | ||
rtol=5e-7, # TODO (magdalena) was rtol=1e-10 for local experiment only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two tolerances are questionable too. different from blueline
def zd_diffcoef(self): | ||
return self._get_field("zd_diffcoef", CellDim, KDim) | ||
|
||
@optionally_registered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It accounts for those fields being present in the global run, because they do not even get allocated there, so they are not registered in the serialbox savepoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay thanks!
|
||
from icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro import NonHydrostaticConfig | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess an alternative method would be to define the entire config (diffusion + nonhydro + ...) for LAM or APE experiments, and then individual configs will pick up the config they need. But not sure about pros and cons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. Where this should go is: some thing ( a class what ever) reads the configuration from file does necessary consistency checks and divides it up into the configuration bits needed for the individual components.
@@ -99,12 +104,13 @@ def apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance( | |||
vertical_start: int32, | |||
vertical_end: int32, | |||
): | |||
_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulance( | |||
_apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for changing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You can merge after syncing/testing.
cscs-ci run |
launch jenkins spack |
remove empty diagnostic_state.py remov l_open_ubc from solve_nonhydro.py
cscs-ci run |
launch jenkins spack |
Mandatory Tests Please make sure you run these tests via comment before you merge!
Optional Tests In case your change might affect downstream icon-exclaim, please consider running
For more detailed information please look at CI in the EXCLAIM universe. |
cscs-ci run |
launch jenkins spack |
Add verification for a global model experiment (exclaim_ape_R02B04)
apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence.py
to allow for shear_type (see icon-exclaim PR)NonHydrostaticConfig
now uses ICON default values as default parametersk_start_moist
debug
log statements toSolveNonHydro
Further fixes :
model/common
onmodel/atmosphere/diffusion
by moving construction of the diffusion specific types from serialbox data out ofcommon/test_utils
data_handling.py
dallclose
such that the reference values comes in second place seedycore/state_utils
andcommon/test_utils/serialbox_utils.py
,VectorTuple
type