MOM6
mom_obsolete_params Module Reference

Detailed Description

Methods for testing for, and list of, obsolete run-time parameters.

Functions/Subroutines

subroutine, public find_obsolete_params (param_file)
 Scans input parameter file for list obsolete parameters. More...
 
subroutine, public obsolete_logical (param_file, varname, warning_val, hint)
 Test for presence of obsolete LOGICAL in parameter file. More...
 
subroutine, public obsolete_char (param_file, varname, hint)
 Test for presence of obsolete STRING in parameter file. More...
 
subroutine, public obsolete_real (param_file, varname, warning_val, hint)
 Test for presence of obsolete REAL in parameter file. More...
 
subroutine, public obsolete_int (param_file, varname, warning_val, hint)
 Test for presence of obsolete INTEGER in parameter file. More...
 

Function/Subroutine Documentation

◆ find_obsolete_params()

subroutine, public mom_obsolete_params::find_obsolete_params ( type(param_file_type), intent(in)  param_file)

Scans input parameter file for list obsolete parameters.

Parameters
[in]param_fileStructure containing parameter file data.

Definition at line 21 of file MOM_obsolete_params.F90.

References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), obsolete_char(), obsolete_int(), obsolete_logical(), and obsolete_real().

Referenced by mom::initialize_mom().

