FMS  2024.03
Flexible Modeling System
fm_yaml_mod

Reads entries from a field table yaml into a nested object for use in the field manager. More...

Data Types

type  fmattr_t
 This type represents a subparameter block for a given variable parameter. This type contains the name of the associated parameter and the subparameter key/value pairs. More...
 
type  fmmodel_t
 This type represents the entries for a given model, e.g. land, ocean, atmosphere. This type contains the name of the model, the block id, and the variables within this model. More...
 
type  fmtable_t
 This type contains the field types within a field table. More...
 
type  fmtype_t
 This type represents the entries for a specific field type, e.g. a tracer. This type contains the name of the field type, the block id, and the models within this field type. More...
 
type  fmvar_t
 This type represents the entries for a given variable, e.g. dust. This type contains the name of the variable, the block id, the key/value pairs for the variable's parameters, and any applicable subparameters. More...
 

Functions/Subroutines

subroutine build_fmmodel (fmModel, yfid)
 Populates an fmModel, which is assumed to already have its id parameter set. More...
 
subroutine, public build_fmtable (fmTable, filename)
 Subroutine to populate an fmTable by reading a yaml file, given an optional filename. More...
 
subroutine build_fmtype (fmType, yfid)
 Populates an fmType, which is assumed to already have its id parameter set. More...
 
subroutine build_fmvar (fmVar, yfid)
 Populates an fmVar and creates any associated fmAttrs. More...
 
subroutine fmvar_read_attrs (fmVar, yfid, method_keys, method_values)
 Reads the attribute blocks attached to a variable and populates the associated fmAttr structures. Returns two arrays containing key/value pairs of all methods defined via attribute blocks. More...
 

Detailed Description

Reads entries from a field table yaml into a nested object for use in the field manager.

Author
Eric Stofferahn

Data Type Documentation

◆ fm_yaml_mod::fmattr_t

type fm_yaml_mod::fmattr_t

This type represents a subparameter block for a given variable parameter. This type contains the name of the associated parameter and the subparameter key/value pairs.

Definition at line 48 of file fm_yaml.F90.

Collaboration diagram for fmattr_t:
[legend]

Public Attributes

integer id
 block id of this var
 
character(len=:), dimension(:), allocatable keys
 name of the attribute
 
character(len=:), allocatable paramname
 name of associated parameter
 
character(len=:), dimension(:), allocatable values
 value of the attribute
 

◆ fm_yaml_mod::fmmodel_t

type fm_yaml_mod::fmmodel_t

This type represents the entries for a given model, e.g. land, ocean, atmosphere. This type contains the name of the model, the block id, and the variables within this model.

Definition at line 70 of file fm_yaml.F90.

Collaboration diagram for fmmodel_t:
[legend]

Public Attributes

integer id
 block id of this model
 
character(len=:), allocatable name
 name of the model
 
type(fmvar_t), dimension(:), allocatable variables
 variables in this model
 

◆ fm_yaml_mod::fmtable_t

type fm_yaml_mod::fmtable_t

This type contains the field types within a field table.

Definition at line 87 of file fm_yaml.F90.

Collaboration diagram for fmtable_t:
[legend]

Public Attributes

type(fmtype_t), dimension(:), allocatable types
 field types in this table
 

◆ fm_yaml_mod::fmtype_t

type fm_yaml_mod::fmtype_t

This type represents the entries for a specific field type, e.g. a tracer. This type contains the name of the field type, the block id, and the models within this field type.

Definition at line 79 of file fm_yaml.F90.

Collaboration diagram for fmtype_t:
[legend]

Public Attributes

integer id
 block id of this type
 
type(fmmodel_t), dimension(:), allocatable models
 models in this type
 
character(len=:), allocatable name
 name of the type
 

◆ fm_yaml_mod::fmvar_t

type fm_yaml_mod::fmvar_t

This type represents the entries for a given variable, e.g. dust. This type contains the name of the variable, the block id, the key/value pairs for the variable's parameters, and any applicable subparameters.

Definition at line 59 of file fm_yaml.F90.

Collaboration diagram for fmvar_t:
[legend]

Public Attributes

type(fmattr_t), dimension(:), allocatable attributes
 attributes in this var
 
integer id
 block id of this var
 
character(len=:), dimension(:), allocatable keys
 names of params
 
character(len=:), allocatable name
 name of the variable
 
character(len=:), dimension(:), allocatable values
 values of params
 

Function/Subroutine Documentation

◆ build_fmmodel()

subroutine fm_yaml_mod::build_fmmodel ( type(fmmodel_t), intent(inout)  fmModel,
integer, intent(in)  yfid 
)
private

Populates an fmModel, which is assumed to already have its id parameter set.

Parameters
[in,out]fmmodelmodel object
[in]yfidfile id of the yaml file

Definition at line 157 of file fm_yaml.F90.

◆ build_fmtable()

subroutine, public fm_yaml_mod::build_fmtable ( type(fmtable_t), intent(out)  fmTable,
character(len=*), intent(in), optional  filename 
)

Subroutine to populate an fmTable by reading a yaml file, given an optional filename.

Parameters
[out]fmtablethe field table
[in]filenamethe name of the yaml file

Definition at line 97 of file fm_yaml.F90.

◆ build_fmtype()

subroutine fm_yaml_mod::build_fmtype ( type(fmtype_t), intent(inout)  fmType,
integer, intent(in)  yfid 
)
private

Populates an fmType, which is assumed to already have its id parameter set.

Parameters
[in,out]fmtypetype object
[in]yfidfile id of the yaml file

Definition at line 122 of file fm_yaml.F90.

◆ build_fmvar()

subroutine fm_yaml_mod::build_fmvar ( type(fmvar_t), intent(inout)  fmVar,
integer, intent(in)  yfid 
)
private

Populates an fmVar and creates any associated fmAttrs.

Parameters
[in,out]fmvarvariable object
[in]yfidfile id of the yaml file

Definition at line 192 of file fm_yaml.F90.

◆ fmvar_read_attrs()

subroutine fm_yaml_mod::fmvar_read_attrs ( type(fmvar_t), intent(inout)  fmVar,
integer, intent(in)  yfid,
character(:), dimension(:), intent(out), allocatable  method_keys,
character(:), dimension(:), intent(out), allocatable  method_values 
)
private

Reads the attribute blocks attached to a variable and populates the associated fmAttr structures. Returns two arrays containing key/value pairs of all methods defined via attribute blocks.

Parameters
[in,out]fmvarvariable object
[in]yfidfile id of the yaml file
[out]method_keysMethod keys (names of attribute blocks)
[out]method_valuesMethod values from attribute blocks

Definition at line 266 of file fm_yaml.F90.