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

(*)Fixes implementation of minimum viscosity #800

Merged
merged 1 commit into from
Jun 26, 2018
Merged

(*)Fixes implementation of minimum viscosity #800

merged 1 commit into from
Jun 26, 2018

Conversation

adcroft
Copy link
Collaborator

@adcroft adcroft commented Jun 25, 2018

This fixes a bug that:

  • meant the minimum viscosity was not doing anything in the tension component;
  • was breaking the backscatter parameterization.

While this does not change any of our active tests this will change answers for experiments using KH_BG_MIN or the backscatter scheme.

- The minimum viscsoity was only being applied in the strain component.
  The minimum with KH_BG_MIN was not applied to the tension component.
  This broke isotropy of the stress tensor.
- The parameter KH_BG_MIN defaults to 0.0 which would be harmless if
  viscosities are always non-negative. However, when using backscatter
  the viscosity is intentionally negative and this limiter was zeroing
  out the backscatter, but only in the strain component.
  - I've moved the min() function to before adding in the MEKE component
    which is where negative viscosities might come from.
- This does not change answers in any tests BUT will change answers for
  any backscatter experiments OR where KH_BG_MIN is non-zero.
@adcroft adcroft added the bug label Jun 25, 2018
@adcroft
Copy link
Collaborator Author

adcroft commented Jun 25, 2018

@Hallberg-NOAA Hallberg-NOAA merged commit 3b5657b into mom-ocean:dev/gfdl Jun 26, 2018
@adcroft adcroft deleted the bugfix-minimum-visc branch July 10, 2018 12:43
herrwang0 pushed a commit to herrwang0/MOM6 that referenced this pull request Jan 15, 2025
* Add ice shelf pressure initialisation bug fix

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

* Resolve indenting and white space inconsitencies with MOM6 style
for ice shelf pressure initialisation bug fix FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX
ashao pushed a commit to ashao/MOM6 that referenced this pull request Jan 30, 2025
* Add ice shelf pressure initialisation bug fix

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

* Resolve indenting and white space inconsitencies with MOM6 style
for ice shelf pressure initialisation bug fix FRAC_DP_AT_POS_NEGATIVE_P_BUGFIX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants