mom_file_parser module reference
The MOM6 facility to parse input files for runtime parameters.
Data Types
A simple type to allow lines in an array to be allocated with variable sizes. |
|
The valid lines extracted from an input parameter file without comments. |
|
A link in the list of variables that have already had override warnings issued. |
|
Specify the active parameter block. |
|
A structure that can be parsed to read and document run-time parameters. |
Functions/Subroutines
Make the contents of a parameter input file available in a |
|
Close any open input files and deallocate memory associated with this |
|
Read the contents of a parameter input file, and store the contents in a |
|
Return True if a /* appears on this line without a closing */. |
|
Return True if a */ appears on this line. |
|
Find position of last character before any comments, As marked by "!", "//", or "/*" following F90, C++, or C syntax. |
|
Find position of last non-blank character before any comments. |
|
Returns a string with tabs replaced by a blank. |
|
Trims comments and leading blanks from string. |
|
Constructs a string with all repeated white space replaced with single blanks and insert white space where it helps delineate tokens (e.g. |
|
This subroutine reads the value of an integer model parameter from a parameter file. |
|
This subroutine reads the values of an array of integer model parameters from a parameter file. |
|
This subroutine reads the value of a real model parameter from a parameter file. |
|
This subroutine reads the values of an array of real model parameters from a parameter file. |
|
This subroutine reads the value of a character string model parameter from a parameter file. |
|
This subroutine reads the values of an array of character string model parameters from a parameter file. |
|
This subroutine reads the value of a logical model parameter from a parameter file. |
|
This subroutine reads the value of a time_type model parameter from a parameter file. |
|
This function removes single and double quotes from a character string. |
|
This function returns the maximum number of characters in any input lines after they have been combined by any line continuation. |
|
This subroutine extracts the contents of lines in the |
|
Record that a line has been used to set a parameter. |
|
Returns true if an override warning has been issued for the variable varName. |
|
Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file. |
|
Log the version of a module to a log file and/or stdout. |
|
Log the name and value of an integer model parameter in documentation files. |
|
Log the name and values of an array of integer model parameter in documentation files. |
|
Log the name and value of a real model parameter in documentation files. |
|
Log the name and values of an array of real model parameter in documentation files. |
|
Log the name and value of a logical model parameter in documentation files. |
|
Log the name and value of a character string model parameter in documentation files. |
|
This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from. |
|
This function converts a date into a string, valid with ticks and for dates up to year 99,999,999. |
|
This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files. |
|
This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files. |
|
This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files. |
|
This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files. |
|
This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files. |
|
This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files. |
|
This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files. |
|
This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files. |
|
Issue error messages or warnings about the use of an archaic parameter name. |
|
Resets the parameter block name to blank. |
|
Tags blockName onto the end of the active parameter block name. |
|
Remove the lowest level of recursion from the active block name. |
|
Extends block name (deeper level of parameter block) |
|
Truncates block name (shallower level of parameter block) |
Detailed Description
By Robert Hallberg and Alistair Adcroft, updated 9/2013.
The subroutines here parse a set of input files for the value a named parameter and sets that parameter at run time. Currently these files use use one of several formats: #define VAR ! To set the logical VAR to true. VAR = True ! To set the logical VAR to true. #undef VAR ! To set the logical VAR to false. VAR = False ! To set the logical VAR to false. #define VAR 999 ! To set the real or integer VAR to 999. VAR = 999 ! To set the real or integer VAR to 999. #override VAR = 888 ! To override a previously set value. VAR = 1.1, 2.2, 3.3 ! To set an array of real values.
Type Documentation
- type mom_file_parser/file_line_type
A simple type to allow lines in an array to be allocated with variable sizes.
- Type fields:
% line ::
character(len=:), allocatable, privateAn allocatable line with content.
- type mom_file_parser/file_data_type
The valid lines extracted from an input parameter file without comments.
- Type fields:
% num_lines ::
integer, privateThe number of lines in this type.% fln ::
type(file_line_type), dimension(:), allocatable, privateLines with the input content.% line_used ::
logical, dimension(:), pointer, privateIf true, the line has been read.
- type mom_file_parser/link_parameter
A link in the list of variables that have already had override warnings issued.
- Type fields:
% next ::
type(link_parameter), pointer, privateFacilitates linked list.% name ::
character(len=80), privateParameter name.% hasissuedoverridewarning ::
logical, privateHas a default value.
- type mom_file_parser/parameter_block
Specify the active parameter block.
- Type fields:
% name ::
character(len=240), privateThe active parameter block name.% log_access ::
logical, privateLog the entry and exit of the block (but not its contents)
- type mom_file_parser/param_file_type
A structure that can be parsed to read and document run-time parameters.
- Type fields:
% nfiles ::
integerThe number of open files.% iounit ::
integer, dimension(max_param_files)The unit numbers of open files.% filename ::
character(len=filename_length), dimension(max_param_files)The names of the open files.% netcdf_file ::
logical, dimension(max_param_files)If true, the input file is in NetCDF.% param_data ::
type(file_data_type), dimension(max_param_files)Structures that contain the valid data lines from the parameter files, enabling all subsequent reads of parameter data to occur internally.% report_unused ::
logicalIf true, report any parameter lines that are not used in the run.% unused_params_fatal ::
logicalIf true, kill the run if there are any unused parameters.% log_to_stdout ::
logicalIf true, all log messages are also sent to stdout.% log_open ::
logicalTrue if the log file has been opened.% max_line_len ::
integerThe maximum number of characters in the lines in any of the files in this% stdout ::
integerThe unit number from% stdlog ::
integerThe unit number from% doc_file ::
character(len=240)A file where all run-time parameters, their settings and defaults are documented.% complete_doc ::
logicalIf true, document all run-time parameters.% minimal_doc ::
logicalIf true, document only those run-time parameters that differ from defaults.% doc ::
type(doc_type), pointerA structure that contains information related to parameter documentation.% chain ::
type(link_parameter), pointerFacilitates linked list.% blockname ::
type(parameter_block), pointerName of active parameter block.
Function/Subroutine Documentation
- subroutine mom_file_parser/open_param_file(filename, CS, checkable, component, doc_file_dir, ensemble_num)
Make the contents of a parameter input file available in a
param_file_type(). .- Parameters:
filename ::
filename[in] An input file name, optionally with the full pathcs :: [inout] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
checkable ::
checkable[in] If this is false, it disables checks of this file for unused parameters. The default is True.component ::
component[in] If present, this component name is used to generate parameter documentation file names; the default is”MOM”doc_file_dir ::
doc_file_dir[in] An optional directory in which to write out the documentation files. The default is effectively ‘./’.ensemble_num ::
ensemble_num[in] ensemble number to be appended to _doc filenames (optional)
- Call to:
complete_doc_defaultmax_input_line_lengthminimal_doc_defaultpopulate_param_data- Called from:
- subroutine mom_file_parser/close_param_file(CS, quiet_close, component)
Close any open input files and deallocate memory associated with this
param_file_type(). To use this type again, open_param_file would have to be called again. . To use this type again, open_param_file would have to be called again.- Parameters:
cs :: [inout] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
quiet_close ::
quiet_close[in] if present and true, do not do any logging with this call.component ::
component[in] If present, this component name is used to generate parameter documentation file names
- Call to:
complete_doc_defaultlog_to_stdout_defaultminimal_doc_defaultreport_unused_defaultunused_params_fatal_default- Called from:
mom_tracer_flow_control::call_tracer_flux_initmom6ocean_model_mod::ocean_model_init
- subroutine mom_file_parser/populate_param_data(iounit, filename, param_data)
Read the contents of a parameter input file, and store the contents in a
file_data_type()after removing comments and simplifying white space. after removing comments and simplifying white space.- Parameters:
iounit ::
iounit[in] The IO unit number that is open for filenamefilename ::
filename[in] An input file name, optionally with the full pathparam_data ::
param_data[inout] A list of the input lines that set parameters after comments have been stripped out.
- Call to:
closemultilinecommentinput_str_lengthlastnoncommentnonblankopenmultilinecommentremovecommentsreplacetabssimplifywhitespace- Called from:
- function mom_file_parser/openmultilinecomment(string)
Return True if a /* appears on this line without a closing */.
- Parameters:
string ::
string[in] The input string to process- Call to:
- Called from:
- function mom_file_parser/closemultilinecomment(string)
Return True if a */ appears on this line.
- Parameters:
string ::
string[in] The input string to process- Called from:
- function mom_file_parser/lastnoncommentindex(string)
Find position of last character before any comments, As marked by “!”, “//”, or “/*” following F90, C++, or C syntax.
- Parameters:
string ::
string[in] The input string to process- Called from:
- function mom_file_parser/lastnoncommentnonblank(string)
Find position of last non-blank character before any comments.
- Parameters:
string ::
string[in] The input string to process- Call to:
- Called from:
- function mom_file_parser/replacetabs(string)
Returns a string with tabs replaced by a blank.
- Parameters:
string ::
string[in] The input string to process- Called from:
- function mom_file_parser/removecomments(string)
Trims comments and leading blanks from string.
- Parameters:
string ::
string[in] The input string to process- Call to:
- Called from:
- function mom_file_parser/simplifywhitespace(string)
Constructs a string with all repeated white space replaced with single blanks and insert white space where it helps delineate tokens (e.g. around =)
- Parameters:
string ::
string[in] A string to modify to simplify white space- Called from:
- subroutine mom_file_parser/read_param_int(CS, varname, value, fail_if_missing, set)
This subroutine reads the value of an integer model parameter from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter fileset ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_int_array(CS, varname, value, fail_if_missing, set)
This subroutine reads the values of an array of integer model parameters from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter fileset ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_real(CS, varname, value, fail_if_missing, scale, set)
This subroutine reads the value of a real model parameter from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filescale ::
scale[in] A scaling factor that the parameter is multiplied by before it is returned.set ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_real_array(CS, varname, value, fail_if_missing, scale, set)
This subroutine reads the values of an array of real model parameters from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filescale ::
scale[in] A scaling factor that the parameter is multiplied by before it is returned.set ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_char(CS, varname, value, fail_if_missing, set)
This subroutine reads the value of a character string model parameter from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter fileset ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_char_array(CS, varname, value, fail_if_missing, set)
This subroutine reads the values of an array of character string model parameters from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter fileset ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_logical(CS, varname, value, fail_if_missing, set)
This subroutine reads the value of a logical model parameter from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filefail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter fileset ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- subroutine mom_file_parser/read_param_time(CS, varname, value, timeunit, fail_if_missing, date_format, set)
This subroutine reads the value of a time_type model parameter from a parameter file.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter filetimeunit ::
timeunit[in] The number of seconds in a time unit for real-number input.fail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedate_format ::
date_format[out] If present, this indicates whether this parameter was read in a date format, so that it can later be logged in the same format.set ::
set[out] If present, this indicates whether this parameter has been found and successfully set in the input files.
- Called from:
- function mom_file_parser/strip_quotes(val_str)
This function removes single and double quotes from a character string.
- Parameters:
val_str ::
val_str[in] The character string to work on- Called from:
mom_file_parser::read_param::read_param_charmom_file_parser::read_param::read_param_char_array
- function mom_file_parser/max_input_line_length(CS, pf_num)
This function returns the maximum number of characters in any input lines after they have been combined by any line continuation.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
pf_num ::
pf_num[in] If present, only work on a single file in theparam_file_type(), or return 0 if this exceeds the number of files in the , or return 0 if this exceeds the number of files in theparam_file_type(). .
- Return:
undefined :: The maximum number of characters in any input lines after they have been combined by any line continuation.
- Called from:
- subroutine mom_file_parser/get_variable_line(CS, varname, found, defined, value_string, paramIsLogical)
This subroutine extracts the contents of lines in the
param_file_type()that refer to a named parameter. The value_string that is returned must be interpreted in a way that depends on the type of this variable. that refer to a named parameter. The value_string that is returned must be interpreted in a way that depends on the type of this variable.- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
varname ::
varname[in] The case-sensitive name of the parameter to readfound ::
found[out] If true, this parameter has been found in CSdefined ::
defined[out] If true, this parameter is set (or true) in the CSvalue_string ::
value_string[out] A string that encodes the new valueparamislogical :: [in] If true, this is a logical parameter that can be simply defined without parsing a value_string.
- Call to:
flag_line_as_readoverridewarninghasbeenissuedpopblocklevelpushblocklevel- Called from:
mom_file_parser::read_param::read_param_charmom_file_parser::read_param::read_param_char_arraymom_file_parser::read_param::read_param_intmom_file_parser::read_param::read_param_int_arraymom_file_parser::read_param::read_param_logicalmom_file_parser::read_param::read_param_realmom_file_parser::read_param::read_param_real_arraymom_file_parser::read_param::read_param_time
- subroutine mom_file_parser/flag_line_as_read(line_used, count)
Record that a line has been used to set a parameter.
- Parameters:
line_used ::
line_usedA structure indicating which lines have been readcount ::
count[in] The parameter on this line number has been read
- Called from:
- function mom_file_parser/overridewarninghasbeenissued(chain, varName)
Returns true if an override warning has been issued for the variable varName.
- Parameters:
chain ::
chainThe linked list of variables that have already had override warnings issuedvarname :: [in] The name of the variable being queried for warnings
- Called from:
- subroutine mom_file_parser/log_version_cs(CS, modulename, version, desc, log_to_all, all_default, layout, debugging)
Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file.
- Parameters:
cs :: [in] File parser type
modulename ::
modulename[in] Name of calling moduleversion ::
version[in] Version string of moduledesc ::
desc[in] Module descriptionlog_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.layout ::
layout[in] If present and true, this module has layout parameters.debugging ::
debugging[in] If present and true, this module has debugging parameters.
- subroutine mom_file_parser/log_version_plain(modulename, version)
Log the version of a module to a log file and/or stdout.
- Parameters:
modulename ::
modulename[in] Name of calling moduleversion ::
version[in] Version string of module
- subroutine mom_file_parser/log_param_int(CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam, like_default)
Log the name and value of an integer model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the module using this parametervarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterlayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.
- Called from:
- subroutine mom_file_parser/log_param_int_array(CS, modulename, varname, value, desc, units, default, defaults, layoutParam, debuggingParam, like_default)
Log the name and values of an array of integer model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the module using this parametervarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
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 parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.
- Called from:
- subroutine mom_file_parser/log_param_real(CS, modulename, varname, value, desc, units, default, debuggingParam, like_default, unscale)
Log the name and value of a real model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterdebuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.unscale ::
unscale[in] A reciprocal scaling factor that the parameter is multiplied by before it is logged
- Called from:
- subroutine mom_file_parser/log_param_real_array(CS, modulename, varname, value, desc, units, default, defaults, debuggingParam, like_default, unscale)
Log the name and values of an array of real model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] A uniform default value of the parameterdefaults ::
defaults[in] The element-wise defaults of the parameterdebuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.unscale ::
unscale[in] A reciprocal scaling factor that the parameter is multiplied by before it is logged
- Called from:
- subroutine mom_file_parser/log_param_logical(CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam, like_default)
Log the name and value of a logical model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterlayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.
- Called from:
- subroutine mom_file_parser/log_param_char(CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam, like_default)
Log the name and value of a character string model parameter in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterlayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.
- Called from:
mom_file_parser::get_param::get_param_charmom_file_parser::get_param::get_param_char_array
- subroutine mom_file_parser/log_param_time(CS, modulename, varname, value, desc, units, default, timeunit, layoutParam, debuggingParam, log_date, like_default)
This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The name of the parameter to logvalue ::
value[in] The value of the parameter to logdesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parametertimeunit ::
timeunit[in] The number of seconds in a time unit for real-number output.log_date ::
log_date[in] If true, log the time_type in date format. If missing the default is false.layoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
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.
- Called from:
- function mom_file_parser/convert_date_to_string(date)
This function converts a date into a string, valid with ticks and for dates up to year 99,999,999.
- Parameters:
date ::
date[in] The date to be translated into a string.- Return:
undefined :: A date string in a format like YYYY-MM-DD HH:MM:SS.sss
- Called from:
- subroutine mom_file_parser/get_param_int(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, layoutParam, debuggingParam, old_name)
This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation fileslayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_int_array(CS, modulename, varname, value, desc, units, default, defaults, fail_if_missing, do_not_read, do_not_log, layoutParam, debuggingParam, old_name)
This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be reset from the parameter filedesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The uniform default value of this parameterdefaults ::
defaults[in] The element-wise default values of this parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation fileslayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_real(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, debuggingParam, scale, unscaled, old_name)
This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation filesdebuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
scale ::
scale[in] A scaling factor that the parameter is multiplied by before it is returned.unscaled ::
unscaled[out] The value of the parameter that would be returned without any multiplication by a scaling factor.old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_real_array(CS, modulename, varname, value, desc, units, default, defaults, fail_if_missing, do_not_read, do_not_log, debuggingParam, scale, unscaled, old_name)
This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] A uniform default value of the parameterdefaults ::
defaults[in] The element-wise defaults of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation filesdebuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
scale ::
scale[in] A scaling factor that the parameter is multiplied by before it is returned.unscaled ::
unscaled[out] The value of the parameter that would be returned without any multiplication by a scaling factor.old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_char(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, layoutParam, debuggingParam, old_name)
This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation fileslayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_char_array(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, old_name)
This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation filesold_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_logical(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, layoutParam, debuggingParam, old_name)
This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation fileslayoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/get_param_time(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, timeunit, layoutParam, debuggingParam, log_as_date, old_name)
This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
modulename ::
modulename[in] The name of the calling modulevarname ::
varname[in] The case-sensitive name of the parameter to readvalue ::
value[inout] The value of the parameter that may be read from the parameter file and loggeddesc ::
desc[in] A description of this variable; if not present, this parameter is not written to a doc fileunits ::
units[in] The units of this parameterdefault ::
default[in] The default value of the parameterfail_if_missing ::
fail_if_missing[in] If present and true, a fatal error occurs if this variable is not found in the parameter filedo_not_read ::
do_not_read[in] If present and true, do not read a value for this parameter, although it might be logged.do_not_log ::
do_not_log[in] If present and true, do not log this parameter to the documentation filestimeunit ::
timeunit[in] The number of seconds in a time unit for real-number input to be translated to a time.layoutparam :: [in] If present and true, this parameter is logged in the layout parameter file
debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file
log_as_date ::
log_as_date[in] If true, log the time_type in date format. The default is false.old_name ::
old_name[in] A case-sensitive archaic name of the parameter to read. Errors or warnings are issued if the old name is being used.
- subroutine mom_file_parser/archaic_param_name_message(varname, old_name, new_name_used, same_value)
Issue error messages or warnings about the use of an archaic parameter name.
- Parameters:
varname ::
varname[in] The case-sensitive name of the parameter to readold_name ::
old_name[in] The case-sensitive archaic name of the parameternew_name_used ::
new_name_used[in] True if varname is used in the parameter file.same_value ::
same_value[in] True if varname and old_name give the same values.
- Called from:
mom_file_parser::get_param::get_param_charmom_file_parser::get_param::get_param_char_arraymom_file_parser::get_param::get_param_intmom_file_parser::get_param::get_param_int_arraymom_file_parser::get_param::get_param_logicalmom_file_parser::get_param::get_param_realmom_file_parser::get_param::get_param_real_arraymom_file_parser::get_param::get_param_time
- subroutine mom_file_parser/clearparameterblock(CS)
Resets the parameter block name to blank.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
- subroutine mom_file_parser/openparameterblock(CS, blockName, desc, do_not_log)
Tags blockName onto the end of the active parameter block name.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
blockname :: [in] The name of a parameter block being added
desc ::
desc[in] A description of the parameter block being addeddo_not_log ::
do_not_log[in] Log block entry if true. This only prevents logging of entry to the block, and not the contents.
- Call to:
- Called from:
baroclinic_zone_initialization::bcz_paramsmom_cvmix_kpp::kpp_initmom_set_visc::set_visc_register_restarts
- subroutine mom_file_parser/closeparameterblock(CS)
Remove the lowest level of recursion from the active block name.
- Parameters:
cs :: [in] The control structure for the file_parser module, it is also a structure to parse for run-time parameters
- Call to:
- Called from:
baroclinic_zone_initialization::bcz_paramsmom_cvmix_kpp::kpp_initmom_set_visc::set_visc_register_restartsmom_file_parser_tests::test_close_unallocated_blockmom_file_parser_tests::test_read_param_blockmom_file_parser_tests::test_read_param_block_close_unnamedmom_file_parser_tests::test_read_param_block_empty_popmom_file_parser_tests::test_read_param_block_inline_stackmom_file_parser_tests::test_read_param_block_stack
- function mom_file_parser/pushblocklevel(oldblockName, newBlockName)
Extends block name (deeper level of parameter block)
- Parameters:
oldblockname :: [in] A sequence of hierarchical parameter block names
newblockname :: [in] A new block name to add to the end of the sequence
- Called from:
- function mom_file_parser/popblocklevel(oldblockName)
Truncates block name (shallower level of parameter block)
- Parameters:
oldblockname :: [in] A sequence of hierarchical parameter block names
- Called from: