mom_document module reference
The subroutines here provide hooks for document generation functions at various levels of granularity.
Data Types
A structure that controls where the documentation occurs, its veborsity and formatting. |
|
A linked list of the parameter documentation messages that have been issued so far. |
Functions/Subroutines
This subroutine handles parameter documentation with no value. |
|
This subroutine handles parameter documentation for logicals. |
|
This subroutine handles parameter documentation for arrays of logicals. |
|
This subroutine handles parameter documentation for integers. |
|
This subroutine handles parameter documentation for arrays of integers. |
|
This subroutine handles parameter documentation for reals. |
|
This subroutine handles parameter documentation for arrays of reals. |
|
This subroutine handles parameter documentation for character strings. |
|
This subroutine handles documentation for opening a parameter block. |
|
This subroutine handles documentation for closing a parameter block. |
|
This subroutine handles parameter documentation for time-type variables. |
|
This subroutine writes out the message and description to the documentation files. |
|
This function returns a string with a time type formatted as seconds (perhaps including a fractional number of seconds) and days. |
|
This function returns a string with a real formatted like '(G)'. |
|
Returns a character string of a comma-separated, compact formatted, reals e.g. |
|
Returns a character string of a comma-separated, compact formatted, integers e.g. |
|
This function tests whether a real value is encoded in a string. |
|
This function returns a string with an integer formatted like '(I)'. |
|
This function returns a string with an logical formatted like '(L)'. |
|
This function returns a string for formatted parameter assignment. |
|
This function returns a string for formatted false logicals. |
|
This subroutine handles the module documentation. |
|
This subroutine handles the subroutine documentation. |
|
This subroutine handles the function documentation. |
|
Initialize the parameter documentation. |
|
This subroutine allocates and populates a structure that controls where the documentation occurs and its formatting, and opens up the files controlled by this structure. |
|
Find an unused unit number, returning >0 if found, and triggering a FATAL error if not. |
|
This subroutine closes the files controlled by doc, and sets flags in doc to indicate that parameterization is no longer permitted. |
|
Returns true if documentation has already been written. |
Detailed Description
The subroutines here provide hooks for document generation functions at various levels of granularity.
Type Documentation
- type mom_document/doc_type
A structure that controls where the documentation occurs, its veborsity and formatting.
- Type fields:
% unitall ::
integerThe open unit number for docFileBase + .all.% unitshort ::
integerThe open unit number for docFileBase + .short.% unitlayout ::
integerThe open unit number for docFileBase + .layout.% unitdebugging ::
integerThe open unit number for docFileBase + .debugging.% filesareopen ::
logicalTrue if any files were successfully opened.% docfilebase ::
character(len=mlen)The basename of the files where run-time parameters, settings and defaults are documented.% complete ::
logicalIf true, document all parameters.% minimal ::
logicalIf true, document non-default parameters.% layout ::
logicalIf true, document layout parameters.% debugging ::
logicalIf true, document debugging parameters.% definesyntax ::
logicalIf true, use ‘#def’ syntax instead of a=b syntax.% warnonconflicts ::
logicalCause a WARNING error if defaults differ.% commentcolumn ::
integerNumber of spaces before the comment marker.% max_line_len ::
integerThe maximum length of message lines.% chain_msg ::
type(link_msg), pointerDatabase of messages.% blockprefix ::
character(len=240)The full name of the current block.
- type mom_document/link_msg
A linked list of the parameter documentation messages that have been issued so far.
- Type fields:
% next ::
type(link_msg), pointer, privateFacilitates linked list.% name ::
character(len=80), privateParameter name.% msg ::
character(len=620), privateParameter value and default.
Function/Subroutine Documentation
- subroutine mom_document/doc_param_none(doc, varname, desc, units)
This subroutine handles parameter documentation with no value.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documented
- subroutine mom_document/doc_param_logical(doc, varname, desc, units, val, default, layoutParam, debuggingParam, like_default)
This subroutine handles parameter documentation for logicals.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedval ::
val[in] The value of this parameterdefault ::
default[in] The default value of this parameterlayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_logical_array(doc, varname, desc, units, vals, default, layoutParam, debuggingParam, like_default)
This subroutine handles parameter documentation for arrays of logicals.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedvals ::
vals[in] The array of values to recorddefault ::
default[in] The default value of this parameterlayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_int(doc, varname, desc, units, val, default, layoutParam, debuggingParam, like_default)
This subroutine handles parameter documentation for integers.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedval ::
val[in] The value of this parameterdefault ::
default[in] The default value of this parameterlayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_int_array(doc, varname, desc, units, vals, default, defaults, layoutParam, debuggingParam, like_default)
This subroutine handles parameter documentation for arrays of integers.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedvals ::
vals[in] The array of values to recorddefault ::
default[in] The uniform default value of this parameterdefaults ::
defaults[in] The element-wise default values of this parameterlayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_real(doc, varname, desc, units, val, default, debuggingParam, like_default)
This subroutine handles parameter documentation for reals.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedval ::
val[in] The value of this parameterdefault ::
default[in] The default value of this parameterdebuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_real_array(doc, varname, desc, units, vals, default, defaults, debuggingParam, like_default)
This subroutine handles parameter documentation for arrays of reals.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedvals ::
vals[in] The array of values to recorddefault ::
default[in] A uniform default value of this parameterdefaults ::
defaults[in] The element-wise default values of this parameterdebuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_param_char(doc, varname, desc, units, val, default, layoutParam, debuggingParam, like_default)
This subroutine handles parameter documentation for character strings.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedunits ::
units[in] The units of the parameter being documentedval ::
val[in] The value of the parameterdefault ::
default[in] The default value of this parameterlayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/doc_openblock(doc, blockName, desc)
This subroutine handles documentation for opening a parameter block.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingblockname :: [in] The name of the parameter block being opened
desc ::
desc[in] A description of the parameter block being opened
- Call to:
- subroutine mom_document/doc_closeblock(doc, blockName)
This subroutine handles documentation for closing a parameter block.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingblockname :: [in] The name of the parameter block being closed
- Call to:
- subroutine mom_document/doc_param_time(doc, varname, desc, val, default, units, debuggingParam, like_default)
This subroutine handles parameter documentation for time-type variables.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname ::
varname[in] The name of the parameter being documenteddesc ::
desc[in] A description of the parameter being documentedval ::
val[in] The value of the parameterdefault ::
default[in] The default value of this parameterunits ::
units[in] The units of the parameter being documenteddebuggingparam :: [in] If present and true, this is a debugging parameter.
like_default ::
like_default[in] If present and true, log this parameter as though it has the default value, even if there is no default.
- subroutine mom_document/writemessageanddesc(doc, vmesg, desc, valueWasDefault, indent, layoutParam, debuggingParam)
This subroutine writes out the message and description to the documentation files.
- Parameters:
doc ::
doc[in] A pointer to a structure that controls where the documentation occurs and its formattingvmesg ::
vmesg[in] A message with the parameter name, units, and default value.desc ::
desc[in] A description of the parameter being documentedvaluewasdefault :: [in] If true, this parameter has its default value
indent ::
indent[in] An amount by which to indent this messagelayoutparam :: [in] If present and true, this is a layout parameter.
debuggingparam :: [in] If present and true, this is a debugging parameter.
- Called from:
doc_closeblockdoc_moduledoc_openblockmom_document::doc_param::doc_param_charmom_document::doc_param::doc_param_intmom_document::doc_param::doc_param_int_arraymom_document::doc_param::doc_param_logicalmom_document::doc_param::doc_param_logical_arraymom_document::doc_param::doc_param_nonemom_document::doc_param::doc_param_realmom_document::doc_param::doc_param_real_arraymom_document::doc_param::doc_param_time
- function mom_document/time_string(time)
This function returns a string with a time type formatted as seconds (perhaps including a fractional number of seconds) and days.
- Parameters:
time ::
time[in] The time type being translated- Call to:
- Called from:
- function mom_document/real_string(val)
This function returns a string with a real formatted like ‘(G)’.
- Parameters:
val ::
val[in] The value being written into a string- Call to:
- Called from:
mom_document::doc_param::doc_param_realmom_document::doc_param::doc_param_real_arrayreal_array_string
- function mom_document/real_array_string(vals, sep)
Returns a character string of a comma-separated, compact formatted, reals e.g. “1., 2., 5*3., 5.E2”, that give the list of values.
- Return:
undefined :: The output string listing vals
- Parameters:
vals ::
vals[in] The array of values to recordsep ::
sep[in] The separator between successive values,
- Call to:
- Called from:
- function mom_document/int_array_string(vals, sep)
Returns a character string of a comma-separated, compact formatted, integers e.g. “1, 2, 7*3, 500”, that give the list of values.
- Return:
undefined :: The output string listing vals
- Parameters:
vals ::
vals[in] The array of values to recordsep ::
sep[in] The separator between successive values,
- Call to:
- Called from:
- function mom_document/testformattedfloatisreal(str, val)
This function tests whether a real value is encoded in a string.
- Parameters:
str ::
str[in] The string that match valval ::
val[in] The value being tested
- Called from:
- function mom_document/int_string(val)
This function returns a string with an integer formatted like ‘(I)’.
- Parameters:
val ::
val[in] The value being written into a string- Called from:
mom_document::doc_param::doc_param_intmom_document::doc_param::doc_param_int_arrayint_array_stringreal_array_stringtime_string
- function mom_document/logical_string(val)
This function returns a string with an logical formatted like ‘(L)’.
- Parameters:
val ::
val[in] The value being written into a string
- function mom_document/define_string(doc, varName, valString, units)
This function returns a string for formatted parameter assignment.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname :: [in] The name of the parameter being documented
valstring :: [in] A string containing the value of the parameter
units ::
units[in] The units of the parameter being documented
- Call to:
mlen- Called from:
mom_document::doc_param::doc_param_charmom_document::doc_param::doc_param_intmom_document::doc_param::doc_param_int_arraymom_document::doc_param::doc_param_logicalmom_document::doc_param::doc_param_logical_arraymom_document::doc_param::doc_param_realmom_document::doc_param::doc_param_real_arraymom_document::doc_param::doc_param_time
- function mom_document/undef_string(doc, varName, units)
This function returns a string for formatted false logicals.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname :: [in] The name of the parameter being documented
units ::
units[in] The units of the parameter being documented
- Call to:
string_false- Called from:
- subroutine mom_document/doc_module(doc, modname, desc, log_to_all, all_default, layoutMod, debuggingMod)
This subroutine handles the module documentation.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingmodname ::
modname[in] The name of the module being documenteddesc ::
desc[in] A description of the module being documentedlog_to_all ::
log_to_all[in] If present and true, log this parameter to the …_doc.all files, even if this module also has layout or debugging parameters.all_default ::
all_default[in] If true, all parameters take their default values.layoutmod :: [in] If present and true, this module has layout parameters.
debuggingmod :: [in] If present and true, this module has debugging parameters.
- Call to:
- subroutine mom_document/doc_subroutine(doc, modname, subname, desc)
This subroutine handles the subroutine documentation.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingmodname ::
modname[in] The name of the module being documentedsubname ::
subname[in] The name of the subroutine being documenteddesc ::
desc[in] A description of the subroutine being documented
- Call to:
- subroutine mom_document/doc_function(doc, modname, fnname, desc)
This subroutine handles the function documentation.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingmodname ::
modname[in] The name of the module being documentedfnname ::
fnname[in] The name of the function being documenteddesc ::
desc[in] A description of the function being documented
- Call to:
- subroutine mom_document/doc_init(docFileBase, doc, minimal, complete, layout, debugging)
Initialize the parameter documentation.
- Parameters:
docfilebase :: [in] The base file name for this set of parameters, for example MOM_parameter_doc
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingminimal ::
minimal[in] If present and true, write out the files (.short) documenting those parameters that do not take on their default values.complete ::
complete[in] If present and true, write out the (.all) files documenting all parameterslayout ::
layout[in] If present and true, write out the (.layout) files documenting the layout parametersdebugging ::
debugging[in] If present and true, write out the (.debugging) files documenting the debugging parameters
- subroutine mom_document/open_doc_file(doc)
This subroutine allocates and populates a structure that controls where the documentation occurs and its formatting, and opens up the files controlled by this structure.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formatting- Call to:
- Called from:
doc_closeblockdoc_functiondoc_moduledoc_openblockmom_document::doc_param::doc_param_charmom_document::doc_param::doc_param_intmom_document::doc_param::doc_param_int_arraymom_document::doc_param::doc_param_logicalmom_document::doc_param::doc_param_logical_arraymom_document::doc_param::doc_param_nonemom_document::doc_param::doc_param_realmom_document::doc_param::doc_param_real_arraymom_document::doc_param::doc_param_timedoc_subroutine
- function mom_document/find_unused_unit_number()
Find an unused unit number, returning >0 if found, and triggering a FATAL error if not.
- Call to:
- Called from:
- subroutine mom_document/doc_end(doc)
This subroutine closes the files controlled by doc, and sets flags in doc to indicate that parameterization is no longer permitted.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formatting
- function mom_document/mesghasbeendocumented(doc, varName, mesg)
Returns true if documentation has already been written.
- Parameters:
doc ::
docA pointer to a structure that controls where the documentation occurs and its formattingvarname :: [in] The name of the parameter being documented
mesg ::
mesg[in] A message with parameter values, defaults, and descriptions to compare with the message that was written previously
- Call to:
- Called from:
mom_document::doc_param::doc_param_charmom_document::doc_param::doc_param_intmom_document::doc_param::doc_param_int_arraymom_document::doc_param::doc_param_logicalmom_document::doc_param::doc_param_logical_arraymom_document::doc_param::doc_param_nonemom_document::doc_param::doc_param_realmom_document::doc_param::doc_param_real_arraymom_document::doc_param::doc_param_time