FMS
2024.03
Flexible Modeling System
|
Reads entries from a field table and stores this information along with the type of field it belongs to. More...
Data Types | |
type | field_def |
Private type for internal use. More... | |
type | field_mgr_type |
Private type for internal use. More... | |
type | field_names_type |
Private type for internal use. More... | |
type | field_names_type_short |
Private type for internal use. More... | |
interface | find_field_index |
Returns an index corresponding to the given field name. More... | |
interface | fm_get_value |
An overloaded function to find and extract a value for a named field. More... | |
type | fm_list_iter_type |
Iterator over the field manager list. More... | |
interface | fm_loop_over_list |
A function for looping over a list. More... | |
interface | fm_new_value |
An overloaded function to assign a value to a field. More... | |
type | method_type |
This method_type is a way to allow a component module to alter the parameters it needs for various tracers. More... | |
type | method_type_short |
This method_type is the same as method_type except that the method_control string is not present. This is used when you wish to change to a scheme within a module but do not need to pass parameters. See method_type for member information. More... | |
type | method_type_very_short |
This is the same as method_type except that the method_control and method_name strings are not present. This is used when you wish to change to a scheme within a module but do not need to pass parameters. More... | |
interface | parse |
A function to parse an integer or an array of integers, a real or an array of reals, a string or an array of strings. More... | |
Functions/Subroutines | |
subroutine | check_for_name_duplication |
subroutine | concat_strings (str1, str2) |
private function: appends str2 to the end of str1, with length check | |
type(field_def) function, pointer, private | create_field (parent_p, name) |
A function to create a field as a child of parent_p. This will return a pointer to a field_def type. More... | |
logical recursive function, private | dump_list (list_p, recursive, depth, out_unit) |
This is a function that lists the parameters of a field. More... | |
subroutine, public | field_manager_end |
Destructor for field manager. More... | |
subroutine, public | field_manager_init (nfields, table_name) |
Routine to initialize the field manager. More... | |
subroutine, private | find_base (name, path, base) |
A subroutine that splits a listname into a path and a base. More... | |
type(field_def) function, pointer, private | find_field (name, this_list_p) |
Find and return a pointer to the field in the specified list. Return a null pointer on error. More... | |
integer function, public | find_field_index_new (field_name) |
integer function, public | find_field_index_old (model, field_name) |
Function to return the index of the field. More... | |
subroutine, private | find_head (name, head, rest) |
Find the first list for a name by splitting the name into a head and the rest. More... | |
type(field_def) function, pointer, private | find_list (path, relative_p, create) |
Find and return a pointer to the specified list, relative to relative_p. Return a null pointer on error. More... | |
recursive logical function | find_method (list_p, recursive, num_meth, method, control) |
Given a field list pointer this function retrieves methods and associated parameters for the field list. More... | |
logical function, public | fm_change_list (name) |
Change the current list. Return true on success, false otherwise. More... | |
logical function, public | fm_change_root (name) |
Change the root list. More... | |
integer function, public | fm_copy_list (list_name, suffix, create) |
A function that allows the user to copy a field and add a suffix to the name of the new field. More... | |
logical function, public | fm_dump_list (name, recursive, unit) |
A function to list properties associated with a field. More... | |
logical function, public | fm_exists (name) |
A function to test whether a named field exists. More... | |
logical function, public | fm_find_methods (list_name, methods, control) |
This function retrieves all the methods associated with a field. More... | |
character(len=fms_path_len) function, public | fm_get_current_list () |
A function to return the full path of the current list. More... | |
integer function, public | fm_get_index (name) |
A function to return the index of a named field. More... | |
integer function, public | fm_get_length (name) |
A function to return how many elements are contained within the named list or entry. More... | |
character(len=8) function, public | fm_get_type (name) |
A function to return the type of the named field. More... | |
logical function, public | fm_get_value_integer (name, get_ival, index) |
logical function, public | fm_get_value_logical (name, get_lval, index) |
logical function, public | fm_get_value_string (name, get_sval, index) |
subroutine, public | fm_init_loop (loop_list, iter) |
given a name of the list, prepares an iterator over the list content. If the name of the given list is blank, then the current list is used More... | |
logical function | fm_loop_over_list_new (iter, name, field_type, index) |
given a list iterator, returns information about curren list element and advances the iterator to the next list element. At the end of the list, returns FALSE More... | |
logical function | fm_loop_over_list_old (list, name, field_type, index) |
Iterates through the given list. More... | |
logical function, public | fm_modify_name (oldname, newname) |
This function allows a user to rename a field without modifying the contents of the field. More... | |
integer function, public | fm_new_list (name, create, keep) |
A function to create a new list. More... | |
integer function, public | fm_new_value_integer (name, new_ival, create, index, append) |
Assigns a given value to a given field. More... | |
integer function, public | fm_new_value_logical (name, new_lval, create, index, append) |
Assigns a given value to a given field. More... | |
integer function, public | fm_new_value_string (name, new_sval, create, index, append) |
Assigns a given value to a given field. More... | |
logical function, public | fm_query_method (name, method_name, method_control) |
This is a function that provides the capability to return parameters associated with a field in a pair of strings. More... | |
subroutine, public | fm_reset_loop |
Resets the loop variable. For use in conjunction with fm_loop_over_list. | |
subroutine, public | fm_return_root |
Return the root list to the value at initialization. More... | |
type(field_def) function, pointer, private | get_field (name, this_list_p) |
Return a pointer to the field if it exists relative to this_list_p, null otherwise. More... | |
subroutine, public | get_field_info (n, fld_type, fld_name, model, num_methods) |
This routine allows access to field information given an index. More... | |
subroutine, public | get_field_method (n, m, method) |
A routine to get a specified method. More... | |
subroutine, public | get_field_methods (n, methods) |
A routine to obtain all the methods associated with a field. More... | |
subroutine, private | initialize_module_variables |
A function to initialize the values of the pointers. This will remove all fields and reset the field tree to only the root field. | |
type(field_def) function, pointer, private | make_list (this_list_p, name) |
This function creates a new field and returns a pointer to that field. More... | |
subroutine | new_name (list_name, method_name_in, val_name_in) |
Subroutine to add new values to list parameters. More... | |
subroutine | new_name_yaml (list_name, method_name_in, val_name_in) |
Subroutine to add new values to list parameters. More... | |
integer function | parse_integer (text, label, parse_ival) |
function | parse_integers (text, label, values) |
integer function | parse_string (text, label, parse_sval) |
function | parse_strings (text, label, values) |
recursive logical function | query_method (list_p, recursive, name, method_name, method_control) |
A private function that can recursively recover values for parameters associated with a field. More... | |
subroutine | read_field_table_legacy (nfields, table_name) |
Routine to read and parse the field table yaml. More... | |
subroutine | read_field_table_yaml (nfields, table_name) |
Routine to read and parse the field table yaml. More... | |
logical function | set_list_stuff () |
If the the pointer matches to the right list, extract the field information. Used in fm_loop_over_list. More... | |
subroutine | strip_front_blanks (name) |
A routine to strip whitespace from the start of character strings. More... | |
Variables | |
type(field_def), pointer | current_list_p => NULL() |
type(method_type), public | default_method |
character(len=fm_type_name_len), dimension(num_types) | field_type_name |
type(field_mgr_type), dimension(:), allocatable, private | fields |
fields of field_mgr_type | |
integer, parameter, public | fm_field_name_len = 48 |
The length of a character string representing the field name. | |
integer, parameter, public | fm_path_name_len = FMS_PATH_LEN |
The length of a character string representing the field path. | |
integer, parameter, public | fm_string_len = 1024 |
The length of a character string representing character values for the field. | |
integer, parameter, public | fm_type_name_len = 8 |
The length of a character string representing the various types that the values of the field can take. | |
character(len=fms_path_len) | loop_list |
type(field_def), pointer | loop_list_p => NULL() |
integer, parameter, public | model_atmos = 1 |
Atmospheric model. | |
integer, parameter, public | model_coupler = 5 |
Ice model. | |
integer, parameter, public | model_ice = 4 |
Ice model. | |
integer, parameter, public | model_land = 3 |
Land model. | |
character(len=11), dimension(num_models), parameter, public | model_names =(/'atmospheric','oceanic ','land ','ice ','coupler '/) |
Model names, e.g. MODEL_NAMES(MODEL_OCEAN) is 'oceanic'. | |
integer, parameter, public | model_ocean = 2 |
Ocean model. | |
integer, parameter, public | no_field = -1 |
The value returned if a field is not defined. | |
integer | num_fields = 0 |
integer, parameter, public | num_models = 5 |
Number of models (ATMOS, OCEAN, LAND, ICE, COUPLER). | |
type(field_def), target, save | root |
type(field_def), pointer | root_p => NULL() |
character(len=fm_field_name_len) | save_root_name |
type(field_def), pointer | save_root_parent_p => NULL() |
character(len=52) | set = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
character(len=50) | set_nonexp = "ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz" |
character(len=13) | setnum = "0123456789+-." |
logical | use_field_table_yaml = .false. |
.True. if using the field_table.yaml, .false. if using the legacy field_table | |
Reads entries from a field table and stores this information along with the type of field it belongs to.
This allows the component models to query the field manager to see if non-default methods of operation are desired. In essence the field table is a powerful type of namelist. Default values can be provided for all the fields through a namelist, individual fields can be modified through the field table however.
An example of field table entries could be
"tracer","atmos_mod","sphum" "tracer","atmos_mod","sf6" "longname","sulf_hex" "advection_scheme_horiz","2nd_order" "Profile_type","Fixed","surface_value = 0.0E+00"/ "prog_tracers","ocean_mod","age_global" horizontal-advection-scheme = mdfl_sweby vertical-advection-scheme = mdfl_sweby restart_file = ocean_age.res.nc
The field table consists of entries in the following format.
The first line of an entry should consist of three quoted strings.
The first quoted string will tell the field manager what type of field it is.
The second quoted string will tell the field manager which model the field is being applied to. The supported types at present are
"coupler_mod" for the coupler, "atmos_mod" for the atmosphere model, "ocean_mod" for the ocean model, "land_mod" for the land model, and, "ice_mod" for the ice model.
The third quoted string should be a unique name that can be used as a query.
The second and following lines of each entry are called methods in this context. Methods can be developed within any module and these modules can query the field manager to find any methods that are supplied in the field table.
These lines can be coded quite flexibly.
The line can consist of two or three quoted strings or a simple unquoted string.
If the line consists two or three quoted strings, then the first string will be an identifier that the querying module will ask for.
The second string will be a name that the querying module can use to set up values for the module.
The third string, if present, can supply parameters to the calling module that can be parsed and used to further modify values.
If the line consists of a simple unquoted string then quotes are not allowed in any part of the line.
An entry is ended with a backslash (/) as the final character in a row.
Comments can be inserted in the field table by having a # as the first character in the line.
In the example above we have three field entries.
The first is a simple declaration of a tracer called "sphum".
The second is for a tracer called "sf6". In this case a field named "longname" will be given the value "sulf_hex". A field named "advection_scheme_horiz" will be given the value "2nd_order". Finally a field name "Profile_type" will be given a child field called "Fixed", and that field will be given a field called "surface_value" with a real value of 0.0E+00.
The third entry is an example of a oceanic age tracer. Note that the method lines are formatted differently here. This is the flexibility mentioned above.
With these formats, a number of restrictions are required.
The following formats are equally valid.
"longname","sulf_hex" "longname = sulf_hex" longname = sulf_hex
However the following is not valid.
longname = "sulf_hex"
In the SF6 example above the last line of the entry could be written in the following ways.
"Profile_type","Fixed","surface_value = 0.0E+00"/ Profile_type/Fixed/surface_value = 0.0E+00/
Values supplied with fields are converted to the various types with the following assumptions.
Real values : These values contain a decimal point or are in exponential format. These values only support e or E format for exponentials. e.g. 10.0, 1e10 and 1E10 are considered to be real numbers. Integer values : These values only contain numbers. e.g 10 is an integer. 10.0 and 1e10 are not. Logical values : These values are supplied as one of the following formats. T, .T., TRUE, .TRUE. t, .t., true, .true. F, .F., FALSE, .FALSE. f, .f., false, .false. These will be converted to T or F in a dump of the field. Character strings : These values are assumed to be strings if a character other than an e (or E) is in the value. Numbers can be suppled in the value. If the value does not meet the criteria for a real, integer or logical type, it is assumed to be a character type.
The entries within the field table can be designed by the individual authors of code to allow modification of their routines.
type field_manager_mod::field_def |
Private type for internal use.
Definition at line 490 of file field_manager.F90.
Private Attributes | |
integer | array_dim |
integer | field_type |
type(field_def), pointer | first_field => NULL() |
integer, dimension(:), allocatable | i_value |
integer | index |
logical, dimension(:), allocatable | l_value |
type(field_def), pointer | last_field => NULL() |
integer | length |
integer | max_index |
character(len=fm_field_name_len) | name |
type(field_def), pointer | next => NULL() |
type(field_def), pointer | parent => NULL() |
type(field_def), pointer | prev => NULL() |
real(r8_kind), dimension(:), allocatable | r_value |
string to real conversion will be done at r8; all real values will be stored as r8_kind. | |
character(len=fm_string_len), dimension(:), allocatable | s_value |
type field_manager_mod::field_mgr_type |
Private type for internal use.
Definition at line 464 of file field_manager.F90.
Private Attributes | |
character(len=fm_string_len) | field_name |
character(len=fm_field_name_len) | field_type |
type(method_type), dimension(:), allocatable | methods |
methods associated with this field name | |
integer | model |
integer | num_methods |
type field_manager_mod::field_names_type |
Private type for internal use.
Definition at line 475 of file field_manager.F90.
Private Attributes | |
character(len=fm_string_len) | fld_name |
character(len=fm_field_name_len) | fld_type |
character(len=fm_field_name_len) | mod_name |
type field_manager_mod::field_names_type_short |
Private type for internal use.
Definition at line 483 of file field_manager.F90.
Private Attributes | |
character(len=fm_field_name_len) | fld_type |
character(len=fm_field_name_len) | mod_name |
interface field_manager_mod::find_field_index |
Returns an index corresponding to the given field name.
Model number can be given for old method.
Example usage:
Definition at line 350 of file field_manager.F90.
Private Member Functions | |
integer function | find_field_index_new (field_name) |
integer function | find_field_index_old (model, field_name) |
Function to return the index of the field. More... | |
|
private |
[in] | field_name | The path to the name of the field that an index is being requested for. |
Definition at line 1434 of file field_manager.F90.
|
private |
Function to return the index of the field.
This function when passed a model number and a field name will return the index of the field within the field manager. This index can be used to access other information from the field manager.
[in] | model | The number indicating which model is used. |
[in] | field_name | The name of the field that an index is being requested for. |
Definition at line 1414 of file field_manager.F90.
interface field_manager_mod::fm_get_value |
An overloaded function to find and extract a value for a named field.
Find and extract the value for name. The value may be of type real, integer, logical or character. If a single value from an array of values is required, an optional index can be supplied. Return true for success and false for failure
Example usage:
Definition at line 415 of file field_manager.F90.
Private Member Functions | |
logical function | fm_get_value_integer (name, get_ival, index) |
logical function | fm_get_value_logical (name, get_lval, index) |
fm_get_value_real_r4 | |
fm_get_value_real_r8 | |
logical function | fm_get_value_string (name, get_sval, index) |
|
private |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_ival | The value associated with the named field. |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2292 of file field_manager.F90.
|
private |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_lval | The value associated with the named field |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2349 of file field_manager.F90.
|
private |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_sval | The value associated with the named field |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2407 of file field_manager.F90.
type field_manager_mod::fm_list_iter_type |
Iterator over the field manager list.
Definition at line 334 of file field_manager.F90.
Public Attributes | |
type(field_def), pointer | ptr => NULL() |
pointer to the current field | |
interface field_manager_mod::fm_loop_over_list |
A function for looping over a list.
Loop over the list, setting the name, type and index of the next field. Return false at the end of the loop.
Example usage:
Definition at line 432 of file field_manager.F90.
Private Member Functions | |
logical function | fm_loop_over_list_new (iter, name, field_type, index) |
given a list iterator, returns information about curren list element and advances the iterator to the next list element. At the end of the list, returns FALSE More... | |
logical function | fm_loop_over_list_old (list, name, field_type, index) |
Iterates through the given list. More... | |
|
private |
given a list iterator, returns information about curren list element and advances the iterator to the next list element. At the end of the list, returns FALSE
[in,out] | iter | list iterator |
[out] | name | name of the current list item |
[out] | field_type | type of the field |
[out] | index | index in the list |
Definition at line 2551 of file field_manager.F90.
|
private |
Iterates through the given list.
[in] | list | Name of a list to loop over |
[out] | name | name of a field from list |
[out] | field_type | type of a list entry |
[out] | index | index of the field within the list |
Definition at line 2465 of file field_manager.F90.
interface field_manager_mod::fm_new_value |
An overloaded function to assign a value to a field.
Allocate and initialize a new value and return the index. If an error condition occurs the parameter NO_FIELD is returned.
If the type of the field is changing (e.g. real values being transformed to integers), then any previous values for the field are removed and replaced by the value passed in the present call to this function.
If append is present and .true., then index cannot be greater than 0 if it is present.
Example usage:
Definition at line 396 of file field_manager.F90.
Private Member Functions | |
integer function | fm_new_value_integer (name, new_ival, create, index, append) |
Assigns a given value to a given field. More... | |
integer function | fm_new_value_logical (name, new_lval, create, index, append) |
Assigns a given value to a given field. More... | |
fm_new_value_real_r4 | |
fm_new_value_real_r8 | |
integer function | fm_new_value_string (name, new_sval, create, index, append) |
Assigns a given value to a given field. More... | |
|
private |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_ival | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to an array of the present values. If present and .true., then index cannot be greater than 0. |
Definition at line 2639 of file field_manager.F90.
|
private |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_lval | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to an array of the present values. If present and .true., then index cannot be greater than 0. |
Definition at line 2779 of file field_manager.F90.
|
private |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_sval | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to |
Definition at line 2913 of file field_manager.F90.
type field_manager_mod::method_type |
This method_type is a way to allow a component module to alter the parameters it needs for various tracers.
In essence this is a way to modify a namelist. A namelist can supply default parameters for all tracers. This method will allow the user to modify these default parameters for an individual tracer. An example could be that the user wishes to use second order advection on a tracer and also use fourth order advection on a second tracer within the same model run. The default advection could be second order and the field table would then indicate that the second tracer requires fourth order advection. This would be parsed by the advection routine.
Definition at line 300 of file field_manager.F90.
Public Attributes | |
character(len=fm_string_len) | method_control |
This is the string containing parameters that the module can use as values for a field method. These should override default values within the module. | |
character(len=fm_string_len) | method_name |
This is the name of a method which the module can parse and use to assign different default values to a field method. | |
character(len=fm_string_len) | method_type |
This string represents a tag that a module using this method can key on. Typically this should contain some reference to the module that is calling it. | |
type field_manager_mod::method_type_short |
This method_type is the same as method_type except that the method_control string is not present. This is used when you wish to change to a scheme within a module but do not need to pass parameters. See method_type for member information.
Definition at line 318 of file field_manager.F90.
Public Attributes | |
character(len=fm_string_len) | method_name |
character(len=fm_string_len) | method_type |
type field_manager_mod::method_type_very_short |
This is the same as method_type except that the method_control and method_name strings are not present. This is used when you wish to change to a scheme within a module but do not need to pass parameters.
Definition at line 328 of file field_manager.F90.
Public Attributes | |
character(len=fm_string_len) | method_type |
interface field_manager_mod::parse |
A function to parse an integer or an array of integers, a real or an array of reals, a string or an array of strings.
Parse is an integer function that decodes values from a text string. The text string has the form: "label=list" where "label" is an arbitrary user defined label describing the values being decoded, and "list" is a list of one or more values separated by commas. The values may be integer, real, or character. Parse returns the number of values decoded.
Example usage:
Definition at line 369 of file field_manager.F90.
Private Member Functions | |
integer function | parse_integer (text, label, parse_ival) |
function | parse_integers (text, label, values) |
parse_real_r4 | |
parse_real_r8 | |
parse_reals_r4 | |
parse_reals_r8 | |
integer function | parse_string (text, label, parse_sval) |
function | parse_strings (text, label, values) |
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | parse_ival | The value or values that have been decoded. |
Definition at line 1527 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | values | The value or values that have been decoded. |
Definition at line 1511 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | parse_sval | The value or values that have been decoded. |
Definition at line 1539 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | values | The value or values that have been decoded. |
Definition at line 1519 of file field_manager.F90.
|
private |
A function to create a field as a child of parent_p. This will return a pointer to a field_def type.
Allocate and initialize a new field in parent_p list. Return a pointer to the field on success, or a null pointer on failure.
Example usage:
parent_p | A pointer to the parent of the field that is to be created | |
[in] | name | The name of the field that is to be created |
Definition at line 1561 of file field_manager.F90.
|
private |
This is a function that lists the parameters of a field.
Given a pointer to a list, this function prints out the fields, and subfields, if recursive is true, associated with the list.
This is most likely to be used through fm_dump_list.
Example usage:
list_p | pointer to the field to be printed out | |
[in] | recursive | flag to make function recursively print subfields |
[in] | depth | Listing will be padded so that 'depth' spaces appear before the field being printed |
[in] | out_unit | unit number to print to |
Definition at line 1626 of file field_manager.F90.
subroutine, public field_manager_mod::field_manager_end |
Destructor for field manager.
This subroutine deallocates allocated variables (if allocated) and changes the initialized flag to false.
Definition at line 1386 of file field_manager.F90.
subroutine, public field_manager_mod::field_manager_init | ( | integer, intent(out), optional | nfields, |
character(len=fm_string_len), intent(in), optional | table_name | ||
) |
Routine to initialize the field manager.
This routine reads from a file containing yaml paramaters. These yaml parameters contain information on which schemes are needed within various modules. The field manager does not initialize any of those schemes however. It simply holds the information and is queried by the appropriate module.
The routine has two loops. The first loop initializes the my_table object and counts the number of fields contained therein. The second loop is the main loop that acts on each field in the my_table object, defining a list object (in the field_manager definition) from which various fm routines may be called, as well as populating the "fields" object and the "methods" objects within each field object. The "fields" and "methods" objects are then used with the subroutine new_name to append various characteristics to the list object. Note that the "fields" and "methods" objects are also used with other fm routines in a bit of a parallel system.
[out] | nfields | number of fields |
[in] | table_name | Name of the field table, default |
Definition at line 556 of file field_manager.F90.
|
private |
A subroutine that splits a listname into a path and a base.
Find the base name for a list by splitting the list name into a path and base. The base is the last field within name, while the path is the preceding section of name. The base string can then be used to query for values associated with name.
[in] | name | list name for a field |
[out] | path | path of the base field |
[out] | base | A string which can be used to query for values associated with name |
Definition at line 1755 of file field_manager.F90.
|
private |
Find and return a pointer to the field in the specified list. Return a null pointer on error.
Find and return a pointer to the field in the specified list. Return a null pointer on error. Given a pointer to a field, this function searchs for "name" as a sub field.
[in] | name | The name of a field that the user wishes to find |
this_list_p | A pointer to a list which the user wishes to search for a field "name". |
Definition at line 1812 of file field_manager.F90.
integer function, public field_manager_mod::find_field_index_new | ( | character(len=*), intent(in) | field_name | ) |
[in] | field_name | The path to the name of the field that an index is being requested for. |
Definition at line 1434 of file field_manager.F90.
integer function, public field_manager_mod::find_field_index_old | ( | integer, intent(in) | model, |
character(len=*), intent(in) | field_name | ||
) |
Function to return the index of the field.
This function when passed a model number and a field name will return the index of the field within the field manager. This index can be used to access other information from the field manager.
[in] | model | The number indicating which model is used. |
[in] | field_name | The name of the field that an index is being requested for. |
Definition at line 1414 of file field_manager.F90.
|
private |
Find the first list for a name by splitting the name into a head and the rest.
Find the first list for a name by splitting the name into a head and the rest. The head is the first field within name, while rest is the remaining section of name. The head string can then be used to find other fields that may be associated with name.
[in] | name | The name of a field of interest |
[out] | head | the first field within name |
[out] | rest | the remaining section of name |
Definition at line 1857 of file field_manager.F90.
|
private |
Find and return a pointer to the specified list, relative to relative_p. Return a null pointer on error.
This function, when supplied a pointer to a field and a name of a second field relative to that pointer, will find a list and return the pointer to the second field. If create is .true. and the second field does not exist, it will be created.
[in] | path | path to the list of interest |
relative_p | pointer to the list to which "path" is relative to | |
[in] | create | If the list does not exist, it will be created if set to true |
Definition at line 1903 of file field_manager.F90.
|
private |
Given a field list pointer this function retrieves methods and associated parameters for the field list.
list_p | A pointer to the field of interest | |
[in] | recursive | If true, search recursively for fields |
[in,out] | num_meth | The number of methods found |
[out] | method | The methods associated with the field pointed to by list_p |
[out] | control | The control parameters for the methods found |
Definition at line 3567 of file field_manager.F90.
logical function, public field_manager_mod::fm_change_list | ( | character(len=*), intent(in) | name | ) |
Change the current list. Return true on success, false otherwise.
This function changes the currect list to correspond to the list named name. If the first character of name is the list separator (/) then the list will search for "name" starting from the root of the field tree. Otherwise it will search for name starting from the current list.
[in] | name | name of a list to change to |
Definition at line 1991 of file field_manager.F90.
logical function, public field_manager_mod::fm_change_root | ( | character(len=*), intent(in) | name | ) |
Change the root list.
This function changes the root of the field tree to correspond to the field named name. An example of a use of this would be if code is interested in a subset of fields with a common base. This common base could be set using fm_change_root and fields could be referenced using this root.
This function should be used in conjunction with fm_return_root.
[in] | name | name of the field which the user wishes to become the root. |
Definition at line 2023 of file field_manager.F90.
integer function, public field_manager_mod::fm_copy_list | ( | character(len=*), intent(in) | list_name, |
character(len=*), intent(in) | suffix, | ||
logical, intent(in), optional | create | ||
) |
A function that allows the user to copy a field and add a suffix to the name of the new field.
Given the name of a pre-existing field and a suffix, this function will create a new field. The name of the new field will be that of the old field with a suffix supplied by the user.
[in] | list_name | name of a field that the user wishes to copy |
[in] | suffix | suffix that will be added to list_name when field is copied |
[in] | create | flag to create new list if applicable |
Definition at line 3417 of file field_manager.F90.
logical function, public field_manager_mod::fm_dump_list | ( | character(len=*), intent(in) | name, |
logical, intent(in), optional | recursive, | ||
integer, intent(in), optional | unit | ||
) |
A function to list properties associated with a field.
This function writes the contents of the field named "name" to stdout. If recursive is present and .true., then this function writes out the contents of any subfields associated with the field named "name".
[in] | name | The name of the field for which output is requested. |
[in] | recursive | If present and .true., then a recursive listing of fields will be performed. |
[in] | unit | file to print to |
Definition at line 2074 of file field_manager.F90.
logical function, public field_manager_mod::fm_exists | ( | character(len=*), intent(in) | name | ) |
A function to test whether a named field exists.
This function determines is a field exists, relative to the current list, and returns true if the list exists, false otherwise.
[in] | name | The name of the field that is being queried |
Definition at line 2118 of file field_manager.F90.
logical function, public field_manager_mod::fm_find_methods | ( | character(len=*), intent(in) | list_name, |
character(len=*), dimension(:), intent(out) | methods, | ||
character(len=*), dimension(:), intent(out) | control | ||
) |
This function retrieves all the methods associated with a field.
This is different from fm_query_method in that this function gets all the methods associated as opposed to 1 method.
[in] | list_name | The name of a list that the user wishes to find methods for |
[out] | methods | An array of the methods associated with list_name |
[out] | control | An array of the parameters associated with methods |
Definition at line 3521 of file field_manager.F90.
character(len=fms_path_len) function, public field_manager_mod::fm_get_current_list |
A function to return the full path of the current list.
This function returns the full path for the current list. A blank path indicates an error condition has occurred.
Definition at line 2175 of file field_manager.F90.
integer function, public field_manager_mod::fm_get_index | ( | character(len=*), intent(in) | name | ) |
A function to return the index of a named field.
Returns the index for name, returns the parameter NO_FIELD if it does not exist. If the first character of the named field is the list peparator, then the named field will be relative to the root of the field tree. Otherwise the named field will be relative to the current list.
[in] | name | The name of a field that the user wishes to get an index for |
Definition at line 2141 of file field_manager.F90.
integer function, public field_manager_mod::fm_get_length | ( | character(len=*), intent(in) | name | ) |
A function to return how many elements are contained within the named list or entry.
This function returns the list or entry length for the named list or entry. If the named field or entry does not exist, a value of 0 is returned.
[in] | name | The name of a list or entry that the user wishes to get the length of |
Definition at line 2219 of file field_manager.F90.
character(len=8) function, public field_manager_mod::fm_get_type | ( | character(len=*), intent(in) | name | ) |
A function to return the type of the named field.
This function returns the type of the field for name. This indicates whether the named field is a "list" (has children fields), or has values of type "integer", "real", "logical" or "string". If it does not exist it returns a blank string.
[in] | name | The name of a field that the user wishes to find the type of |
Definition at line 2260 of file field_manager.F90.
logical function, public field_manager_mod::fm_get_value_integer | ( | character(len=*), intent(in) | name, |
integer, intent(out) | get_ival, | ||
integer, intent(in), optional | index | ||
) |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_ival | The value associated with the named field. |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2292 of file field_manager.F90.
logical function, public field_manager_mod::fm_get_value_logical | ( | character(len=*), intent(in) | name, |
logical, intent(out) | get_lval, | ||
integer, intent(in), optional | index | ||
) |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_lval | The value associated with the named field |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2349 of file field_manager.F90.
logical function, public field_manager_mod::fm_get_value_string | ( | character(len=*), intent(in) | name, |
character(len=*), intent(out) | get_sval, | ||
integer, intent(in), optional | index | ||
) |
[in] | name | The name of a field that the user wishes to get a value for. |
[out] | get_sval | The value associated with the named field |
[in] | index | An optional index to retrieve a single value from an array. |
Definition at line 2407 of file field_manager.F90.
subroutine, public field_manager_mod::fm_init_loop | ( | character(len=*), intent(in) | loop_list, |
type(fm_list_iter_type), intent(out) | iter | ||
) |
given a name of the list, prepares an iterator over the list content. If the name of the given list is blank, then the current list is used
[in] | loop_list | name of the list to iterate over |
[out] | iter | loop iterator |
Definition at line 2534 of file field_manager.F90.
|
private |
given a list iterator, returns information about curren list element and advances the iterator to the next list element. At the end of the list, returns FALSE
[in,out] | iter | list iterator |
[out] | name | name of the current list item |
[out] | field_type | type of the field |
[out] | index | index in the list |
Definition at line 2551 of file field_manager.F90.
|
private |
Iterates through the given list.
[in] | list | Name of a list to loop over |
[out] | name | name of a field from list |
[out] | field_type | type of a list entry |
[out] | index | index of the field within the list |
Definition at line 2465 of file field_manager.F90.
logical function, public field_manager_mod::fm_modify_name | ( | character(len=*), intent(in) | oldname, |
character(len=*), intent(in) | newname | ||
) |
This function allows a user to rename a field without modifying the contents of the field.
Function to modify the name of a field. Should be used with caution.
[in] | oldname | The name of a field that the user wishes to change the name of |
[in] | newname | The name that the user wishes to change the name of the field to. |
Definition at line 3119 of file field_manager.F90.
integer function, public field_manager_mod::fm_new_list | ( | character(len=*), intent(in) | name, |
logical, intent(in), optional | create, | ||
logical, intent(in), optional | keep | ||
) |
A function to create a new list.
Allocate and initialize a new list and return the index of the list. If an error occurs return the parameter NO_FIELD.
[in] | name | Name of a list that user wishes to create |
[in] | create | If present and true, create the list if it does not exist |
[in] | keep | If present and true, make this list the current list |
Definition at line 2578 of file field_manager.F90.
integer function, public field_manager_mod::fm_new_value_integer | ( | character(len=*), intent(in) | name, |
integer, intent(in) | new_ival, | ||
logical, intent(in), optional | create, | ||
integer, intent(in), optional | index, | ||
logical, intent(in), optional | append | ||
) |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_ival | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to an array of the present values. If present and .true., then index cannot be greater than 0. |
Definition at line 2639 of file field_manager.F90.
integer function, public field_manager_mod::fm_new_value_logical | ( | character(len=*), intent(in) | name, |
logical, intent(in) | new_lval, | ||
logical, intent(in), optional | create, | ||
integer, intent(in), optional | index, | ||
logical, intent(in), optional | append | ||
) |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_lval | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to an array of the present values. If present and .true., then index cannot be greater than 0. |
Definition at line 2779 of file field_manager.F90.
integer function, public field_manager_mod::fm_new_value_string | ( | character(len=*), intent(in) | name, |
character(len=*), intent(in) | new_sval, | ||
logical, intent(in), optional | create, | ||
integer, intent(in), optional | index, | ||
logical, intent(in), optional | append | ||
) |
Assigns a given value to a given field.
[in] | name | The name of a field that the user wishes to create a value for. |
[in] | new_sval | The value that the user wishes to apply to the named field. |
[in] | create | If present and .true., then a value for this field will be created. |
[in] | index | The index to an array of values that the user wishes to apply a new value. |
[in] | append | If present and .true., then append the value to |
Definition at line 2913 of file field_manager.F90.
logical function, public field_manager_mod::fm_query_method | ( | character(len=*), intent(in) | name, |
character(len=*), intent(out) | method_name, | ||
character(len=*), intent(out) | method_control | ||
) |
This is a function that provides the capability to return parameters associated with a field in a pair of strings.
Given a name return a list of method names and control strings. This function should return strings similar to those in the field table if a comma delimited format is being used.
[in] | name | name of a list that the user wishes to change to |
[out] | method_name | name of a parameter associated with the named field |
[out] | method_control | value of parameters associated with the named field |
Definition at line 3261 of file field_manager.F90.
subroutine, public field_manager_mod::fm_return_root |
Return the root list to the value at initialization.
For use in conjunction with fm_change_root.
Users should use this routine before leaving their routine if they previously used fm_change_root.
Definition at line 3065 of file field_manager.F90.
|
private |
Return a pointer to the field if it exists relative to this_list_p, null otherwise.
[in] | name | The name of a list that the user wishes to get information for |
this_list_p | A pointer to a list that serves as the base point for searching for name |
Definition at line 3084 of file field_manager.F90.
subroutine, public field_manager_mod::get_field_info | ( | integer, intent(in) | n, |
character (len=*), intent(out) | fld_type, | ||
character (len=*), intent(out) | fld_name, | ||
integer, intent(out) | model, | ||
integer, intent(out) | num_methods | ||
) |
This routine allows access to field information given an index.
When passed an index, this routine will return the type of field, the name of the field, the model which the field is associated and the number of methods associated with the field.
Example usage:
[in] | n | index of field |
[out] | fld_type | field type |
[out] | fld_name | name of the field |
[out] | model | number indicating which model is used |
[out] | num_methods | number of methods |
Definition at line 1455 of file field_manager.F90.
subroutine, public field_manager_mod::get_field_method | ( | integer, intent(in) | n, |
integer, intent(in) | m, | ||
type(method_type), intent(inout) | method | ||
) |
A routine to get a specified method.
This routine, when passed a field index and a method index will return the method text associated with the field(n) method(m).
[in] | n | index of field |
[in] | m | index of method |
[in,out] | method | the m-th method of field with index n |
Definition at line 1475 of file field_manager.F90.
subroutine, public field_manager_mod::get_field_methods | ( | integer, intent(in) | n, |
type(method_type), dimension(:), intent(inout) | methods | ||
) |
A routine to obtain all the methods associated with a field.
When passed a field index, this routine will return the text associated with all the methods attached to the field.
[in] | n | field index |
[in,out] | methods | an array of methods for field with index n |
Definition at line 1492 of file field_manager.F90.
|
private |
This function creates a new field and returns a pointer to that field.
Allocate and initialize a new list in this_list_p list.
this_list_p | Base of a list that the user wishes to add a list to | |
[in] | name | name of a list that the user wishes to create |
Definition at line 3217 of file field_manager.F90.
|
private |
Subroutine to add new values to list parameters.
This subroutine uses input strings list_name, method_name and val_name_in to add new values to the list. Given list_name a new list item is created that is named method_name and is given the value or values in val_name_in. If there is more than 1 value in val_name_in, these values should be comma-separated.
[in] | list_name | The name of the field that is of interest here. |
[in] | method_name_in | The name of the method that values are being supplied for. |
[in,out] | val_name_in | The value or values that will be parsed and used as the value when creating a new field or fields. |
Definition at line 1202 of file field_manager.F90.
|
private |
Subroutine to add new values to list parameters.
This subroutine uses input strings list_name, method_name and val_name_in to add new values to the list. Given list_name a new list item is created that is named method_name and is given the value or values in val_name_in. If there is more than 1 value in val_name_in, these values should be comma-separated.
[in] | list_name | The name of the field that is of interest here. |
[in] | method_name_in | The name of the method that values are being supplied for. |
[in,out] | val_name_in | The value or values that will be parsed and used as the value when creating a new field or fields. |
Definition at line 720 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | parse_ival | The value or values that have been decoded. |
Definition at line 1527 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | values | The value or values that have been decoded. |
Definition at line 1511 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | parse_sval | The value or values that have been decoded. |
Definition at line 1539 of file field_manager.F90.
|
private |
[in] | text | The text string from which the values will be parsed. |
[in] | label | A label which describes the values being decoded. |
[out] | values | The value or values that have been decoded. |
Definition at line 1519 of file field_manager.F90.
|
private |
A private function that can recursively recover values for parameters associated with a field.
list_p | A pointer to the field that is of interest | |
[in] | recursive | A flag to enable recursive searching if true |
[in] | name | name of a list that the user wishes to change to |
[out] | method_name | name of a parameter associated with the named field |
[out] | method_control | value of parameters associated with the named field |
Definition at line 3325 of file field_manager.F90.
|
private |
Routine to read and parse the field table yaml.
This routine reads from a file containing formatted strings. These formatted strings contain information on which schemes are needed within various modules. The field manager does not initialize any of those schemes however. It simply holds the information and is queried by the appropriate module.
[out] | nfields | number of fields |
[in] | table_name | Name of the field table, default is 'field_table' |
Definition at line 854 of file field_manager.F90.
|
private |
Routine to read and parse the field table yaml.
[out] | nfields | number of fields |
[in] | table_name | Name of the field table file, default is 'field_table.yaml' |
Definition at line 591 of file field_manager.F90.
|
private |
If the the pointer matches to the right list, extract the field information. Used in fm_loop_over_list.
Definition at line 2510 of file field_manager.F90.
|
private |
A routine to strip whitespace from the start of character strings.
This subroutine removes spaces and tabs from the start of a character string.
[in,out] | name | name to remove whitespace from |
Definition at line 1401 of file field_manager.F90.