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_logical(param_file,
"BLOCKED_ANALYTIC_FV_PGF", &
33 hint=
"BLOCKED_ANALYTIC_FV_PGF is no longer available.")
35 call obsolete_logical(param_file,
"ADD_KV_SLOW", &
36 hint=
"This option is no longer needed, nor supported.")
38 call obsolete_char(param_file,
"OBC_CONFIG", &
39 hint=
"Instead use OBC_USER_CONFIG and use the new segments protocol.")
40 call obsolete_char(param_file,
"READ_OBC_ETA", &
41 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
42 call obsolete_char(param_file,
"READ_OBC_UV", &
43 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
44 call obsolete_char(param_file,
"READ_OBC_TS", &
45 hint=
"Instead use OBC_SEGMENT_XXX_DATA.")
46 call obsolete_char(param_file,
"EXTEND_OBC_SEGMENTS", &
47 hint=
"This option is no longer needed, nor supported.")
48 call obsolete_char(param_file,
"MEKE_VISCOSITY_COEFF", &
49 hint=
"This option has been replaced by MEKE_VISCOSITY_COEFF_KU and \n" //&
50 " MEKE_VISCOSITY_COEFF_AU. Please set these parameters instead.")
52 call read_param(param_file,
"OBC_NUMBER_OF_SEGMENTS", nseg)
54 write(temp_string(1:22),
"('OBC_SEGMENT_',i3.3,'_TNUDGE')") l_seg
55 call obsolete_real(param_file, temp_string, &
56 hint=
"Instead use OBC_SEGMENT_xxx_VELOCITY_NUDGING_TIMESCALES.")
59 call obsolete_logical(param_file,
"MASK_MASSLESS_TRACERS", .false.)
61 call obsolete_logical(param_file,
"SALT_REJECT_BELOW_ML", .false.)
62 call obsolete_logical(param_file,
"MLE_USE_MLD_AVE_BUG", .false.)
63 call obsolete_logical(param_file,
"KG_BG_2D_BUG", .false.)
64 call obsolete_logical(param_file,
"CORRECT_DENSITY", .true.)
65 call obsolete_char(param_file,
"WINDSTRESS_STAGGER", warning_val=
"C", &
66 hint=
"Use WIND_STAGGER instead.")
68 call obsolete_char(param_file,
"DIAG_REMAP_Z_GRID_DEF", &
69 hint=
"Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
71 call obsolete_real(param_file,
"VSTAR_SCALE_FACTOR", hint=
"Use EPBL_VEL_SCALE_FACTOR instead.")
72 call obsolete_logical(param_file,
"ORIG_MLD_ITERATION", .false.)
74 call obsolete_real(param_file,
"VSTAR_SCALE_COEF")
75 call obsolete_real(param_file,
"ZSTAR_RIGID_SURFACE_THRESHOLD")
78 split = .true. ; test_logic = .false.
80 call read_param(param_file,
"DYNAMIC_SURFACE_PRESSURE",test_logic)
81 if (test_logic .and. .not.split)
call mom_error(fatal, &
82 "find_obsolete_params: #define DYNAMIC_SURFACE_PRESSURE is not yet "//&
83 "implemented without #define SPLIT.")
85 call obsolete_real(param_file,
"BT_MASS_SOURCE_LIMIT", 0.0)
87 call obsolete_int(param_file,
"SEAMOUNT_LENGTH_SCALE", hint=
"Use SEAMOUNT_X_LENGTH_SCALE instead.")
89 call obsolete_logical(param_file,
"MSTAR_FIXED", hint=
"Instead use MSTAR_MODE.")
90 call obsolete_logical(param_file,
"USE_VISBECK_SLOPE_BUG", .false.)
92 call obsolete_real(param_file,
"MIN_Z_DIAG_INTERVAL")
93 call obsolete_char(param_file,
"Z_OUTPUT_GRID_FILE")
98 end subroutine find_obsolete_params
101 subroutine obsolete_logical(param_file, varname, warning_val, hint)
103 character(len=*),
intent(in) :: varname
104 logical,
optional,
intent(in) :: warning_val
105 character(len=*),
optional,
intent(in) :: hint
107 logical :: test_logic, fatal_err
108 character(len=128) :: hint_msg
110 test_logic = .false. ;
call read_param(param_file, varname,test_logic)
112 if (
present(warning_val)) fatal_err = (warning_val .neqv. .true.)
113 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
117 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
118 " is an obsolete run-time flag, and should not be used. "// &
121 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
122 " is an obsolete run-time flag. "//trim(hint_msg))
126 test_logic = .true. ;
call read_param(param_file, varname, test_logic)
128 if (
present(warning_val)) fatal_err = (warning_val .neqv. .false.)
130 if (.not.test_logic)
then
132 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
133 " is an obsolete run-time flag, and should not be used. "// &
136 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
137 " is an obsolete run-time flag. "//trim(hint_msg))
141 end subroutine obsolete_logical
144 subroutine obsolete_char(param_file, varname, warning_val, hint)
146 character(len=*),
intent(in) :: varname
147 character(len=*),
optional,
intent(in) :: warning_val
148 character(len=*),
optional,
intent(in) :: hint
150 character(len=200) :: test_string, hint_msg
153 test_string =
'';
call read_param(param_file, varname, test_string)
154 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
156 if (len_trim(test_string) > 0)
then
158 if (
present(warning_val))
then
159 if (len_trim(warning_val) == len_trim(test_string))
then
160 if (index(trim(test_string), trim(warning_val)) == 1) only_warn = .true.
165 call mom_error(warning, &
166 "MOM_obsolete_params: "//trim(varname)// &
167 " is an obsolete run-time flag. "//trim(hint_msg))
169 call mom_error(fatal, &
170 "MOM_obsolete_params: "//trim(varname)// &
171 " is an obsolete run-time flag, and should not be used. "//trim(hint_msg))
174 end subroutine obsolete_char
177 subroutine obsolete_real(param_file, varname, warning_val, hint)
179 character(len=*),
intent(in) :: varname
180 real,
optional,
intent(in) :: warning_val
181 character(len=*),
optional,
intent(in) :: hint
183 real :: test_val, warn_val
184 character(len=128) :: hint_msg
186 test_val = -9e35;
call read_param(param_file, varname, test_val)
187 warn_val = -9e35;
if (
present(warning_val)) warn_val = warning_val
188 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
190 if (test_val /= -9e35)
then
191 if (test_val == warn_val)
then
192 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
193 " is an obsolete run-time flag. "//trim(hint_msg))
195 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
196 " is an obsolete run-time flag, and should not be used. "// &
200 end subroutine obsolete_real
203 subroutine obsolete_int(param_file, varname, warning_val, hint)
205 character(len=*),
intent(in) :: varname
206 integer,
optional,
intent(in) :: warning_val
207 character(len=*),
optional,
intent(in) :: hint
209 integer :: test_val, warn_val
210 character(len=128) :: hint_msg
212 test_val = -123456788;
call read_param(param_file, varname, test_val)
213 warn_val = -123456788;
if (
present(warning_val)) warn_val = warning_val
214 hint_msg =
" " ;
if (
present(hint)) hint_msg = hint
216 if (test_val /= -123456788)
then
217 if (test_val == warn_val)
then
218 call mom_error(warning,
"MOM_obsolete_params: "//trim(varname)// &
219 " is an obsolete run-time flag. "//trim(hint_msg))
221 call mom_error(fatal,
"MOM_obsolete_params: "//trim(varname)// &
222 " is an obsolete run-time flag, and should not be used. "// &
226 end subroutine obsolete_int