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

(*)Corrected the units of VarMix_CS%slope_x #314

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

Hallberg-NOAA
Copy link
Member

VarMix_CS%slope_x was being set with units of [Z L-1 ~> nondim], but described in comments as though it was simply [nondim], and then used in the (apparently unused?) calculate_slopes=.false. branch in calc_slope_functions_using_just_e as though its units actually were [nondim]. This commit corrects this inconsistency, while also rescaling the internal slope variables in that routine to also have the proper units of [Z L-1 ~> nondim]. In so doing, several rescaling factors could be eliminated from the calculations. In addition, the slopes used in calc_QG_Leith_viscosity were also being rescaled with the wrong factor or had dimensionally incorrect tiny values in some denominators, and this has been corrected as well. In testing this rescaling fix, a number of other bugs were identified with USE_QG_LEITH_VISC=True (as described at github.com/mom-ocean/issues/1590), so a fatal error message was added if this option is enabled. All answers in the MOM6-examples test suite are bitwise identical, but the code will now give a fatal error if USE_QG_LEITH_VISC=.true.

 VarMix_CS%slope_x was being set with units of [Z L-1 ~> nondim], but described
in comments as though it was simply [nondim], and then used in the (apparently
unused?) calculate_slopes=.false. branch in calc_slope_functions_using_just_e as
though its units actually were [nondim].  This commit corrects this
inconsistency, while also rescaling the internal slope variables in that routine
to also have the proper units of [Z L-1 ~> nondim].  In so doing, several
rescaling factors could be eliminated from the calculations.  In addition, the
slopes used in calc_QG_Leith_viscosity were also being rescaled with the wrong
factor or had dimensionally incorrect tiny values in some denominators, and this
has been corrected as well.  In testing this rescaling fix, a number of other
bugs were identified with USE_QG_LEITH_VISC=True (as described at
github.com/mom-ocean/issues/1590), so a fatal error message was added if
this option is enabled.  All answers in the MOM6-examples test suite are bitwise
identical, but the code will now give a fatal error if USE_QG_LEITH_VISC=.true.
@Hallberg-NOAA Hallberg-NOAA added bug Something isn't working documentation Improvements or additions to documentation answer-changing A change in results (actual or potential) labels Jan 26, 2023
@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Merging #314 (4779bf1) into dev/gfdl (b22617c) will decrease coverage by 0.01%.
The diff coverage is 46.66%.

@@             Coverage Diff              @@
##           dev/gfdl     #314      +/-   ##
============================================
- Coverage     37.17%   37.17%   -0.01%     
============================================
  Files           265      265              
  Lines         74401    74402       +1     
  Branches      13821    13822       +1     
============================================
- Hits          27661    27659       -2     
- Misses        41655    41658       +3     
  Partials       5085     5085              
Impacted Files Coverage Δ
src/parameterizations/lateral/MOM_hor_visc.F90 50.31% <0.00%> (-0.10%) ⬇️
src/diagnostics/MOM_wave_speed.F90 44.17% <33.33%> (-0.11%) ⬇️
...eterizations/lateral/MOM_lateral_mixing_coeffs.F90 42.64% <52.00%> (ø)
src/framework/MOM_document.F90 72.92% <0.00%> (-0.22%) ⬇️

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

  Incorporated a slope squared rescaling factor into the definition of the
local N2min variable in wave_speed, thereby eliminating 4 points in the code
where rescaling had been necessary and another local variable.  All answers
and output are bitwise identical.
@Hallberg-NOAA
Copy link
Member Author

Another small commit related to this pull request was added that eliminates some rescaling factors in wave_speed() by folding a slope rescaling factor into a local variable that sets a floor on the stratification.

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 0b857c0 into NOAA-GFDL:dev/gfdl Jan 31, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the slope_units branch May 10, 2024 22:21
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 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants