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

Prepare for PR to dev/gfdl #6

Open
wants to merge 1,579 commits into
base: merge-bgc-obc-3_fix_restart
Choose a base branch
from

Conversation

nikizadehgfdl
Copy link
Owner

No description provided.

nikizadehgfdl pushed a commit that referenced this pull request Aug 12, 2022
Add initialization tests using CS%initialized
@marshallward marshallward force-pushed the dev/gfdl branch 3 times, most recently from 8a66adc to 9de6ce7 Compare September 11, 2023 18:27
Hallberg-NOAA and others added 25 commits July 13, 2024 05:55
  Cleaned up the error messages when there are fatal problems in
interpolate_for_nondim_position() in the MOM_neutral_diffusion module to
explicitly give an indications of all the problems.  These had previously
triggered fatal errors (or should have), but had less explicit or incorrect
error messages in some cases, so all solutions and behavior are identical in any
cases that worked previously.
  Corrected the case of the do-loop index variable in 10 places in 6 files,
initialized two whole diagnostic arrays to 0 instead of having shared loops
initializing u- and v-point arrays, and shortened two loops initializing
pressures to the size that is actually used in the corresponding equation of
state calls.  With these changes, there are no i- or j- loops with extents that
are inconsistent with the stagger-based index case convention used throughout
the MOM6 code.  All answers are bitwise identical in all cases.
  Replaced 382 scale arguments with unscale arguments in calls to chksum
routines, and did the same in another 5 calls to global_mean or global_integral
routines.  Also added 2 missing unscale arguments to checksums for the initial
velocities, which probably had gone undetected because we usually initialize
velocities to 0.  All answers and diagnostic debugging output (apart from the
afore noted checksums of the initial velocities in some rare case) are bitwise
identical.
  Added the new function query_debugging_checks to the MOM_debugging module to
return flags indicating what types of debugging are enabled, including checksums
or redundant value checks.  This new routine is used to allow for the redundant
value checks in various step_MOM routines to be enabled or disabled at run-time
when debugging is on overall (by setting DEBUG = True).  For cases with
inconsistent redundant points, this change allows for a reduction in the volume
of debugging information sent to stdout from multiple PEs (in an arbitrary
order), while for cases without inconsistent redundant points this change will
allow for faster debugging with checksums alone.  All answers are bitwise
identical, but there is a new publicly visible routine.
  This commit restores the effectiveness of the runtime parameter
USE_WRIGHT_2ND_DERIV_BUG in determining whether a bug is corrected in the
calculation of two of the second derivative terms returned by
calculate_density_second_derivs_elem() with the "WRIGHT" equation of state,
recreating the behavior (and answers) that are currently on the main branch of
MOM6.  To do this, it adds and calls the new routine set_params_buggy_Wright()
when appropriate, and adds the new element "three" to the buggy_Wright_EOS type.
When the bug is fixed, buggy_Wright_EOS%three = 3, but ...%three = 2 to
recreate the bug.  This commit does change answers for cases using the "WRIGHT"
equation of state and one of the "USE_STANLEY_..." parameterizations from those
on the dev/gfdl branch of MOM6, but in so doing it restores the answers on the
main branch of MOM6.  There is also a new publicly visible subroutine.
  Moved a check for whether to initialize an uninitialized visc%h_ML field from
visc%MLD outside of the test for the value of CS%mixedlayer_restart.  This
change will prevent answer changes between code versions for certain cases that
initialize from a restart file, use the melt_potential field and have
MLE_USE_PBL_MLD = True but also have MIXEDLAYER_RESTRAT = False.  This commit
corrects a very specific oversight that was introduced when the roles of
visc%h_ML and visc%MLD were separated, and it can change answers (reverting them
to answers from older versions of the main branch of MOM6) in very specific
cases where MOM6 is initialized from a restart file from an older versions of
the code, including the 5x5-degree test case in the dev/emc regression suite.
  Added checksum calls for the melt_potential, ocean_mass, ocean_heat and
ocean_salt elements of the surface state in MOM_surface_chksum if these fields
are allocated for more comprehensive debugging.  Also added the symmetric
optional argument to the call to MOM_surface_chksum form extract_surface_state
so that all of the surface velocity values that could contribute to the ocean
surface velocities that are seen by the coupler are checksummed.  All solutions
are bitwise identical, but there are enhancements to the MOM6 debugging
capabilities.
The module MOM_harmonic_analysis computes the constant coefficients
of sine/cosine functions for the SSH and barotropic velocity fields
of each tidal constituent.
Performance optimization for subroutine HA_solver.
  Optionally corrected a bug (essentially a sign error) in the selection of
