| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| class(type_node), | public, | pointer | :: | root | => | null() |
top level (main) access to the tree |
| type(YamlFile), | public | :: | file |
used only for top level config |
|||
| type(type_dictionary), | public | :: | cmp_by_type |
dictionary with arrays of components |
|||
| type(input_t), | public, | pointer | :: | cmp_arr(:) | => | null() |
array of components of the same type |
Open and parse file and return as input dictionary
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | file_name | |||
| logical, | intent(in), | optional | :: | included |
ignore it - only present for included files |
Get input sub-dictionary
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| character(len=*), | intent(in), | optional | :: | filter_key | ||
| character(len=*), | intent(in), | optional | :: | filter_value | ||
| logical, | intent(in), | optional | :: | empty |
Get allocatable array of input sub-dictionaries
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| character(len=*), | intent(in), | optional | :: | filter_key | ||
| character(len=*), | intent(in), | optional | :: | filter_value | ||
| logical, | intent(in), | optional | :: | empty |
Get 'real' double precision value
Function returns double value given by the key and stops if key doesn't exist.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key |
key to the value in dictionary |
||
| real(kind=dp), | intent(in), | optional | :: | default_value |
default value in case of missing key |
returned value
Get 'real' double precision allocatable one dimension array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=dp), | intent(in), | optional | :: | default_value(:) |
default value in case of missing key |
|
| integer, | intent(in), | optional | :: | n |
Get 'real' double precision allocatable two dimensional array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=dp), | intent(in), | optional | :: | default_value(:,:) |
default value in case of missing key |
Get 'logical' value like: true/false yes/no etc...
Get 'logical' 1d array of values of true/false yes/no etc...
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| logical, | intent(in), | optional | :: | default_value(:) |
default value in case of missing key |
|
| integer, | intent(in), | optional | :: | n |
Get 'integer' value
Get 'integer' value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| integer, | intent(in), | optional | :: | default_value(:) |
default value in case of missing key |
|
| integer, | intent(in), | optional | :: | n |
expected number of elements in the array (can be used broadcast scalar to array) |
Get allocatable trimmed 'character(:)' value
Get allocatable trimmed 'character(:)' value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key | |||
| type(str_ptr), | intent(in), | optional | :: | default_value | ||
| logical, | intent(in), | optional | :: | empty |
Get pointer to array of input components
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | keys(:) |
Get total number of components
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me |
Return true if dictionary has a key
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key |
Return 1d array of keys
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me |
Get "type_node" from yaml lib
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | me | |||
| character(len=*), | intent(in) | :: | key |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | unit | |||
| integer, | intent(in) | :: | indent |
type, extends(type_node) :: input_t class(type_node), pointer :: root => null() !! top level (main) access to the tree type(YamlFile) :: file !! used only for top level config type(type_dictionary) :: cmp_by_type !! dictionary with arrays of components type(input_t), pointer :: cmp_arr(:) => null() !! array of components of the same type contains procedure :: open => input_open_yaml !! Open and parse file and return as input dictionary ! Main get access functions procedure :: dict => input_dict !! Get input sub-dictionary procedure :: dict1d => input_dict1d !! Get allocatable array of input sub-dictionaries procedure :: dbl => input_dbl !! Get 'real' double precision value procedure :: dbl1d => input_dbl1d !! Get 'real' double precision allocatable one dimension array procedure :: dbl2d => input_dbl2d !! Get 'real' double precision allocatable two dimensional array procedure :: bin => input_bin !! Get 'logical' value like: true/false yes/no etc... procedure :: bin1d => input_bin1d !! Get 'logical' 1d array of values of true/false yes/no etc... procedure :: int => input_int !! Get 'integer' value procedure :: int1d => input_int1d !! Get 'integer' value procedure :: str => input_str !! Get allocatable trimmed 'character(:)' value procedure :: str1d => input_str1d !! Get allocatable trimmed 'character(:)' value procedure :: cmp1d => input_cmp1d !! Get pointer to array of input components procedure :: nb_cmp => input_nb_cmp !! Get total number of components procedure :: has_key => input_has_key!! Return true if dictionary has a key procedure :: keys1d => input_keys1d !! Return 1d array of keys ! Private only for debugging procedure :: node => input_node !! Get "type_node" from yaml lib procedure :: dump => input_dump_dict end type input_t