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

Minor diagnostics code improvements and unit annotations #306

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

Hallberg-NOAA
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA commented Jan 9, 2023

This PR has three commits that improve the diagnostics code, by adding to the description of internal variables and their units, by using rescaled units for 6 globally averaged temperature and salinity diagnostics, and by adding unscale arguments to the various check_redundant and chksum_vec routines that can be used to give debugging error messages that are invariant to dimensional rescaling. A separate commit adds unscale arguments to the various check_redundant calls so that any error messages that are generated by inconsistent redundant points will be invariant to the unit scaling that is in use. All answers and typical output are bitwise identical, but there are new optional arguments to several publicly visible routines.

The commits in this PR include:

  • c4176e5b7 Use unscale args to check_redundant calls
  • 7d3bec493 +Add optional unscale argument to check_redundant
  • c5284bef5 Use rescaled variables for global mean T & S diags

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #306 (62dc4f0) into dev/gfdl (0b857c0) will increase coverage by 0.00%.
The diff coverage is 43.36%.

@@            Coverage Diff            @@
##           dev/gfdl     #306   +/-   ##
=========================================
  Coverage     37.17%   37.17%           
=========================================
  Files           265      265           
  Lines         74402    74407    +5     
  Branches      13822    13822           
=========================================
+ Hits          27659    27664    +5     
- Misses        41658    41659    +1     
+ Partials       5085     5084    -1     
Impacted Files Coverage Δ
src/diagnostics/MOM_debugging.F90 11.39% <8.95%> (+0.13%) ⬆️
src/core/MOM.F90 51.41% <66.66%> (+0.03%) ⬆️
src/core/MOM_dynamics_split_RK2.F90 62.94% <100.00%> (ø)
src/diagnostics/MOM_diagnostics.F90 71.58% <100.00%> (-0.04%) ⬇️
src/framework/MOM_document.F90 73.79% <0.00%> (+0.87%) ⬆️

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

@Hallberg-NOAA Hallberg-NOAA added the documentation Improvements or additions to documentation label Jan 10, 2023
  Use rescaled variables for 6 global mean temperature and salinity diagnostics,
using the tmp_scale arguments to the various global mean functions so that they
have conversion factors that can be verified against their declared units in
their register_scalar_field calls.  Also added or corrected unit descriptions
for a handful of variables in the MOM_diagnostics module.  All answers and
output are bitwise identical.
  Added an optional unscale argument to the various check_redundant and
chksum_vec routines so that the values that are written out in error messages
are independent of rescaling values.  Also added or amended comments to document
the units of numerous internal variables and function arguments in
MOM_debugging.F90.  All answers are bitwise identical, but there are new
optional arguments to several publicly visible routines.
  Added unscale arguments to the various check_redundant calls so that any error
messages that are generated by inconsistent redundant points will be invariant
to the unit scaling that is is in use.  Also rescaled the units of
dtbt_reset_period to [T ~> s] in the MOM_control_struct.  All answers are
bitwise identical, but in some rare debugging output will become consistent.
@Hallberg-NOAA
Copy link
Member Author

This PR has been updated to address concerns from Alistair Adcroft regarding the clarity of the comments describing arbitrary but potentially rescaled units.

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 09880a8 into NOAA-GFDL:dev/gfdl Feb 1, 2023
@Hallberg-NOAA Hallberg-NOAA deleted the annotate_diags 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
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants