Skip to content

*+Non-Boussinesq form of mixedlayer_restrat#426

Merged
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:nonBous_ML_restrat
Aug 21, 2023
Merged

*+Non-Boussinesq form of mixedlayer_restrat#426
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:nonBous_ML_restrat

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

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.

  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.
@Hallberg-NOAA Hallberg-NOAA added bug Something isn't working enhancement New feature or request answer-changing A change in results (actual or potential) labels Jul 26, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 26, 2023

Codecov Report

Merging #426 (f647e9f) into dev/gfdl (4c224e7) will decrease coverage by 0.03%.
The diff coverage is 59.09%.

❗ Current head f647e9f differs from pull request most recent head d5b1bc4. Consider uploading reports for the commit d5b1bc4 to get more accurate results

@@             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     
Files Changed Coverage Δ
...ameterizations/lateral/MOM_mixed_layer_restrat.F90 70.03% <59.09%> (-7.00%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment thread src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
Copy link
Copy Markdown
Member

@adcroft adcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit includes changes to the units of the Kv_restrat, ustar_min and wpup_filtered elements in the mixedlayer_restrat_CS

Is this only for the scaling tests or did the physical units change?

@marshallward
Copy link
Copy Markdown
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/20377 ✔️

@marshallward marshallward merged commit 7e51f1d into NOAA-GFDL:dev/gfdl Aug 21, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_ML_restrat branch September 27, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

answer-changing A change in results (actual or potential) bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants