FMS  2024.03
Flexible Modeling System
fms_yaml_output_mod

Data Types

type  fmsyamloutkeys_type
 Keys for the output yaml on a given level corresponding to the struct in yaml_output_functions.c Should be set using the fms_f2c_string routine to get properly formatted c style strings level2keys should be set with add_level2key() More...
 
type  fmsyamloutvalues_type
 Values for the output yaml on a given level corresponding to the struct in yaml_output_functions.c. More...
 
interface  write_yaml_from_struct_3
 

Functions/Subroutines

subroutine, public initialize_key_struct (yk)
 
subroutine, public initialize_val_struct (yv)
 
subroutine write_yaml_from_struct_3 (yamlname, a1size, keys, vals, a2size, key2, val2, a3size, a3each, key3, val3, lvl2keyeach)
 
subroutine yaml_out_add_level2key_c (key_length, key_name, keytype)
 

Variables

character(c_char), dimension(string_len_parameter) key1
 
character(c_char), dimension(string_len_parameter) key10
 
character(c_char), dimension(string_len_parameter) key11
 
character(c_char), dimension(string_len_parameter) key12
 
character(c_char), dimension(string_len_parameter) key13
 
character(c_char), dimension(string_len_parameter) key14
 
character(c_char), dimension(string_len_parameter) key15
 
character(c_char), dimension(string_len_parameter) key16
 
character(c_char), dimension(string_len_parameter) key2
 
character(c_char), dimension(string_len_parameter) key3
 
character(c_char), dimension(string_len_parameter) key4
 
character(c_char), dimension(string_len_parameter) key5
 
character(c_char), dimension(string_len_parameter) key6
 
character(c_char), dimension(string_len_parameter) key7
 
character(c_char), dimension(string_len_parameter) key8
 
character(c_char), dimension(string_len_parameter) key9
 
character(c_char), dimension(string_len_parameter *lvl2_key_parameter) level2key
 
integer(c_int) level2key_offset
 
integer, parameter lvl2_key_parameter = 8
 Max number of strings to be stored in lvl2keys Must match whats in yaml_output_functions.c.
 
character(c_char), dimension(string_len_parameter) val1
 
character(c_char), dimension(string_len_parameter) val10
 
character(c_char), dimension(string_len_parameter) val11
 
character(c_char), dimension(string_len_parameter) val12
 
character(c_char), dimension(string_len_parameter) val13
 
character(c_char), dimension(string_len_parameter) val14
 
character(c_char), dimension(string_len_parameter) val15
 
character(c_char), dimension(string_len_parameter) val16
 
character(c_char), dimension(string_len_parameter) val2
 
character(c_char), dimension(string_len_parameter) val3
 
character(c_char), dimension(string_len_parameter) val4
 
character(c_char), dimension(string_len_parameter) val5
 
character(c_char), dimension(string_len_parameter) val6
 
character(c_char), dimension(string_len_parameter) val7
 
character(c_char), dimension(string_len_parameter) val8
 
character(c_char), dimension(string_len_parameter) val9
 

Detailed Description

Author
Tom Robinson @description Writes a 3 tiered yaml where the first and second tier can have 1 key that has an array of values. This is usefule for writing a diag_output.yaml Here is an example:
 ---
 basedate: 0 0 0 0 0 0 0
 experiment: c192L65_exp
 files:
 - name: atmos_daily
   freq: days
   vars:
   - name: temp
     units: K
   - name: P
     longname: pressure
   - name: wind
     units: m/s
     longname: wind velocity magnitude
 - name: atmos_monthly
   freq: months
   vars:
   - name: temp
     units: K
 ...
In this example, basedate, experiment, and files are the level 1 (top level) keys. files is the level2key in the keys struct. The array of structs for the files with name, freq has a size of 2, and vars is the level2key. The key3 and var3 arrays should have a size of 4, and a3each=(\3,1) corresponding to the number of elements in each array within the yaml.

Data Type Documentation

◆ fms_yaml_output_mod::fmsyamloutkeys_type

type fms_yaml_output_mod::fmsyamloutkeys_type

Keys for the output yaml on a given level corresponding to the struct in yaml_output_functions.c Should be set using the fms_f2c_string routine to get properly formatted c style strings level2keys should be set with add_level2key()

Definition at line 78 of file fms_yaml_output.F90.

Collaboration diagram for fmsyamloutkeys_type:
[legend]

Private Attributes

character(c_char), dimension(string_len_parameter) key1
 
character(c_char), dimension(string_len_parameter) key10
 
character(c_char), dimension(string_len_parameter) key11
 
character(c_char), dimension(string_len_parameter) key12
 
character(c_char), dimension(string_len_parameter) key13
 
character(c_char), dimension(string_len_parameter) key14
 
character(c_char), dimension(string_len_parameter) key15
 
