MONC
|
Manages the options database. Contains administration functions and deduce runtime options from the command line. More...
Data Types | |
interface | options_add |
Generic add interface for adding different types of data to the databases. More... | |
Functions/Subroutines | |
integer function, public | options_size (options_database) |
Returns the number of entries in the options database. More... | |
character(len=string_length) function, public | options_key_at (options_database, i) |
Returns the ith key in the options database. More... | |
class(*) function, pointer, public | options_value_at (options_database, i) |
Returns the value at index in the database. More... | |
logical function, public | options_has_key (options_database, key) |
Determines whether a specific key is in the database. More... | |
real(kind=default_precision) function, public | options_get_real (options_database, key, index) |
Retrieves a real value from the database that matches the provided key. More... | |
subroutine, public | options_get_real_array (options_database, key, array_data, from, to) |
Retrieves an entire (or subset) real array. More... | |
logical function, public | options_get_logical (options_database, key, index) |
Retrieves a logical value from the database that matches the provided key. More... | |
subroutine, public | options_get_logical_array (options_database, key, array_data, from, to) |
Retrieves an entire (or subset) logical array. More... | |
integer function, public | options_get_integer (options_database, key, index) |
Retrieves an integer value from the database that matches the provided key. More... | |
subroutine, public | options_get_integer_array (options_database, key, array_data, from, to) |
Retrieves an entire (or subset) integer array. More... | |
character(len=string_length) function, public | options_get_string (options_database, key, index) |
Retrieves a string value from the database that matches the provided key. More... | |
subroutine, public | options_get_string_array (options_database, key, array_data, from, to) |
Retrieves an entire (or subset) string array. More... | |
integer function, public | options_get_array_size (options_database, key) |
Gets the size of the array held in the options database corresponding to a specific key. More... | |
subroutine, public | load_command_line_into_options_database (options_database) |
Loads in the command line arguments and stores them in the options database. More... | |
subroutine, public | options_remove_key (options_database, key) |
Removes a specific key from the options database, if it is an array then the entire array is removed. More... | |
subroutine | check_options_key_exists (options_database, key) |
Determines whether a specific options key exists in the database or not, if it doesn't then this results in a log error being issued. More... | |
subroutine | options_add_real (options_database, key, real_value, do_not_replace, array_index) |
Adds a real value to the options database with a specific key. More... | |
subroutine | options_add_logical (options_database, key, logical_value, do_not_replace, array_index) |
Adds a logical value to the options database with a specific key. More... | |
subroutine | options_add_string (options_database, key, string_value, do_not_replace, array_index) |
Adds a string value to the options database with a specific key. More... | |
recursive subroutine | options_add_integer (options_database, key, int_value, do_not_replace, array_index) |
Adds an integer value to the options database with a specific key. More... | |
character(len=string_length) function | get_options_array_key (key, index) |
Gets a key corresponding to the correct options key and index combination. More... | |
integer function | get_argument_value_type (specific_value) |
Given a specific value this will determine the type of data. More... | |
subroutine | add_specific_option_key_value_pair (type_of_config, parse_options, specific_arg) |
This will add a specific option key value pair to the options hashmap_type. More... | |
subroutine | set_options_logical_value (optionhashmap_type, key, logical_value) |
A helper procedure to set a specific logical value. More... | |
subroutine | set_options_real_value (optionhashmap_type, key, real_value) |
A helper procedure to set a specific real value. More... | |
subroutine | set_options_integer_value (optionhashmap_type, key, int_value) |
A helper procedure to set a specific integer value. More... | |
subroutine | set_options_string_value (optionhashmap_type, key, str_value) |
A helper procedure to set a specific string value. More... | |
Variables | |
integer, parameter | logical_type =0 |
Type of logical value data. More... | |
integer, parameter | integer_type =1 |
Type of integer value data. More... | |
integer, parameter | real_type =2 |
Type of real value data. More... | |
integer, parameter | string_type =3 |
Type of string value data. More... | |
integer, parameter | array_append_size = 10 |
Manages the options database. Contains administration functions and deduce runtime options from the command line.
The key-value character length limit for each option is 64 characters, the value length limit is 44 characters and key length 20 characters. Note that the options database should be entirely agnostic of where or now the database is stored (in our case in the state.)
|
private |
This will add a specific option key value pair to the options hashmap_type.
As per the hashmap_type semantics, if the user supplies an option then this will override any existing default value.
type_of_config | The type of value to add to the configuration hashmap_type |
parse_options | The key-value pairs of configuration options |
specific_arg | The argument string (key=value or just key) |
Definition at line 640 of file optionsdatabase.F90.
|
private |
Determines whether a specific options key exists in the database or not, if it doesn't then this results in a log error being issued.
options_database | The options database |
key | The key to search for and return the matching value |
Definition at line 412 of file optionsdatabase.F90.
|
private |
Given a specific value this will determine the type of data.
It basically wraps around the conversion test utilities, but will select a real if the string contains a dot and an integer if not. If no conversions_mod can be achieved then the value is assumed to be of type string
specific_value | String value to deduce the type of |
Definition at line 605 of file optionsdatabase.F90.
|
private |
Gets a key corresponding to the correct options key and index combination.
key | The key |
index | The index |
Definition at line 591 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::load_command_line_into_options_database | ( | type(hashmap_type), intent(inout) | options_database | ) |
Loads in the command line arguments and stores them in the options database.
Definition at line 356 of file optionsdatabase.F90.
|
private |
Adds an integer value to the options database with a specific key.
options_database | The options database |
key | The key to use |
value | The integer value to add to the database |
do_not_replace | Optional flag whether to ignore existing values or replace them |
array_index | Optional array index which specifies which location in the array to write to |
Definition at line 552 of file optionsdatabase.F90.
|
private |
Adds a logical value to the options database with a specific key.
options_database | The options database |
key | The key to use |
value | The logical value to add to the database |
do_not_replace | Optional flag whether to ignore existing values or replace them |
array_index | Optional array index which specifies which location in the array to write to |
Definition at line 468 of file optionsdatabase.F90.
|
private |
Adds a real value to the options database with a specific key.
options_database | The options database |
key | The key to use |
value | The real value to add to the database |
do_not_replace | Optional flag whether to ignore existing values or replace them |
array_index | Optional array index which specifies which location in the array to write to |
Definition at line 427 of file optionsdatabase.F90.
|
private |
Adds a string value to the options database with a specific key.
options_database | The options database |
key | The key to use |
value | The string value to add to the database |
do_not_replace | Optional flag whether to ignore existing values or replace them |
array_index | Optional array index which specifies which location in the array to write to |
Definition at line 509 of file optionsdatabase.F90.
integer function, public optionsdatabase_mod::options_get_array_size | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key | ||
) |
Gets the size of the array held in the options database corresponding to a specific key.
options_database | The options database |
key | The key to look up |
Definition at line 341 of file optionsdatabase.F90.
integer function, public optionsdatabase_mod::options_get_integer | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
integer, intent(in), optional | index | ||
) |
Retrieves an integer value from the database that matches the provided key.
options_database | The options database |
key | The key to search for and return the matching value |
index | Optional array index to look up an array value |
Definition at line 216 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::options_get_integer_array | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
integer, dimension(:), intent(inout) | array_data, | ||
integer, intent(in), optional | from, | ||
integer, intent(in), optional | to | ||
) |
Retrieves an entire (or subset) integer array.
options_database | The options database |
key | The key to search for |
array_data | The array data to write into |
from | Optional starting index |
to | Optional end index |
Definition at line 238 of file optionsdatabase.F90.
logical function, public optionsdatabase_mod::options_get_logical | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
integer, intent(in), optional | index | ||
) |
Retrieves a logical value from the database that matches the provided key.
options_database | The options database |
key | The key to search for and return the matching value |
index | Optional array index to look up an array value |
Definition at line 153 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::options_get_logical_array | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
logical, dimension(:), intent(inout) | array_data, | ||
integer, intent(in), optional | from, | ||
integer, intent(in), optional | to | ||
) |
Retrieves an entire (or subset) logical array.
options_database | The options database |
key | The key to search for |
array_data | The array data to write into |
from | Optional starting index |
to | Optional end index |
Definition at line 175 of file optionsdatabase.F90.
real(kind=default_precision) function, public optionsdatabase_mod::options_get_real | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
integer, intent(in), optional | index | ||
) |
Retrieves a real value from the database that matches the provided key.
options_database | The options database |
key | The key to search for and return the matching value |
index | Optional array index to look up an array value |
Definition at line 90 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::options_get_real_array | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
real(kind=default_precision), dimension(:), intent(inout) | array_data, | ||
integer, intent(in), optional | from, | ||
integer, intent(in), optional | to | ||
) |
Retrieves an entire (or subset) real array.
options_database | The options database |
key | The key to search for |
array_data | The array data to write into |
from | Optional starting index |
to | Optional end index |
Definition at line 112 of file optionsdatabase.F90.
character(len=string_length) function, public optionsdatabase_mod::options_get_string | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
integer, intent(in), optional | index | ||
) |
Retrieves a string value from the database that matches the provided key.
options_database | The options database |
key | The key to search for and return the matching value |
index | Optional array index to look up an array value |
Definition at line 279 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::options_get_string_array | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key, | ||
character(len=string_length), dimension(:), intent(inout) | array_data, | ||
integer, intent(in), optional | from, | ||
integer, intent(in), optional | to | ||
) |
Retrieves an entire (or subset) string array.
options_database | The options database |
key | The key to search for |
array_data | The array data to write into |
from | Optional starting index |
to | Optional end index |
Definition at line 301 of file optionsdatabase.F90.
logical function, public optionsdatabase_mod::options_has_key | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key | ||
) |
Determines whether a specific key is in the database.
options_database | The options database |
key | The key to find |
Definition at line 75 of file optionsdatabase.F90.
character(len=string_length) function, public optionsdatabase_mod::options_key_at | ( | type(hashmap_type), intent(inout) | options_database, |
integer, intent(in) | i | ||
) |
Returns the ith key in the options database.
options_database | The options database |
i | The index to retrieve the key at |
Definition at line 52 of file optionsdatabase.F90.
subroutine, public optionsdatabase_mod::options_remove_key | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | key | ||
) |
Removes a specific key from the options database, if it is an array then the entire array is removed.
options_database | The options database |
key | The key to locate and remove |
Definition at line 383 of file optionsdatabase.F90.
integer function, public optionsdatabase_mod::options_size | ( | type(hashmap_type), intent(inout) | options_database | ) |
Returns the number of entries in the options database.
options_database | The options database |
Definition at line 42 of file optionsdatabase.F90.
class(*) function, pointer, public optionsdatabase_mod::options_value_at | ( | type(hashmap_type), intent(inout) | options_database, |
integer, intent(in) | i | ||
) |
Returns the value at index in the database.
options_database | The options database |
i | The index to retrieve the value at |
Definition at line 63 of file optionsdatabase.F90.
|
private |
A helper procedure to set a specific integer value.
Definition at line 686 of file optionsdatabase.F90.
|
private |
A helper procedure to set a specific logical value.
Definition at line 668 of file optionsdatabase.F90.
|
private |
A helper procedure to set a specific real value.
Definition at line 677 of file optionsdatabase.F90.
|
private |
A helper procedure to set a specific string value.
Definition at line 695 of file optionsdatabase.F90.
|
private |
Definition at line 25 of file optionsdatabase.F90.
|
private |
Type of integer value data.
Definition at line 19 of file optionsdatabase.F90.
|
private |
Type of logical value data.
Definition at line 19 of file optionsdatabase.F90.
|
private |
Type of real value data.
Definition at line 19 of file optionsdatabase.F90.
|
private |
Type of string value data.
Definition at line 19 of file optionsdatabase.F90.