Skip to content

+Refactor totalTandS to optionally work with scaled variables #827

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

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Refactored totalTandS() and totalStuff() to optionally work with scaled variables, by adding an optional unit_scale_type argument and a optional argument specifying the unscaling of thickness to totalTandS() and an optional unscale argument to totalStuff(). The comments describing the units of 19 variables were modified to reflect the various units that might be used. All solutions are bitwise identical, and output is unchanged when dimensional rescaling is not being used, but the debugging output can now be unaltered by the use of dimensional rescaling. There are new optional arguments to two publicly visible routines.

This change has been tested via calls to totalTandS() added to step_MOM_thermo(), but because totalTandS() is only intended for debugging, these testing calls are commented out. I am uncertain whether to ultimately retain these comments to illustrate the use of totalTandS() or whether to delete them before this PR is merged into dev/gfdl, but retaining them for now seems like they may help the PR review process.

@Hallberg-NOAA Hallberg-NOAA added the enhancement New feature or request label Feb 5, 2025
@marshallward marshallward assigned marshallward and unassigned adcroft Apr 7, 2025
Copy link
Member

@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.

This looks good to me. I added some comments that you may want to consider before merging.

@Hallberg-NOAA
Copy link
Member Author

Hallberg-NOAA commented Apr 7, 2025

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/27056.

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.

Project coverage is 21.66%. Comparing base (8be87a2) to head (4e27812).

Files with missing lines Patch % Lines
src/diagnostics/MOM_debugging.F90 0.00% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #827      +/-   ##
============================================
- Coverage     21.66%   21.66%   -0.01%     
============================================
  Files           137      137              
  Lines         33238    33245       +7     
  Branches       5972     5973       +1     
============================================
  Hits           7202     7202              
- Misses        25479    25486       +7     
  Partials        557      557              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  Refactored totalTandS and totalStuff to optionally work with scaled
variables, by adding an optional unit_scale_type argument and a optional
argument specifying the unscaling of thickness to totalTandS and an optional
unscale argument to totalStuff.  The comments describing the units of 19
variables were modified to reflect the various units that might be used.  All
solutions are bitwise identical, and output is unchanged when dimensional
rescaling is not being used, but the debugging output can now be unaltered by
the use of dimensional rescaling.  There are new optional arguments to two
publicly visible routines.

  This change has been tested via calls to totalTandS added to step_MOM_thermo,
but because totalTandS is only intended for debugging, these testing calls are
commented out.  I am uncertain whether to ultimately retain these comments to
illustrate the use of totalTandS or whether to delete them before this PR is
merged in, but retaining them for now seems like they may help the PR review
process.
@Hallberg-NOAA Hallberg-NOAA merged commit 6eca7bb into NOAA-GFDL:dev/gfdl Apr 8, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the refactor_totalTandS branch April 22, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants