FMS
2024.03
Flexible Modeling System
|
Routines to use for parsing yaml files. More...
Data Types | |
interface | get_value_from_key |
Dermine the value of a key from a keyname. More... | |
interface | open_and_parse_file_wrap |
c functions binding More... | |
Functions/Subroutines | |
subroutine | check_error_code (error_code, filename) |
Checks the error code from a open_and_parse_file_wrap function call. | |
subroutine, public | get_block_ids (file_id, block_name, block_ids, parent_block_id) |
Gets the the ids of the blocks with block_name in the yaml file If parent_block_id is present, it only gets those that belong to that block. More... | |
subroutine, public | get_block_name (file_id, block_id, block_name) |
Gets the block name form the block id. More... | |
subroutine, public | get_key_ids (file_id, block_id, key_ids) |
Gets the ids of the key-value pairs in a block. More... | |
subroutine, public | get_key_name (file_id, key_id, key_name) |
Gets the key from a file id. More... | |
subroutine, public | get_key_value (file_id, key_id, key_value) |
Gets the value from a file id. More... | |
integer function, public | get_nkeys (file_id, block_id) |
Gets the number of key-value pairs in a block. More... | |
integer function, public | get_num_blocks (file_id, block_name, parent_block_id) |
Determines the number of blocks with block_name in the yaml file If parent_block_id is present, it only counts those that belong to that block. More... | |
integer function, public | get_num_unique_blocks (file_id, parent_block_id) |
Gets the number of unique blocks. More... | |
subroutine, public | get_unique_block_ids (file_id, block_ids, parent_block_id) |
Gets the ids of the unique block ids. More... | |
subroutine | get_value_from_key_0d (file_id, block_id, key_name, key_value, is_optional) |
Used to dermine the value of a key from a keyname. More... | |
subroutine | get_value_from_key_1d (file_id, block_id, key_name, key_value, is_optional) |
Used' to dermine the 1D value of a key from a keyname. More... | |
integer function, public | open_and_parse_file (filename) |
Opens and parses a yaml file. More... | |
Routines to use for parsing yaml files.
interface yaml_parser_mod::get_value_from_key |
Dermine the value of a key from a keyname.
Definition at line 57 of file yaml_parser.F90.
Private Member Functions | |
subroutine | get_value_from_key_0d (file_id, block_id, key_name, key_value, is_optional) |
Used to dermine the value of a key from a keyname. More... | |
subroutine | get_value_from_key_1d (file_id, block_id, key_name, key_value, is_optional) |
Used' to dermine the 1D value of a key from a keyname. More... | |
|
private |
Used to dermine the value of a key from a keyname.
[in] | file_id | File id of the yaml file to search |
[in] | block_id | ID corresponding to the block you want the key for |
[in] | key_name | Name of the key you want the value for |
[in,out] | key_value | Value of the key |
[in] | is_optional | Flag indicating if it is okay for the key to not exist. If the key does not exist key_value will not be set, so it is the user's responsibility to initialize it before the call |
Definition at line 313 of file yaml_parser.F90.
|
private |
Used' to dermine the 1D value of a key from a keyname.
[in] | file_id | File id of the yaml file to search |
[in] | block_id | ID corresponding to the block you want the key for |
[in] | key_name | Name of the key you want the value for |
[in,out] | key_value | Value of the key |
[in] | is_optional | Flag indicating if it is okay for the key' to not exist. If the key does not exist key_value will not be set, so it is the user's responsibility to initialize it before the call |
Definition at line 379 of file yaml_parser.F90.
interface yaml_parser_mod::open_and_parse_file_wrap |
c functions binding
Private c function that opens and parses a yaml file (see yaml_parser_binding.c)
Definition at line 74 of file yaml_parser.F90.
Private Member Functions | |
logical(kind=c_int) function | open_and_parse_file_wrap (filename, file_id) |
|
private |
[in] | filename | Filename of the yaml file |
[out] | file_id | File id corresponding to the yaml file that was opened |
Definition at line 74 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_block_ids | ( | integer, intent(in) | file_id, |
character(len=*), intent(in) | block_name, | ||
integer, dimension(:), intent(inout) | block_ids, | ||
integer, intent(in), optional | parent_block_id | ||
) |
Gets the the ids of the blocks with block_name in the yaml file If parent_block_id is present, it only gets those that belong to that block.
[in] | file_id | File id of the yaml file to search |
[in] | block_name | The name of the block you are looking for |
[in,out] | block_ids | Id of blocks with block_name |
[in] | parent_block_id | Id of the parent_block |
Definition at line 460 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_block_name | ( | integer, intent(in) | file_id, |
integer, intent(in) | block_id, | ||
character(len=*), intent(out) | block_name | ||
) |
Gets the block name form the block id.
[in] | file_id | File id corresponding to the yaml file that was opened |
[in] | block_id | Id of the block to get the name from |
[out] | block_name | Name of the block |
Definition at line 562 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_key_ids | ( | integer, intent(in) | file_id, |
integer, intent(in) | block_id, | ||
integer, dimension(:), intent(inout) | key_ids | ||
) |
Gets the ids of the key-value pairs in a block.
[in] | file_id | File id corresponding to the yaml file that was opened |
[in] | block_id | Id of the parent_block |
[in,out] | key_ids | Ids of the key-value pairs |
Definition at line 502 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_key_name | ( | integer, intent(in) | file_id, |
integer, intent(in) | key_id, | ||
character(len=*), intent(out) | key_name | ||
) |
Gets the key from a file id.
[in] | key_id | Id of the key-value pair of interest |
[in] | file_id | File id of the yaml file to search |
Definition at line 283 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_key_value | ( | integer, intent(in) | file_id, |
integer, intent(in) | key_id, | ||
character(len=*), intent(out) | key_value | ||
) |
Gets the value from a file id.
[in] | key_id | Id of the key-value pair of interest |
[in] | file_id | File id of the yaml file to search |
Definition at line 298 of file yaml_parser.F90.
integer function, public yaml_parser_mod::get_nkeys | ( | integer, intent(in) | file_id, |
integer, intent(in) | block_id | ||
) |
Gets the number of key-value pairs in a block.
[in] | file_id | File id corresponding to the yaml file that was opened |
[in] | block_id | Id of the parent_block |
Definition at line 487 of file yaml_parser.F90.
integer function, public yaml_parser_mod::get_num_blocks | ( | integer, intent(in) | file_id, |
character(len=*), intent(in) | block_name, | ||
integer, intent(in), optional | parent_block_id | ||
) |
Determines the number of blocks with block_name in the yaml file If parent_block_id is present, it only counts those that belong to that block.
[in] | file_id | File id of the yaml file to search |
[in] | block_name | The name of the block you are looking for |
[in] | parent_block_id | Id of the parent block |
Definition at line 438 of file yaml_parser.F90.
integer function, public yaml_parser_mod::get_num_unique_blocks | ( | integer, intent(in) | file_id, |
integer, intent(in), optional | parent_block_id | ||
) |
Gets the number of unique blocks.
[in] | file_id | File id corresponding to the yaml file that was opened |
[in] | parent_block_id | Id of the parent_block |
Definition at line 525 of file yaml_parser.F90.
subroutine, public yaml_parser_mod::get_unique_block_ids | ( | integer, intent(in) | file_id, |
integer, dimension(:), intent(inout) | block_ids, | ||
integer, intent(in), optional | parent_block_id | ||
) |
Gets the ids of the unique block ids.
[in] | file_id | File id corresponding to the yaml file that was opened |
[in,out] | block_ids | Ids of each unique block |
[in] | parent_block_id | Id of the parent_block |
Definition at line 544 of file yaml_parser.F90.
|
private |
Used to dermine the value of a key from a keyname.
[in] | file_id | File id of the yaml file to search |
[in] | block_id | ID corresponding to the block you want the key for |
[in] | key_name | Name of the key you want the value for |
[in,out] | key_value | Value of the key |
[in] | is_optional | Flag indicating if it is okay for the key to not exist. If the key does not exist key_value will not be set, so it is the user's responsibility to initialize it before the call |
Definition at line 313 of file yaml_parser.F90.
|
private |
Used' to dermine the 1D value of a key from a keyname.
[in] | file_id | File id of the yaml file to search |
[in] | block_id | ID corresponding to the block you want the key for |
[in] | key_name | Name of the key you want the value for |
[in,out] | key_value | Value of the key |
[in] | is_optional | Flag indicating if it is okay for the key' to not exist. If the key does not exist key_value will not be set, so it is the user's responsibility to initialize it before the call |
Definition at line 379 of file yaml_parser.F90.
integer function, public yaml_parser_mod::open_and_parse_file | ( | character(len=*), intent(in) | filename | ) |
Opens and parses a yaml file.
[in] | filename | Filename of the yaml file |
Definition at line 245 of file yaml_parser.F90.