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

+(*)Pressure gradient corrections under ice shelves #713

Merged
merged 11 commits into from
Sep 17, 2024

Conversation

Hallberg-NOAA
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA commented Aug 17, 2024

This series of 10 commits adds options for correcting the pressure gradient forces in ice-shelf cavities or massive sea-ice or icebergs. These changes include adding the option of using mass-weighting when interpolating the sub-gridscale distributions of temperature and salinity under ice, analogously to what is done near the topography, along with several different options for changing which interface has an distribution of pressure as a function of depth (or vice-versa in non-Boussinesq mode) that can be determined from a combination of hydrostatic changes and a linear large-scale gradient. The new runtime parameters that impact this behavior include CORRECTION_INTX_PA, RESET_INTXPA_INTEGRAL, RESET_INTXPA_H_NONVANISHED and MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP. There are both Boussinesq and non-Boussinesq versions of all these added capabilities, and all the new options have been tested to confirm that they satisfy rotational symmetry and dimensional consistency. By default, these new options are not used and all answers are bitwise identical, but there are new runtime parameters in multiple MOM_parameter_doc files.

The commits in this PR include:

  • 64628f710 +(*)Eliminate CORRECTION_INTXPA_5PT
  • 3a7e4a177 +(*)Add 5-point quadrature in RESET_INTXPA_INTEGRAL
  • c6ec94874 *Non-Boussinesq code for RESET_INTXPA_INTEGRAL
  • 65d998879 *Refactor CORRECTION_INTX_PA
  • 3c9bdfe44 Revisions of sub-ice pressure gradient fixes
  • 37418fc70 +Add RESET_INTXPA_INTEGRAL
  • e0870a826 +Add CORRECTION_INTXPA_5PT
  • 94e4db0a9 +Add CORRECTION_INTXPA
  • 4b9a8c00b +Add top mass_weight_in_PGF option to 13 integrals
  • ecb365e33 +Add MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP

@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request Parameter change Input parameter changes (addition, removal, or description) labels Aug 17, 2024
@Hallberg-NOAA
Copy link
Member Author

An additional commit was added to this PR to add the ability to use a 5-point quadrature integral with RESET_INTXPA_INTEGRAL.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.72%. Comparing base (f1ba822) to head (685e60c).
Report is 6 commits behind head on dev/gfdl.

Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #713      +/-   ##
============================================
- Coverage     36.97%   35.72%   -1.25%     
============================================
  Files           273      270       -3     
  Lines         82517    82070     -447     
  Branches      15437    15509      +72     
============================================
- Hits          30510    29323    -1187     
- Misses        46313    46963     +650     
- Partials       5694     5784      +90     

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

@Hallberg-NOAA
Copy link
Member Author

There is a diagnostic change in the regression tests that is is arising because previously the code diagnosed the value of the mass-weighting that would have been applied if MASS_WEIGHT_IN_PRESSURE_GRADIENT had been true, even if it is false (as is the case in the TC tests). By contrast, with the new code if MASS_WEIGHT_IN_PRESSURE_GRADIENT = False and MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP = False, the reported mass weighting is always 0. Because this diagnostic is not relevant unless one of these two settings is enabled, it probably should not even be calculated or written out in this case.

@Hallberg-NOAA
Copy link
Member Author

Given some of the results that we have gotten from tests that use this new code in realistic ice-shelf cavities, I think that maybe we should simplify the logic of this code by only doing the 5-point quadrature integrals along the interfaces, and avoiding the option to do the simpler but less effective trapezoidal rule integrals. Would you concur with this decision, @claireyung?

@claireyung
Copy link

Given some of the results that we have gotten from tests that use this new code in realistic ice-shelf cavities, I think that maybe we should simplify the logic of this code by only doing the 5-point quadrature integrals along the interfaces, and avoiding the option to do the simpler but less effective trapezoidal rule integrals. Would you concur with this decision, @claireyung?

Sounds good to me!

claireyung and others added 10 commits September 14, 2024 17:03
  Add MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP option for the top boundary, using
top interface height, analogously to what is done near the bathymetry when
MASS_WEIGHT_IN_PRESSURE_GRADIENT.  The information from the is parameter is
encoded in the MassWghtInterp value passed to the various int_density_... and
int_spec_vol_... routines, so the routine interfaces do not change.  For now
this new bit of information about whether to do mass weighting near the surface
under ice shelves is only used in int_density_dz_generic_plm.  By default this
new option is set to false and no answers are changed.
  Implemented the MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP related capabilities to
the 13 density or specific volume integral routines that did not have them yet,
mirroring what was already done in int_density_dz_generic_plm.  This includes
both the density integral routines that are used primarily for Boussinesq cases
and the specific volume integral routines that are primarily used with
non-Boussinesq simulations.

  This change includes the addition of an optional SSH argument to
int_density_dz and 6 other related routines (int_density_dz_generic_pcm,
analytic_int_density_dz, int_density_dz_wright, int_density_dz_wright_full,
int_density_dz_wright_red and int_density_dz_linear).  It also includes the
addition of an optional P_surf argument to int_specific_vol_dp and 7 other
related routines (int_spec_vol_dp_generic_pcm, int_spec_vol_dp_generic_plm,
analytic_int_specific_vol_dp int_spec_vol_dp_wright,
int_spec_vol_dp_wright_full, int_spec_vol_dp_wright_red and
int_spec_vol_dp_linear).  Both of these new optional arguments are required
when the new near-surface mass weighting is activated, and there are test that
would issue a fatal error if they are not provided in such cases.  (Note that
these routines can be called from other places than the pressure gradient force
calculation, in which case the calculations that need these fields are not
done.)

  The diagnose_mass_weight_Z and diagnose_mass_weight_p diagnostic routines were
similarly revised to mirror the expanded range of capabilities in the integral
routines.

  This commit can change answers when MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP is
true, but all answers are bitwise identical otherwise.  There are new arguments
to 15 publicly visible routines.
  Add CORRECTION_INTXPA which makes a quadratic correction to surface pressure
integrals (intx_pa and inty_pa) under ice based on the horizontal gradients of
the in-situ density  anomaly along the surface.  The non-Boussinesq version
corrects the topmost value of intx_za and inty_za and uses in-situ specific
volume gradients along the ocean surface.  By default new the runtime parameter
CORRECTION_INTXPA is false, and answers are unchanged.
  Add CORRECTION_INTXPA_5PT which uses 5 point quadrature to calculate surface
pressure integral and therefore could work with a nonlinear EOS, or (if added)
different subgrid distributions.  This option requires CORRECTION_INTXPA = True.
By default CORRECTION_INTXPA_5PT is false and no answers are changed.
  Add RESET_INTXPA_INTEGRAL which resets intxpa and intypa at a trusted cell in
the interior (non-vanished and non-MWIPG-affected), and then integrates both up
and down to update intxpa and intypa for the interfaces above and below.  This
also adds the new runtime parameter RESET_INTXPA_H_NONVANISHED and to determine
when a cell is trusted.  This option is recommended with
MASS_WEIGHT_IN_PRESSURE_GRADIENT_IS for a quiet zstar ice shelf.  By default,
this option is not on and no answers change, but there are new parameters in
some MOM_parameter_doc files.
  Refactored and revised the recently added code in MOM_PressureForce_FV.F90 to
reduce the number of calls to the equation of state routines, and corrected a
number of minor bugs in the original implementation.  Answers are bitwise
identical unless the new options to reset the pressure gradient calculations are
actively selected.
  Refactored the CORRECTION_INTX_PA calculations to avoid multiple intermediate
steps, while also adding comments documenting the derivation of the final
expression.  Also calculate the pressures used in the equation of state calls
with the Boussinesq CORRECTION_INTX_PA and RESET_INTXPA_INTEGRAL options
consistently with the other terms.  These changes will change the answers when
either of those options are in use, but are bitwise identical when they are not.
  Added non-Boussinesq versions of the code that is exercised when
CORRECTION_INTXPA_5PT and RESET_INTXPA_INTEGRAL are set to true.  These options
use the same names as in their Boussinesq forms, even though the arrays that are
being adjusted are actually intx_za and inty_za.  As a part of the testing of
this commit, several checksums were added to the PressureForce_FV routines;
these are enabled when DEBUG = True.  The changes in this commit will change the
answers in non-Boussinesq cases when either of those options are in use, but are
bitwise identical when they are not, and all Boussinesq answers are bitwise
identical.
  Added code to do 5-point quadrature integrals when RESET_INTXPA_INTEGRAL and
CORRECTION_INTXPA_5PT are true.  Also extended the ranged of interfaces that
can be used for the corrections to include the bottom interface and use the
surface interface for the nonlinear pressure gradient force corrections either
when the ocean surface interface is within the pressure or height range of the
top cell, or when no appropriate interior interface has been found (for lack of
a better idea).  This latter case should probably be reconsidered later.  This
commit will change answers if RESET_INTXPA_INTEGRAL is true and one description
of a runtime parameter in the MOM_parameter_doc files has been revised.
  Eliminated the runtime parameter CORRECTION_INTXPA_5PT by always selecting the
code that would have been used if it were true.  This decision was based on the
relative performance of the options with this set to true or false, and on the
desire to maintain consistency with the 5-point Boole's rule quadrature used
elsewhere in the pressure gradient force calculations.  CORRECTION_INTXPA_5PT
was only added in the same PR as this commit, so it can been simply removed and
there is no need to obsolete it.  This will change answers if CORRECTION_INTXPA
or RESET_INTXPA_INTEGRAL are true and CORRECTION_INTXPA_5PT was set to false,
but otherwise answers are bitwise identical.  There are fewer entries in the
MOM_parameter_doc files as a result of this commit.
@marshallward
Copy link
Member

If we add

MASS_WEIGHT_IN_PRESSURE_GRADIENT = True !   [Boolean] default = False`

to tc1/MOM_input, tc2/MOM_input, and tc4/MOM_input, then the regression tests will pass.

See marshallward#20

I suppose it is covering up a diagnostic regression. But as mention in the comments, no one would ever use this.

  Set MASS_WEIGHT_IN_PRESSURE_GRADIENT = True in the MOM_input files for the
tc1, tc2 and tc4 test cases in .testing, to permit the code to pass this testing
while dealing with inconsistent settings for two diagnostics related to the
mass-weighting in the pressure gradient forces.  This commit redefines these 3
test cases.
@Hallberg-NOAA
Copy link
Member Author

Thanks for that suggestion @marshallward . With the suggested change to the configurations of the TCs, the regression tests are now all passing.

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 0363d2b into NOAA-GFDL:dev/gfdl Sep 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Parameter change Input parameter changes (addition, removal, or description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants