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

MOM6: +(*)Dimensional consistency completion #1040

Merged
merged 7 commits into from
Dec 6, 2019

Conversation

Hallberg-NOAA
Copy link
Collaborator

This PR corrects some dimensionally inconsistent expressions in the tracer
advection code and cleans up or improves dimensional consistency testing in a
few places, with dimensional rescaling now working over at least a range of
2^-120 to 2^120 ~= 1.3e+/-36 for all 5 rescaled units (T, L, H, R, and Z). At this
point, I believe that instrumenting the MOM6 code for dimensional consistency
testing is essentially complete, and there are unlikely to be any more
inconsistent expressions that are exercised by the MOM6-examples regression
tests. No answers in the MOM6-examples test suite or MOM_parameter_doc files
are changed. The commits in this PR include:

  Added conversion factors to 4 mass-flux diagnostics and comments to 4 others
on why no conversion factors are needed.  All answers are bitwise identical.
  Added scale arguments to 5 chksum calls and grouped another two chksum calls
while also adding the right scaling argument. All answers are bitwise identical.
  Undoes the dimensional scaling of the cell areas before taking their global
sum, so that the reproducing sum does not overflow when there is dimensional
rescaling.  All answers are bitwise identical when there is no rescaling, but
this eliminates a source of inadvertent overflows or underflows in the global
sums, and there is a new optional argument to compute_global_grid_integrals.
  Corrects the dimensionally inconsistent expressions for the CFL number in
the tracer advection code, in which a negligible thickness had been added to
the cell volume to avoid division by zero.  This change does not alter the
solutions in the MOM6-examples test cases, but now it permits dimensional
rescaling of lengths over a much larger range, and it could change answers if
the minimum layer thicknesses are small enough.
  Unscale interface heights before taking a global average via a reproducing sum
in non-Boussinesq mode global diagnostics to permit dimensional consistency
testing over a larger range.  All answers are bitwise identical.
  Added an optional tmp_scale argument to global_i_mean and global_j_mean to
specify an internal rescaling of variables being averaged before the reproducing
sum.  All answers are bitwise identical, but there are new optional arguments
to two public interfaces.
  Use tmp_scale when taking the i-mean interface heights for i-mean sponges, to
give a greatly expanded range of dimensional consistency testing.  All answers
are bitwise identical.
@Hallberg-NOAA
Copy link
Collaborator Author

This PR is being tested with https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/9465

@codecov-io
Copy link

codecov-io commented Dec 5, 2019

Codecov Report

Merging #1040 into dev/gfdl will increase coverage by <.01%.
The diff coverage is 46.87%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/gfdl    #1040      +/-   ##
============================================
+ Coverage     45.09%   45.09%   +<.01%     
============================================
  Files           212      212              
  Lines         62578    62588      +10     
============================================
+ Hits          28217    28222       +5     
- Misses        34361    34366       +5
Impacted Files Coverage Δ
src/core/MOM_forcing_type.F90 71.13% <ø> (ø) ⬆️
src/diagnostics/MOM_sum_output.F90 60.71% <0%> (-0.1%) ⬇️
src/parameterizations/vertical/MOM_sponge.F90 0% <0%> (ø) ⬆️
src/initialization/MOM_state_initialization.F90 31.53% <0%> (-0.04%) ⬇️
src/core/MOM_dynamics_split_RK2.F90 87.47% <100%> (ø) ⬆️
src/initialization/MOM_shared_initialization.F90 38.19% <100%> (+0.1%) ⬆️
src/core/MOM.F90 69.48% <100%> (ø) ⬆️
src/tracer/MOM_tracer_advect.F90 69.03% <100%> (ø) ⬆️
src/initialization/MOM_fixed_initialization.F90 71.23% <100%> (ø) ⬆️
...parameterizations/vertical/MOM_set_diffusivity.F90 64.43% <100%> (-0.05%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9a7f98...274a613. Read the comment docs.

Copy link
Collaborator

@marshallward marshallward left a comment

Choose a reason for hiding this comment

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

Very good changes but recommend renaming tmp_scale to something more meaningful in the future.

@marshallward marshallward merged commit 4d7a947 into mom-ocean:dev/gfdl Dec 6, 2019
@Hallberg-NOAA Hallberg-NOAA deleted the rescale_diag_fix branch July 30, 2021 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants