Module that allows working with a configuration file
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | CFG_integer_type | = | 1 |
Integer type |
| integer, | public, | parameter | :: | CFG_logic_type | = | 4 |
Boolean/logical type |
| integer, | public, | parameter | :: | CFG_max_array_size | = | 20 |
Maximum number of entries in a variable (if it's an array) |
| integer, | public, | parameter | :: | CFG_name_len | = | 80 |
Maximum length of variable names |
| integer, | public, | parameter | :: | CFG_real_type | = | 2 |
Real number type |
| integer, | public, | parameter | :: | CFG_string_len | = | 200 |
Fixed length of string type |
| integer, | public, | parameter | :: | CFG_string_type | = | 3 |
String type |
| character(len=10), | public, | parameter | :: | CFG_type_names(0:CFG_num_types) | = | [character(len=10)::"storage", "integer", "real", "string ", "logical"] |
Names of the types |
| character(len=*), | private, | parameter | :: | CFG_category_separator | = | "%" |
The separator for categories (stored in var_name) |
| integer, | private, | parameter | :: | CFG_num_types | = | 4 |
Number of variable types |
| character(len=*), | private, | parameter | :: | CFG_separators | = | " ,'"""//char(9) |
The separator(s) for array-like variables (space, comma, ', ", and tab) |
| integer, | private, | parameter | :: | CFG_unknown_type | = | 0 |
Used before a variable is created |
| integer, | private, | parameter | :: | dp | = | kind(0.0d0) |
The double precision kind-parameter |
Interface to add variables to the configuration
Add a configuration variable with a real value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(in) | :: | real_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(in) | :: | real_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | int_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | int_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an character value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(in) | :: | char_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type character
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(in) | :: | char_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an logical value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(in) | :: | logic_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type logical
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(in) | :: | logic_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Interface to get variables from the configuration
Get or add a real value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a real array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get or add a integer value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a integer array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get or add a logical value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logical_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a logical array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logic_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get a character value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | string_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a character array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | char_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Interface to get variables from the configuration
Get a real value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(out) | :: | res |
Get a real array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data(:) |
Get a integer value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | res |
Get a integer array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data(:) |
Get a logical value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(out) | :: | res |
Get a logical array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logic_data(:) |
Get a character value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(out) | :: | res |
Get a character array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | char_data(:) |
The configuration that contains all the variables
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | num_vars | = | 0 | ||
| logical, | public | :: | sorted | = | .false. | ||
| type(CFG_var_t), | public, | allocatable | :: | vars(:) |
The type of a configuration variable
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=CFG_string_len), | private, | allocatable | :: | char_data(:) | |||
| character(len=CFG_string_len), | private | :: | description |
Description of variable |
|||
| logical, | private | :: | dynamic_size |
Whether the variable size is flexible |
|||
| integer, | private, | allocatable | :: | int_data(:) | |||
| logical, | private, | allocatable | :: | logic_data(:) | |||
| real(kind=dp), | private, | allocatable | :: | real_data(:) | |||
| character(len=CFG_string_len), | private | :: | stored_data |
Data that has been read in for this variable |
|||
| logical, | private | :: | used |
Whether the variable's value has been requested |
|||
| character(len=CFG_name_len), | private | :: | var_name |
Name of the variable |
|||
| integer, | private | :: | var_size |
Size of variable, 1 means scalar, > 1 means array |
|||
| integer, | private | :: | var_type |
Type of variable |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg |
Get the size of a variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(out) | :: | res |
Get the type of a given variable of a configuration type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(out) | :: | res |
Update the variables in the configartion with the values found in 'filename'
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | filename |
Sort the variables for faster lookup
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg |
This routine writes the current configuration to a file with descriptions
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg_in | |||
| character(len=*), | intent(in) | :: | filename | |||
| logical, | intent(in), | optional | :: | hide_unused |
This routine writes the current configuration to a markdown file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg_in | |||
| character(len=*), | intent(in) | :: | filename | |||
| logical, | intent(in), | optional | :: | hide_unused |
Get or add a integer value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a integer array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get or add a logical value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logical_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a logical array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logic_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get or add a real value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a real array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Get a character value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | string_data | |||
| character(len=*), | intent(in) | :: | comment |
Get or add a character array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | char_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | int_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | int_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an logical value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(in) | :: | logic_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type logical
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(in) | :: | logic_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with a real value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(in) | :: | real_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(in) | :: | real_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Add a configuration variable with an character value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(in) | :: | char_data | |||
| character(len=*), | intent(in) | :: | comment |
Add a configuration variable with an array of type character
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(in) | :: | char_data(:) | |||
| character(len=*), | intent(in) | :: | comment | |||
| logical, | intent(in), | optional | :: | dynamic_size |
Performa a binary search for the variable 'var_name'
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(out) | :: | ix |
Routine to ensure that enough storage is allocated for the configuration type. If not the new size will be twice as much as the current size. If no storage is allocated yet a minumum amount of starage is allocated.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg |
Routine to find the indices of entries in a string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | line |
The line from which we want to read |
||
| character(len=*), | intent(in) | :: | delims |
A string with delimiters. For example delims = " ,'"""//char(9) |
||
| integer, | intent(in) | :: | n_max |
Maximum number of entries to read in |
||
| integer, | intent(inout) | :: | n_found |
Number of entries found |
||
| integer, | intent(inout) | :: | ixs_start(n_max) |
On return, ix_start(i) holds the starting point of entry i |
||
| integer, | intent(inout) | :: | ixs_end(n_max) |
On return, ix_end(i) holds the end point of entry i |
Get a integer value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | res |
Get a integer array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(inout) | :: | int_data(:) |
Get a logical value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(out) | :: | res |
Get a logical array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| logical, | intent(inout) | :: | logic_data(:) |
Get a real value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(out) | :: | res |
Get a real array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| real(kind=dp), | intent(inout) | :: | real_data(:) |
Get a character value of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(out) | :: | res |
Get a character array of a given name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| character(len=*), | intent(inout) | :: | char_data(:) |
Return the index of the variable with name 'var_name', or -1 if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(out) | :: | ix |
This routine will be called if an error occurs in one of the subroutines of this module.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | err_string |
Helper routine for quicksort, to perform partitioning
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_var_t), | intent(inout) | :: | list(:) | |||
| integer, | intent(out) | :: | marker |
Helper routine to get variables. This is useful because a lot of the same code is executed for the different types of variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | var_type | |||
| integer, | intent(in) | :: | var_size | |||
| integer, | intent(out) | :: | ix |
Helper routine to store variables. This is useful because a lot of the same code is executed for the different types of variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(inout) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(in) | :: | var_type | |||
| integer, | intent(in) | :: | var_size | |||
| character(len=*), | intent(in) | :: | description | |||
| integer, | intent(out) | :: | ix |
Index of variable |
||
| logical, | intent(in), | optional | :: | dynamic_size |
Simple implementation of quicksort algorithm to sort the variable list alphabetically.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_var_t), | intent(inout) | :: | list(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_var_t), | intent(inout) | :: | var |
Resize the storage size of variable, which can be of type integer, logical, real or character
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_var_t), | intent(inout) | :: | variable |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_var_t), | intent(in) | :: | variable | |||
| character(len=CFG_name_len), | intent(out) | :: | category | |||
| character(len=CFG_name_len), | intent(out) | :: | var_name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(inout) | :: | line | |||
| character(len=*), | intent(in) | :: | comment_chars |