21  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
22  ! Local variables
23  character(len=40) :: mdl = "find_obsolete_params" ! This module's name.
24 ! This include declares and sets the variable "version".
25 #include "version_variable.h"
26  integer :: test_int
27  logical :: test_logic, test_logic2, test_logic3, split
28 
29  if (.not.is_root_pe()) return
30 
31  call obsolete_int(param_file, "NTSTEP", &
32  hint="Instead use DT_THERM to set the thermodynamic time-step.")
33 
34  call obsolete_logical(param_file, "JACOBIAN_PGF", .false., &
35  hint="Instead use ANALYTIC_FV_PGF.")
36 
37  call obsolete_logical(param_file, "SADOURNY", &
38  hint="Instead use CORIOLIS_SCHEME='SADOURNY'.")
39 
40  call obsolete_logical(param_file, "ARITHMETIC_BT_THICK", &
41  hint="Instead use BT_THICK_SCHEME='ARITHMETIC'.")
42 
43  call obsolete_logical(param_file, "HYBRID_BT_THICK", &
44  hint="Instead use BT_THICK_SCHEME='HYBRID'.")
45 
46  call obsolete_logical(param_file, "BT_CONT_BT_THICK", &
47  hint="Instead use BT_THICK_SCHEME='FROM_BT_CONT'.")
48 
49  call obsolete_logical(param_file, "APPLY_OBC_U", &
50  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
51  call obsolete_logical(param_file, "APPLY_OBC_V", &
52  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
53  call obsolete_logical(param_file, "APPLY_OBC_V_FLATHER_NORTH", &
54  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
55  call obsolete_logical(param_file, "APPLY_OBC_V_FLATHER_SOUTH", &
56  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
57  call obsolete_logical(param_file, "APPLY_OBC_U_FLATHER_EAST", &
58  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
59  call obsolete_logical(param_file, "APPLY_OBC_U_FLATHER_WEST", &
60  hint="Instead use OBC_NUMBER_SEGMENTS>0 and use the new segments protocol.")
61  call obsolete_char(param_file, "OBC_CONFIG", &
62  hint="Instead use OBC_USER_CONFIG and use the new segments protocol.")
63  call obsolete_char(param_file, "READ_OBC_ETA", &
64  hint="Instead use OBC_SEGMENT_XXX_DATA.")
65  call obsolete_char(param_file, "READ_OBC_UV", &
66  hint="Instead use OBC_SEGMENT_XXX_DATA.")
67  call obsolete_char(param_file, "READ_OBC_TS", &
68  hint="Instead use OBC_SEGMENT_XXX_DATA.")
69 
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.")
77  else
78  call mom_error(fatal, "find_obsolete_params: "// &
79  "TEMPERATURE is an obsolete run-time flag. Use ENABLE_THERMODYNAMICS instead.")
80  endif ; endif
81 
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.")
87  endif
88 
89 ! test_logic = .true. ; call read_param(param_file,"USE_RIVER_HEAT_CONTENT",test_logic)
90 ! test_logic2 = .false. ; call read_param(param_file,"USE_RIVER_HEAT_CONTENT",test_logic2)
91 ! if (test_logic .eqv. test_logic2) call MOM_ERROR(FATAL, "find_obsolete_params: "// &
92 ! "USE_RIVER_HEAT_CONTENT, is an obsolete run-time flag.")
93 
94 ! test_logic = .true. ; call read_param(param_file,"USE_CALVING_HEAT_CONTENT",test_logic)
95 ! test_logic2 = .false. ; call read_param(param_file,"USE_CALVING_HEAT_CONTENT",test_logic2)
96 ! if (test_logic .eqv. test_logic2) call MOM_ERROR(FATAL, "find_obsolete_params: "// &
97 ! "USE_CALVING_HEAT_CONTENT, is an obsolete run-time flag.")
98 
99  call obsolete_int(param_file, "NXTOT")
100  call obsolete_int(param_file, "NYTOT")
101  call obsolete_int(param_file, "NZ")
102  call obsolete_int(param_file, "NXPROC")
103  call obsolete_int(param_file, "NYPROC")
104  call obsolete_int(param_file, "NXPROC_IO")
105  call obsolete_int(param_file, "NYPROC_IO")
106  call obsolete_int(param_file, "NXHALO")
107  call obsolete_int(param_file, "NYHALO")
108  call obsolete_int(param_file, "ML_PRESORT_NZ_CONV_ADJ")
109 
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.")
112 
113  call obsolete_real(param_file, "BT_COR_SLOW_RATE", 0.0)
114  call obsolete_real(param_file, "BT_COR_FRAC", 1.0)
115 
116  call obsolete_logical(param_file, "BT_INCLUDE_UDHDT", .false.)
117 
118  call obsolete_logical(param_file, "RIGA_SET_DIFFUSIVITY", .false.)
119  call obsolete_logical(param_file, "RIGA_ITIDE_BUGS", .false.)
120  call obsolete_logical(param_file, "RIGA_ENTRAINMENT_FOIBLES", .false.)
121  call obsolete_logical(param_file, "RIGA_TRACER_DIFFUSE_BUGS", .false.)
122  call obsolete_logical(param_file, "RIGA_KAPPA_SHEAR_BUGS1", .false.)
123  call obsolete_logical(param_file, "RIGA_KAPPA_SHEAR_BUGS2", .false.)
124  call obsolete_logical(param_file, "CONT_PPM_RIGA_BUGS", .false.)
125  call obsolete_logical(param_file, "USE_REPRODUCING_SUM", .true.)
126  call obsolete_logical(param_file, "SLOW_BITWISE_GLOBAL_FORCING_SUMS", .false.)
127  call obsolete_logical(param_file, "ALWAYS_WRITE_GEOM")
128  call obsolete_real(param_file, "I_ZETA")
129 
130  call obsolete_logical(param_file, "REF_COMPRESS_3D")
131  call obsolete_char(param_file, "COMPRESS_FILE")
132  call obsolete_char(param_file, "REF_COMPRESS_FILE_TEMP")
133  call obsolete_char(param_file, "REF_COMPRESS_FILE_SALT")
134  call obsolete_char(param_file, "REF_COMPRESS_FILE_DEPTH")
135  call obsolete_char(param_file, "DIAG_REMAP_Z_GRID_DEF", "Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
136 
137  call obsolete_logical(param_file, "OLD_RESTRAT_PARAM", .false.)
138  call obsolete_real(param_file, "ML_RESTRAT_COEF", 0.0)
139  call obsolete_logical(param_file, "FULL_THICKNESSDIFFUSE", .true.)
140  call obsolete_logical(param_file, "DIFFUSE_ISOPYCNALS", .true.)
141 
142  call obsolete_logical(param_file, "MOREL_PEN_SW")
143  call obsolete_logical(param_file, "MANIZZA_PEN_SW")
144 
145  call obsolete_logical(param_file, "USE_H2000_SHEAR_MIXING", .false.)
146  call obsolete_real(param_file, "SHEARMIX_LAT_EQ", 0.0)
147  call obsolete_real(param_file, "RINO_CRIT_EQ")
148  call obsolete_real(param_file, "SHEARMIX_RATE_EQ")
149 
150  call obsolete_logical(param_file, "CONTINUITY_PPM", .true.)
151 
152  call obsolete_logical(param_file, "USE_LOCAL_PREF", .true.)
153  call obsolete_logical(param_file, "USE_LOCAL_PREF_CORRECT", .true.)
154  test_logic = .false. ; call read_param(param_file, "USE_JACKSON_PARAM", test_logic)
155  call obsolete_logical(param_file, "RINOMIX", test_logic)
156  call obsolete_logical(param_file, "NORMALIZED_SUM_OUT", .true.)
157 
158  call obsolete_real(param_file, "RLAY_RANGE")
159  call obsolete_real(param_file, "RLAY_REF")
160 
161  call obsolete_real(param_file, "HMIX")
162  call obsolete_real(param_file, "VSTAR_SCALE_COEF")
163  call obsolete_real(param_file, "ZSTAR_RIGID_SURFACE_THRESHOLD")
164 
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.")
171 
172  ! Test for inconsistent parameter settings.
173  split = .true. ; test_logic = .false.
174  call read_param(param_file,"SPLIT",split)
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.")
179 
180  call read_param(param_file,"USE_LEGACY_SPLIT",test_logic)
181  if (.not.(split .and. test_logic)) then
182  call obsolete_logical(param_file, "FLUX_BT_COUPLING", .false.)
183  call obsolete_logical(param_file, "READJUST_BT_TRANS", .false.)
184  call obsolete_logical(param_file, "RESCALE_BE_FACE_AREAS", .false.)
185  call obsolete_logical(param_file, "APPLY_BT_DRAG", .true.)
186  endif
187 
188  call obsolete_int(param_file, "SEAMOUNT_LENGTH_SCALE", hint="Use SEAMOUNT_X_LENGTH_SCALE instead.")
189 
190  call obsolete_logical(param_file, "MSTAR_FIXED", hint="Instead use MSTAR_MODE.")
191 
192  ! Write the file version number to the model log.
193  call log_version(param_file, mdl, version)
194 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ obsolete_char()

subroutine, public mom_obsolete_params::obsolete_char ( type(param_file_type), intent(in)  param_file,
character(len=*), intent(in)  varname,
character(len=*), intent(in), optional  hint 
)

Test for presence of obsolete STRING in parameter file.

Parameters
[in]param_fileStructure containing parameter file data.
[in]varnameName of obsolete STRING parameter.
[in]hintA hint to the user about what to do.

Definition at line 242 of file MOM_obsolete_params.F90.

References mom_error_handler::mom_error().

Referenced by find_obsolete_params().

242  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
243  character(len=*), intent(in) :: varname !< Name of obsolete STRING parameter.
244  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
245  ! Local variables
246  character(len=200) :: test_string, hint_msg
247 
248  test_string = ''; call read_param(param_file, varname, test_string)
249  hint_msg = " " ; if (present(hint)) hint_msg = hint
250 
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. "// &
254  trim(hint_msg))
255 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ obsolete_int()

subroutine, public mom_obsolete_params::obsolete_int ( type(param_file_type), intent(in)  param_file,
character(len=*), intent(in)  varname,
integer, intent(in), optional  warning_val,
character(len=*), intent(in), optional  hint 
)

Test for presence of obsolete INTEGER in parameter file.

Parameters
[in]param_fileStructure containing parameter file data.
[in]varnameName of obsolete INTEGER parameter.
[in]warning_valAn allowed value that causes a warning instead of an error.
[in]hintA hint to the user about what to do.

Definition at line 286 of file MOM_obsolete_params.F90.

References mom_error_handler::mom_error().

Referenced by find_obsolete_params().

286  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
287  character(len=*), intent(in) :: varname !< Name of obsolete INTEGER parameter.
288  integer, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
289  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
290  ! Local variables
291  integer :: test_val, warn_val
292  character(len=128) :: hint_msg
293 
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
297 
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))
302  else
303  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
304  " is an obsolete run-time flag, and should not be used. "// &
305  trim(hint_msg))
306  endif
307  endif
Here is the call graph for this function:
Here is the caller graph for this function:

◆ obsolete_logical()

subroutine, public mom_obsolete_params::obsolete_logical ( type(param_file_type), intent(in)  param_file,
character(len=*), intent(in)  varname,
logical, intent(in), optional  warning_val,
character(len=*), intent(in), optional  hint 
)

Test for presence of obsolete LOGICAL in parameter file.

Parameters
[in]param_fileStructure containing parameter file data.
[in]varnameName of obsolete LOGICAL parameter.
[in]warning_valAn allowed value that causes a warning instead of an error.
[in]hintA hint to the user about what to do.

Definition at line 199 of file MOM_obsolete_params.F90.

References mom_error_handler::mom_error().

Referenced by find_obsolete_params().

199  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
200  character(len=*), intent(in) :: varname !< Name of obsolete LOGICAL parameter.
201  logical, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
202  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
203  ! Local variables
204  logical :: test_logic, fatal_err
205  character(len=128) :: hint_msg
206 
207  test_logic = .false. ; call read_param(param_file, varname,test_logic)
208  fatal_err = .true.
209  if (present(warning_val)) fatal_err = (warning_val .neqv. .true.)
210  hint_msg = " " ; if (present(hint)) hint_msg = hint
211 
212  if (test_logic) then
213  if (fatal_err) then
214  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
215  " is an obsolete run-time flag, and should not be used. "// &
216  trim(hint_msg))
217  else
218  call mom_error(warning, "MOM_obsolete_params: "//trim(varname)// &
219  " is an obsolete run-time flag. "//trim(hint_msg))
220  endif
221  endif
222 
223  test_logic = .true. ; call read_param(param_file, varname, test_logic)
224  fatal_err = .true.
225  if (present(warning_val)) fatal_err = (warning_val .neqv. .false.)
226 
227  if (.not.test_logic) then
228  if (fatal_err) then
229  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
230  " is an obsolete run-time flag, and should not be used. "// &
231  trim(hint_msg))
232  else
233  call mom_error(warning, "MOM_obsolete_params: "//trim(varname)// &
234  " is an obsolete run-time flag. "//trim(hint_msg))
235  endif
236  endif
237 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ obsolete_real()

subroutine, public mom_obsolete_params::obsolete_real ( type(param_file_type), intent(in)  param_file,
character(len=*), intent(in)  varname,
real, intent(in), optional  warning_val,
character(len=*), intent(in), optional  hint 
)

Test for presence of obsolete REAL in parameter file.

Parameters
[in]param_fileStructure containing parameter file data.
[in]varnameName of obsolete REAL parameter.
[in]warning_valAn allowed value that causes a warning instead of an error.
[in]hintA hint to the user about what to do.

Definition at line 260 of file MOM_obsolete_params.F90.

References mom_error_handler::mom_error().

Referenced by find_obsolete_params().

260  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
261  character(len=*), intent(in) :: varname !< Name of obsolete REAL parameter.
262  real, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
263  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
264  ! Local variables
265  real :: test_val, warn_val
266  character(len=128) :: hint_msg
267 
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
271 
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))
276  else
277  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
278  " is an obsolete run-time flag, and should not be used. "// &
279  trim(hint_msg))
280  endif
281  endif
Here is the call graph for this function:
Here is the caller graph for this function: