10 implicit none ;
private
12 #include <MOM_memory.h>
23 character(len=40) :: mdl =
"find_obsolete_params"
25 #include "version_variable.h"
26 integer :: test_int, l_seg, nseg
27 logical :: test_logic, test_logic2, test_logic3, split
28 character(len=40) :: temp_string
33 hint=
"Instead use DT_THERM to set the thermodynamic time-step.")
36 hint=
"Instead use ANALYTIC_FV_PGF.")
39 hint=
"Instead use CORIOLIS_SCHEME='SADOURNY'.")
42 hint=
"Instead use BT_THICK_SCHEME='ARITHMETIC'.")
45 hint=
"Instead use BT_THICK_SCHEME='HYBRID'.")
48 hint=
"Instead use BT_THICK_SCHEME='FROM_BT_CONT'.")
51 hint=
"This option is no longer needed, nor supported.")
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_NUMBER_SEGMENTS>0 and use the new segments protocol.")
64 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
66 hint=
"Instead use OBC_USER_CONFIG and use the new segments protocol.")
68 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
70 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
72 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
74 hint=
"This option is no longer needed, nor supported.")
76 hint=
"This option has been replaced by MEKE_VISCOSITY_COEFF_KU and \n" //&
77 " MEKE_VISCOSITY_COEFF_AU. Please set these parameters instead.")
79 call read_param(param_file,
"OBC_NUMBER_OF_SEGMENTS", nseg)
81 write(temp_string(1:22),
"('OBC_SEGMENT_',i3.3,'_TNUDGE')") l_seg
83 hint=
"Instead use OBC_SEGMENT_xxx_VELOCITY_NUDGING_TIMESCALES.")
86 test_logic3 = .true. ;
call read_param(param_file,
"ENABLE_THERMODYNAMICS",test_logic3)
87 test_logic = .true. ;
call read_param(param_file,
"TEMPERATURE",test_logic)
88 test_logic2 = .false. ;
call read_param(param_file,
"TEMPERATURE",test_logic2)
89 if (test_logic .eqv. test_logic2)
then ;
if (test_logic .eqv. test_logic3)
then
90 call mom_error(warning,
"find_obsolete_params: "// &
91 "TEMPERATURE is an obsolete run-time flag, but is set consistently with \n"//&
92 " ENABLE_THERMODYNAMICS.")
94 call mom_error(fatal,
"find_obsolete_params: "// &
95 "TEMPERATURE is an obsolete run-time flag. Use ENABLE_THERMODYNAMICS instead.")
98 test_logic = test_logic3 ;
call read_param(param_file,
"NONLINEAR_EOS",test_logic)
99 if (test_logic .neqv. test_logic3)
then
100 call mom_error(warning,
"find_obsolete_params: "// &
101 "NONLINEAR_EOS is an obsolete option. Instead define " // &
102 "USE_EOS to use an equation of state to calculate density.")
126 call obsolete_int(param_file,
"NIPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
127 call obsolete_int(param_file,
"NJPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
144 call obsolete_logical(param_file,
"SLOW_BITWISE_GLOBAL_FORCING_SUMS", .false.)
153 call obsolete_char(param_file,
"DIAG_REMAP_Z_GRID_DEF",
"Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
168 call obsolete_real(param_file,
"VSTAR_SCALE_FACTOR", hint=
"Use EPBL_VEL_SCALE_FACTOR instead.")
175 test_logic = .false. ;
call read_param(param_file,
"USE_JACKSON_PARAM", test_logic)
184 call obsolete_real(param_file,
"ZSTAR_RIGID_SURFACE_THRESHOLD")
186 test_int = -1 ;
call read_param(param_file,
"ML_RADIATION_CODING",test_int)
187 if (test_int == 1)
call mom_error(fatal,
"find_obsolete_params: "// &
188 "ML_RADIATION_CODING is an obsolete option and the code previously "//&
189 "used by setting it to 1 has been eliminated.")
190 if (test_int /= -1)
call mom_error(warning,
"find_obsolete_params: "// &
191 "ML_RADIATION_CODING is an obsolete option.")
194 split = .true. ; test_logic = .false.
196 call read_param(param_file,
"DYNAMIC_SURFACE_PRESSURE",test_logic)
197 if (test_logic .and. .not.split)
call mom_error(fatal, &
198 "find_obsolete_params: #define DYNAMIC_SURFACE_PRESSURE is not yet "//&
199 "implemented without #define SPLIT.")
209 call obsolete_int(param_file,
"SEAMOUNT_LENGTH_SCALE", hint=
"Use SEAMOUNT_X_LENGTH_SCALE instead.")
211 call obsolete_logical(param_file,
"MSTAR_FIXED", hint=
"Instead use MSTAR_MODE.")
225 character(len=*),
intent(in) :: varname
226 logical,
optional,
intent(in) :: warning_val
227 character(len=*),
optional,
intent(in) :: hint
229 logical :: test_logic, fatal_err
230 character(len=128) :: hint_msg
232 test_logic = .false. ;
call read_param(param_file, varname,test_logic)
234 if (
present(warning_val)) fatal_err = (warning_val .neqv. .true.)
235 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
239 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
240 " is an obsolete run-time flag, and should not be used. "// &
243 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
244 " is an obsolete run-time flag. "//trim(hint_msg))
248 test_logic = .true. ;
call read_param(param_file, varname, test_logic)
250 if (
present(warning_val)) fatal_err = (warning_val .neqv. .false.)
252 if (.not.test_logic)
then
254 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
255 " is an obsolete run-time flag, and should not be used. "// &
258 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
259 " is an obsolete run-time flag. "//trim(hint_msg))
268 character(len=*),
intent(in) :: varname
269 character(len=*),
optional,
intent(in) :: hint
271 character(len=200) :: test_string, hint_msg
273 test_string =
'';
call read_param(param_file, varname, test_string)
274 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
276 if (len_trim(test_string) > 0)
call mom_error(fatal, &
277 "MOM_obsolete_params: "//trim(varname)// &
278 " is an obsolete run-time flag, and should not be used. "// &
284 subroutine obsolete_real(param_file, varname, warning_val, hint)
286 character(len=*),
intent(in) :: varname
287 real,
optional,
intent(in) :: warning_val
288 character(len=*),
optional,
intent(in) :: hint
290 real :: test_val, warn_val
291 character(len=128) :: hint_msg
293 test_val = -9e35;
call read_param(param_file, varname, test_val)
294 warn_val = -9e35;
if (
present(warning_val)) warn_val = warning_val
295 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
297 if (test_val /= -9e35)
then
298 if (test_val == warn_val)
then
299 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
300 " is an obsolete run-time flag. "//trim(hint_msg))
302 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
303 " is an obsolete run-time flag, and should not be used. "// &
310 subroutine obsolete_int(param_file, varname, warning_val, hint)
312 character(len=*),
intent(in) :: varname
313 integer,
optional,
intent(in) :: warning_val
314 character(len=*),
optional,
intent(in) :: hint
316 integer :: test_val, warn_val
317 character(len=128) :: hint_msg
319 test_val = -123456788;
call read_param(param_file, varname, test_val)
320 warn_val = -123456788;
if (
present(warning_val)) warn_val = warning_val
321 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
323 if (test_val /= -123456788)
then
324 if (test_val == warn_val)
then
325 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
326 " is an obsolete run-time flag. "//trim(hint_msg))
328 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
329 " is an obsolete run-time flag, and should not be used. "// &