FMS 2025.01.02-dev
Flexible Modeling System
Loading...
Searching...
No Matches
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
 
interface  yaml_out_add_level2key_c
 Adds a level 2 key (key that starts new tabbed section) to the list. yaml_out_add_level2key (wrapper routine) should be used instead. More...
 

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, public yaml_out_add_level2key (key_name, keytype)
 Adds a level 2 key (key that starts new tabbed section) to the list. Will print level 2 keys in the order added. See write_yaml_from_struct_3 for more details. This routine is a wrapper for yaml_out_add_level2key_c .
 
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_parameterlevel2key
 
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]

Public 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_parameterlevel2key
 
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]

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

Public Member Functions

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

◆ fms_yaml_output_mod::yaml_out_add_level2key_c

interface fms_yaml_output_mod::yaml_out_add_level2key_c

Adds a level 2 key (key that starts new tabbed section) to the list. yaml_out_add_level2key (wrapper routine) should be used instead.

Definition at line 141 of file fms_yaml_output.F90.

Public Member Functions

subroutine yaml_out_add_level2key_c (key_length, key_name, keytype)
 

Function/Subroutine Documentation

◆ initialize_key_struct()

subroutine, public 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 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 
)
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()

subroutine, public yaml_out_add_level2key ( character(len=*)  key_name,
type(fmsyamloutkeys_type), intent(inout)  keytype 
)

Adds a level 2 key (key that starts new tabbed section) to the list. Will print level 2 keys in the order added. See write_yaml_from_struct_3 for more details. This routine is a wrapper for yaml_out_add_level2key_c .

Definition at line 155 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 
)
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.

Variable Documentation

◆ key1

character (c_char), dimension (string_len_parameter) key1

Definition at line 79 of file fms_yaml_output.F90.

◆ key10

character (c_char), dimension (string_len_parameter) key10

Definition at line 88 of file fms_yaml_output.F90.

◆ key11

character (c_char), dimension (string_len_parameter) key11

Definition at line 89 of file fms_yaml_output.F90.

◆ key12

character (c_char), dimension (string_len_parameter) key12

Definition at line 90 of file fms_yaml_output.F90.

◆ key13

character (c_char), dimension (string_len_parameter) key13

Definition at line 91 of file fms_yaml_output.F90.

◆ key14

character (c_char), dimension (string_len_parameter) key14

Definition at line 92 of file fms_yaml_output.F90.

◆ key15

character (c_char), dimension (string_len_parameter) key15

Definition at line 93 of file fms_yaml_output.F90.

◆ key16

character (c_char), dimension (string_len_parameter) key16

Definition at line 94 of file fms_yaml_output.F90.

◆ key2

character (c_char), dimension (string_len_parameter) key2

Definition at line 80 of file fms_yaml_output.F90.

◆ key3

character (c_char), dimension (string_len_parameter) key3

Definition at line 81 of file fms_yaml_output.F90.

◆ key4

character (c_char), dimension (string_len_parameter) key4

Definition at line 82 of file fms_yaml_output.F90.

◆ key5

character (c_char), dimension (string_len_parameter) key5

Definition at line 83 of file fms_yaml_output.F90.

◆ key6

character (c_char), dimension (string_len_parameter) key6

Definition at line 84 of file fms_yaml_output.F90.

◆ key7

character (c_char), dimension (string_len_parameter) key7

Definition at line 85 of file fms_yaml_output.F90.

◆ key8

character (c_char), dimension (string_len_parameter) key8

Definition at line 86 of file fms_yaml_output.F90.

◆ key9

character (c_char), dimension (string_len_parameter) key9

Definition at line 87 of file fms_yaml_output.F90.

◆ level2key

character (c_char), dimension (string_len_parameter * lvl2_key_parameter) level2key

Definition at line 95 of file fms_yaml_output.F90.

◆ level2key_offset

integer(c_int) level2key_offset

Definition at line 96 of file fms_yaml_output.F90.

◆ lvl2_key_parameter

integer, parameter lvl2_key_parameter = 8
private

Max number of strings to be stored in lvl2keys Must match whats in yaml_output_functions.c.

Definition at line 73 of file fms_yaml_output.F90.

◆ val1

character (c_char), dimension (string_len_parameter) val1

Definition at line 100 of file fms_yaml_output.F90.

◆ val10

character (c_char), dimension (string_len_parameter) val10

Definition at line 109 of file fms_yaml_output.F90.

◆ val11

character (c_char), dimension (string_len_parameter) val11

Definition at line 110 of file fms_yaml_output.F90.

◆ val12

character (c_char), dimension (string_len_parameter) val12

Definition at line 111 of file fms_yaml_output.F90.

◆ val13

character (c_char), dimension (string_len_parameter) val13

Definition at line 112 of file fms_yaml_output.F90.

◆ val14

character (c_char), dimension (string_len_parameter) val14

Definition at line 113 of file fms_yaml_output.F90.

◆ val15

character (c_char), dimension (string_len_parameter) val15

Definition at line 114 of file fms_yaml_output.F90.

◆ val16

character (c_char), dimension (string_len_parameter) val16

Definition at line 115 of file fms_yaml_output.F90.

◆ val2

character (c_char), dimension (string_len_parameter) val2

Definition at line 101 of file fms_yaml_output.F90.

◆ val3

character (c_char), dimension (string_len_parameter) val3

Definition at line 102 of file fms_yaml_output.F90.

◆ val4

character (c_char), dimension (string_len_parameter) val4

Definition at line 103 of file fms_yaml_output.F90.

◆ val5

character (c_char), dimension (string_len_parameter) val5

Definition at line 104 of file fms_yaml_output.F90.

◆ val6

character (c_char), dimension (string_len_parameter) val6

Definition at line 105 of file fms_yaml_output.F90.

◆ val7

character (c_char), dimension (string_len_parameter) val7

Definition at line 106 of file fms_yaml_output.F90.

◆ val8

character (c_char), dimension (string_len_parameter) val8

Definition at line 107 of file fms_yaml_output.F90.

◆ val9

character (c_char), dimension (string_len_parameter) val9

Definition at line 108 of file fms_yaml_output.F90.