Skip to content

Commit

Permalink
+Add the runtime parameter HOR_REGRID_ANSWER_DATE
Browse files Browse the repository at this point in the history
  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.
  • Loading branch information
Hallberg-NOAA committed Jul 30, 2022
1 parent 9277013 commit ab1e514
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,7 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just
! answers from 2018, while higher values use more robust
! forms of the same remapping expressions.
logical :: hor_regrid_answers_2018
integer :: default_hor_reg_ans_date ! The default setting for hor_regrid_answer_date
integer :: hor_regrid_answer_date ! The vintage of the order of arithmetic and expressions to use
! for horizontal regridding. Values below 20190101 recover the
! answers from 2018, while higher values use expressions that have
Expand Down Expand Up @@ -2603,7 +2604,17 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just
"If true, use the order of arithmetic for horizonal regridding that recovers "//&
"the answers from the end of 2018. Otherwise, use rotationally symmetric "//&
"forms of the same expressions.", default=default_2018_answers)
hor_regrid_answer_date = 20190101 ; if (hor_regrid_answers_2018) hor_regrid_answer_date = 20181231
! Revise inconsistent default answer dates for horizontal regridding.
default_hor_reg_ans_date = default_answer_date
if (hor_regrid_answers_2018 .and. (default_hor_reg_ans_date >= 20190101)) default_hor_reg_ans_date = 20181231
if (.not.hor_regrid_answers_2018 .and. (default_hor_reg_ans_date < 20190101)) default_hor_reg_ans_date = 20190101
call get_param(PF, mdl, "HOR_REGRID_ANSWER_DATE", hor_regrid_answer_date, &
"The vintage of the order of arithmetic for horizontal regridding. "//&
"Dates before 20190101 give the same answers as the code did in late 2018, "//&
"while later versions add parentheses for rotational symmetry. "//&
"If both HOR_REGRID_2018_ANSWERS and HOR_REGRID_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_hor_reg_ans_date)

if (.not.useALEremapping) then
call get_param(PF, mdl, "ADJUST_THICKNESS", correct_thickness, &
"If true, all mass below the bottom removed if the "//&
Expand Down
12 changes: 11 additions & 1 deletion src/initialization/MOM_tracer_initialization_from_Z.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, US, PF, src_file, src_var_
! answers from 2018, while higher values use more robust
! forms of the same remapping expressions.
logical :: hor_regrid_answers_2018
integer :: default_hor_reg_ans_date ! The default setting for hor_regrid_answer_date
integer :: hor_regrid_answer_date ! The vintage of the order of arithmetic and expressions to use
! for horizontal regridding. Values below 20190101 recover the
! answers from 2018, while higher values use expressions that have
Expand Down Expand Up @@ -141,7 +142,16 @@ subroutine MOM_initialize_tracer_from_Z(h, tr, G, GV, US, PF, src_file, src_var_
"If true, use the order of arithmetic for horizonal regridding that recovers "//&
"the answers from the end of 2018. Otherwise, use rotationally symmetric "//&
"forms of the same expressions.", default=default_2018_answers)
hor_regrid_answer_date = 20190101 ; if (hor_regrid_answers_2018) hor_regrid_answer_date = 20181231
! Revise inconsistent default answer dates for horizontal regridding.
default_hor_reg_ans_date = default_answer_date
if (hor_regrid_answers_2018 .and. (default_hor_reg_ans_date >= 20190101)) default_hor_reg_ans_date = 20181231
if (.not.hor_regrid_answers_2018 .and. (default_hor_reg_ans_date < 20190101)) default_hor_reg_ans_date = 20190101
call get_param(PF, mdl, "HOR_REGRID_ANSWER_DATE", hor_regrid_answer_date, &
"The vintage of the order of arithmetic for horizontal regridding. "//&
"Dates before 20190101 give the same answers as the code did in late 2018, "//&
"while later versions add parentheses for rotational symmetry. "//&
"If both HOR_REGRID_2018_ANSWERS and HOR_REGRID_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_hor_reg_ans_date)

! These are model grid properties, but being applied to the data grid for now.
! need to revisit this (mjh)
Expand Down
24 changes: 22 additions & 2 deletions src/parameterizations/vertical/MOM_ALE_sponge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ subroutine initialize_ALE_sponge_fixed(Iresttime, G, GV, param_file, CS, data_h,
logical :: hor_regrid_answers_2018 ! If true, use the order of arithmetic for horizontal regridding
! that recovers the answers from the end of 2018. Otherwise, use
! rotationally symmetric forms of the same expressions.
integer :: default_hor_reg_ans_date ! The default setting for hor_regrid_answer_date
integer :: i, j, k, col, total_sponge_cols, total_sponge_cols_u, total_sponge_cols_v

if (associated(CS)) then
Expand Down Expand Up @@ -243,7 +244,16 @@ subroutine initialize_ALE_sponge_fixed(Iresttime, G, GV, param_file, CS, data_h,
"If true, use the order of arithmetic for horizontal regridding that recovers "//&
"the answers from the end of 2018. Otherwise, use rotationally symmetric "//&
"forms of the same expressions.", default=default_2018_answers)
CS%hor_regrid_answer_date = 20190101 ; if (hor_regrid_answers_2018) CS%hor_regrid_answer_date = 20181231
! Revise inconsistent default answer dates for horizontal regridding.
default_hor_reg_ans_date = default_answer_date
if (hor_regrid_answers_2018 .and. (default_hor_reg_ans_date >= 20190101)) default_hor_reg_ans_date = 20181231
if (.not.hor_regrid_answers_2018 .and. (default_hor_reg_ans_date < 20190101)) default_hor_reg_ans_date = 20190101
call get_param(param_file, mdl, "HOR_REGRID_ANSWER_DATE", CS%hor_regrid_answer_date, &
"The vintage of the order of arithmetic for horizontal regridding. "//&
"Dates before 20190101 give the same answers as the code did in late 2018, "//&
"while later versions add parentheses for rotational symmetry. "//&
"If both HOR_REGRID_2018_ANSWERS and HOR_REGRID_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_hor_reg_ans_date)
call get_param(param_file, mdl, "REENTRANT_X", CS%reentrant_x, &
"If true, the domain is zonally reentrant.", default=.true.)
call get_param(param_file, mdl, "TRIPOLAR_N", CS%tripolar_N, &
Expand Down Expand Up @@ -468,6 +478,7 @@ subroutine initialize_ALE_sponge_varying(Iresttime, G, GV, param_file, CS, Irest
logical :: hor_regrid_answers_2018 ! If true, use the order of arithmetic for horizontal regridding
! that recovers the answers from the end of 2018. Otherwise, use
! rotationally symmetric forms of the same expressions.
integer :: default_hor_reg_ans_date ! The default setting for hor_regrid_answer_date
integer :: i, j, col, total_sponge_cols, total_sponge_cols_u, total_sponge_cols_v

if (associated(CS)) then
Expand Down Expand Up @@ -523,7 +534,16 @@ subroutine initialize_ALE_sponge_varying(Iresttime, G, GV, param_file, CS, Irest
"returned in certain cases. Otherwise, use rotationally symmetric "//&
"forms of the same expressions and initialize the mask properly.", &
default=default_2018_answers)
CS%hor_regrid_answer_date = 20190101 ; if (hor_regrid_answers_2018) CS%hor_regrid_answer_date = 20181231
! Revise inconsistent default answer dates for horizontal regridding.
default_hor_reg_ans_date = default_answer_date
if (hor_regrid_answers_2018 .and. (default_hor_reg_ans_date >= 20190101)) default_hor_reg_ans_date = 20181231
if (.not.hor_regrid_answers_2018 .and. (default_hor_reg_ans_date < 20190101)) default_hor_reg_ans_date = 20190101
call get_param(param_file, mdl, "HOR_REGRID_ANSWER_DATE", CS%hor_regrid_answer_date, &
"The vintage of the order of arithmetic for horizontal regridding. "//&
"Dates before 20190101 give the same answers as the code did in late 2018, "//&
"while later versions add parentheses for rotational symmetry. "//&
"If both HOR_REGRID_2018_ANSWERS and HOR_REGRID_ANSWER_DATE are specified, the "//&
"latter takes precedence.", default=default_hor_reg_ans_date)
call get_param(param_file, mdl, "SPONGE_DATA_ONGRID", CS%spongeDataOngrid, &
"When defined, the incoming sponge data are "//&
"assumed to be on the model grid " , &
Expand Down

0 comments on commit ab1e514

Please sign in to comment.