Skip to content
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

+*Non-Boussinesq revision of lateral_mixing_coeffs #447

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

Hallberg-NOAA
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA commented Aug 7, 2023

This commit revises lateral_mixing_coeffs to work in an appropriate mixture of thickness and vertical extent variables to avoid any dependence on the Boussinesq reference density in non-Boussinesq mode, while retaining the previous answers in Boussinesq mode.

This commit adds the new runtime parameter FULL_DEPTH_EADY_GROWTH_RATE to indicate that the denominator of an Eady growth rate calculation should be based on the full depth of the water column, rather than the nominal depth of the bathymetry. The new option is only the default for fully non-Boussinesq cases.

A primordial horizontal indexing bug was corrected in the v-direction slope calculation. Because it only applies for very shallow bathymetry, does not appear to impact any existing test cases and went undetected for at least 12 years, it was corrected directly rather than wrapping in another new runtime flag. However, this bug is being retained for now in a comment to help with review and debugging if the answers should change unexpectedly in some yet-to-be identified configuration.

Two debugging checksums were added for the output variables calculated in calc_resoln_function.

The case of some indices was corrected to follow the MOM6 soft convention using case to indicate the staggering position of variables. The previously incorrect units of one comment were also fixed. There is a new logical element in the VarMix_CS type. To accommodate these changes, there are three new internal variables in calc_slope_functions_using_just_e. A total of 9 GV%H_to_Z conversion factors were eliminated with this commit.

N2 is no longer calculated separately in calc_slope_functions_using_just_e, but this code is left in a comment as it may be instructive. This commit involved changing the units of one internal variable in calc_QG_Leith_viscosity to use inverse thickness units (as its descriptive comment already indicated). There are already known problems with calc_QG_Leith_viscosity as documented with a fatal error; this will be addressed in a subsequent commit.

All answers are bitwise identical in the existing MOM6-examples test suite, but they will change when fully non-Boussinesq, and there is a new entry in some MOM_parameter_doc 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) Parameter change Input parameter changes (addition, removal, or description) labels Aug 7, 2023
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #447 (eea8e02) into dev/gfdl (6d68459) will decrease coverage by 0.01%.
The diff coverage is 47.61%.

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

@@             Coverage Diff              @@
##           dev/gfdl     #447      +/-   ##
============================================
- Coverage     37.84%   37.84%   -0.01%     
============================================
  Files           270      270              
  Lines         78231    78244      +13     
  Branches      14477    14481       +4     
============================================
+ Hits          29606    29610       +4     
- Misses        43238    43242       +4     
- Partials       5387     5392       +5     
Files Coverage Δ
...eterizations/lateral/MOM_lateral_mixing_coeffs.F90 42.15% <47.61%> (-0.38%) ⬇️

... and 1 file with indirect coverage changes

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

Copy link
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.

Changes look good (mostly unrelated to non_Bouusinesq) but the new if blocks in the main loops added more code (and ifs than needed.

Copy link
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.

There are two issues I would like addressed: i) removing a newly added but unused dummy argument, and ii) cleaning up an unnecessary if block.

Copy link
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.

Minor change left

  This commit revises lateral_mixing_coeffs to work in an appropriate mixture of
thickness and vertical extent variables to avoid any dependence on the
Boussinesq reference density in non-Boussinesq mode, while retaining the
previous answers in Boussinesq mode.

  This commit adds the new runtime parameter FULL_DEPTH_EADY_GROWTH_RATE to
indicate that the denominator of an Eady growth rate calculation should be based
on the full depth of the water column, rather than the nominal depth of the
bathymetry.  The new option is only the default for fully non-Boussinesq cases.

  A primordial horizontal indexing bug was corrected in the v-direction slope
calculation.  Because it only applies for very shallow bathymetry, does not
appear to impact any existing test cases and went undetected for at least 12
years, it was corrected directly rather than wrapping in another new runtime
flag.  However, this bug is being retained for now in a comment to help with
review and debugging if the answers should change unexpectedly in some yet-to-be
identified configuration.

  Two debugging checksums were added for the output variables calculated in
calc_resoln_function.

  The case of some indices was corrected to follow the MOM6 soft convention using
case to indicate the staggering position of variables.  The previously incorrect
units of one comment were also fixed.  There is a new logical element in the
VarMix_CS type.  To accommodate these changes there are three new internal
variables in calc_slope_functions_using_just_e.  A total of 9 GV%H_to_Z
conversion factors were eliminated with this commit.

  N2 is no longer calculated separately in calc_slope_functions_using_just_e,
but this code is left in a comment as it may be instructive. This commit
involved changing the units of one internal variable in calc_QG_Leith_viscosity
to use inverse thickness units (as its descriptive comment already indicated).
There are already known problems with calc_QG_Leith_viscosity as documented with
a fatal error; this will be addressed in a subsequent commit.

  All answers are bitwise identical in the existing MOM6-examples test suite,
but they will change when fully non-Boussinesq, and there is a new entry in some
MOM_parameter_doc files.
@adcroft adcroft force-pushed the nonBous_lat_mix_coef branch from 97668a3 to 15673a4 Compare October 5, 2023 20:55
@adcroft
Copy link
Member

adcroft commented Oct 5, 2023

@adcroft adcroft merged commit 13f2603 into NOAA-GFDL:dev/gfdl Oct 5, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the nonBous_lat_mix_coef branch May 10, 2024 22:01
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 Parameter change Input parameter changes (addition, removal, or description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants