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

+Optionally use SSH in calculate density for PGF #696

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Added the option of including the atmospheric or ice pressure and sea surface height displacements from the global reference height in the pressures used in the density calculations for Boussinesq pressure gradient calculations. Note that the full pressures were already being used everywhere apart from the calculation of the equation of state. This capability is controlled by the new runtime parameter SSH_IN_EOS_PRESSURE_FOR_PGF. This commit changes the Z_0p argument to int_density_dz() and 8 other routines (int_density_dz_generic_pcm(), int_density_dz_generic_plm(), int_density_dz_generic_ppm(), analytic_int_density_dz(), int_density_dz_wright(), int_density_dz_wright_full(), int_density_dz_wright_red() and int_density_dz_linear()) from scalars into 2-d arrays, as were the internal z0pres arrays in most of these routines. By default, all answers are bitwise identical, but there is a new runtime parameter in the MOM_parameter_doc files for Boussinesq cases.

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

I have re-examined the question of whether the reference height for calculating the pressure used for the equation of state calls is correctly placed relative to the addition of self-attraction and loading adjustments to the geoid, and I am convinced that the order of these two parts of the code is correct.

Copy link

@MJHarrison-GFDL MJHarrison-GFDL 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 reviewed these changes and agree. The new parameter flag SSH_IN_EOS_PRESSURE_FOR_PGF will correctly account for sea surface displacement in the calculation of in situ pressure gradient forces.

@herrwang0
Copy link

hWght = max(0., -bathyT(i,j)-z_t(i+1,j), -bathyT(i+1,j)-z_t(i,j))

I think z_t also needs to be referenced to z0pres as well, and similarly for thickness weighting in other schemes.

@herrwang0
Copy link

For Boussinesq, if we incorporate tidal and SAL potential into interface height, there will be a baroclinic component of these forcing, which means for each layer tidal and SAL (both body forces ) term is different. Maybe we can argue that this is consistent with Boussinesq approximation, but I am not sure.

@Hallberg-NOAA
Copy link
Member Author

hWght = max(0., -bathyT(i,j)-z_t(i+1,j), -bathyT(i+1,j)-z_t(i,j))

I think z_t also needs to be referenced to z0pres as well, and similarly for thickness weighting in other schemes.

After re-inspecting the code, I am pretty sure that z_t does not need to be referenced z0pres because it is being taken relative to bathyT. However, I do think that there is a problem here in that z_t is adjusted for tidal and SAL contributions, but bathyT is not. This can be addressed by replacing the (optional) G%bathyT arguments to the various int_density_dz routines with e(:,:,nz+1), but this could change answers in some cases with tides or SAL enabled, so we should handle this with a bug-fix flag to recover the previous answers, and it should be dealt with separately from this PR.

@Hallberg-NOAA
Copy link
Member Author

For Boussinesq, if we incorporate tidal and SAL potential into interface height, there will be a baroclinic component of these forcing, which means for each layer tidal and SAL (both body forces ) term is different. Maybe we can argue that this is consistent with Boussinesq approximation, but I am not sure.

This is a good question, and I think that the answer is ambiguous to when we are making the Boussinesq approximation. However, I also think that this question goes beyond the scope of what is being addressed with this PR.

  Added the option of including the atmospheric or ice pressure and sea surface
height displacements from the global reference height in the pressures used in
the density calculations for Boussinesq pressure gradient calculations.  Note
that the full pressures were already being used everywhere apart from the
calculation of the equation of state.  This capability is controlled by the new
runtime parameter SSH_IN_EOS_PRESSURE_FOR_PGF.  This commit changes the Z_0p
argument to int_density_dz and 8 other routines (int_density_dz_generic_pcm,
int_density_dz_generic_plm, int_density_dz_generic_ppm, analytic_int_density_dz,
int_density_dz_wright, int_density_dz_wright_full, int_density_dz_wright_red
and int_density_dz_linear) from scalars into 2-d arrays, as were the internal
z0pres arrays in most of these routines.  By default, all answers are bitwise
identical, but there is a new runtime parameter in the MOM_parameter_doc files
for Boussinesq cases.
  Rearranged the calculation of the layer average pressure used in the density
integrals to have one less multiply and be clearer to read.  This could change
answers at roundoff if REFERENCE_HEIGHT is nonzero (it is 0 by default and in
all known cases) or if SSH_IN_EOS_PRESSURE_FOR_PGF is set to true.  Because the
former is mostly used for approximate self-consistency testing and the latter
option has just been added, it is unlikely that answers will change for any
production runs.
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.

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 9b9c165 into NOAA-GFDL:dev/gfdl Sep 11, 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.

4 participants