MOM6
mom_document::doc_param Interface Reference

Detailed Description

Document parameter values.

Definition at line 16 of file MOM_document.F90.

Private functions

subroutine doc_param_none (doc, varname, desc, units)
 This subroutine handles parameter documentation with no value. More...
 
subroutine doc_param_logical (doc, varname, desc, units, val, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for logicals. More...
 
subroutine doc_param_logical_array (doc, varname, desc, units, vals, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for arrays of logicals. More...
 
subroutine doc_param_int (doc, varname, desc, units, val, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for integers. More...
 
subroutine doc_param_int_array (doc, varname, desc, units, vals, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for arrays of integers. More...
 
subroutine doc_param_real (doc, varname, desc, units, val, default, debuggingParam)
 This subroutine handles parameter documentation for reals. More...
 
subroutine doc_param_real_array (doc, varname, desc, units, vals, default, debuggingParam)
 This subroutine handles parameter documentation for arrays of reals. More...
 
subroutine doc_param_char (doc, varname, desc, units, val, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for character strings. More...
 
subroutine doc_param_time (doc, varname, desc, units, val, default, layoutParam, debuggingParam)
 This subroutine handles parameter documentation for time-type variables. More...
 

Functions and subroutines

◆ doc_param_char()

subroutine mom_document::doc_param::doc_param_char ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
character(len=*), intent(in)  val,
character(len=*), intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for character strings.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valThe value of the parameter
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 332 of file MOM_document.F90.

332  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
333  !! documentation occurs and its formatting
334  character(len=*), intent(in) :: varname !< The name of the parameter being documented
335  character(len=*), intent(in) :: desc !< A description of the parameter being documented
336  character(len=*), intent(in) :: units !< The units of the parameter being documented
337  character(len=*), intent(in) :: val !< The value of the parameter
338  character(len=*), &
339  optional, intent(in) :: default !< The default value of this parameter
340  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
341  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
342 ! This subroutine handles parameter documentation for character strings.
343  character(len=mLen) :: mesg
344  logical :: equalsDefault
345 
346  if (.not. (is_root_pe() .and. associated(doc))) return
347  call open_doc_file(doc)
348 
349  if (doc%filesAreOpen) then
350  mesg = define_string(doc,varname,'"'//trim(val)//'"',units)
351 
352  equalsdefault = .false.
353  if (present(default)) then
354  if (trim(val) == trim(default)) equalsdefault = .true.
355  mesg = trim(mesg)//' default = "'//trim(adjustl(default))//'"'
356  endif
357 
358  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
359  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
360  layoutparam=layoutparam, debuggingparam=debuggingparam)
361  endif
362 

◆ doc_param_int()

subroutine mom_document::doc_param::doc_param_int ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
integer, intent(in)  val,
integer, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for integers.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valThe value of this parameter
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 181 of file MOM_document.F90.

181  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
182  !! documentation occurs and its formatting
183  character(len=*), intent(in) :: varname !< The name of the parameter being documented
184  character(len=*), intent(in) :: desc !< A description of the parameter being documented
185  character(len=*), intent(in) :: units !< The units of the parameter being documented
186  integer, intent(in) :: val !< The value of this parameter
187  integer, optional, intent(in) :: default !< The default value of this parameter
188  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
189  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
190 ! This subroutine handles parameter documentation for integers.
191  character(len=mLen) :: mesg
192  character(len=doc%commentColumn) :: valstring
193  logical :: equalsDefault
194 
195  if (.not. (is_root_pe() .and. associated(doc))) return
196  call open_doc_file(doc)
197 
198  if (doc%filesAreOpen) then
199  valstring = int_string(val)
200  mesg = define_string(doc,varname,valstring,units)
201 
202  equalsdefault = .false.
203  if (present(default)) then
204  if (val == default) equalsdefault = .true.
205  mesg = trim(mesg)//" default = "//(trim(int_string(default)))
206  endif
207 
208  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
209  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
210  layoutparam=layoutparam, debuggingparam=debuggingparam)
211  endif

◆ doc_param_int_array()

subroutine mom_document::doc_param::doc_param_int_array ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
integer, dimension(:), intent(in)  vals,
integer, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for arrays of integers.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valsThe array of values to record
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 217 of file MOM_document.F90.

217  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
218  !! documentation occurs and its formatting
219  character(len=*), intent(in) :: varname !< The name of the parameter being documented
220  character(len=*), intent(in) :: desc !< A description of the parameter being documented
221  character(len=*), intent(in) :: units !< The units of the parameter being documented
222  integer, intent(in) :: vals(:) !< The array of values to record
223  integer, optional, intent(in) :: default !< The default value of this parameter
224  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
225  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
226 ! This subroutine handles parameter documentation for arrays of integers.
227  integer :: i
228  character(len=mLen) :: mesg
229  character(len=mLen) :: valstring
230  logical :: equalsDefault
231 
232  if (.not. (is_root_pe() .and. associated(doc))) return
233  call open_doc_file(doc)
234 
235  if (doc%filesAreOpen) then
236  valstring = int_string(vals(1))
237  do i=2,min(size(vals),128)
238  valstring = trim(valstring)//", "//trim(int_string(vals(i)))
239  enddo
240 
241  mesg = define_string(doc,varname,valstring,units)
242 
243  equalsdefault = .false.
244  if (present(default)) then
245  equalsdefault = .true.
246  do i=1,size(vals) ; if (vals(i) /= default) equalsdefault = .false. ; enddo
247  mesg = trim(mesg)//" default = "//(trim(int_string(default)))
248  endif
249 
250  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
251  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
252  layoutparam=layoutparam, debuggingparam=debuggingparam)
253  endif
254 

◆ doc_param_logical()

subroutine mom_document::doc_param::doc_param_logical ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
logical, intent(in)  val,
logical, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for logicals.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valThe value of this parameter
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 89 of file MOM_document.F90.

89  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
90  !! documentation occurs and its formatting
91  character(len=*), intent(in) :: varname !< The name of the parameter being documented
92  character(len=*), intent(in) :: desc !< A description of the parameter being documented
93  character(len=*), intent(in) :: units !< The units of the parameter being documented
94  logical, intent(in) :: val !< The value of this parameter
95  logical, optional, intent(in) :: default !< The default value of this parameter
96  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
97  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
98 ! This subroutine handles parameter documentation for logicals.
99  character(len=mLen) :: mesg
100  logical :: equalsDefault
101 
102  if (.not. (is_root_pe() .and. associated(doc))) return
103  call open_doc_file(doc)
104 
105  if (doc%filesAreOpen) then
106  if (val) then
107  mesg = define_string(doc,varname,string_true,units)
108  else
109  mesg = undef_string(doc,varname,units)
110  endif
111 
112  equalsdefault = .false.
113  if (present(default)) then
114  if (val .eqv. default) equalsdefault = .true.
115  if (default) then
116  mesg = trim(mesg)//" default = "//string_true
117  else
118  mesg = trim(mesg)//" default = "//string_false
119  endif
120  endif
121 
122  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
123  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
124  layoutparam=layoutparam, debuggingparam=debuggingparam)
125  endif

◆ doc_param_logical_array()

subroutine mom_document::doc_param::doc_param_logical_array ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
logical, dimension(:), intent(in)  vals,
logical, intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for arrays of logicals.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valsThe array of values to record
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 131 of file MOM_document.F90.

131  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
132  !! documentation occurs and its formatting
133  character(len=*), intent(in) :: varname !< The name of the parameter being documented
134  character(len=*), intent(in) :: desc !< A description of the parameter being documented
135  character(len=*), intent(in) :: units !< The units of the parameter being documented
136  logical, intent(in) :: vals(:) !< The array of values to record
137  logical, optional, intent(in) :: default !< The default value of this parameter
138  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
139  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
140 ! This subroutine handles parameter documentation for arrays of logicals.
141  integer :: i
142  character(len=mLen) :: mesg
143  character(len=mLen) :: valstring
144  logical :: equalsDefault
145 
146  if (.not. (is_root_pe() .and. associated(doc))) return
147  call open_doc_file(doc)
148 
149  if (doc%filesAreOpen) then
150  if (vals(1)) then ; valstring = string_true ; else ; valstring = string_false ; endif
151  do i=2,min(size(vals),128)
152  if (vals(i)) then
153  valstring = trim(valstring)//", "//string_true
154  else
155  valstring = trim(valstring)//", "//string_false
156  endif
157  enddo
158 
159  mesg = define_string(doc,varname,valstring,units)
160 
161  equalsdefault = .false.
162  if (present(default)) then
163  equalsdefault = .true.
164  do i=1,size(vals) ; if (vals(i) .neqv. default) equalsdefault = .false. ; enddo
165  if (default) then
166  mesg = trim(mesg)//" default = "//string_true
167  else
168  mesg = trim(mesg)//" default = "//string_false
169  endif
170  endif
171 
172  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
173  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
174  layoutparam=layoutparam, debuggingparam=debuggingparam)
175  endif

◆ doc_param_none()

subroutine mom_document::doc_param::doc_param_none ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units 
)
private

This subroutine handles parameter documentation with no value.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented

Definition at line 64 of file MOM_document.F90.

64  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
65  !! documentation occurs and its formatting
66  character(len=*), intent(in) :: varname !< The name of the parameter being documented
67  character(len=*), intent(in) :: desc !< A description of the parameter being documented
68  character(len=*), intent(in) :: units !< The units of the parameter being documented
69 ! This subroutine handles parameter documentation with no value.
70  integer :: numspc
71  character(len=mLen) :: mesg
72 
73  if (.not. (is_root_pe() .and. associated(doc))) return
74  call open_doc_file(doc)
75 
76  if (doc%filesAreOpen) then
77  numspc = max(1,doc%commentColumn-8-len_trim(varname))
78  mesg = "#define "//trim(varname)//repeat(" ",numspc)//"!"
79  if (len_trim(units) > 0) mesg = trim(mesg)//" ["//trim(units)//"]"
80 
81  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
82  call writemessageanddesc(doc, mesg, desc)
83  endif

◆ doc_param_real()

subroutine mom_document::doc_param::doc_param_real ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
real, intent(in)  val,
real, intent(in), optional  default,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for reals.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valThe value of this parameter
[in]defaultThe default value of this parameter
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 259 of file MOM_document.F90.

259  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
260  !! documentation occurs and its formatting
261  character(len=*), intent(in) :: varname !< The name of the parameter being documented
262  character(len=*), intent(in) :: desc !< A description of the parameter being documented
263  character(len=*), intent(in) :: units !< The units of the parameter being documented
264  real, intent(in) :: val !< The value of this parameter
265  real, optional, intent(in) :: default !< The default value of this parameter
266  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
267 ! This subroutine handles parameter documentation for reals.
268  character(len=mLen) :: mesg
269  character(len=doc%commentColumn) :: valstring
270  logical :: equalsDefault
271 
272  if (.not. (is_root_pe() .and. associated(doc))) return
273  call open_doc_file(doc)
274 
275  if (doc%filesAreOpen) then
276  valstring = real_string(val)
277  mesg = define_string(doc,varname,valstring,units)
278 
279  equalsdefault = .false.
280  if (present(default)) then
281  if (val == default) equalsdefault = .true.
282  mesg = trim(mesg)//" default = "//trim(real_string(default))
283  endif
284 
285  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
286  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
287  debuggingparam=debuggingparam)
288  endif

◆ doc_param_real_array()

subroutine mom_document::doc_param::doc_param_real_array ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
real, dimension(:), intent(in)  vals,
real, intent(in), optional  default,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for arrays of reals.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valsThe array of values to record
[in]defaultThe default value of this parameter
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 293 of file MOM_document.F90.

293  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
294  !! documentation occurs and its formatting
295  character(len=*), intent(in) :: varname !< The name of the parameter being documented
296  character(len=*), intent(in) :: desc !< A description of the parameter being documented
297  character(len=*), intent(in) :: units !< The units of the parameter being documented
298  real, intent(in) :: vals(:) !< The array of values to record
299  real, optional, intent(in) :: default !< The default value of this parameter
300  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
301 ! This subroutine handles parameter documentation for arrays of reals.
302  integer :: i
303  character(len=mLen) :: mesg
304  character(len=mLen) :: valstring
305  logical :: equalsDefault
306 
307  if (.not. (is_root_pe() .and. associated(doc))) return
308  call open_doc_file(doc)
309 
310  if (doc%filesAreOpen) then
311  valstring = trim(real_array_string(vals(:)))
312 
313  mesg = define_string(doc,varname,valstring,units)
314 
315  equalsdefault = .false.
316  if (present(default)) then
317  equalsdefault = .true.
318  do i=1,size(vals) ; if (vals(i) /= default) equalsdefault = .false. ; enddo
319  mesg = trim(mesg)//" default = "//trim(real_string(default))
320  endif
321 
322  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
323  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
324  debuggingparam=debuggingparam)
325  endif
326 

