10 implicit none ;
private
12 #include <MOM_memory.h>
14 public find_obsolete_params
15 public obsolete_logical, obsolete_int, obsolete_real, obsolete_char
20 subroutine find_obsolete_params(param_file)
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
30 if (.not.is_root_pe())
return
32 call obsolete_int(param_file,
"NTSTEP", &
33 hint=
"Instead use DT_THERM to set the thermodynamic time-step.")
35 call obsolete_logical(param_file,
"JACOBIAN_PGF", .false., &
36 hint=
"Instead use ANALYTIC_FV_PGF.")
38 call obsolete_logical(param_file,
"SADOURNY", &
39 hint=
"Instead use CORIOLIS_SCHEME='SADOURNY'.")
41 call obsolete_logical(param_file,
"ARITHMETIC_BT_THICK", &
42 hint=
"Instead use BT_THICK_SCHEME='ARITHMETIC'.")
44 call obsolete_logical(param_file,
"HYBRID_BT_THICK", &
45 hint=
"Instead use BT_THICK_SCHEME='HYBRID'.")
47 call obsolete_logical(param_file,
"BT_CONT_BT_THICK", &
48 hint=
"Instead use BT_THICK_SCHEME='FROM_BT_CONT'.")
50 call obsolete_logical(param_file,
"APPLY_OBC_U", &
51 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
52 call obsolete_logical(param_file,
"APPLY_OBC_V", &
53 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
54 call obsolete_logical(param_file,
"APPLY_OBC_V_FLATHER_NORTH", &
55 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
56 call obsolete_logical(param_file,
"APPLY_OBC_V_FLATHER_SOUTH", &
57 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
58 call obsolete_logical(param_file,
"APPLY_OBC_U_FLATHER_EAST", &
59 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
60 call obsolete_logical(param_file,
"APPLY_OBC_U_FLATHER_WEST", &
61 hint=
"Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
62 call obsolete_char(param_file,
"OBC_CONFIG", &
63 hint=
"Instead use OBC_USER_CONFIG and use the new segments protocol.")
64 call obsolete_char(param_file,
"READ_OBC_ETA", &
65 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
66 call obsolete_char(param_file,
"READ_OBC_UV", &
67 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
68 call obsolete_char(param_file,
"READ_OBC_TS", &
69 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
70 call obsolete_char(param_file,
"EXTEND_OBC_SEGMENTS", &
71 hint=
"This option is no longer needed, nor supported.")
72 call obsolete_char(param_file,
"MEKE_VISCOSITY_COEFF", &
73 hint=
"This option has been replaced by MEKE_VISCOSITY_COEFF_KU and \n" //&
74 " MEKE_VISCOSITY_COEFF_AU. Please set these parameters instead.")
76 call read_param(param_file,
"OBC_NUMBER_OF_SEGMENTS", nseg)
78 write(temp_string(1:22),
"('OBC_SEGMENT_',i3.3,'_TNUDGE')") l_seg
79 call obsolete_real(param_file, temp_string, &
80 hint=
"Instead use OBC_SEGMENT_xxx_VELOCITY_NUDGING_TIMESCALES.")
83 test_logic3 = .true. ;
call read_param(param_file,
"ENABLE_THERMODYNAMICS",test_logic3)
84 test_logic = .true. ;
call read_param(param_file,
"TEMPERATURE",test_logic)
85 test_logic2 = .false. ;
call read_param(param_file,
"TEMPERATURE",test_logic2)
86 if (test_logic .eqv. test_logic2)
then ;
if (test_logic .eqv. test_logic3)
then
87 call mom_error(warning,
"find_obsolete_params: "// &
88 "TEMPERATURE is an obsolete run-time flag, but is set consistently with \n"//&
89 " ENABLE_THERMODYNAMICS.")
91 call mom_error(fatal,
"find_obsolete_params: "// &
92 "TEMPERATURE is an obsolete run-time flag. Use ENABLE_THERMODYNAMICS instead.")
95 test_logic = test_logic3 ;
call read_param(param_file,
"NONLINEAR_EOS",test_logic)
96 if (test_logic .neqv. test_logic3)
then
97 call mom_error(warning,
"find_obsolete_params: "// &
98 "NONLINEAR_EOS is an obsolete option. Instead define " // &
99 "USE_EOS to use an equation of state to calculate density.")
112 call obsolete_int(param_file,
"NXTOT")
113 call obsolete_int(param_file,
"NYTOT")
114 call obsolete_int(param_file,
"NZ")
115 call obsolete_int(param_file,
"NXPROC")
116 call obsolete_int(param_file,
"NYPROC")
117 call obsolete_int(param_file,
"NXPROC_IO")
118 call obsolete_int(param_file,
"NYPROC_IO")
119 call obsolete_int(param_file,
"NXHALO")
120 call obsolete_int(param_file,
"NYHALO")
121 call obsolete_int(param_file,
"ML_PRESORT_NZ_CONV_ADJ")
123 call obsolete_int(param_file,
"NIPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
124 call obsolete_int(param_file,
"NJPROC_IO", hint=
"Use IO_LAYOUT=#,# instead.")
126 call obsolete_real(param_file,
"BT_COR_SLOW_RATE", 0.0)
127 call obsolete_real(param_file,
"BT_COR_FRAC", 1.0)
129 call obsolete_logical(param_file,
"MASK_MASSLESS_TRACERS", .false.)
131 call obsolete_logical(param_file,
"BT_INCLUDE_UDHDT", .false.)
133 call obsolete_logical(param_file,
"RIGA_SET_DIFFUSIVITY", .false.)
134 call obsolete_logical(param_file,
"RIGA_ITIDE_BUGS", .false.)
135 call obsolete_logical(param_file,
"RIGA_ENTRAINMENT_FOIBLES", .false.)
136 call obsolete_logical(param_file,
"RIGA_TRACER_DIFFUSE_BUGS", .false.)
137 call obsolete_logical(param_file,
"RIGA_KAPPA_SHEAR_BUGS1", .false.)
138 call obsolete_logical(param_file,
"RIGA_KAPPA_SHEAR_BUGS2", .false.)
139 call obsolete_logical(param_file,
"CONT_PPM_RIGA_BUGS", .false.)
140 call obsolete_logical(param_file,
"USE_REPRODUCING_SUM", .true.)
141 call obsolete_logical(param_file,
"SLOW_BITWISE_GLOBAL_FORCING_SUMS", .false.)
142 call obsolete_logical(param_file,
"ALWAYS_WRITE_GEOM")
143 call obsolete_real(param_file,
"I_ZETA")
145 call obsolete_logical(param_file,
"REF_COMPRESS_3D")
146 call obsolete_char(param_file,
"COMPRESS_FILE")
147 call obsolete_char(param_file,
"REF_COMPRESS_FILE_TEMP")
148 call obsolete_char(param_file,
"REF_COMPRESS_FILE_SALT")
149 call obsolete_char(param_file,
"REF_COMPRESS_FILE_DEPTH")
150 call obsolete_char(param_file,
"DIAG_REMAP_Z_GRID_DEF",
"Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
152 call obsolete_logical(param_file,
"OLD_RESTRAT_PARAM", .false.)
153 call obsolete_real(param_file,
"ML_RESTRAT_COEF", 0.0)
154 call obsolete_logical(param_file,
"FULL_THICKNESSDIFFUSE", .true.)
155 call obsolete_logical(param_file,
"DIFFUSE_ISOPYCNALS", .true.)
157 call obsolete_logical(param_file,
"MOREL_PEN_SW")
158 call obsolete_logical(param_file,
"MANIZZA_PEN_SW")
160 call obsolete_logical(param_file,
"USE_H2000_SHEAR_MIXING", .false.)
161 call obsolete_real(param_file,
"SHEARMIX_LAT_EQ", 0.0)
162 call obsolete_real(param_file,
"RINO_CRIT_EQ")
163 call obsolete_real(param_file,
"SHEARMIX_RATE_EQ")
165 call obsolete_real(param_file,
"VSTAR_SCALE_FACTOR", hint=
"Use EPBL_VEL_SCALE_FACTOR instead.")
166 call obsolete_logical(param_file,
"ORIG_MLD_ITERATION", .false.)
168 call obsolete_logical(param_file,
"CONTINUITY_PPM", .true.)
170 call obsolete_logical(param_file,
"USE_LOCAL_PREF", .true.)
171 call obsolete_logical(param_file,
"USE_LOCAL_PREF_CORRECT", .true.)
172 test_logic = .false. ;
call read_param(param_file,
"USE_JACKSON_PARAM", test_logic)
173 call obsolete_logical(param_file,
"RINOMIX", test_logic)
174 call obsolete_logical(param_file,
"NORMALIZED_SUM_OUT", .true.)
176 call obsolete_real(param_file,
"RLAY_RANGE")
177 call obsolete_real(param_file,
"RLAY_REF")
179 call obsolete_real(param_file,
"HMIX")
180 call obsolete_real(param_file,
"VSTAR_SCALE_COEF")
181 call obsolete_real(param_file,
"ZSTAR_RIGID_SURFACE_THRESHOLD")
183 test_int = -1 ;
call read_param(param_file,
"ML_RADIATION_CODING",test_int)
184 if (test_int == 1)
call mom_error(fatal,
"find_obsolete_params: "// &
185 "ML_RADIATION_CODING is an obsolete option and the code previously "//&
186 "used by setting it to 1 has been eliminated.")
187 if (test_int /= -1)
call mom_error(warning,
"find_obsolete_params: "// &
188 "ML_RADIATION_CODING is an obsolete option.")
191 split = .true. ; test_logic = .false.
193 call read_param(param_file,
"DYNAMIC_SURFACE_PRESSURE",test_logic)
194 if (test_logic .and. .not.split)
call mom_error(fatal, &
195 "find_obsolete_params: #define DYNAMIC_SURFACE_PRESSURE is not yet "//&
196 "implemented without #define SPLIT.")
198 call obsolete_logical(param_file,
"USE_LEGACY_SPLIT", .false.)
200 call obsolete_logical(param_file,
"FLUX_BT_COUPLING", .false.)
201 call obsolete_logical(param_file,
"READJUST_BT_TRANS", .false.)
202 call obsolete_logical(param_file,
"RESCALE_BT_FACE_AREAS", .false.)
203 call obsolete_logical(param_file,
"APPLY_BT_DRAG", .true.)
204 call obsolete_real(param_file,
"BT_MASS_SOURCE_LIMIT", 0.0)
206 call obsolete_int(param_file,
"SEAMOUNT_LENGTH_SCALE", hint=
"Use SEAMOUNT_X_LENGTH_SCALE instead.")
208 call obsolete_logical(param_file,
"MSTAR_FIXED", hint=
"Instead use MSTAR_MODE.")
209 call obsolete_logical(param_file,
"USE_VISBECK_SLOPE_BUG", .false.)
211 call obsolete_real(param_file,
"MIN_Z_DIAG_INTERVAL")
212 call obsolete_char(param_file,
"Z_OUTPUT_GRID_FILE")
217 end subroutine find_obsolete_params
220 subroutine obsolete_logical(param_file, varname, warning_val, hint)
222 character(len=*),
intent(in) :: varname
223 logical,
optional,
intent(in) :: warning_val
224 character(len=*),
optional,
intent(in) :: hint
226 logical :: test_logic, fatal_err
227 character(len=128) :: hint_msg
229 test_logic = .false. ;
call read_param(param_file, varname,test_logic)
231 if (
present(warning_val)) fatal_err = (warning_val .neqv. .true.)
232 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
236 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
237 " is an obsolete run-time flag, and should not be used. "// &
240 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
241 " is an obsolete run-time flag. "//trim(hint_msg))
245 test_logic = .true. ;
call read_param(param_file, varname, test_logic)
247 if (
present(warning_val)) fatal_err = (warning_val .neqv. .false.)
249 if (.not.test_logic)
then
251 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
252 " is an obsolete run-time flag, and should not be used. "// &
255 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
256 " is an obsolete run-time flag. "//trim(hint_msg))
260 end subroutine obsolete_logical
263 subroutine obsolete_char(param_file, varname, hint)
265 character(len=*),
intent(in) :: varname
266 character(len=*),
optional,
intent(in) :: hint
268 character(len=200) :: test_string, hint_msg
270 test_string =
'';
call read_param(param_file, varname, test_string)
271 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
273 if (len_trim(test_string) > 0)
call mom_error(fatal, &
274 "MOM_obsolete_params: "//trim(varname)// &
275 " is an obsolete run-time flag, and should not be used. "// &
278 end subroutine obsolete_char
281 subroutine obsolete_real(param_file, varname, warning_val, hint)
283 character(len=*),
intent(in) :: varname
284 real,
optional,
intent(in) :: warning_val
285 character(len=*),
optional,
intent(in) :: hint
287 real :: test_val, warn_val
288 character(len=128) :: hint_msg
290 test_val = -9e35;
call read_param(param_file, varname, test_val)
291 warn_val = -9e35;
if (
present(warning_val)) warn_val = warning_val
292 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
294 if (test_val /= -9e35)
then
295 if (test_val == warn_val)
then
296 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
297 " is an obsolete run-time flag. "//trim(hint_msg))
299 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
300 " is an obsolete run-time flag, and should not be used. "// &
304 end subroutine obsolete_real
307 subroutine obsolete_int(param_file, varname, warning_val, hint)
309 character(len=*),
intent(in) :: varname
310 integer,
optional,
intent(in) :: warning_val
311 character(len=*),
optional,
intent(in) :: hint
313 integer :: test_val, warn_val
314 character(len=128) :: hint_msg
316 test_val = -123456788;
call read_param(param_file, varname, test_val)
317 warn_val = -123456788;
if (
present(warning_val)) warn_val = warning_val
318 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
320 if (test_val /= -123456788)
then
321 if (test_val == warn_val)
then
322 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
323 " is an obsolete run-time flag. "//trim(hint_msg))
325 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
326 " is an obsolete run-time flag, and should not be used. "// &
330 end subroutine obsolete_int