mom_file_parser module reference

The MOM6 facility to parse input files for runtime parameters.

More…

Data Types

file_line_type

A simple type to allow lines in an array to be allocated with variable sizes.

file_data_type

The valid lines extracted from an input parameter file without comments.

link_parameter

A link in the list of variables that have already had override warnings issued.

parameter_block

Specify the active parameter block.

param_file_type

A structure that can be parsed to read and document run-time parameters.

Functions/Subroutines

open_param_file()

Make the contents of a parameter input file availalble in a param_file_type().

close_param_file()

Close any open input files and deallocate memory associated with this param_file_type().

populate_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.

openmultilinecomment()

Return True if a /* appears on this line without a closing */.

closemultilinecomment()

Return True if a */ appears on this line.

lastnoncommentindex()

Find position of last character before any comments, As marked by “!”, “//”, or “/*” following F90, C++, or C syntax.

lastnoncommentnonblank()

Find position of last non-blank character before any comments.

replacetabs()

Returns a string with tabs replaced by a blank.

removecomments()

Trims comments and leading blanks from string.

simplifywhitespace()

Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.g.

read_param_int()

This subroutine reads the value of an integer model parameter from a parameter file.

read_param_int_array()

This subroutine reads the values of an array of integer model parameters from a parameter file.

read_param_real()

This subroutine reads the value of a real model parameter from a parameter file.

read_param_real_array()

This subroutine reads the values of an array of real model parameters from a parameter file.

read_param_char()

This subroutine reads the value of a character string model parameter from a parameter file.

read_param_char_array()

This subroutine reads the values of an array of character string model parameters from a parameter file.

read_param_logical()

This subroutine reads the value of a logical model parameter from a parameter file.

read_param_time()

This subroutine reads the value of a time_type model parameter from a parameter file.

strip_quotes()

This function removes single and double quotes from a character string.

max_input_line_length()

This function returns the maximum number of characters in any input lines after they have been combined by any line continuation.

get_variable_line()

This subroutine extracts the contents of lines in the param_file_type() that refer to a named parameter.

flag_line_as_read()

Record that a line has been used to set a parameter.

overridewarninghasbeenissued()

Returns true if an override warning has been issued for the variable varName.

log_version_cs()

Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file.

log_version_plain()

Log the version of a module to a log file and/or stdout.

log_param_int()

Log the name and value of an integer model parameter in documentation files.

log_param_int_array()

Log the name and values of an array of integer model parameter in documentation files.

log_param_real()

Log the name and value of a real model parameter in documentation files.

log_param_real_array()

Log the name and values of an array of real model parameter in documentation files.

log_param_logical()

Log the name and value of a logical model parameter in documentation files.

log_param_char()

Log the name and value of a character string model parameter in documentation files.

log_param_time()

This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from.

convert_date_to_string()

This function converts a date into a string, valid with ticks and for dates up to year 99,999,999.

get_param_int()

This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files.

get_param_int_array()

This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files.

get_param_real()

This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files.

get_param_real_array()

This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files.

get_param_char()

This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files.

get_param_char_array()

This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files.

get_param_logical()

This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files.

get_param_time()

This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files.

clearparameterblock()

Resets the parameter block name to blank.

openparameterblock()

Tags blockName onto the end of the active parameter block name.

closeparameterblock()

Remove the lowest level of recursion from the active block name.

pushblocklevel()

Extends block name (deeper level of parameter block)

popblocklevel()

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, private] :: An 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,private] :: The number of lines in this type.

  • % fln [type( file_line_type )(:),allocatable, private] :: Lines with the input content.

  • % line_used [logical(:),pointer, private] :: If true, the line has been read.

A link in the list of variables that have already had override warnings issued.

Type fields:
  • % next [type( link_parameter ),pointer, private] :: Facilitates linked list.

  • % name [character (len=80),private] :: Parameter name.

  • % hasissuedoverridewarning [logical,private] :: Has a default value.

type mom_file_parser/parameter_block

Specify the active parameter block.

