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

Refactor ice shelf rescaling and diagnostic calcs #795

Merged

Conversation

Hallberg-NOAA
Copy link
Member

This PR consists of two commits that refactor the MOM6 ice_shelf code to work more extensively in rescaled variables, and to do the unscaling of all diagnostics by the conversions arguments to register_diag_field() or register_scalar_field() calls.
These change make use of the recently added unscale argument to reproducing_sum(). Several missing unit conversion factors for rates of mass change were also added, and the diagnostics have now been verified to pass dimensional consistency testing. After these commits, all of the dimensional scaling factors for diagnostics in the ice_shelf code occur via conversion factors that are immediately adjacent to the declaration of the units of those diagnostics, facilitating comparison for consistency.

The specific changes included refactoring of volume_above_floatation(), write_ice_shelf_energy() and ice_shelf_solve_outer() to work in rescaled arguments, and the conversion of integrate_over_Ice_sheet_area() into a function that returns the integral in rescaled units.

The declared units of one diagnostic, "taub_beta", were revised from "MPa s m-1" to "MPa yr m-1" to be consistent with its conversion factor, which was also corrected (essentially by a factor of [Z L-1 ~> 1]).

The input scale factor for the (perhaps unused) variable INPUT_VEL_ICE_SHELF was corrected from US%m_s_to_L_T*US%m_to_Z to just US%m_s_to_L_T. This could change answers for some rescaled configurations with forced inflow into an ice sheet, such as that of Goldberg et al., (2010), but such configurations do not appear to be used much.

As a part of these changes, comments documenting the units of about 26 real variables were added or corrected.

With these changes, all solutions in our test cases are bitwise identical and are passing dimensional consistency testing. The ice shelf diagnostics should now be invariant when dimensional rescaling is applied, and the units of the ice shelf diagnostics are now all consistent with the required rescaling factors. The commits in this PR include:

  • d9344bd1a (*)Conversion arguments for ice shelf scalar diags
  • 4d8d2a74f Revise the ice_shelf dimensional rescaling

@Hallberg-NOAA Hallberg-NOAA added bug Something isn't working refactor Code cleanup with no changes in functionality or results labels Jan 4, 2025
Copy link

@alex-huth alex-huth left a comment

Choose a reason for hiding this comment

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

I have run dimensional consistency tests that confirm these changes to scaling factors are correct. Comments documenting or correcting the units of variables also appear to be correct.

  Refactored the volume_above_floatation, write_ice_shelf_energy and
ice_shelf_solve_outer routines to work in rescaled units by making use of the
unscale arguments to reproducing_sum().  Also added or corrected comments
documenting the units of 11 real variables in these routines.

  The routine integrate_over_Ice_sheet_area was converted into a function and
var_scale was renamed to unscale for more consistency with the rest of the MOM6
code.  Additionally, add_shelf_flux and update_shelf_mass were modified to use
the scale arguments to time_interp_external.

  A total of 12 rescaling variables were eliminated or moved into unscale
arguments, and 2 blocks of code that scale input variables were eliminated.  All
answers and diagnostics are bitwise identical, and no interfaces are changed.
  Revised volume_above_floatation and integrate_over_ice_sheet_area to return
values in scaled units, and added conversion factors to the
register_scalar_field calls in MOM_ice_shelf so that all unit unscaling of
diagnostics occurs via  the diag mediator and not in the code itself.  After
this commit, all of the dimensional scaling factors for diagnostics in the
ice_shelf code occur via conversion factors that are immediately adjacent to the
declaration of the units of those diagnostics, facilitating comparison for
consistency.

  The declared units of one diagnostic, "taub_beta", were revised from "MPa s
m-1" to "MPa yr m-1" to be consistent with its conversion factor, which was also
corrected (essentially by a factor of [Z L-1 ~> 1].  Several missing unit
conversion factors for rates of mass change were also added, and about 15
missing or incorrect units in lines documenting real variables were added or
fixed.

  The input scale factor for the (perhaps unused) variable INPUT_VEL_ICE_SHELF
was corrected from `US%m_s_to_L_T*US%m_to_Z` to just `US%m_s_to_L_T`.

  With these changes, all solutions are bitwise identical, apart from regional
cases with a specified inflow when run with dimensional rescaling.  The ice
shelf diagnostics should now be invariant when dimensional rescaling is applied,
and the units of the ice shelf diagnostics are now all consistent with the
required rescaling factors.
@Hallberg-NOAA Hallberg-NOAA force-pushed the revise_ice_shelf_rescaling branch from d9344bd to 62334f3 Compare January 8, 2025 10:05
@Hallberg-NOAA
Copy link
Member Author

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

@Hallberg-NOAA Hallberg-NOAA merged commit 5d3d504 into NOAA-GFDL:dev/gfdl Jan 8, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the revise_ice_shelf_rescaling branch January 14, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants