10 implicit none ;
private 12 #include <MOM_memory.h> 23 character(len=40) :: mdl =
"find_obsolete_params" 25 #include "version_variable.h" 27 logical :: test_logic, test_logic2, test_logic3, split
32 hint=
"Instead use DT_THERM to set the thermodynamic time-step.")
35 hint=
"Instead use ANALYTIC_FV_PGF.")
38 hint=
"Instead use CORIOLIS_SCHEME='SADOURNY'.")
41 hint=
"Instead use BT_THICK_SCHEME='ARITHMETIC'.")
44 hint=
"Instead use BT_THICK_SCHEME='HYBRID'.")
47 hint=
"Instead use BT_THICK_SCHEME='FROM_BT_CONT'.")
50 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
52 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
54 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
56 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
58 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
60 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
62 hint=
"Instead use OBC_USER_CONFIG and use the new segments protocol.")
64 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
66 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
68 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
70 test_logic3 = .true. ;
call read_param(param_file,
"ENABLE_THERMODYNAMICS",test_logic3)
71 test_logic = .true. ;
call read_param(param_file,
"TEMPERATURE",test_logic)
72 test_logic2 = .false. ;
call read_param(param_file,
"TEMPERATURE",test_logic2)
73 if (test_logic .eqv. test_logic2)
then ;
if (test_logic .eqv. test_logic3)
then 74 call mom_error(warning,
"find_obsolete_params: "// &
75 "TEMPERATURE is an obsolete run-time flag, but is set consistently with \n"//&
76 " ENABLE_THERMODYNAMICS.")
78 call mom_error(fatal,
"find_obsolete_params: "// &
79 "TEMPERATURE is an obsolete run-time flag. Use ENABLE_THERMODYNAMICS instead.")
82 test_logic = test_logic3 ;
call read_param(param_file,
"NONLINEAR_EOS",test_logic)
83 if (test_logic .neqv. test_logic3)
then 84 call mom_error(warning,
"find_obsolete_params: "// &
85 "NONLINEAR_EOS is an obsolete option. Instead define " // &
86 "USE_EOS to use an equation of state to calculate density.")
110 call obsolete_int(param_file,
"NIPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
111 call obsolete_int(param_file,
"NJPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
126 call obsolete_logical(param_file,
"SLOW_BITWISE_GLOBAL_FORCING_SUMS", .false.)
135 call obsolete_char(param_file,
"DIAG_REMAP_Z_GRID_DEF",
"Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
154 test_logic = .false. ;
call read_param(param_file,
"USE_JACKSON_PARAM", test_logic)
163 call obsolete_real(param_file,
"ZSTAR_RIGID_SURFACE_THRESHOLD")
165 test_int = -1 ;
call read_param(param_file,
"ML_RADIATION_CODING",test_int)
166 if (test_int == 1)
call mom_error(fatal,
"find_obsolete_params: "// &
167 "ML_RADIATION_CODING is an obsolete option and the code previously "//&
168 "used by setting it to 1 has been eliminated.")
169 if (test_int /= -1)
call mom_error(warning,
"find_obsolete_params: "// &
170 "ML_RADIATION_CODING is an obsolete option.")
173 split = .true. ; test_logic = .false.
175 call read_param(param_file,
"DYNAMIC_SURFACE_PRESSURE",test_logic)
176 if (test_logic .and. .not.split)
call mom_error(fatal, &
177 "find_obsolete_params: #define DYNAMIC_SURFACE_PRESSURE is not yet "//&
178 "implemented without #define SPLIT.")
180 call read_param(param_file,
"USE_LEGACY_SPLIT",test_logic)
181 if (.not.(split .and. test_logic))
then 188 call obsolete_int(param_file,
"SEAMOUNT_LENGTH_SCALE", hint=
"Use SEAMOUNT_X_LENGTH_SCALE instead.")
190 call obsolete_logical(param_file,
"MSTAR_FIXED", hint=
"Instead use MSTAR_MODE.")
200 character(len=*),
intent(in) :: varname
201 logical,
optional,
intent(in) :: warning_val
202 character(len=*),
optional,
intent(in) :: hint
204 logical :: test_logic, fatal_err
205 character(len=128) :: hint_msg
207 test_logic = .false. ;
call read_param(param_file, varname,test_logic)
209 if (
present(warning_val)) fatal_err = (warning_val .neqv. .true.)
210 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
214 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
215 " is an obsolete run-time flag, and should not be used. "// &
218 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
219 " is an obsolete run-time flag. "//trim(hint_msg))
223 test_logic = .true. ;
call read_param(param_file, varname, test_logic)
225 if (
present(warning_val)) fatal_err = (warning_val .neqv. .false.)
227 if (.not.test_logic)
then 229 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
230 " is an obsolete run-time flag, and should not be used. "// &
233 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
234 " is an obsolete run-time flag. "//trim(hint_msg))
243 character(len=*),
intent(in) :: varname
244 character(len=*),
optional,
intent(in) :: hint
246 character(len=200) :: test_string, hint_msg
248 test_string =
'';
call read_param(param_file, varname, test_string)
249 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
251 if (len_trim(test_string) > 0)
call mom_error(fatal, &
252 "MOM_obsolete_params: "//trim(varname)// &
253 " is an obsolete run-time flag, and should not be used. "// &
259 subroutine obsolete_real(param_file, varname, warning_val, hint)
261 character(len=*),
intent(in) :: varname
262 real,
optional,
intent(in) :: warning_val
263 character(len=*),
optional,
intent(in) :: hint
265 real :: test_val, warn_val
266 character(len=128) :: hint_msg
268 test_val = -9e35;
call read_param(param_file, varname, test_val)
269 warn_val = -9e35;
if (
present(warning_val)) warn_val = warning_val
270 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
272 if (test_val /= -9e35)
then 273 if (test_val == warn_val)
then 274 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
275 " is an obsolete run-time flag. "//trim(hint_msg))
277 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
278 " is an obsolete run-time flag, and should not be used. "// &
285 subroutine obsolete_int(param_file, varname, warning_val, hint)
287 character(len=*),
intent(in) :: varname
288 integer,
optional,
intent(in) :: warning_val
289 character(len=*),
optional,
intent(in) :: hint
291 integer :: test_val, warn_val
292 character(len=128) :: hint_msg
294 test_val = -123456788;
call read_param(param_file, varname, test_val)
295 warn_val = -123456788;
if (
present(warning_val)) warn_val = warning_val
296 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
298 if (test_val /= -123456788)
then 299 if (test_val == warn_val)
then 300 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
301 " is an obsolete run-time flag. "//trim(hint_msg))
303 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
304 " is an obsolete run-time flag, and should not be used. "// &
Methods for testing for, and list of, obsolete run-time parameters.
subroutine, public find_obsolete_params(param_file)
Scans input parameter file for list obsolete parameters.
subroutine, public obsolete_int(param_file, varname, warning_val, hint)
Test for presence of obsolete INTEGER in parameter file.
logical function, public is_root_pe()
subroutine, public obsolete_char(param_file, varname, hint)
Test for presence of obsolete STRING in parameter file.
subroutine, public mom_error(level, message, all_print)
subroutine, public obsolete_logical(param_file, varname, warning_val, hint)
Test for presence of obsolete LOGICAL in parameter file.
subroutine, public obsolete_real(param_file, varname, warning_val, hint)
Test for presence of obsolete REAL in parameter file.