MOM6
|
The MOM6 facility to parse input files for runtime parameters.
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.
Data Types | |
type | file_data_type |
The valid lines extracted from an input parameter file without comments. More... | |
interface | get_param |
An overloaded interface to read and log the values of various types of parameters. More... | |
type | link_parameter |
A link in the list of variables that have already had override warnings issued. More... | |
interface | log_param |
An overloaded interface to log the values of various types of parameters. More... | |
interface | log_version |
An overloaded interface to log version information about modules. More... | |
type | param_file_type |
A structure that can be parsed to read and document run-time parameters. More... | |
type | parameter_block |
Specify the active parameter block. More... | |
interface | read_param |
An overloaded interface to read various types of parameters. More... | |
Variables | |
integer, parameter, public | max_param_files = 5 |
Maximum number of parameter files. More... | |
integer, parameter | input_str_length = 320 |
Maximum line length in parameter file. More... | |
integer, parameter | filename_length = 200 |
Maximum number of characters in file names. More... | |
logical | all_pes_read = .false. |
If true, all PEs read the input files TODO: Eliminate this parameter. More... | |
logical, parameter | report_unused_default = .false. |
Default values for parameters. More... | |
logical, parameter | unused_params_fatal_default = .false. |
Default values for parameters. More... | |
logical, parameter | log_to_stdout_default = .false. |
Default values for parameters. More... | |
logical, parameter | complete_doc_default = .true. |
Default values for parameters. More... | |
logical, parameter | minimal_doc_default = .true. |
Default values for parameters. More... | |
subroutine, public | open_param_file (filename, CS, checkable, component, doc_file_dir) |
Make the contents of a parameter input file availalble in a param_file_type. More... | |
subroutine, public | 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. More... | |
subroutine | 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. More... | |
logical function | openmultilinecomment (string) |
Return True if a /* appears on this line without a closing */. More... | |
logical function | closemultilinecomment (string) |
Return True if a */ appears on this line. More... | |
integer function | lastnoncommentindex (string) |
Find position of last character before any comments, As marked by "!", "//", or "/*" following F90, C++, or C syntax. More... | |
integer function | lastnoncommentnonblank (string) |
Find position of last non-blank character before any comments. More... | |
character(len=len(string)) function | replacetabs (string) |
Returns a string with tabs replaced by a blank. More... | |
character(len=len(string)) function | removecomments (string) |
Trims comments and leading blanks from string. More... | |
character(len=len(string)+16) function | simplifywhitespace (string) |
Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.g. around =) More... | |
subroutine | read_param_int (CS, varname, value, fail_if_missing) |
This subroutine reads the value of an integer model parameter from a parameter file. More... | |
subroutine | 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. More... | |
subroutine | read_param_real (CS, varname, value, fail_if_missing, scale) |
This subroutine reads the value of a real model parameter from a parameter file. More... | |
subroutine | 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. More... | |
subroutine | read_param_char (CS, varname, value, fail_if_missing) |
This subroutine reads the value of a character string model parameter from a parameter file. More... | |
subroutine | 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. More... | |
subroutine | read_param_logical (CS, varname, value, fail_if_missing) |
This subroutine reads the value of a logical model parameter from a parameter file. More... | |
subroutine | 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. More... | |
character(len=input_str_length) function | strip_quotes (val_str) |
This function removes single and double quotes from a character string. More... | |
subroutine | get_variable_line (CS, varname, found, defined, value_string, paramIsLogical) |
This subtoutine 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. More... | |
subroutine | flag_line_as_read (line_used, count) |
Record that a line has been used to set a parameter. More... | |
logical function | overridewarninghasbeenissued (chain, varName) |
Returns true if an override warning has been issued for the variable varName. More... | |
subroutine | log_version_cs (CS, modulename, version, desc) |
Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file. More... | |
subroutine | log_version_plain (modulename, version) |
Log the version of a module to a log file and/or stdout. More... | |
subroutine | log_param_int (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam) |
Log the name and value of an integer model parameter in documentation files. More... | |
subroutine | log_param_int_array (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam) |
Log the name and values of an array of integer model parameter in documentation files. More... | |
subroutine | log_param_real (CS, modulename, varname, value, desc, units, default, debuggingParam) |
Log the name and value of a real model parameter in documentation files. More... | |
subroutine | log_param_real_array (CS, modulename, varname, value, desc, units, default, debuggingParam) |
Log the name and values of an array of real model parameter in documentation files. More... | |
subroutine | log_param_logical (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam) |
Log the name and value of a logical model parameter in documentation files. More... | |
subroutine | log_param_char (CS, modulename, varname, value, desc, units, default, layoutParam, debuggingParam) |
Log the name and value of a character string model parameter in documentation files. More... | |
subroutine | log_param_time (CS, modulename, varname, value, desc, units, default, timeunit, layoutParam, debuggingParam, log_date) |
This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from. More... | |
character(len=40) function | 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. More... | |
subroutine | get_param_int (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam) |
This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files. More... | |
subroutine | get_param_int_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam) |
This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files. More... | |
subroutine | get_param_real (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, debuggingParam, scale, unscaled) |
This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files. More... | |
subroutine | get_param_real_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, debuggingParam, static_value, scale, unscaled) |
This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files. More... | |
subroutine | get_param_char (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam) |
This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files. More... | |
subroutine | get_param_char_array (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value) |
This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files. More... | |
subroutine | get_param_logical (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, static_value, layoutParam, debuggingParam) |
This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files. More... | |
subroutine | get_param_time (CS, modulename, varname, value, desc, units, default, fail_if_missing, do_not_read, do_not_log, timeunit, static_value, 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. More... | |
subroutine, public | clearparameterblock (CS) |
Resets the parameter block name to blank. More... | |
subroutine, public | openparameterblock (CS, blockName, desc) |
Tags blockName onto the end of the active parameter block name. More... | |
subroutine, public | closeparameterblock (CS) |
Remove the lowest level of recursion from the active block name. More... | |
character(len=len(oldblockname)+40) function | pushblocklevel (oldblockName, newBlockName) |
Extends block name (deeper level of parameter block) More... | |
character(len=len(oldblockname)+40) function | popblocklevel (oldblockName) |
Truncates block name (shallower level of parameter block) More... | |
subroutine, public mom_file_parser::clearparameterblock | ( | type(param_file_type), intent(in) | CS | ) |
Resets the parameter block name to blank.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
Definition at line 2000 of file MOM_file_parser.F90.
subroutine, public mom_file_parser::close_param_file | ( | type(param_file_type), intent(inout) | CS, |
logical, intent(in), optional | quiet_close, | ||
character(len=*), intent(in), optional | 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.
[in,out] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | quiet_close | if present and true, do not do any logging with this call. |
[in] | component | If present, this component name is used to generate parameter documentation file names |
Definition at line 242 of file MOM_file_parser.F90.
References all_pes_read, complete_doc_default, mom_error_handler::is_root_pe(), log_to_stdout_default, minimal_doc_default, report_unused_default, and unused_params_fatal_default.
Referenced by mom_tracer_flow_control::call_tracer_flux_init(), mom_main(), mom_ocean_model_mct::ocean_model_init(), mom_ocean_model_nuopc::ocean_model_init(), and ocn_comp_mct::ocn_init_mct().
|
private |
Return True if a */ appears on this line.
[in] | string | The input string to process |
Definition at line 455 of file MOM_file_parser.F90.
Referenced by populate_param_data().
subroutine, public mom_file_parser::closeparameterblock | ( | type(param_file_type), intent(in) | CS | ) |
Remove the lowest level of recursion from the active block name.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
Definition at line 2033 of file MOM_file_parser.F90.
References popblocklevel().
Referenced by baroclinic_zone_initialization::bcz_params(), and mom_cvmix_kpp::kpp_init().
|
private |
This function converts a date into a string, valid with ticks and for dates up to year 99,999,999.
[in] | date | The date to be translated into a string. |
Definition at line 1568 of file MOM_file_parser.F90.
Referenced by log_param_time().
|
private |
Record that a line has been used to set a parameter.
line_used | A structure indicating which lines have been read | |
[in] | count | The parameter on this line number has been read |
Definition at line 1209 of file MOM_file_parser.F90.
Referenced by get_variable_line().
|
private |
This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1799 of file MOM_file_parser.F90.
References log_param_char(), and read_param_char().
|
private |
This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
Definition at line 1845 of file MOM_file_parser.F90.
References log_param_char(), and read_param_char_array().
|
private |
This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1601 of file MOM_file_parser.F90.
References log_param_int(), and read_param_int().
|
private |
This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be reset from the parameter file |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1648 of file MOM_file_parser.F90.
References log_param_int_array(), and read_param_int_array().
|
private |
This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1899 of file MOM_file_parser.F90.
References log_param_logical(), and read_param_logical().
|
private |
This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
[in] | scale | A scaling factor that the parameter is multiplied by before it is returned. |
[out] | unscaled | The value of the parameter that would be returned without any multiplication by a scaling factor. |
Definition at line 1695 of file MOM_file_parser.F90.
References log_param_real(), and read_param_real().
|
private |
This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
[in] | scale | A scaling factor that the parameter is multiplied by before it is returned. |
[out] | unscaled | The value of the parameter that would be returned without any multiplication by a scaling factor. |
Definition at line 1747 of file MOM_file_parser.F90.
References log_param_real_array(), and read_param_real_array().
|
private |
This subroutine reads the value of a time-type model parameter from a parameter file and logs it in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file and logged |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | static_value | If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | do_not_read | If present and true, do not read a value for this parameter, although it might be logged. |
[in] | do_not_log | If present and true, do not log this parameter to the documentation files |
[in] | timeunit | The number of seconds in a time unit for real-number input to be translated to a time. |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
[in] | log_as_date | If true, log the time_type in date format. The default is false. |
Definition at line 1947 of file MOM_file_parser.F90.
References log_param_time(), and read_param_time().
|
private |
This subtoutine 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.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[out] | found | If true, this parameter has been found in CS |
[out] | defined | If true, this parameter is set (or true) in the CS |
[out] | value_string | A string that encodes the new value |
[in] | paramislogical | If true, this is a logical parameter that can be simply defined without parsing a value_string. |
Definition at line 888 of file MOM_file_parser.F90.
References flag_line_as_read(), input_str_length, overridewarninghasbeenissued(), popblocklevel(), and pushblocklevel().
Referenced by read_param_char(), read_param_char_array(), read_param_int(), read_param_int_array(), read_param_logical(), read_param_real(), read_param_real_array(), and read_param_time().
|
private |
Find position of last character before any comments, As marked by "!", "//", or "/*" following F90, C++, or C syntax.
[in] | string | The input string to process |
Definition at line 465 of file MOM_file_parser.F90.
Referenced by lastnoncommentnonblank(), and openmultilinecomment().
|
private |
Find position of last non-blank character before any comments.
[in] | string | The input string to process |
Definition at line 481 of file MOM_file_parser.F90.
References lastnoncommentindex().
Referenced by populate_param_data(), and removecomments().
|
private |
Log the name and value of a character string model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1445 of file MOM_file_parser.F90.
Referenced by get_param_char(), and get_param_char_array().
|
private |
Log the name and value of an integer model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the module using this parameter |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1278 of file MOM_file_parser.F90.
Referenced by get_param_int().
|
private |
Log the name and values of an array of integer model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the module using this parameter |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1310 of file MOM_file_parser.F90.
Referenced by get_param_int_array().
|
private |
Log the name and value of a logical model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1409 of file MOM_file_parser.F90.
Referenced by get_param_logical().
|
private |
Log the name and value of a real model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1343 of file MOM_file_parser.F90.
Referenced by get_param_real().
|
private |
Log the name and values of an array of real model parameter in documentation files.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1374 of file MOM_file_parser.F90.
Referenced by get_param_real_array().
|
private |
This subroutine writes the value of a time-type parameter to a log file, along with its name and the module it came from.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | modulename | The name of the calling module |
[in] | varname | The name of the parameter to log |
[in] | value | The value of the parameter to log |
[in] | desc | A description of this variable; if not present, this parameter is not written to a doc file |
[in] | units | The units of this parameter |
[in] | default | The default value of the parameter |
[in] | timeunit | The number of seconds in a time unit for real-number output. |
[in] | log_date | If true, log the time_type in date format. If missing the default is false. |
[in] | layoutparam | If present and true, this parameter is logged in the layout parameter file |
[in] | debuggingparam | If present and true, this parameter is logged in the debugging parameter file |
Definition at line 1479 of file MOM_file_parser.F90.
References convert_date_to_string().
Referenced by get_param_time().
|
private |
Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file.
[in] | cs | File parser type |
[in] | modulename | Name of calling module |
[in] | version | Version string of module |
[in] | desc | Module description |
Definition at line 1244 of file MOM_file_parser.F90.
|
private |
Log the version of a module to a log file and/or stdout.
[in] | modulename | Name of calling module |
[in] | version | Version string of module |
Definition at line 1263 of file MOM_file_parser.F90.
subroutine, public mom_file_parser::open_param_file | ( | character(len=*), intent(in) | filename, |
type(param_file_type), intent(inout) | CS, | ||
logical, intent(in), optional | checkable, | ||
character(len=*), intent(in), optional | component, | ||
character(len=*), intent(in), optional | doc_file_dir | ||
) |
Make the contents of a parameter input file availalble in a param_file_type.
[in] | filename | An input file name, optionally with the full path |
[in,out] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | checkable | If this is false, it disables checks of this file for unused parameters. The default is True. |
[in] | component | If present, this component name is used to generate parameter documentation file names; the default is"MOM" |
[in] | doc_file_dir | An optional directory in which to write out the documentation files. The default is effectively './'. |
Definition at line 117 of file MOM_file_parser.F90.
References all_pes_read, complete_doc_default, mom_error_handler::is_root_pe(), minimal_doc_default, and populate_param_data().
Referenced by mom_get_input::get_mom_input().
|
private |
Return True if a /* appears on this line without a closing */.
[in] | string | The input string to process |
Definition at line 437 of file MOM_file_parser.F90.
References lastnoncommentindex().
Referenced by populate_param_data().
subroutine, public mom_file_parser::openparameterblock | ( | type(param_file_type), intent(in) | CS, |
character(len=*), intent(in) | blockName, | ||
character(len=*), intent(in), optional | desc | ||
) |
Tags blockName onto the end of the active parameter block name.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | blockname | The name of a parameter block being added |
[in] | desc | A description of the parameter block being added |
Definition at line 2015 of file MOM_file_parser.F90.
References pushblocklevel().
Referenced by baroclinic_zone_initialization::bcz_params(), and mom_cvmix_kpp::kpp_init().
|
private |
Returns true if an override warning has been issued for the variable varName.
chain | The linked list of variables that have already had override warnings issued | |
[in] | varname | The name of the variable being queried for warnings |
Definition at line 1216 of file MOM_file_parser.F90.
Referenced by get_variable_line().
|
private |
Truncates block name (shallower level of parameter block)
[in] | oldblockname | A sequence of hierarchical parameter block names |
Definition at line 2066 of file MOM_file_parser.F90.
Referenced by closeparameterblock(), and get_variable_line().
|
private |
Read the contents of a parameter input file, and store the contents in a file_data_type after removing comments and simplifying white space.
[in] | iounit | The IO unit number that is open for filename |
[in] | filename | An input file name, optionally with the full path |
[in,out] | param_data | A list of the input lines that set parameters after comments have been stripped out. |
Definition at line 338 of file MOM_file_parser.F90.
References all_pes_read, closemultilinecomment(), input_str_length, mom_error_handler::is_root_pe(), lastnoncommentnonblank(), mom_error_handler::mom_error(), openmultilinecomment(), removecomments(), replacetabs(), and simplifywhitespace().
Referenced by open_param_file().
|
private |
Extends block name (deeper level of parameter block)
[in] | oldblockname | A sequence of hierarchical parameter block names |
[in] | newblockname | A new block name to add to the end of the sequence |
Definition at line 2053 of file MOM_file_parser.F90.
Referenced by get_variable_line(), and openparameterblock().
|
private |
This subroutine reads the value of a character string model parameter from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
Definition at line 711 of file MOM_file_parser.F90.
References get_variable_line(), and strip_quotes().
Referenced by get_param_char().
|
private |
This subroutine reads the values of an array of character string model parameters from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
Definition at line 734 of file MOM_file_parser.F90.
References get_variable_line(), and strip_quotes().
Referenced by get_param_char_array().
|
private |
This subroutine reads the value of an integer model parameter from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
Definition at line 572 of file MOM_file_parser.F90.
References get_variable_line(), and mom_error_handler::mom_error().
Referenced by get_param_int().
|
private |
This subroutine reads the values of an array of integer model parameters from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
Definition at line 604 of file MOM_file_parser.F90.
References get_variable_line(), and mom_error_handler::mom_error().
Referenced by get_param_int_array().
|
private |
This subroutine reads the value of a logical model parameter from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
Definition at line 772 of file MOM_file_parser.F90.
References get_variable_line().
Referenced by get_param_logical().
|
private |
This subroutine reads the value of a real model parameter from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | scale | A scaling factor that the parameter is multiplied by before it is returned. |
Definition at line 637 of file MOM_file_parser.F90.
References get_variable_line(), and mom_error_handler::mom_error().
Referenced by get_param_real().
|
private |
This subroutine reads the values of an array of real model parameters from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[in] | scale | A scaling factor that the parameter is multiplied by before it is returned. |
Definition at line 673 of file MOM_file_parser.F90.
References get_variable_line(), and mom_error_handler::mom_error().
Referenced by get_param_real_array().
|
private |
This subroutine reads the value of a time_type model parameter from a parameter file.
[in] | cs | The control structure for the file_parser module, it is also a structure to parse for run-time parameters |
[in] | varname | The case-sensitive name of the parameter to read |
[in,out] | value | The value of the parameter that may be read from the parameter file |
[in] | timeunit | The number of seconds in a time unit for real-number input. |
[in] | fail_if_missing | If present and true, a fatal error occurs if this variable is not found in the parameter file |
[out] | date_format | If present, this indicates whether this parameter was read in a date format, so that it can later be logged in the same format. |
Definition at line 795 of file MOM_file_parser.F90.
References get_variable_line().
Referenced by get_param_time().
|
private |
Trims comments and leading blanks from string.
[in] | string | The input string to process |
Definition at line 505 of file MOM_file_parser.F90.
References lastnoncommentnonblank().
Referenced by populate_param_data().
|
private |
Returns a string with tabs replaced by a blank.
[in] | string | The input string to process |
Definition at line 489 of file MOM_file_parser.F90.
Referenced by populate_param_data().
|
private |
Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.g. around =)
[in] | string | A string to modify to simpify white space |
Definition at line 518 of file MOM_file_parser.F90.
References mom_error_handler::mom_error().
Referenced by populate_param_data().
|
private |
This function removes single and double quotes from a character string.
val_str | The character string to work on |
Definition at line 865 of file MOM_file_parser.F90.
Referenced by read_param_char(), and read_param_char_array().
|
private |
If true, all PEs read the input files TODO: Eliminate this parameter.
Definition at line 23 of file MOM_file_parser.F90.
Referenced by close_param_file(), open_param_file(), and populate_param_data().
|
private |
Default values for parameters.
Definition at line 30 of file MOM_file_parser.F90.
Referenced by close_param_file(), and open_param_file().
|
private |
Maximum number of characters in file names.
Definition at line 20 of file MOM_file_parser.F90.
|
private |
Maximum line length in parameter file.
Definition at line 19 of file MOM_file_parser.F90.
Referenced by get_variable_line(), and populate_param_data().
|
private |
Default values for parameters.
Definition at line 29 of file MOM_file_parser.F90.
Referenced by close_param_file().
integer, parameter, public mom_file_parser::max_param_files = 5 |
Maximum number of parameter files.
Definition at line 18 of file MOM_file_parser.F90.
|
private |
Default values for parameters.
Definition at line 31 of file MOM_file_parser.F90.
Referenced by close_param_file(), and open_param_file().
|
private |
Default values for parameters.
Definition at line 27 of file MOM_file_parser.F90.
Referenced by close_param_file().
|
private |
Default values for parameters.
Definition at line 28 of file MOM_file_parser.F90.
Referenced by close_param_file().