Skip to content

Commit 663d389

Browse files
committed
+Obsoleted 9 parameters, including BETTER_BOUND_KH
Obsoleted 9 runtime parameters that always take the same value, as agreed upon in a MOM6 consortium wide conversations on June 2, 2025, and added tests to catch these parameters in MOM_obsolete_params. The parameters that were obsoleted include BETTER_BOUND_KH, BETTER_BOUND_AH, USE_DIABATIC_TIME_BUG, FIX_UNSPLIT_DT_VISC_BUG, CFL_BASED_TRUNCATIONS, ICE_SHELF_BUOYANCY_FLUX_ITT_BUG, ICE_SHELF_SALT_FLUX_ITT_BUG and KD_BACKGROUND_VIA_KDML_BUG. The runtime parameter MAXVEL still exists, but it is logged in a different order than before, changing the contents of the MOM_parameter_doc files. All answers are bitwise identical in cases that run, but cases that use these parameters will experience a fatal error.
1 parent ce13592 commit 663d389

File tree

8 files changed

+103
-322
lines changed

8 files changed

+103
-322
lines changed

src/core/MOM.F90

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ module MOM
314314
logical :: useMEKE !< If true, call the MEKE parameterization.
315315
logical :: use_stochastic_EOS !< If true, use the stochastic EOS parameterizations.
316316
logical :: useWaves !< If true, update Stokes drift
317-
logical :: use_diabatic_time_bug !< If true, uses the wrong calendar time for diabatic processes,
318-
!! as was done in MOM6 versions prior to February 2018.
319317
real :: dtbt_reset_period !< The time interval between dynamic recalculation of the
320318
!! barotropic time step [T ~> s]. If this is negative dtbt is never
321319
!! calculated, and if it is 0, dtbt is calculated every step.
@@ -840,15 +838,9 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
840838

841839
rel_time = 0.0
842840
do n=1,n_max
843-
if (CS%use_diabatic_time_bug) then
844-
! This wrong form of update was used until Feb 2018, recovered with CS%use_diabatic_time_bug=T.
845-
CS%Time = Time_start + real_to_time(US%T_to_s*int(floor(rel_time+0.5*dt+0.5)))
846-
rel_time = rel_time + dt
847-
else
848-
rel_time = rel_time + dt ! The relative time at the end of the step.
849-
! Set the universally visible time to the middle of the time step.
850-
CS%Time = Time_start + real_to_time(US%T_to_s*(rel_time - 0.5*dt))
851-
endif
841+
rel_time = rel_time + dt ! The relative time at the end of the step.
842+
! Set the universally visible time to the middle of the time step.
843+
CS%Time = Time_start + real_to_time(US%T_to_s*(rel_time - 0.5*dt))
852844
! Set the local time to the end of the time step.
853845
Time_local = Time_start + real_to_time(US%T_to_s*rel_time)
854846

@@ -878,16 +870,12 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
878870
endif
879871

880872
end_time_thermo = Time_local
881-
if (dtdia > dt .and. .not. CS%use_diabatic_time_bug) then
873+
if (dtdia > dt) then
882874
! If necessary, temporarily reset CS%Time to the center of the period covered
883875
! by the call to step_MOM_thermo, noting that they begin at the same time.
884-
! This step was missing prior to Feb 2018, and is skipped with CS%use_diabatic_time_bug=T.
885876
CS%Time = CS%Time + real_to_time(0.5*US%T_to_s*(dtdia-dt))
886-
endif
887-
if (dtdia > dt .or. CS%use_diabatic_time_bug) then
888877
! The end-time of the diagnostic interval needs to be set ahead if there
889878
! are multiple dynamic time steps worth of thermodynamics applied here.
890-
! This line was not conditional prior to Feb 2018, recovered with CS%use_diabatic_time_bug=T.
891879
end_time_thermo = Time_local + real_to_time(US%T_to_s*(dtdia-dt))
892880
endif
893881

@@ -903,8 +891,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
903891
CS%t_dyn_rel_thermo = -dtdia
904892
if (showCallTree) call callTree_waypoint("finished diabatic_first (step_MOM)")
905893

906-
if (dtdia > dt .and. .not. CS%use_diabatic_time_bug) & ! Reset CS%Time to its previous value.
907-
! This step was missing prior to Feb 2018, recovered with CS%use_diabatic_time_bug=T.
894+
if (dtdia > dt) & ! Reset CS%Time to its previous value.
908895
CS%Time = Time_start + real_to_time(US%T_to_s*(rel_time - 0.5*dt))
909896
endif ! end of block "(CS%diabatic_first .and. (CS%t_dyn_rel_adv==0.0))"
910897

@@ -1004,8 +991,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
1004991

1005992
! If necessary, temporarily reset CS%Time to the center of the period covered
1006993
! by the call to step_MOM_thermo, noting that they end at the same time.
1007-
! This step was missing prior to Feb 2018, and is skipped with CS%use_diabatic_time_bug=T.
1008-
if (dtdia > dt .and. .not. CS%use_diabatic_time_bug) &
994+
if (dtdia > dt) &
1009995
CS%Time = CS%Time - real_to_time(0.5*US%T_to_s*(dtdia-dt))
1010996

1011997
! Apply diabatic forcing, do mixing, and regrid.
@@ -1024,8 +1010,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
10241010
endif
10251011

10261012
! Reset CS%Time to its previous value.
1027-
! This step was missing prior to Feb 2018, and is skipped with CS%use_diabatic_time_bug=T.
1028-
if (dtdia > dt .and. .not. CS%use_diabatic_time_bug) &
1013+
if (dtdia > dt) &
10291014
CS%Time = Time_start + real_to_time(US%T_to_s*(rel_time - 0.5*dt))
10301015
endif
10311016

@@ -2732,11 +2717,6 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
27322717
default=default_answer_date, do_not_log=non_Bous)
27332718
if (non_Bous) CS%answer_date = 99991231
27342719

2735-
call get_param(param_file, "MOM", "USE_DIABATIC_TIME_BUG", CS%use_diabatic_time_bug, &
2736-
"If true, uses the wrong calendar time for diabatic processes, as was "//&
2737-
"done in MOM6 versions prior to February 2018. This is not recommended.", &
2738-
default=.false.)
2739-
27402720
call get_param(param_file, "MOM", "SAVE_INITIAL_CONDS", save_IC, &
27412721
"If true, write the initial conditions to a file given "//&
27422722
"by IC_OUTPUT_FILE.", default=.false.)

src/core/MOM_dynamics_unsplit.F90

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,6 @@ subroutine initialize_dyn_unsplit(u, v, h, tv, Time, G, GV, US, param_file, diag
634634
character(len=48) :: flux_units
635635
! This include declares and sets the variable "version".
636636
# include "version_variable.h"
637-
logical :: use_correct_dt_visc
638-
logical :: test_value ! This is used to determine whether a logical parameter is being set explicitly.
639-
logical :: explicit_bug, explicit_fix ! These indicate which parameters are set explicitly.
640637
integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
641638
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nz = GV%ke
642639
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
@@ -655,33 +652,6 @@ subroutine initialize_dyn_unsplit(u, v, h, tv, Time, G, GV, US, param_file, diag
655652
call log_version(param_file, mdl, version, "")
656653

657654
call get_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", CS%dt_visc_bug, &
658-
"If false, use the correct timestep in the viscous terms applied in the first "//&
659-
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
660-
"of the turbulent mixed layer properties for viscosity with unsplit or "//&
661-
"unsplit_RK2. If true, an older incorrect value is used.", &
662-
default=.false., do_not_log=.true.)
663-
! This is used to test whether UNSPLIT_DT_VISC_BUG is being actively set.
664-
call get_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", test_value, default=.true., do_not_log=.true.)
665-
explicit_bug = CS%dt_visc_bug .eqv. test_value
666-
call get_param(param_file, mdl, "FIX_UNSPLIT_DT_VISC_BUG", use_correct_dt_visc, &
667-
"If true, use the correct timestep in the viscous terms applied in the first "//&
668-
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
669-
"of the turbulent mixed layer properties for viscosity with unsplit or "//&
670-
"unsplit_RK2.", default=.true., do_not_log=.true.)
671-
call get_param(param_file, mdl, "FIX_UNSPLIT_DT_VISC_BUG", test_value, default=.false., do_not_log=.true.)
672-
explicit_fix = use_correct_dt_visc .eqv. test_value
673-
674-
if (explicit_bug .and. explicit_fix .and. (use_correct_dt_visc .eqv. CS%dt_visc_bug)) then
675-
! UNSPLIT_DT_VISC_BUG is being explicitly set, and should not be changed.
676-
call MOM_error(FATAL, "UNSPLIT_DT_VISC_BUG and FIX_UNSPLIT_DT_VISC_BUG are both being set "//&
677-
"with inconsistent values. FIX_UNSPLIT_DT_VISC_BUG is an obsolete "//&
678-
"parameter and should be removed.")
679-
elseif (explicit_fix) then
680-
call MOM_error(WARNING, "FIX_UNSPLIT_DT_VISC_BUG is an obsolete parameter. "//&
681-
"Use UNSPLIT_DT_VISC_BUG instead (noting that it has the opposite sense).")
682-
CS%dt_visc_bug = .not.use_correct_dt_visc
683-
endif
684-
call log_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", CS%dt_visc_bug, &
685655
"If false, use the correct timestep in the viscous terms applied in the first "//&
686656
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
687657
"of the turbulent mixed layer properties for viscosity with unsplit or "//&

src/core/MOM_dynamics_unsplit_RK2.F90

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,6 @@ subroutine initialize_dyn_unsplit_RK2(u, v, h, tv, Time, G, GV, US, param_file,
581581
character(len=48) :: flux_units
582582
! This include declares and sets the variable "version".
583583
# include "version_variable.h"
584-
logical :: use_correct_dt_visc
585-
logical :: test_value ! This is used to determine whether a logical parameter is being set explicitly.
586-
logical :: explicit_bug, explicit_fix ! These indicate which parameters are set explicitly.
587584
integer :: isd, ied, jsd, jed, nz, IsdB, IedB, JsdB, JedB
588585
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nz = GV%ke
589586
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
@@ -618,33 +615,6 @@ subroutine initialize_dyn_unsplit_RK2(u, v, h, tv, Time, G, GV, US, param_file,
618615
units="nondim", default=0.0)
619616

620617
call get_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", CS%dt_visc_bug, &
621-
"If false, use the correct timestep in the viscous terms applied in the first "//&
622-
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
623-
"of the turbulent mixed layer properties for viscosity with unsplit or "//&
624-
"unsplit_RK2. If true, an older incorrect value is used.", &
625-
default=.false., do_not_log=.true.)
626-
! This is used to test whether UNSPLIT_DT_VISC_BUG is being explicitly set.
627-
call get_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", test_value, default=.true., do_not_log=.true.)
628-
explicit_bug = CS%dt_visc_bug .eqv. test_value
629-
call get_param(param_file, mdl, "FIX_UNSPLIT_DT_VISC_BUG", use_correct_dt_visc, &
630-
"If true, use the correct timestep in the viscous terms applied in the first "//&
631-
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
632-
"of the turbulent mixed layer properties for viscosity with unsplit or "//&
633-
"unsplit_RK2.", default=.true., do_not_log=.true.)
634-
call get_param(param_file, mdl, "FIX_UNSPLIT_DT_VISC_BUG", test_value, default=.false., do_not_log=.true.)
635-
explicit_fix = use_correct_dt_visc .eqv. test_value
636-
637-
if (explicit_bug .and. explicit_fix .and. (use_correct_dt_visc .eqv. CS%dt_visc_bug)) then
638-
! UNSPLIT_DT_VISC_BUG is being explicitly set, and should not be changed.
639-
call MOM_error(FATAL, "UNSPLIT_DT_VISC_BUG and FIX_UNSPLIT_DT_VISC_BUG are both being set "//&
640-
"with inconsistent values. FIX_UNSPLIT_DT_VISC_BUG is an obsolete "//&
641-
"parameter and should be removed.")
642-
elseif (explicit_fix) then
643-
call MOM_error(WARNING, "FIX_UNSPLIT_DT_VISC_BUG is an obsolete parameter. "//&
644-
"Use UNSPLIT_DT_VISC_BUG instead (noting that it has the opposite sense).")
645-
CS%dt_visc_bug = .not.use_correct_dt_visc
646-
endif
647-
call log_param(param_file, mdl, "UNSPLIT_DT_VISC_BUG", CS%dt_visc_bug, &
648618
"If false, use the correct timestep in the viscous terms applied in the first "//&
649619
"predictor step with the unsplit time stepping scheme, and in the calculation "//&
650620
"of the turbulent mixed layer properties for viscosity with unsplit or "//&

src/diagnostics/MOM_obsolete_params.F90

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ subroutine find_obsolete_params(param_file)
8282
call obsolete_real(param_file, "HALOCLINE_FILTER_LENGTH")
8383
call obsolete_real(param_file, "HALOCLINE_STRAT_TOL")
8484

85+
call obsolete_logical(param_file, "ICE_SHELF_BUOYANCY_FLUX_ITT_BUG", .true.)
86+
call obsolete_logical(param_file, "ICE_SHELF_SALT_FLUX_ITT_BUG", .true.)
87+
8588
! Test for inconsistent parameter settings.
8689
split = .true. ; test_logic = .false.
8790
call read_param(param_file,"SPLIT",split)
@@ -108,10 +111,23 @@ subroutine find_obsolete_params(param_file)
108111
call obsolete_real(param_file, "MIN_Z_DIAG_INTERVAL")
109112
call obsolete_char(param_file, "Z_OUTPUT_GRID_FILE")
110113

114+
call obsolete_logical(param_file, "CFL_BASED_TRUNCATIONS", .true.)
115+
call obsolete_logical(param_file, "KD_BACKGROUND_VIA_KDML_BUG", .false.)
116+
call obsolete_logical(param_file, "USE_DIABATIC_TIME_BUG", .false.)
117+
111118
call read_param(param_file, "INTERPOLATE_SPONGE_TIME_SPACE", test_logic)
112119
call obsolete_logical(param_file, "NEW_SPONGES", warning_val=test_logic, &
113120
hint="Use INTERPOLATE_SPONGE_TIME_SPACE instead.")
114121

122+
test_logic = .true. ; call read_param(param_file, "BOUND_KH", test_logic)
123+
call obsolete_logical(param_file, "BETTER_BOUND_KH", warning_val=test_logic, hint="Use BOUND_KH alone.")
124+
test_logic = .true. ; call read_param(param_file, "BOUND_AH", test_logic)
125+
call obsolete_logical(param_file, "BETTER_BOUND_AH", warning_val=test_logic, hint="Use BOUND_AH alone.")
126+
127+
test_logic = .false. ; call read_param(param_file, "UNSPLIT_DT_VISC_BUG", test_logic)
128+
call obsolete_logical(param_file, "FIX_UNSPLIT_DT_VISC_BUG", warning_val=(.not.test_logic), &
129+
hint="Use UNSPLIT_DT_VISC_BUG instead, but with the reversed meaning.")
130+
115131
call obsolete_logical(param_file, "SMOOTH_RI", hint="Instead use N_SMOOTH_RI.")
116132

117133
call obsolete_logical(param_file, "INTERNAL_TIDE_CORNER_ADVECT", .false.)

src/ice_shelf/MOM_ice_shelf.F90

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ module MOM_ice_shelf
197197
!! divided by the von Karman constant VK. Was 1/8.
198198
real :: Vk !< Von Karman's constant - dimensionless
199199
real :: Rc !< critical flux Richardson number.
200-
logical :: buoy_flux_itt_bug !< If true, fixes buoyancy iteration bug
201-
logical :: salt_flux_itt_bug !< If true, fixes salt iteration bug
202200
real :: buoy_flux_itt_threshold !< Buoyancy iteration threshold for convergence
203201

204202
!>@{ Diagnostic handles
@@ -615,7 +613,7 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
615613
! This is Newton's method without any bounds. Should bounds be needed?
616614
wB_flux_new = wB_flux - (wB_flux_new - wB_flux) / dDwB_dwB_in
617615
! Update wB_flux
618-
if (CS%buoy_flux_itt_bug) wB_flux = wB_flux_new
616+
wB_flux = wB_flux_new
619617
enddo !it3
620618
endif
621619

@@ -688,8 +686,6 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step_in, CS)
688686
Sbdry(i,j) = Sbdry_it
689687
endif ! Sb_min_set
690688

691-
if (.not.CS%salt_flux_itt_bug) Sbdry(i,j) = Sbdry_it
692-
693689
endif ! CS%find_salt_root
694690

695691
enddo !it1
@@ -1686,10 +1682,6 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, Time_init,
16861682
call get_param(param_file, mdl, "ICE_SHELF_RC", CS%Rc, &
16871683
"Critical flux Richardson number for ice melt ", &
16881684
units="nondim", default=0.20)
1689-
call get_param(param_file, mdl, "ICE_SHELF_BUOYANCY_FLUX_ITT_BUG", CS%buoy_flux_itt_bug, &
1690-
"Bug fix of buoyancy iteration", default=.true.)
1691-
call get_param(param_file, mdl, "ICE_SHELF_SALT_FLUX_ITT_BUG", CS%salt_flux_itt_bug, &
1692-
"Bug fix of salt iteration", default=.true.)
16931685
call get_param(param_file, mdl, "ICE_SHELF_BUOYANCY_FLUX_ITT_THRESHOLD", CS%buoy_flux_itt_threshold, &
16941686
"Convergence criterion of Newton's method for ice shelf "//&
16951687
"buoyancy iteration.", units="nondim", default=1.0e-4)

0 commit comments

Comments
 (0)