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,575 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 9, 2024 16:35
  Renamed the optional scale argument to myStats to unscale, mirroring the
recent additions of unscale arguments to the various chksum routines.  This
included changes to 6 calls to myStats in the two horiz_interp_and_extrap_tracer
routines.  Although myStats is public, it really is only used in
MOM_horizontal_regridding in the main version of MOM6, apart from a single call
in MOM_initialize_tracer_from_Z that does not use the optional unscale argument,
so rather than adding a second optional argument, this case seemed to be safe
enough to rename the argument in place.  If there were any unanticipated
problems with this argument name change, they would be manifest in code that
does not compile.  All answers are bitwise identical, but an optional argument
(scale) to a publicly visible diagnostic routine (myStats) was renamed.
  Added a refactored version of add_LOTW_BBL_diffusivity that is more accurate
by avoiding a subtraction of two large numbers to determine the distance from
the surface and more reproducible by avoiding the use of the Fortran sum
function.  This new version of the code is mathematically equivalent to the
original, and it is selected by setting the new runtime parameter
LOTW_BBL_ANSWER_DATE to be greater than 20240630.  This probably could have been
done reusing the existing parameter SET_DIFF_ANSWER_DATE, but this would have
meant answer changes for some cases that set this to a high value.  By default
the original code is used, but the default should be changed later to follow the
value of DEFAULT_ANSWER_DATE.  By default, all answers are bitwise identical but
there is a new runtime parameter in some cases.
  Added an optional unscale argument to 16 checksum and 9 spatial_mean or
spatial_integral routines.  These are synonymous with the existing optional
scale arguments to these routines, and if both are provided, the new unscale
arguments take precedence.

  All this is done to come up with a more systematic nomenclature for the
various scaling and unscaling arguments, so that the factors passed to them will
follow a more regular pattern.  With this change, the `scale=` argument to a
get_param or read_data call will take the opposite setting to the `unscale=`
argument used in a checksum call.  For example, for a velocity, these arguments
would be `scale=US%m_s_to_L_T` and `unscale=US%L_T_to_m_s`, but the reverse
values of `scale=US%L_T_to_m_s` and `unscale=US%m_s_to_L_T` would only work for
inverse velocities and will therefore be very uncommon and warrant extra
scrutiny. With this change, `unscale=` and `conversion=` arguments used when
registering diagnostics will often take similar  arguments, although the latter
can also have extra factors that are unrelated to dimensional rescaling.

  As a test of these capabilities, these new `unscale` arguments are being used
in 23 calls from the MOM_chksum_packages routines and in 76 calls to chksums or
global integrals from MOM_forcing_chksum(), MOM_mech_forcing_chksum() and
forcing_diagnostics().  The results are equivalent to what was generated before
in cases with debugging enabled so the revised code would be exercised.

  All answers are bitwise identical, but there are new optional arguments to 25
publicly visible routines.
  Added an optional unscale argument to 10 routines under the overloaded
MOM_write_field interface, mirroring the recent additions of unscale arguments
to the various chksum routines.  These new unscale arguments are synonymous with
the existing optional scale arguments to these routines, and if both are
provided, the new unscale arguments take precedence.

  A total of 26 MOM_write_field calls in save_restart, write_depth_list,
write_Hybgen_coord_file, write_vertgrid_file and write_ocean_geometry_file were
modified to replace a scale argument with the new unscale argument.

  All answers are bitwise identical, but there are new optional arguments to 10
publicly visible routines.
  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.
Hallberg-NOAA and others added 30 commits February 1, 2025 07:10
  Corrected incorrect syntax in the descriptions of 4 positions variables in
write energy, 1 reused position variable in set_grid_metrics_from_mosaic and 1
position variable in bkgnd_mixing_CS.  Also added the unscaled units to the
comments documenting two lines of calculations in wave_speeds, and added the
scaled units to two variables related to the ice-shelf surface mass balance.
Only comments are changed and all answers are bitwise identical.
  Replaced the unused real tide_flow element of the file_OBC_CS type with the
logical OBC_file_used element to more clearly reflect that this placeholder
element is only here to avoid having a completely empty type.  The actual value
of this element is irrelevant, but some compilers require that all Fortran types
have at least one element.  This change eliminates a meaningless hard-coded real
variable with undefined units and a misleading name and replaces it with a
logical variable named to reflect its actual purpose.  All answers are bitwise
identical.
…start-20250121

flexible restart writing in UFS
* 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.
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.