where MASS_WEIGHT_IN_PRESSURE_GRADIENT is applied in non-Boussinesq test cases.
The (incorrect) non-Boussinesq version of the test for where interfaces are
outside of the range of hydrostatic consistency due to interactions with
bathymetry was converted from the (correct) Boussinesq version without properly
taking into account that pressure increases downward while height increases
upward.  This bug is repeated 12 times in 6 different specific volume integral
routines, including in the analytical specific volume integrals with 4 equations
of state.

  To accommodate these corrections as well as a future expansion of the
mass weighting to apply near the surface under ice-shelves or icebergs, the
previous optional logical argument (useMassWghtInterp) was replaced with a new
optional integer argument (MassWghtInterp) that can be used to encode
information about where this weighting is applied as well as whether to fix this
bug.

  This combination of settings (MASS_WEIGHT_IN_PRESSURE_GRADIENT = True and
non-Boussinesq) does not seem to be widely used yet (it is not used in the GFDL
regression suite), so rather than preserving the old (incorrect) solutions by
default, this bug is corrected by default.  However, the previous answers can be
recovered by setting the new runtime parameter MASS_WEIGHT_IN_PGF_NONBOUS_BUG to
true.  This parameter that is only used (and logged) for non-Boussinesq cases
with MASS_WEIGHT_IN_PRESSURE_GRADIENT set to true.  It is intended that this new
runtime bug-fix parameter will be obsoleted with an aggressive schedule if it
is not needed to recreate any production runs.

  In addition, there are two new diagnostics, MassWt_u and MassWt_v, that show
the fractional (0 to 1) effects of the mass weighting in the pressure gradient
forces at the velocity points, along with the new diagnostic subroutines
diagnose_mass_weight_Z and diagnose_mass_weight_p that calculate these
diagnostics by layer in code that replicates the 13 copies for various
equations of state and vertical structures within layers.

  By default, this commit does change answers in non-Boussinesq cases that use
MASS_WEIGHT_IN_PRESSURE_GRADIENT = True, and there is a new runtime parameter
in such cases.  There are also two new diagnostics.  Answers are bitwise
identical in all Boussinesq cases.
breichl and others added 30 commits February 5, 2025 18:03
* Correct bug in kappa shear viscosity with vertex shear option.

- Viscosities at vertices along the coast were incorrectly zero'd out.  This commit removes that mask so the non-zero shear driven viscosities can be interpolated from in the model.  This bug caused diffusivities to be very large in channels and potentially near coastlines.
- A bugfix flag is added with an option to use the current behavior for legacy purposes.

* Fix missing paranthesis in previous commit (VS_viscosity_bug)

* Update logging of vertex shear viscosity bug parameter
  Add the new runtime parameter PHILLIPS_ANSWER_DATE to enable the option to use
mathematically equivalent expressions in Phillips_initialize_velocity() that
exactly specify the arithmetic to be used, avoid excess divisions and permit
full rescaling of the internal variables and the elimination of rescaling
variables.  This new slightly answer-changing option is enabled by setting
PHILLIPS_ANSWER_DATE >= 20250101.  For now, the default for PHILLIPS_ANSWER_DATE
is set to 20241231 to avoid changing answers without explicitly setting it.

  This commit also introduces code to use G%grid_unit_to_L to detect and handle
various choices for the units of the G%geolat and G%geolon variables.

  By default, all answers are bitwise identical, but there is a new runtime
parameter in some MOM_parameter_doc files.  This commit changes answers at
roundoff when there is an explicit setting of PHILLIPS_ANSWER_DATE >= 20250101,
  Added the new zero_zeros optional argument to the 10 MOM_write_field routines
in MOM_io and the 6 rescale_comp_data routines in MOM_domain_infra to cause
negative zeros to replaced with ordinary signless zeros before they are written
out to files.  This has no impact at all on answers, but it does help with
comparisons between rotated restart files, in which meaningless differences
between positive and negative zeros were leading to false differences between
files.  All answers are bitwise identical, and all output is equivalent, but
there are new optional arguments to 16 routines covered by 2 publicly visible
interfaces.
  Added a new turns optional argument to 6 versions of the MOM_read_data
routines to allow for the reading to override the number of turns in the
MOM_domain that is passed into these routines.  Several internal turns variables
in the same routines were renamed qturns to allow for the new optional
arguments. Also check for whether the MOM_domain%domain_in pointer is associated
before it is used, avoiding a segmentation fault that was occurring when a
restart file is read and ROTATE_INDEX is true.  Also added rotate_array calls to
ensure that the halo values are retained while reading data into a rotated
array.  These changes are necessary to allow for the model to be initialized
from a restart files with rotated grids.  Several instances of continuation line
indentation that do not follow the typical 4-space pattern used elsewhere in the
MOM6 code and documented in the MOM6 style guide were also altered to follow the
standard.  All answers that previously worked are bitwise identical, but there
are new optional arguments to publicly visible interfaces.
  Modified MOM_restart so that restart files generated by rotated runs match
unrotated restart files, and the model can be properly initialized from a
restart file when the grid is rotated.  Also added runtime options to convert
negative zeros into ordinary zeros before they are written to restart files
(selected with RESTART_UNSIGNED_ZEROS) and to properly do the checksums on the
velocity points on all of the faces (selected with RESTART_SYMMETRIC_CHECKSUMS).

  Also added the new interfaces copy_restart_var and copy_restart vector to use
the names of restart variables and the pointers stored in the restart control
structure to obtain a copy of the variables as the restart variables with the
option to undo the rotation.  These routines are necessary because the reading
of restart files occurs during a phase of the model initialization that works on
an unrotated grid, and they are called from inside of MOM_initialize_state.

  The ranges for the checksums are now set correctly for each variable,
depending on where it is discretized, but when RESTART_SYMMETRIC_CHECKSUMS is
false, the previous ranges are still used so answers do not change in unrotated
test case.

  The conversion factors used for the pair of register_restart_field calls in
register_restart_pair now include the necessary sign changes for the rotation,
as set in the new internal routine set_conversion_pair.  There is also now a
scalar_pair optional argument to the register_restart_pair routines to
accommodate the rotation of pairs of scalars that do not change sign when
rotated (e.g., grid-lengths).

  Instead of working with the hor_grid character string, the restart code has
been modified to instead use the encoded integer position argument returned
from query_vardesc.  This avoids several redundant blocks of code that translate
the hor_grid strings into positions.

  All answers are bitwise identical when there is no grid rotation, but with
grid rotation the restart files that are created are modified to have the
correct signs and replicate the restart fields with no rotation.  Also, cases
with grid rotation can now be reinitialized from restart files, while previously this
simply did not work, either giving an incorrect reinitialized state or a
segmentation fault.  There are also two new runtime parameters in some
MOM_parameter_doc files.
  Added a description of the units of the return values to the comments
describing 33 real functions in 8 modules.  Only comments are changed and all
answers are bitwise identical.
…810)

* Add MASS_WEIGHT_IN_PGF_VANISHED_ONLY to modify mass weighting

This commit introduces the runtime variable `MASS_WEIGHT_IN_PGF_VANISHED_ONLY`
which has default False. If true, then the `MASS_WEIGHT_IN_PRESSURE_GRADIENT`
and `MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP` effect of weighting T/S integrals
in slanted grid cell FV PGF calculation is turned off if both sides of the
grid cell are nonvanished, where nonvanished means thickness greater than
`RESET_INTXPA_H_NONVANISHED` which defaults to 1e-6 m. Since the benefit of
`MASS_WEIGHT_IN_PRESSURE_GRADIENT` happens in vanished layers (creating a
fake PGF away from vanished layer, which is arrested by upwinded viscosity)
the benefit is still there, but now we can use `MASS_WEIGHT_IN_PRESSURE_GRADIENT`
for coordinates that also have slanted layers in the open ocean that are
not vanished, e.g. sigma coordinates or SIGMA_SHELF_ZSTAR coordinates in the
ice shelf where we DO trust T and S values. Additionally, this is required
near a grounding line in a 3D z-coord ice shelf as some strange looking
slanted non-vanished cells can emerge, and MWIPG being on would create fake PGFs
in non-vanished cells (and therefore generating spurious currents).

Reccommend `MASS_WEIGHT_IN_PGF_VANISHED_ONLY` to be set to True, as well as
`MASS_WEIGHT_IN_PRESSURE_GRADIENT` and `MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP`
if you have vanishing layers with min thickness < 0.1m.

Also modifies MassWt_u and MassWt_v diagnostics to reflect usage
of MASS_WEIGHT_IN_PRESSURE_GRADIENT.

This commit should not change answers since it defaults to False. However,
my implementation is not very efficient and should probably be optimised.

* Minor style updates to previous commit of Add MASS_WEIGHT_IN_PGF_VANISHED_ONLY to modify mass weighting

* Address comments from Bob by adding scaling to dimensional numbers, replacing Boussinesq rho in nonBoussinesq code, and removing white space to follow 2-space indenting.
  This commit cleans up several aspects of the MOM_internal_tides code, including
the elimination of one runtime option, the correction of some units in comments
and a start toward enabling the propagation directions to alternate.

1. Eliminated the internal routine propagate_corner_spread.  This routine was
   never completely implemented, and it has never been used in any realistic
   configurations.  In particular, it appears that it will only work on a
   Cartesian grid in which the position variables (G%geoLonBu and G%geoLatBu)
   have the same units as G%dx. The comment describing propagate_corner_spread()
   indicates that "it is too numerically diffusive to be of much use as of yet"
   and that "it is not yet compatible with reflection schemes", so we have no
   plans to complete its implementation.  Although it is being deleted, it can
   always be recovered from older branches of MOM6.

2. The runtime parameter INTERNAL_TIDE_CORNER_ADVECT, which triggered the use
   of propagate_corner_spread was obsoleted.

3. Started adding the option to alternate the direction of the internal tide
   propagation.  The code that actually enacts the change is still commented
   out to avoid changing answers, but it could readily be enabled later with
   changes to a single line, and all the required code is present.

4. The units of 9 area-integrated energy budget debugging diagnostics were
   corrected, as is rescaling factor when their sum is written to stdout.

  With these changes, all answers are expected to be bitwise identical in any
cases that are in active use, but an under-used runtime option has been
eliminated from some MOM_parameter_doc files.
* Reorder optional input arguments in set_dtbt

Change the order of optional input arguments of subroutine set_dtbt so
that they are grouped logically. The decription of the subroutine is
also updated.

* Add runtime parameter SET_DTBT_USE_BT_CONT

The runtime parameter allows to use BT_CONT optional input argument in
subroutine set_dtbt if BT_CONT type is available.

Originally, when BT_CONT is used, set_dtbt is estimated with zero
surface height. The eta optinoal input argument has no effect since it
only works with NONLINEAR_BT_CONTINUITY is true, which is by default
false when BT_CONT is used.

The added option allows accurate estimate of dtbt when the mean surface
height of the domain is not at the same level, while maintains old
answers.

Also, an unused field calc_dtbt in type MOM_dyn_split_RK2_CS is removed.

* Minor fixes on setting dtbt in barotropic_init

* Fix a bug that local variable calc_dtbt is not initialized.
* Rename dtbt_tmp to dtbt_restart for clarity
* Add a comment about the usage of subroutine call set_dtbt
* Remove an unused input argument eta in barotropic_init
This patch adds the MOM_murmur_hash module, a non-cryptographic hash
function used to generate unique hashes for arrays.

The particular property of interest is that murmur hashes are sensitive
to order.  This will allow us to detect a wider range of answer changes
which would otherwise be undetected by the current min/max/mean/bitcount
method.

The checksum functions have also been modified to produce murmur hashes,
although the compile-time flag to generate them is currently disabled.
  Revised the calculation of the netFWGlobalAdj, vPrecGlobalAdj and
saltFluxGlobalAdj elements of the forcing type to work in dimensionally rescaled
units, making use of the unscale argument to reproducing_sum.  This change
includes the addition of conversion factors to the register_scalar_field calls,
and changes to the units of 15 variables to be rescaled.  A total of 27 instances
of multiplication by  unit conversion factors were eliminated as a part of these
changes, with 15 other unit conversion factors added via unscale arguments.  All
answers and output are bitwise identical, but there are changes to the units of
three variables in a transparent type.
  MOM_state_stats() has been refactored to work primarily in dimensionally
rescaled units using the unscale argument to reproducing_sum().  As a result of
these changes, the units of 8 variables were changed to be rescaled, and six
instances of multiplication by rescaling factors were changed into unscale
arguments.  MOM_state_stats() is exercised by setting DEBUG_CONSERVATION = True,
and it has been verified that MOM_state_stats() gives results that are invariant
to the use of dimensional rescaling.  All answers and output are bitwise
identical.
* Frequency-dependent internal wave drag

Utilizing streaming band-pass filters, the frequency-dependent wave
drag can be applied to the narrowband tidal velocities, instead of
the broadband barotropic velocity. This allows internal wave drag
to be optimized for different frequency bands independently, without
affecting the low-frequency, non-tidal motions.

Also fixed the bug that Filt_accum() does not return a valid output
if it is called at the corrector step.

* Frequency-dependent internal wave drag

Minor performance optimization. Also, this commit allows the filters
to be activated without the frequency-dependent drag being activated.
* Commit for coupling of land to ocean adot

* Remove unused ice sheet enabled flag

* add adot to Shelf restart

* Register sfc mass flux outside of initialize fluxes

* Gfdl cryo merge (#3)

* Removed second registration of sfc_mass_flux with register_diag_field.

* Registered sfc_mass_flux to runs with static and dynamic ice sheets.

* This commit removed the second registration of 'sfc_mass_flux' in 'register_diag_field()'

* Testing shelf_sfc_mass_flux restart.

* The earlier removed 'register_diag_field()' for 'mass_flux' has been added back and 'register_restart_field()' of 'fluxes_in%shelf_sfc_mass_flux' is moved before 'restore_state()'

* Corrected the line length error.

* Added back 'CS%id_mass_flux = register_diag_field()'

---------

Co-authored-by: NJSchlegel <nschlegel@gmail.com>
Expand range of halos for checksums for Kh_h, Kh_q, Ah_h and Ah_q to cover the
full range of values that are actually used.  This includes expanding the range
of values where the viscosities are calculated to those used in symmetric memory
mode when DEBUG is true, even though these are not used for efficiency.  One set
of vorticity-point loop ranges was also corrected when the recently added
parameter EY24_EBT_BS is true to avoid setting an extra unused value, perhaps
correcting non-symmetric memory mode cases that would not reproduce across PE
count and layout.  All answers are bitwise identical in any case that
reproduces across PE count.
  Corrected the indenting in most of the lines of ePBL_column to respect the
MOM6 2-space indenting convention, and eliminated the comment explaining why the
incorrect indenting had previously been retained to facilitate the review of a
pull request with substantial actual changes in this routine.  Apart from a
single comment that was removed, only white space is changed, and all answers
are bitwise identical.
* Add MLD_out to diagnose MLD call

Add an optional argument to pass the MLD out of the diagnose MLD
routine.

* Change MLD_out to be only computaional domain

Includes three changes:
- Make MLD_out optional
- initalize MLD_out to 0. everywhere
- copy MLD to MLD_out only in the computational domain.

* Remove unnedded MLD=0 initalization

Remove an extra initalization of MLD in diagnoseMLDbyEnergy

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea63.ncrc.gov>
  Revised the rescaled units of forces%tau_mag, fluxes%tau_mag and
fluxes%tau_mag_gustless from [R Z L T-2 ~> Pa] to [R Z2 T-2 ~> Pa] to avoid the
need for further rescaling when this field is used to calculate turbulent
friction velocities and TKE fluxes in 29 places.  However, this requires the
addition of other rescaling factors when forces%tau_mag is set from the wind
stresses.   A total of 40 rescaling factors were eliminated, while another
36 were added, all where the components of the wind stress are used to calculate
the magnitude of the wind stress.  Several other internal variables were also
rescaled analogously for simplicity.  All answers are bitwise identical, but
there are changes to the rescaling factors for three elements in a transparent
type.
The field is never used by MOM_set_visc and incorrectly logged under
MOM_set_visc section in MOM_parameter_doc, rather than MOM_kappa_shear.
* In subroutine set_viscous_BBL, move and merge `u2_bg` calculation to
avoid redundancy and if-branch within do-loops.
* In subroutine set_viscous_BBL, add a comment on explaining the reason
to reset Ray_[uv]
* In subroutine find_coupling_coef, replace an if-branch with min()
  Added the new publicly visible interface field_checksum to return the checksum
that is used to verify the arrays that are written to or read from files, while
handling both the unscaling and rotation of the arrays.  The 5 internal
rotated_field_chksum_real_... functions were renamed to field_checksum_real_...
to reflect their slightly broadened purpose and now have new optional unscale
arguments.  The previous rotated_field_chksum interface has been retained
because it is still being used in SIS2, but this may change in the future.  All
answers are bitwise identical, but there is a new public function interface and
a new optional argument to a preexisting one.
  Use field_checksum in get_depth_list_checksum to relocate two rescaling
factors into unscale arguments and work in scaled internal variables in that
routine.  All answers are bitwise identical.
  Use field_checksum and its unscale argument in save_restart and restore_state
to avoid 10 instances of array-syntax math which are unnecessary in most cases
because the conversion factor is 1.  All answers are bitwise identical.
* Remove unused local variable I_Rho in int_density

I_Rho = 1.0/rho_0 is never used and therefore removed.

* Add runtime flag RHO_PGF_REF_BUG

This new parameter addresses a bug in Boussinesq finite volume pressure
gradient forces (MOM_PressureForce_FV) that the mean seawater density
Rho_0 and reference density Rho_ref are used incorrectly in several
instances. It should be noted that by default Rho_ref is Rho_0 and
Rho_ref is rarely set to other than Rho_0.

* Bugfix: reference height offset for SAL using bpa

Recover reference height offset (Z_ref) in calculating bottom pressure
for self-attraction and loading in Boussinesq mode.
* Alternative interface to EQN_OF_STATE="LINEAR"

The existing interface to EQN_OF_STATE="LINEAR" is based on RHO_T0_S0, the
density at T=0, S=0.  This is the most computationally efficient way to
specify a linear EOS, but we are usually linearizing about a reference
T and S that are not 0.

The new interface is based on TREF, SREF, and RHO_TREF_SREF, where:

RHO(T,S) = RHO_TREF_SREF + DRHO_DT*(T-TREF) + DRHO_DS*(S-SREF)
RHO_T0_S0 = RHO_TREF_SREF - DRHO_DT*TREF - DRHO_DS*SREF
RHO(T,S) = RHO_T0_S0 + DRHO_DT*T + DRHO_DS*S

The defaults for TREF and SREF are zero and for RHO_TREF_SREF is 1000.0.
So if the new interface is not used answers are not changed but there
are always new model parameters.

* corrected spelling error
* Adding a flag to turn off the bug fix (mostly)

* Fix OBC check if not associated.
* Split grid generation and remapping from step thermo

Move grid generation, remapping, and subsequent processes into a new
routine ALE_gridgen_and_remapping which is called immediately after
step_MOM_thermo.

Clean up inputs and local variables in step_MOM_thermo by removing
those only used for gid generation and remapping.

Routines that need to be done after step_thermo, grid generation
and remapping, regardless of use_ALE or not into another routine
since they do not make sense in ALE_gridgen_and_remapping.

Answers and diagnostics have not changed in Baltic case in ALE mode.
Testing still needs to be done layer mode and with particles.

* Update Names of routines

* Fix doxygen and calltree errors

---------

Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov>
Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea57.ncrc.gov>
* + Add `RESET_INTXPA_INTEGRAL_FLATTEST` option to pressure gradient

This new parameter RESET_INTXPA_INTEGRAL_FLATTEST modifies the
reference interface for the horizontal pressure integrals in the
finite volume pressure gradient force calculation. If true,
in ocean columns where no non-tilted, non-vanished layer can be
found (e.g. near specific shaped ice shelf grounding lines), rather
than using the top surface to integrate downwards as the reference,
the code finds and chooses the flattest (i.e. minimum difference
between depth or pressure) interface as the reference.

The parameter defaults to False therefore should not change default
answers. However, if true, combined with other ice shelf code
changes e.g. MASS_WEIGHT_IN_PGF_VANISHED_ONLY = True,
RESET_INTXPA_INTEGRAL = True, MASS_WEIGHT_IN_PRESSURE_GRADIENT = True
and MASS_WEIGHT_IN_PRESSURE_GRADIENT_TOP = True + initialisation code
fixes I get very low spurious currents in the Boussinesq ZSTAR and
SIGMA_SHELF_ZSTAR ISOMIP+ test cases.

* Amend RESET_INTXPA_INTEGRAL_FLATTEST description
to refer to flattest interface rather than flattest layer.
* Update btstep negative eta warning

In Boussinesq mode the eta below bathyT warning includes the location,
but in non-Boussinesq mode the corresponding negative eta warning does not.

Added the location to the negative eta warning.

No answers are changed.

* 4 space indenting of continuation lines
  This commit takes the first steps toward correcting problems with the Kelvin
initialization code, including making the OBC nudging timescale an explicit
parameter and adding a number of comments identifying concerns and suggesting
possible improvements with the code that is used when KELVIN_WAVE_MODE > 0.
This commit includes the introduction of the new runtime parameter
KELVIN_WAVE_VEL_NUDGING_TIMESCALE, with a default value set to recover the
current hard-coded answers.  A new warning message cautions about the suspected
problems with the internal wave version of the code.  By default, all answers
are bitwise identical in the 4 Kelvin wave test cases that can be found at
github.com/ESMG/ESMG-configs, but there is a new parameter in the
MOM_parameter_doc.all files these cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.