Type fields:
  • % name [character (len=240),private] :: The active parameter block name.

  • % log_access [logical,private] :: Log 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 [integer] :: The number of open files.

  • % iounit [integer( max_param_files )] :: The unit numbers of open files.

  • % filename [character (len= filename_length )( max_param_files )] :: The names of the open files.

  • % netcdf_file [logical( max_param_files )] :: If true, the input file is in NetCDF.

  • % param_data [type( file_data_type )( 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 [logical] :: If true, report any parameter lines that are not used in the run.

  • % unused_params_fatal [logical] :: If true, kill the run if there are any unused parameters.

  • % log_to_stdout [logical] :: If true, all log messages are also sent to stdout.

  • % log_open [logical] :: True if the log file has been opened.

  • % max_line_len [integer] :: The maximum number of characters in the lines in any of the files in this

  • % stdout [integer] :: The unit number from

  • % stdlog [integer] :: The unit number from

  • % doc_file [character (len=240)] :: A file where all run-time parameters, their settings and defaults are documented.

  • % complete_doc [logical] :: If true, document all run-time parameters.

  • % minimal_doc [logical] :: If true, document only those run-time parameters that differ from defaults.

  • % doc [type( doc_type ),pointer] :: A structure that contains information related to parameter documentation.

  • % chain [type( link_parameter ),pointer] :: Facilitates linked list.

  • % blockname [type( parameter_block ),pointer] :: Name 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 availalble in a param_file_type(). .

Parameters:
  • filename :: [in] An input file name, optionally with the full path

  • cs :: [inout] The control structure for the file_parser module, it is also a structure to parse for run-time parameters

  • checkable :: [in] If this is false, it disables checks of this file for unused parameters. The default is True.

  • component :: [in] If present, this component name is used to generate parameter documentation file names; the default is”MOM”

  • doc_file_dir :: [in] An optional directory in which to write out the documentation files. The default is effectively ‘./’.

  • ensemble_num :: [in] ensemble number to be appended to _doc filenames (optional)

Call to:

complete_doc_default max_input_line_length minimal_doc_default populate_param_data

Called from:

mom_get_input::get_mom_input

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 :: [in] if present and true, do not do any logging with this call.

  • component :: [in] If present, this component name is used to generate parameter documentation file names

Call to:

complete_doc_default log_to_stdout_default minimal_doc_default report_unused_default unused_params_fatal_default

Called from:

mom_tracer_flow_control::call_tracer_flux_init mom6 ocean_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 :: [in] The IO unit number that is open for filename

  • filename :: [in] An input file name, optionally with the full path

  • param_data :: [inout] A list of the input lines that set parameters after comments have been stripped out.

Call to:

closemultilinecomment input_str_length lastnoncommentnonblank openmultilinecomment removecomments replacetabs simplifywhitespace

Called from:

open_param_file

function mom_file_parser/openmultilinecomment(string) [logical]

Return True if a /* appears on this line without a closing */.

Parameters:

string :: [in] The input string to process

Call to:

lastnoncommentindex

Called from:

populate_param_data

function mom_file_parser/closemultilinecomment(string) [logical]

Return True if a */ appears on this line.

Parameters:

string :: [in] The input string to process

Called from:

populate_param_data

function mom_file_parser/lastnoncommentindex(string) [integer]

Find position of last character before any comments, As marked by “!”, “//”, or “/*” following F90, C++, or C syntax.

Parameters:

string :: [in] The input string to process

Called from:

lastnoncommentnonblank openmultilinecomment

function mom_file_parser/lastnoncommentnonblank(string) [integer]

Find position of last non-blank character before any comments.

Parameters:

string :: [in] The input string to process

Call to:

lastnoncommentindex

Called from:

populate_param_data removecomments

function mom_file_parser/replacetabs(string) [character(len=len(string))]

Returns a string with tabs replaced by a blank.

Parameters:

string :: [in] The input string to process

Called from:

populate_param_data

function mom_file_parser/removecomments(string) [character(len=len(string))]

Trims comments and leading blanks from string.

Parameters:

string :: [in] The input string to process

Call to:

lastnoncommentnonblank

Called from:

populate_param_data

function mom_file_parser/simplifywhitespace(string) [character(len=len(string)+16)]

Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.g. around =)

Parameters:

string :: [in] A string to modify to simpify white space

Called from:

populate_param_data

subroutine mom_file_parser/read_param_int(CS, varname, value, fail_if_missing)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

Called from:

mom_file_parser::get_param::get_param_int

subroutine mom_file_parser/read_param_int_array(CS, varname, value, fail_if_missing)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

Called from:

mom_file_parser::get_param::get_param_int_array

subroutine mom_file_parser/read_param_real(CS, varname, value, fail_if_missing, scale)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • scale :: [in] A scaling factor that the parameter is multiplied by before it is returned.

Called from:

mom_file_parser::get_param::get_param_real

subroutine mom_file_parser/read_param_real_array(CS, varname, value, fail_if_missing, scale)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • scale :: [in] A scaling factor that the parameter is multiplied by before it is returned.

Called from:

mom_file_parser::get_param::get_param_real_array

subroutine mom_file_parser/read_param_char(CS, varname, value, fail_if_missing)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

Called from:

mom_file_parser::get_param::get_param_char

subroutine mom_file_parser/read_param_char_array(CS, varname, value, fail_if_missing)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

Called from:

mom_file_parser::get_param::get_param_char_array

subroutine mom_file_parser/read_param_logical(CS, varname, value, fail_if_missing)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

Called from:

mom_file_parser::get_param::get_param_logical

subroutine mom_file_parser/read_param_time(CS, varname, value, timeunit, fail_if_missing, date_format)

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 :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file

  • timeunit :: [in] The number of seconds in a time unit for real-number input.

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • 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.

Called from:

mom_file_parser::get_param::get_param_time

function mom_file_parser/strip_quotes(val_str) [character(len=len(val_str))]

This function removes single and double quotes from a character string.

Parameters:

val_str :: [in] The character string to work on

Called from:

mom_file_parser::read_param::read_param_char mom_file_parser::read_param::read_param_char_array

function mom_file_parser/max_input_line_length(CS, pf_num) [integer]

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 :: [in] If present, only work on a single file in the param_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 the param_file_type(). .

Return:

undefined :: The maximum number of characters in any input lines after they have been combined by any line continuation.

Called from:

open_param_file

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 interepreted 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 interepreted 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 :: [in] The case-sensitive name of the parameter to read

  • found :: [out] If true, this parameter has been found in CS

  • defined :: [out] If true, this parameter is set (or true) in the CS

  • value_string :: [out] A string that encodes the new value

  • paramislogical :: [in] If true, this is a logical parameter that can be simply defined without parsing a value_string.

Call to:

flag_line_as_read overridewarninghasbeenissued popblocklevel pushblocklevel

Called from:

mom_file_parser::read_param::read_param_char mom_file_parser::read_param::read_param_char_array mom_file_parser::read_param::read_param_int mom_file_parser::read_param::read_param_int_array mom_file_parser::read_param::read_param_logical mom_file_parser::read_param::read_param_real mom_file_parser::read_param::read_param_real_array mom_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 :: A structure indicating which lines have been read

  • count :: [in] The parameter on this line number has been read

Called from:

get_variable_line

function mom_file_parser/overridewarninghasbeenissued(chain, varName) [logical]

Returns true if an override warning has been issued for the variable varName.

Parameters:
  • chain :: The linked list of variables that have already had override warnings issued

  • varname :: [in] The name of the variable being queried for warnings

Called from:

get_variable_line

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 :: [in] Name of calling module

  • version :: [in] Version string of module

  • desc :: [in] Module description

  • 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 :: [in] If true, all parameters take their default values.

  • layout :: [in] If present and true, this module has layout parameters.

  • 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 :: [in] Name of calling module

  • 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 :: [in] The name of the module using this parameter

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • 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 :: [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_int

subroutine mom_file_parser/log_param_int_array(CS, modulename, varname, value, desc, units, default, 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 :: [in] The name of the module using this parameter

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • 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 :: [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_int_array

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 :: [in] The name of the calling module

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file

  • like_default :: [in] If present and true, log this parameter as though it has the default value, even if there is no default.

  • unscale :: [in] A reciprocal scaling factor that the parameter is multiplied by before it is logged

Called from:

mom_file_parser::get_param::get_param_real

subroutine mom_file_parser/log_param_real_array(CS, modulename, varname, value, desc, units, default, 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 :: [in] The name of the calling module

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file

  • like_default :: [in] If present and true, log this parameter as though it has the default value, even if there is no default.

  • unscale :: [in] A reciprocal scaling factor that the parameter is multiplied by before it is logged

Called from:

mom_file_parser::get_param::get_param_real_array

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 :: [in] The name of the calling module

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • 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 :: [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_logical

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 :: [in] The name of the calling module

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • 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 :: [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_char mom_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 :: [in] The name of the calling module

  • varname :: [in] The name of the parameter to log

  • value :: [in] The value of the parameter to log

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • timeunit :: [in] The number of seconds in a time unit for real-number output.

  • 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 :: [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_time

function mom_file_parser/convert_date_to_string(date) [character(len=40)]

This function converts a date into a string, valid with ticks and for dates up to year 99,999,999.

Parameters:

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:

mom_file_parser::log_param::log_param_time

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)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • 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

subroutine mom_file_parser/get_param_int_array(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, layoutParam, debuggingParam)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be reset from the parameter file

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • 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

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)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file

  • scale :: [in] A scaling factor that the parameter is multiplied by before it is returned.

  • unscaled :: [out] The value of the parameter that would be returned without any multiplication by a scaling factor.

subroutine mom_file_parser/get_param_real_array(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, debuggingParam, scale, unscaled)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • debuggingparam :: [in] If present and true, this parameter is logged in the debugging parameter file

  • scale :: [in] A scaling factor that the parameter is multiplied by before it is returned.

  • unscaled :: [out] The value of the parameter that would be returned without any multiplication by a scaling factor.

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)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • 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

subroutine mom_file_parser/get_param_char_array(CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

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)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • 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

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)

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 :: [in] The name of the calling module

  • varname :: [in] The case-sensitive name of the parameter to read

  • value :: [inout] The value of the parameter that may be read from the parameter file and logged

  • desc :: [in] A description of this variable; if not present, this parameter is not written to a doc file

  • units :: [in] The units of this parameter

  • default :: [in] The default value of the parameter

  • fail_if_missing :: [in] If present and true, a fatal error occurs if this variable is not found in the parameter file

  • do_not_read :: [in] If present and true, do not read a value for this parameter, although it might be logged.

  • do_not_log :: [in] If present and true, do not log this parameter to the documentation files

  • 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 :: [in] If true, log the time_type in date format. The default is false.

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 :: [in] A description of the parameter block being added

  • do_not_log :: [in] Log block entry if true. This only prevents logging of entry to the block, and not the contents.

Call to:

pushblocklevel

Called from:

baroclinic_zone_initialization::bcz_params mom_cvmix_kpp::kpp_init

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:

popblocklevel

Called from:

baroclinic_zone_initialization::bcz_params mom_cvmix_kpp::kpp_init mom_file_parser_tests::test_close_unallocated_block mom_file_parser_tests::test_read_param_block mom_file_parser_tests::test_read_param_block_close_unnamed mom_file_parser_tests::test_read_param_block_empty_pop mom_file_parser_tests::test_read_param_block_inline_stack mom_file_parser_tests::test_read_param_block_stack

function mom_file_parser/pushblocklevel(oldblockName, newBlockName) [character(len=len(oldblockname)+40)]

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:

get_variable_line openparameterblock

function mom_file_parser/popblocklevel(oldblockName) [character(len=len(oldblockname)+40)]

Truncates block name (shallower level of parameter block)

Parameters:

oldblockname :: [in] A sequence of hierarchical parameter block names

Called from:

closeparameterblock get_variable_line