-
Notifications
You must be signed in to change notification settings - Fork 245
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
Possible zero in the denominator in MOM_mixed_layer_restrat #1168
Comments
At first glance this is a good candidate for using Adcroft's rule of reciprocals, namely Another approach might be to take the viscous limit on the mixing rate as floor, namely something like |
@alperaltuntas, can you please post here your initial fix to this issue so we can compare all the alternatives? |
@gustavo-marques and @alperaltuntas, do you have an update on this issue? |
@Hallberg-NOAA, we haven't implemented a fix for this yet. IIRC, the solution I temporarily tested was to skip the computations on land cells, although I am not sure which mask2d is an appropriate test here. Again, this issue occurs only when ustar==0.0, so our current temporary fix is to run with small GUST_CONST when we have to( i.e., when any grid cell corners coincide with the Equator). Also, I am happy to test any of the solutions you proposed. if I interpret your first solution proposal correctly, the fix is to (effectively) set |
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com/NOAA-GFDL/pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com/NOAA-GFDL/pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com/NOAA-GFDL/pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com/NOAA-GFDL/pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com/NOAA-GFDL/pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
Added the runtime parameters KV_RESTRAT and RESTRAT_USTAR_MIN, to build on the improvements in github.com//pull/251, and to provide run-time physical parameters to avoid the potential division by zero in the mixed_layer_restrat code noted at github.com/mom-ocean/issues/1168. Once this PR is merged onto the main branch of MOM6, that issue can be closed. By default, these do not change answers in the MOM6-examples test suite, but the default value for RESTRAT_USTAR_MIN was taken from the hard-coded value in PR that PR. The six copies of the eddy growth rate timescale calculations were consolidated into a new internal function, growth_time, with some other related minor refactoring of the code. Also, mixedlayer_restrat_register_restarts now takes a unit_scale_type arguments like many other analogous routines. All answers are bitwise identical, but there are new runtime parameters or comments that lead to changes in the MOM_parameter_doc files. Also clarified in the comments sent to the MOM_parameter_doc files how VISBECK_L_SCALE works as a dimensional scaling factor when it is given a negative value, and rescaled its units when read as though it were always in m.
This issue has been addressed by NOAA-GFDL#266, which has now been merged onto the main branch of MOM6, and hence this issue can be closed. |
We have a global test case where the corner point is on the Equator. Once we set GUST_CONST=0.0, following the discussion about default parameter changes in one of the dev/calls, this test started failing. The reason being a zero in the denominator of the following calculation:
mom_mixrate = (0.41*9.8696)*u_star**2 / & (absf*h_vel**2 + 4.0*(h_vel+dz_neglect)*u_star)
See relevant lines of code here
There is no issue when GUST_CONST > 0 because that enforces u_star to be > 0. However, since the corner point is on the Equator
absf
is problematic and perhaps must be bounded:absf = 0.5*(abs(G%CoriolisBu(I-1,J)) + abs(G%CoriolisBu(I,J)))
@alperaltuntas has come up with a possible way of avoiding this issue, but it would be good to get @Hallberg-NOAA's option before we send a PR.
The text was updated successfully, but these errors were encountered: