Skip to content

Commit

Permalink
+Add the runtime parameter REMAPPING_ANSWER_DATE
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
Hallberg-NOAA committed Jul 30, 2022
1 parent 7a9c8a8 commit 9277013
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 60 deletions.
20 changes: 13 additions & 7 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module MOM_ALE
integer :: answer_date !< The vintage of the expressions and order of arithmetic to use for
!! remapping. Values below 20190101 result in the use of older, less
!! accurate expressions that were in use at the end of 2018. Higher
!! values result inthe use of more robust and accurate forms of
!! values result in the use of more robust and accurate forms of
!! mathematically equivalent expressions.

logical :: debug !< If true, write verbose checksums for debugging purposes.
Expand Down Expand Up @@ -226,19 +226,25 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
"extrapolated instead of piecewise constant", default=.false.)
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(param_file, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(param_file, mdl, "REMAPPING_2018_ANSWERS", answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
if (answers_2018) then
CS%answer_date = 20181231
else
CS%answer_date = 20190101
endif
! Revise inconsistent default answer dates for remapping.
if (answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(param_file, mdl, "REMAPPING_ANSWER_DATE", CS%answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)

call initialize_remapping( CS%remapCS, string, &
boundary_extrapolation=remap_boundary_extrap, &
check_reconstruction=check_reconstruction, &
Expand Down
15 changes: 13 additions & 2 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ subroutine initialize_regridding(CS, GV, US, max_depth, param_file, mdl, coord_m
integer :: default_answer_date ! The default setting for the various ANSWER_DATE flags.
logical :: default_2018_answers ! The default setting for the various 2018_ANSWERS flags.
logical :: remap_answers_2018
integer :: remap_answer_date ! The vintage of the remapping expressions to use.
real :: filt_len, strat_tol, tmpReal, P_Ref
real :: maximum_depth ! The maximum depth of the ocean [m] (not in Z).
real :: dz_fixed_sfc, Rho_avg_depth, nlay_sfc_int
Expand Down Expand Up @@ -269,15 +270,25 @@ subroutine initialize_regridding(CS, GV, US, max_depth, param_file, mdl, coord_m

call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(param_file, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(param_file, mdl, "REMAPPING_2018_ANSWERS", remap_answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
call set_regrid_params(CS, remap_answers_2018=remap_answers_2018)
! Revise inconsistent default answer dates for remapping.
if (remap_answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.remap_answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(param_file, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)
call set_regrid_params(CS, remap_answer_date=remap_answer_date)
endif

if (main_parameters .and. coord_is_state_dependent) then
Expand Down
17 changes: 11 additions & 6 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -625,19 +625,24 @@ subroutine open_boundary_config(G, US, param_file, OBC)
"round off.", default=.false.,do_not_log=.true.)
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(param_file, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(param_file, mdl, "REMAPPING_2018_ANSWERS", answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
if (answers_2018) then
OBC%remap_answer_date = 20181231
else
OBC%remap_answer_date = 20190101
endif
! Revise inconsistent default answer dates for remapping.
if (answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(param_file, mdl, "REMAPPING_ANSWER_DATE", OBC%remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)

allocate(OBC%remap_CS)
call initialize_remapping(OBC%remap_CS, remappingScheme, boundary_extrapolation = .false., &
Expand Down
17 changes: 11 additions & 6 deletions src/diagnostics/MOM_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1587,19 +1587,24 @@ subroutine MOM_diagnostics_init(MIS, ADp, CDp, Time, G, GV, US, param_file, diag
"starting point for iterations.", default=.true.)
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(param_file, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(param_file, mdl, "REMAPPING_2018_ANSWERS", remap_answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
if (remap_answers_2018) then
remap_answer_date = 20181231
else
remap_answer_date = 20190101
endif
! Revise inconsistent default answer dates for remapping.
if (remap_answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.remap_answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(param_file, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)

call get_param(param_file, mdl, "SPLIT", split, default=.true., do_not_log=.true.)

Expand Down
17 changes: 11 additions & 6 deletions src/framework/MOM_diag_mediator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3181,19 +3181,24 @@ subroutine diag_mediator_init(G, GV, US, nz, param_file, diag_cs, doc_file_dir)
default=1)
call get_param(param_file, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(param_file, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(param_file, mdl, "REMAPPING_2018_ANSWERS", remap_answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
if (remap_answers_2018) then
remap_answer_date = 20181231
else
remap_answer_date = 20190101
endif
! Revise inconsistent default answer dates for remapping.
if (remap_answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.remap_answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(param_file, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)
call get_param(param_file, mdl, 'USE_GRID_SPACE_DIAGNOSTIC_AXES', diag_cs%grid_space_axes, &
'If true, use a grid index coordinate convention for diagnostic axes. ',&
default=.false.)
Expand Down
31 changes: 26 additions & 5 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1198,20 +1198,30 @@ subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read)
call get_param(PF, mdl, "TRIMMING_USES_REMAPPING", use_remapping, &
'When trimming the column, also remap T and S.', &
default=.false., do_not_log=just_read)
remap_answers_2018 = .true.
if (use_remapping) then
call get_param(PF, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(PF, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
call get_param(PF, mdl, "REMAPPING_2018_ANSWERS", remap_answers_2018, &
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
! Revise inconsistent default answer dates for remapping.
if (remap_answers_2018 .and. (default_answer_date >= 20190101)) default_answer_date = 20181231
if (.not.remap_answers_2018 .and. (default_answer_date < 20190101)) default_answer_date = 20190101
call get_param(PF, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_answer_date)
else
remap_answer_date = 20181231
endif
remap_answer_date = 20190101 ; if (remap_answers_2018) remap_answer_date = 20181231

if (just_read) return ! All run-time parameters have been read, so return.

Expand Down Expand Up @@ -2475,6 +2485,7 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just
logical :: remap_answers_2018 ! If true, use the order of arithmetic and expressions that
! recover the remapping answers from 2018. If false, use more
! robust forms of the same remapping expressions.
integer :: default_remap_ans_date ! The default setting for remap_answer_date
integer :: remap_answer_date ! The vintage of the order of arithmetic and expressions to use
! for remapping. Values below 20190101 recover the remapping
! answers from 2018, while higher values use more robust
Expand Down Expand Up @@ -2562,7 +2573,7 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just
default=.false., do_not_log=just_read)
call get_param(PF, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(PF, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
Expand All @@ -2576,7 +2587,17 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
remap_answer_date = 20190101 ; if (remap_answers_2018) remap_answer_date = 20181231
! Revise inconsistent default answer dates for remapping.
default_remap_ans_date = default_answer_date
if (remap_answers_2018 .and. (default_remap_ans_date >= 20190101)) default_remap_ans_date = 20181231
if (.not.remap_answers_2018 .and. (default_remap_ans_date < 20190101)) default_remap_ans_date = 20190101
call get_param(PF, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_remap_ans_date)
endif
call get_param(PF, mdl, "HOR_REGRID_2018_ANSWERS", hor_regrid_answers_2018, &
"If true, use the order of arithmetic for horizonal regridding that recovers "//&
Expand Down
19 changes: 13 additions & 6 deletions src/initialization/MOM_tracer_initialization_from_Z.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, US, PF, src_file, src_var_
logical :: remap_answers_2018 ! If true, use the order of arithmetic and expressions that
! recover the remapping answers from 2018. If false, use more
! robust forms of the same remapping expressions.
integer :: default_remap_ans_date ! The default setting for remap_answer_date
integer :: remap_answer_date ! The vintage of the order of arithmetic and expressions to use
! for remapping. Values below 20190101 recover the remapping
! answers from 2018, while higher values use more robust
Expand Down Expand Up @@ -115,7 +116,7 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, US, PF, src_file, src_var_
default="PLM")
call get_param(PF, mdl, "DEFAULT_ANSWER_DATE", default_answer_date, &
"This sets the default value for the various _ANSWER_DATE parameters.", &
default=99991231, do_not_log=.true.)
default=99991231)
call get_param(PF, mdl, "DEFAULT_2018_ANSWERS", default_2018_answers, &
"This sets the default value for the various _2018_ANSWERS parameters.", &
default=(default_answer_date<20190101))
Expand All @@ -124,11 +125,17 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, US, PF, src_file, src_var_
"If true, use the order of arithmetic and expressions that recover the "//&
"answers from the end of 2018. Otherwise, use updated and more robust "//&
"forms of the same expressions.", default=default_2018_answers)
if (remap_answers_2018) then
remap_answer_date = 20181231
else
remap_answer_date = 20190101
endif
! Revise inconsistent default answer dates for remapping.
default_remap_ans_date = default_answer_date
if (remap_answers_2018 .and. (default_remap_ans_date >= 20190101)) default_remap_ans_date = 20181231
if (.not.remap_answers_2018 .and. (default_remap_ans_date < 20190101)) default_remap_ans_date = 20190101
call get_param(PF, mdl, "REMAPPING_ANSWER_DATE", remap_answer_date, &
"The vintage of the expressions and order of arithmetic to use for remapping. "//&
"Values below 20190101 result in the use of older, less accurate expressions "//&
"that were in use at the end of 2018. Higher values result in the use of more "//&
"robust and accurate forms of mathematically equivalent expressions. "//&
"If both REMAPPING_2018_ANSWERS and REMAPPING_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_remap_ans_date)
endif
call get_param(PF, mdl, "HOR_REGRID_2018_ANSWERS", hor_regrid_answers_2018, &
"If true, use the order of arithmetic for horizonal regridding that recovers "//&
Expand Down
Loading

0 comments on commit 9277013

Please sign in to comment.