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

+Add ANSWER_DATE runtime parameters #179

Merged
merged 11 commits into from
Aug 4, 2022

Conversation

Hallberg-NOAA
Copy link
Member

This PR includes a series of commits that replace the logical answers_2018
variables with 8-digit answer_date variables. Setting these new variables to
20181231 or lower values is equivalent to setting the corresponding answers_2018
variables to True, while the larger values (or dates) will be used to allow
for a succession of newer answers to eventually be supported. There are 16 new
runtime parameters, and corresponding new entries in the MOM_parameter_doc
files, but all answers are bitwise identical by default. Once these new
parameters have become a part of the main branch, the various experiments
should be modified so that the older ANSWERS_2018 parameters can eventually
be obsoleted.

The commits in this PR include:

  • ecbb8d5c9 +Add do_not_log=just_read args in get_param calls
  • 08a502fee +Added 6 more ..._ANSWER_DATE runtime parameters
  • a32b840bd +Added 9 ..._ANSWER_DATE runtime parameters
  • ab1e5140c +Add the runtime parameter HOR_REGRID_ANSWER_DATE
  • 927701393 +Add the runtime parameter REMAPPING_ANSWER_DATE
  • 7a9c8a8dc +Eliminate unused answers_2018 optional arguments
  • 7c7237734 +Use answer_date to specify remapping
  • ecb85cb8b +Use answer_date to specify remapping in ALE
  • 8fd122990 +Add answer_date optional arguments

  Added optional answer_date arguments to various remapping routines.  These are
vintage-encoding integers intended to replace the logical answers_2018
arguments, and allow for multiple generations of improved algorithms rather than
just two choices, without requiring added interface changes.  However, this
change is backward compatible, and these two arguments are both offered for
now.  All answers are bitwise identical, but there are new optional arguments
to numerous publicly visible routines.
  Replace the answers_2018 arguments with answer_date arguments to specify the
version of expressions in a number of calls from the upper-level ALE modules,
while also adding new answer_date optional arguments to several of the publicly
visible remapping routines, including ALE_remap_scalar, regrid_set_params and
remapping_set_params.  The routine interpolate_grid, which is not called from
outside of the regrid_interp module, is no longer being made publicly visible.
Some comments noting parameters that are not guaranteed to be externally set or
that can not be reset were also added.  All answers are bitwise identical.
  Replace answers_2018 arguments with answer_date arguments to specify the
version of expressions used in a number of vertical or horizontal regridding
calls.  In some cases, this also involves replacing one of the elements in an
opaque type.  It can also involve reading (but not yet logging) the new runtime
parameter DEFAULT_ANSWER_DATE, but if it not set the results are unchanged from
before.  There is also a new optional argument, remap_answer_date, to
wave_speed_init and wave_speed_set_param.  Some comments were also added to
describe real variables in VarMix_init.  All answers are bitwise identical.
  Eliminated the now unused answers_2018 optional arguments in a variety of the
ALE-related subroutines that are only called from code in the ALE directory. The
functionality previously provided by answers_2018 is now provided by the more
flexible answer_date arguments.  A handful of spelling errors were also
corrected in comments in the files that were edited.  All answers are bitwise
identical.
  Added the new runtime parameter REMAPPING_ANSWER_DATE, which takes precedence
over the older parameter REMAPPING_2018_ANSWERS.  There are 11 files with
get_param calls for this new parameter.  Also started logging the value of
DEFAULT_ANSWER_DATE.  All answers are bitwise identical, but there are new
entries in the MOM_parameter_doc.all files.
  Added the new runtime parameter HOR_REGRID_ANSWER_DATE, which takes precedence
over the older parameter HOR_REGRID_2018_ANSWERS.  There are 3 files with
get_param calls for this new parameter.  All answers are bitwise identical, but
there are new entries in the MOM_parameter_doc.all files.
  Added 9 ..._ANSWER_DATE runtime parameters controlling the expressions and
order of arithmetic in the parameterizations modules, which take precedence over
their older ..._ANSWERS_2018 counterparts.  The new runtime parameters are
HOR_VISC_ANSWER_DATE, MEKE_GEOMETRIC_ANSWER_DATE, EPBL_ANSWER_DATE,
OPTICS_ANSWER_DATE, REGULARIZE_LAYERS_ANSWER_DATE, SET_DIFF_ANSWER_DATE,
SET_VISC_ANSWER_DATE, TIDAL_MIXING_ANSWER_DATE and VERT_FRICTION_ANSWER_DATE.
All answers are bitwise identical, but there are numerous new entries in the
MOM_parameter_doc.all files.
  Added 6 ..._ANSWER_DATE runtime parameters controlling the expressions and
order of arithmetic in the core, ocean_data_assim, user, and driver modules,
which take precedence over their older ..._ANSWERS_2018 counterparts.  The new
runtime parameters are SURFACE_ANSWER_DATE, BAROTROPIC_ANSWER_DATE,
ODA_ANSWER_DATE, IDL_HURR_ANSWER_DATE SURFACE_FORCING_ANSWER_DATE and
WIND_GYRES_ANSWER_DATE. All answers are bitwise identical, but there are
numerous new entries in the MOM_parameter_doc.all files.
  Added do_not_log=just_read arguments to get_param calls where other calls in
the same initialization routines already had them, so that the logging of the
parameters is consistent.  All answers are bitwise identical, but this could
lead to changes in the MOM_parameter_doc files.
@Hallberg-NOAA Hallberg-NOAA added the enhancement New feature or request label Jul 31, 2022
@codecov
Copy link

codecov bot commented Jul 31, 2022

Codecov Report

Merging #179 (bd60977) into dev/gfdl (2192db9) will decrease coverage by 0.07%.
The diff coverage is 29.21%.

@@             Coverage Diff              @@
##           dev/gfdl     #179      +/-   ##
============================================
- Coverage     37.40%   37.33%   -0.08%     
============================================
  Files           259      258       -1     
  Lines         71850    71456     -394     
  Branches      13442    13418      -24     
============================================
- Hits          26877    26676     -201     
+ Misses        40030    39821     -209     
- Partials       4943     4959      +16     
Impacted Files Coverage Δ
src/ALE/MOM_regridding.F90 26.70% <0.00%> (-0.24%) ⬇️
src/ALE/P1M_functions.F90 0.00% <0.00%> (ø)
src/ALE/P3M_functions.F90 0.00% <0.00%> (ø)
src/ALE/PCM_functions.F90 100.00% <ø> (ø)
src/ALE/PLM_functions.F90 85.10% <ø> (ø)
src/ALE/PQM_functions.F90 0.00% <0.00%> (ø)
src/ALE/regrid_interp.F90 1.59% <0.00%> (ø)
src/ALE/regrid_solvers.F90 17.00% <0.00%> (ø)
...nitialization/MOM_tracer_initialization_from_Z.F90 0.00% <0.00%> (ø)
src/ocean_data_assim/MOM_oda_driver.F90 0.00% <0.00%> (ø)
... and 30 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@marshallward
Copy link
Member

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

@marshallward marshallward merged commit 1d054ef into NOAA-GFDL:dev/gfdl Aug 4, 2022
@Hallberg-NOAA Hallberg-NOAA deleted the answer_date branch February 2, 2023 14:14
Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this pull request Nov 25, 2024
  When HOR_VISC_ANSWER_DATE was introduced to replace HOR_VISC_2018_ANSWERS on
August 4, 2022 as a part of github.com/NOAA-GFDL/pull/179, the logic was
incorrectly specified, using the older form with the newer answer date and vice
versa, because `(CS%answer_date > 20190101)` was used instead of
`(CS%answer_date < 20190101)`.  (Curiously, using exactly 20190101 actually
gives the intended result.)

  This commit modifies this logic so that the older (mildly dimensionally
inconsistent) version is now being used for answer dates between 20190102 and
20241201, but a very late answer date uses the corrected form.  The offending
block of code is only used when USE_MEKE is true and the Rossby number scaling
of the biharmonic energy source is enabled by setting MEKE_BACKSCAT_RO_C > 0,
which does not appear to be very common.  To avoid logging the description of
this ugly new logic in MOM_parameter_doc files where it does not impact the
solutions, new logic was added to limit the logging of  HOR_VISC_ANSWER_DATE.
Also, as there are no known non-Boussinesq cases with this combination of MEKE
parameters, the minimum value of HOR_VISC_ANSWER_DATE was changed to 20241201
when the model is in non-Boussinesq mode.   Because this bug went undetected
when it was first introduced, it probably is not widely used, and it might make
sense to obsolete HOR_VISC_ANSWER_DATE and eliminate the older, inconsistent
block of code.  This commit could change answers for answer dates that are above
20241201 with the MEKE Rossby number scaling enabled via MEKE_BACKSCAT_RO_C > 0.
marshallward pushed a commit that referenced this pull request Nov 26, 2024
  When HOR_VISC_ANSWER_DATE was introduced to replace HOR_VISC_2018_ANSWERS on
August 4, 2022 as a part of github.com//pull/179, the logic was
incorrectly specified, using the older form with the newer answer date and vice
versa, because `(CS%answer_date > 20190101)` was used instead of
`(CS%answer_date < 20190101)`.  (Curiously, using exactly 20190101 actually
gives the intended result.)

  This commit modifies this logic so that the older (mildly dimensionally
inconsistent) version is now being used for answer dates between 20190102 and
20241201, but a very late answer date uses the corrected form.  The offending
block of code is only used when USE_MEKE is true and the Rossby number scaling
of the biharmonic energy source is enabled by setting MEKE_BACKSCAT_RO_C > 0,
which does not appear to be very common.  To avoid logging the description of
this ugly new logic in MOM_parameter_doc files where it does not impact the
solutions, new logic was added to limit the logging of  HOR_VISC_ANSWER_DATE.
Also, as there are no known non-Boussinesq cases with this combination of MEKE
parameters, the minimum value of HOR_VISC_ANSWER_DATE was changed to 20241201
when the model is in non-Boussinesq mode.   Because this bug went undetected
when it was first introduced, it probably is not widely used, and it might make
sense to obsolete HOR_VISC_ANSWER_DATE and eliminate the older, inconsistent
block of code.  This commit could change answers for answer dates that are above
20241201 with the MEKE Rossby number scaling enabled via MEKE_BACKSCAT_RO_C > 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants