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, warning_val, 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 20 of file MOM_obsolete_params.F90.

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, l_seg, nseg
27  logical :: test_logic, test_logic2, test_logic3, split
28  character(len=40) :: temp_string
29 
30  if (.not.is_root_pe()) return
31 
32  call obsolete_logical(param_file, "BLOCKED_ANALYTIC_FV_PGF", &
33  hint="BLOCKED_ANALYTIC_FV_PGF is no longer available.")
34 
35  call obsolete_logical(param_file, "ADD_KV_SLOW", &
36  hint="This option is no longer needed, nor supported.")
37 
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.")
51  nseg = 0
52  call read_param(param_file, "OBC_NUMBER_OF_SEGMENTS", nseg)
53  do l_seg = 1,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.")
57  enddo
58 
59  call obsolete_logical(param_file, "MASK_MASSLESS_TRACERS", .false.)
60 
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.")
67 
68  call obsolete_char(param_file, "DIAG_REMAP_Z_GRID_DEF", &
69  hint="Use NUM_DIAG_COORDS, DIAG_COORDS and DIAG_COORD_DEF_Z")
70 
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.)
73 
74  call obsolete_real(param_file, "VSTAR_SCALE_COEF")
75  call obsolete_real(param_file, "ZSTAR_RIGID_SURFACE_THRESHOLD")
76 
77  ! Test for inconsistent parameter settings.
78  split = .true. ; test_logic = .false.
79  call read_param(param_file,"SPLIT",split)
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.")
84 
85  call obsolete_real(param_file, "BT_MASS_SOURCE_LIMIT", 0.0)
86 
87  call obsolete_int(param_file, "SEAMOUNT_LENGTH_SCALE", hint="Use SEAMOUNT_X_LENGTH_SCALE instead.")
88 
89  call obsolete_logical(param_file, "MSTAR_FIXED", hint="Instead use MSTAR_MODE.")
90  call obsolete_logical(param_file, "USE_VISBECK_SLOPE_BUG", .false.)
91 
92  call obsolete_real(param_file, "MIN_Z_DIAG_INTERVAL")
93  call obsolete_char(param_file, "Z_OUTPUT_GRID_FILE")
94 
95  ! Write the file version number to the model log.
96  call log_version(param_file, mdl, version)
97 

◆ 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  warning_val,
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]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 144 of file MOM_obsolete_params.F90.

145  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
146  character(len=*), intent(in) :: varname !< Name of obsolete STRING parameter.
147  character(len=*), optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
148  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
149  ! Local variables
150  character(len=200) :: test_string, hint_msg
151  logical :: only_warn
152 
153  test_string = ''; call read_param(param_file, varname, test_string)
154  hint_msg = " " ; if (present(hint)) hint_msg = hint
155 
156  if (len_trim(test_string) > 0) then
157  only_warn = .false.
158  if (present(warning_val)) then ! Check if test_string and warning_val are the same.
159  if (len_trim(warning_val) == len_trim(test_string)) then
160  if (index(trim(test_string), trim(warning_val)) == 1) only_warn = .true.
161  endif
162  endif
163 
164  if (only_warn) then
165  call mom_error(warning, &
166  "MOM_obsolete_params: "//trim(varname)// &
167  " is an obsolete run-time flag. "//trim(hint_msg))
168  else
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))
172  endif
173  endif

◆ 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 203 of file MOM_obsolete_params.F90.

204  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
205  character(len=*), intent(in) :: varname !< Name of obsolete INTEGER parameter.
206  integer, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
207  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
208  ! Local variables
209  integer :: test_val, warn_val
210  character(len=128) :: hint_msg
211 
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
215 
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))
220  else
221  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
222  " is an obsolete run-time flag, and should not be used. "// &
223  trim(hint_msg))
224  endif
225  endif

◆ 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 101 of file MOM_obsolete_params.F90.

102  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
103  character(len=*), intent(in) :: varname !< Name of obsolete LOGICAL parameter.
104  logical, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
105  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
106  ! Local variables
107  logical :: test_logic, fatal_err
108  character(len=128) :: hint_msg
109 
110  test_logic = .false. ; call read_param(param_file, varname,test_logic)
111  fatal_err = .true.
112  if (present(warning_val)) fatal_err = (warning_val .neqv. .true.)
113  hint_msg = " " ; if (present(hint)) hint_msg = hint
114 
115  if (test_logic) then
116  if (fatal_err) then
117  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
118  " is an obsolete run-time flag, and should not be used. "// &
119  trim(hint_msg))
120  else
121  call mom_error(warning, "MOM_obsolete_params: "//trim(varname)// &
122  " is an obsolete run-time flag. "//trim(hint_msg))
123  endif
124  endif
125 
126  test_logic = .true. ; call read_param(param_file, varname, test_logic)
127  fatal_err = .true.
128  if (present(warning_val)) fatal_err = (warning_val .neqv. .false.)
129 
130  if (.not.test_logic) then
131  if (fatal_err) then
132  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
133  " is an obsolete run-time flag, and should not be used. "// &
134  trim(hint_msg))
135  else
136  call mom_error(warning, "MOM_obsolete_params: "//trim(varname)// &
137  " is an obsolete run-time flag. "//trim(hint_msg))
138  endif
139  endif
140 

◆ 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 177 of file MOM_obsolete_params.F90.

178  type(param_file_type), intent(in) :: param_file !< Structure containing parameter file data.
179  character(len=*), intent(in) :: varname !< Name of obsolete REAL parameter.
180  real, optional, intent(in) :: warning_val !< An allowed value that causes a warning instead of an error.
181  character(len=*), optional, intent(in) :: hint !< A hint to the user about what to do.
182  ! Local variables
183  real :: test_val, warn_val
184  character(len=128) :: hint_msg
185 
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
189 
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))
194  else
195  call mom_error(fatal, "MOM_obsolete_params: "//trim(varname)// &
196  " is an obsolete run-time flag, and should not be used. "// &
197  trim(hint_msg))
198  endif
199  endif