◆ doc_param_time()

subroutine mom_document::doc_param::doc_param_time ( type(doc_type), pointer  doc,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  desc,
character(len=*), intent(in)  units,
type(time_type), intent(in)  val,
type(time_type), intent(in), optional  default,
logical, intent(in), optional  layoutParam,
logical, intent(in), optional  debuggingParam 
)
private

This subroutine handles parameter documentation for time-type variables.

Parameters
docA pointer to a structure that controls where the documentation occurs and its formatting
[in]varnameThe name of the parameter being documented
[in]descA description of the parameter being documented
[in]unitsThe units of the parameter being documented
[in]valThe value of the parameter
[in]defaultThe default value of this parameter
[in]layoutparamIf present and true, this is a layout parameter.
[in]debuggingparamIf present and true, this is a debugging parameter.

Definition at line 419 of file MOM_document.F90.

419  type(doc_type), pointer :: doc !< A pointer to a structure that controls where the
420  !! documentation occurs and its formatting
421  character(len=*), intent(in) :: varname !< The name of the parameter being documented
422  character(len=*), intent(in) :: desc !< A description of the parameter being documented
423  character(len=*), intent(in) :: units !< The units of the parameter being documented
424  type(time_type), intent(in) :: val !< The value of the parameter
425  type(time_type), optional, intent(in) :: default !< The default value of this parameter
426  logical, optional, intent(in) :: layoutParam !< If present and true, this is a layout parameter.
427  logical, optional, intent(in) :: debuggingParam !< If present and true, this is a debugging parameter.
428 ! This subroutine handles parameter documentation for time-type variables.
429 ! ### This needs to be written properly!
430  integer :: numspc
431  character(len=mLen) :: mesg
432  logical :: equalsDefault
433 
434  if (.not. (is_root_pe() .and. associated(doc))) return
435  call open_doc_file(doc)
436 
437  equalsdefault = .false.
438  if (doc%filesAreOpen) then
439  numspc = max(1,doc%commentColumn-18-len_trim(varname))
440  mesg = "#define "//trim(varname)//" Time-type"//repeat(" ",numspc)//"!"
441  if (len_trim(units) > 0) mesg = trim(mesg)//" ["//trim(units)//"]"
442 
443  if (mesghasbeendocumented(doc, varname, mesg)) return ! Avoid duplicates
444  call writemessageanddesc(doc, mesg, desc, equalsdefault, &
445  layoutparam=layoutparam, debuggingparam=debuggingparam)
446  endif
447 

The documentation for this interface was generated from the following file: