-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add ice shelf pressure initialisation bug fix #800
Add ice shelf pressure initialisation bug fix #800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very well done in identifying this bug, @claireyung, and thank you for this contribution. I think that this PR will be ready to go once some very minor white-space formatting issues are addressed in 5 places, as identified in separate comments.
Great work finding this long-standing bug @claireyung This explains why there were residual initialization problems with TRIM_IC_FOR_PSURF when using the non-linear equation of state. This fix should allow us to clean-up the initialization code and get rid of the alternate initialization routine calc_sfc_displacement, which was a workaround for what was apparently the bug you are identifying with this patch. |
Thanks @Hallberg-NOAA and @MJHarrison-GFDL :) Hopefully my new commit resolves the style issues! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is now looking good. Thank you for this fix to a long-standing bug when an ice-shelf is being used with a pressure-dependent equation of state.
This commit adds a new parameter FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX and associated bug fix. This bug occurs when TRIM_IC_FOR_P_SURF pressure initialisation is used for ice shelf, whilst in Boussinesq mode and a nonlinear equation of state. The subroutine trim_for_ice calls cut_off_column_top. This routine in Boussinesq mode calls find_depth_of_pressure_in_cell in MOM_density_integrals.F90. This subsequently calls the function frac_dp_at_pos which calls the density equation of state based on given salinity, temperature and depth, which is incorrectly converted into pressure by z position (which is negative) multiplied by g and rho0. The bug results in incorrect densities from the equation of state and therefore an imperfect initialisation of layer thicknesses and sea surface height due to the displacement of water by the ice. The bug is fixed by multiplying the pressure by -1. This commit introduces parameter FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX with default value False to preserve answers. If true, the ice shelf initialisation is accurate to a high degree with a nonlinear equation of state. Answers should not change, except for the added parameter in MOM_parameter_doc. The same functions are called by a unit test in MOM_state_initialization; in this commit I set the MOM_state_initialization unit test to use the existing bug (with a false flag).
for ice shelf pressure initialisation bug fix FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX
fdfbb2a
to
5c6f47a
Compare
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26048. |
This commit adds a new parameter
FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX
and associated bug fix. This bug occurs whenTRIM_IC_FOR_P_SURF
pressure initialisation is used for ice shelf, whilst in Boussinesq mode and a nonlinear equation of state. The subroutinetrim_for_ice
callscut_off_column_top
. This routine in Boussinesq mode callsfind_depth_of_pressure_in_cell
inMOM_density_integrals.F90
. This subsequently calls the functionfrac_dp_at_pos
which calls the density equation of state based on given salinity, temperature and depth, which is incorrectly converted into pressure by z position (which is negative) multiplied by g and rho0, therefore resulting in a large negative pressure. The bug results in incorrect densities from the equation of state and therefore an imperfect initialisation of layer thicknesses and sea surface height due to the displacement of water by the ice.The bug is fixed by multiplying the pressure by -1.
This commit introduces parameter
FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX
with default value False to preserve answers. If true, the ice shelf initialisation is accurate to a high degree with a nonlinear equation of state. Furthermore, in spurious velocity inverse seamount (icemount) test cases I now get very low velocities with the Wright eqn of state.Answers should not change, except for the added parameter in MOM_parameter_doc.
Note the same functions are called by a unit test in
MOM_state_initialization
; in this commit I set theMOM_state_initialization
unit test to use the existing bug (with the .false. flag). Please let me know if I should do something differently.