character(c_char), dimension(string_len_parameter) key16
 
character(c_char), dimension(string_len_parameter) key2
 
character(c_char), dimension(string_len_parameter) key3
 
character(c_char), dimension(string_len_parameter) key4
 
character(c_char), dimension(string_len_parameter) key5
 
character(c_char), dimension(string_len_parameter) key6
 
character(c_char), dimension(string_len_parameter) key7
 
character(c_char), dimension(string_len_parameter) key8
 
character(c_char), dimension(string_len_parameter) key9
 
character(c_char), dimension(string_len_parameter *lvl2_key_parameter) level2key
 
integer(c_int) level2key_offset
 

◆ fms_yaml_output_mod::fmsyamloutvalues_type

type fms_yaml_output_mod::fmsyamloutvalues_type

Values for the output yaml on a given level corresponding to the struct in yaml_output_functions.c.

Definition at line 99 of file fms_yaml_output.F90.

Collaboration diagram for fmsyamloutvalues_type:
[legend]

Private Attributes

character(c_char), dimension(string_len_parameter) val1
 
character(c_char), dimension(string_len_parameter) val10
 
character(c_char), dimension(string_len_parameter) val11
 
character(c_char), dimension(string_len_parameter) val12
 
character(c_char), dimension(string_len_parameter) val13
 
character(c_char), dimension(string_len_parameter) val14
 
character(c_char), dimension(string_len_parameter) val15
 
character(c_char), dimension(string_len_parameter) val16
 
character(c_char), dimension(string_len_parameter) val2
 
character(c_char), dimension(string_len_parameter) val3
 
character(c_char), dimension(string_len_parameter) val4
 
character(c_char), dimension(string_len_parameter) val5
 
character(c_char), dimension(string_len_parameter) val6
 
character(c_char), dimension(string_len_parameter) val7
 
character(c_char), dimension(string_len_parameter) val8
 
character(c_char), dimension(string_len_parameter) val9
 

◆ fms_yaml_output_mod::write_yaml_from_struct_3

interface fms_yaml_output_mod::write_yaml_from_struct_3

Definition at line 120 of file fms_yaml_output.F90.

Private Member Functions

subroutine write_yaml_from_struct_3 (yamlname, a1size, keys, vals, a2size, key2, val2, a3size, a3each, key3, val3, lvl2keyeach)
 

Function/Subroutine Documentation

◆ initialize_key_struct()

subroutine, public fms_yaml_output_mod::initialize_key_struct ( type (fmsyamloutkeys_type), intent(inout)  yk)
Parameters
[in,out]ykInstance of the stucture

Definition at line 162 of file fms_yaml_output.F90.

◆ initialize_val_struct()

subroutine, public fms_yaml_output_mod::initialize_val_struct ( type (fmsyamloutvalues_type), intent(inout)  yv)
Parameters
[in,out]yvInstance of the stucture

Definition at line 185 of file fms_yaml_output.F90.

◆ write_yaml_from_struct_3()

subroutine write_yaml_from_struct_3 ( character (c_char)  yamlname,
integer (c_int), value  a1size,
type (fmsyamloutkeys_type), dimension(a1size)  keys,
type (fmsyamloutvalues_type), dimension(a1size)  vals,
integer (c_int), value  a2size,
type (fmsyamloutkeys_type), dimension(a2size)  key2,
type (fmsyamloutvalues_type), dimension(a2size)  val2,
integer (c_int), value  a3size,
integer (c_int), dimension (a2size)  a3each,
type (fmsyamloutkeys_type), dimension(a3size)  key3,
type (fmsyamloutvalues_type), dimension(a3size)  val3,
integer (c_int), dimension(lvl2_key_parameter)  lvl2keyeach 
)
private
Parameters
yamlnameThe output yaml file name
a1sizeThe size of the first yaml array
keysTop level yaml keys
valsValues corresponding to keys
a2sizeThe size of the second yaml array
key2Second level keys
val2Values corresponding to key2
a3sizeThe size of the third yaml array
a3eachArray that has the number of elements for each level 2 key's third level elements. If using multiple lvl2keys, a value must be present for each key.
key3Third level keys
val3Values corresponding to keys2
lvl2keyeachamount of key2 'blocks' to print per level2key in keys

Definition at line 120 of file fms_yaml_output.F90.

◆ yaml_out_add_level2key_c()

subroutine yaml_out_add_level2key_c ( integer(c_int), value  key_length,
character(c_char), intent(in)  key_name,
type(fmsyamloutkeys_type), intent(inout)  keytype 
)
private
Parameters
[in]key_namename of level 2 key (starts a new tabbed section) to add to list
key_lengthlength of key_name
[in,out]keytypestruct of keys to output

Definition at line 141 of file fms_yaml_output.F90.