*+Non-Boussinesq form of mixedlayer_restrat#426
Merged
marshallward merged 2 commits intoAug 21, 2023
Conversation
Revised the code in MOM_mixed_layer_restrat.F90 to work internally with thickness-based units for the restratification timescale calculation and other internal calculations, which eliminates the dependence in this module on the value of the Boussinesq reference density in non-Boussinesq mode. Several other minor issues (which might not change any answers in production runs) were also fixed. The changes with this commit include: - When in non-Boussinesq mode, the mixed layer buoyancy gradients are determined from the average specific volume referenced to the surface pressure, rather than from the average potential density. - Use find_ustar to set the friction velocities in the appropriate units in the various mixed_layer_restrat routines. - A logical branch was added based on the correct mask for land or OBC points to avoid potentially ill-defined calculations of the magnitude of the Bodner parameterization streamfunction, some which were leading to NaNs. - Set a tiny but nonzero default value for MIN_WSTAR2 to avoid NaNs in some calculations of the streamfunction magnitude. - Within the function mu, the expression for dd was revised in a mathematically equivalent way to avoid any possibility of taking a fractional exponential power of a tiny negative number due to truncation errors, which was leading to NaNs in some cases while developing and debugging the other changes in this commit. This does not appear to change any answers in the existing test cases, perhaps because the mixed layer restratification "tail" is not being activated by setting TAIL_DH to be larger than 0. - The addition of code to both mixedlayer_restrat_Bodner and mixedlayer_restrat_OM4 to determine the mixed layer thickness from its vertical extent when in non-Boussinesq mode. This commit includes changes to the units of the Kv_restrat, ustar_min and wpup_filtered elements in the mixedlayer_restrat_CS type and the units of four arguments to the private function growth_time. CS%wpup_filtered also appears in the restart files generated with some mixed layer restratification settings, and it is rescaled to units of vertical distance or mass per unit area in the restart files depending on whether the model is Boussinesq. There are 17 new or renamed internal variables, while the units of 21 internal variables were changed. 19 rescaling factors were cancelled out or replaced. There are also comments where variable units were corrected or added. The rescaling of several chksum calls for thicknesses was modified to GV%H_to_mks to avoid any dependence on RHO_0 when non-Boussinesq. No public interfaces are changed. All answers are bitwise identical in Boussinesq mode (at least when TAIL_DH=0.), but solutions will change in non-Boussinesq mode when mixed layer restratification is enabled, including changes to the units of a variable in the restart files.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #426 +/- ##
============================================
- Coverage 38.05% 38.02% -0.03%
============================================
Files 269 269
Lines 77418 77508 +90
Branches 14301 14315 +14
============================================
+ Hits 29462 29475 +13
- Misses 42613 42683 +70
- Partials 5343 5350 +7
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
adcroft
reviewed
Jul 28, 2023
adcroft
reviewed
Jul 28, 2023
adcroft
approved these changes
Aug 21, 2023
Member
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/20377 ✔️ |
This was referenced Nov 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revised the code in MOM_mixed_layer_restrat.F90 to work internally with thickness-based units for the restratification timescale calculation and other internal calculations, which eliminates the dependence in this module on the value of the Boussinesq reference density in non-Boussinesq mode. Several other minor issues (which might not change any answers in production runs) were also fixed. The changes with this commit include:
When in non-Boussinesq mode, the mixed layer buoyancy gradients are determined from the average specific volume referenced to the surface pressure, rather than from the average potential density.
Use find_ustar to set the friction velocities in the appropriate units in the various mixed_layer_restrat routines.
A logical branch was added based on the correct mask for land or OBC points to avoid potentially ill-defined calculations of the magnitude of the Bodner parameterization streamfunction, some which were leading to NaNs.
Set a tiny but nonzero default value for MIN_WSTAR2 to avoid NaNs in some calculations of the streamfunction magnitude.
Within the function mu, the expression for dd was revised in a mathematically equivalent way to avoid any possibility of taking a fractional exponential power of a tiny negative number due to truncation errors, which was leading to NaNs in some cases while developing and debugging the other changes in this commit. This does not appear to change any answers in the existing test cases, perhaps because the mixed layer restratification "tail" is not being activated by setting TAIL_DH to be larger than 0.
The addition of code to both mixedlayer_restrat_Bodner and mixedlayer_restrat_OM4 to determine the mixed layer thickness from its vertical extent when in non-Boussinesq mode.
This commit includes changes to the units of the Kv_restrat, ustar_min and wpup_filtered elements in the mixedlayer_restrat_CS type and the units of four arguments to the private function growth_time. CS%wpup_filtered also appears in the restart files generated with some mixed layer restratification settings, and it is rescaled to units of vertical distance or mass per unit area in the restart files depending on whether the model is Boussinesq.
There are 17 new or renamed internal variables, while the units of 21 internal variables were changed. 19 rescaling factors were cancelled out or replaced. There are also comments where variable units were corrected or added.
The rescaling of several chksum calls for thicknesses was modified to GV%H_to_mks to avoid any dependence on RHO_0 when non-Boussinesq.
No public interfaces are changed. All answers are bitwise identical in Boussinesq mode (at least when TAIL_DH=0.), but solutions will change in non-Boussinesq mode when mixed layer restratification is enabled, including changes to the units of a variable in the restart files.