Skip to content

finer_option_t ​

Option class definition.

Source: src/lib/finer_option_t.F90

Dependencies

Contents ​

Derived Types ​

option ​

Option data of sections.

Components ​

NameTypeAttributesDescription
onametype(string)Option name.
ovalstype(string)Option values.
ocommtype(string)Eventual option inline comment.

Type-Bound Procedures ​

NameAttributesDescription
count_valuespass(self)Counting option value(s).
freepass(self)Free dynamic memory.
getGet option value (scalar).
get_pairspass(self)Return option name/values pairs.
get_stringpass(self)Get option value as an allocatable string.
name_lenpass(self)Return option name length.
parsepass(self)Parse option data.
printpass(self)Pretty print data.
savepass(self)Save data.
setSet option value (scalar).
values_lenpass(self)Return option values length.
assignment(=)Assignment overloading.
operator(==)Equal operator overloading.
get_optionpass(self)Get option value (scalar).
get_a_optionpass(self)Get option value (array).
parse_commentpass(self)Parse option inline comment.
parse_namepass(self)Parse option name.
parse_valuepass(self)Parse option values.
set_optionpass(self)Set option value (scalar).
set_a_optionpass(self)Set option value (array).
assign_optionpass(lhs)Assignment overloading.
option_eq_stringpass(lhs)Equal to string logical operator.
option_eq_characterpass(lhs)Equal to character logical operator.

Interfaces ​

integer_string ​

Return the string representing an integer number, without the plus sign of positive numbers.

Module procedures: integer_string_I8P, integer_string_I4P, integer_string_I2P, integer_string_I1P

real_string ​

Return the shortest string representing a real number that is read back exactly.

Module procedures: real_string_R8P, real_string_R4P

option ​

Overload option name with a function returning a new (initiliazed) option instance.

Module procedures: new_option

Subroutines ​

free ​

Free dynamic memory.

Attributes: elemental

fortran
subroutine free(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.

get_pairs ​

Return option name/values pairs.

Attributes: pure

fortran
subroutine get_pairs(self, pairs)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
pairscharacter(len=:)outallocatableOption name/values pairs.

Call graph

get_string ​

Get option value as an allocatable string.

val is (re)allocated with the length of the option value. If the option has no value, val is left unchanged and an error is returned.

fortran
subroutine get_string(self, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
valcharacter(len=:)inoutallocatableValue.
errorinteger(kind=I4P)outoptionalError code.

Call graph

parse ​

Parse option data from a source string.

Attributes: elemental

fortran
subroutine parse(self, sep, source, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inoutString containing option data.
errorinteger(kind=I4P)outError code.

Call graph

get_option ​

for getting option data value (scalar).

If the option value cannot be converted to the type of val, val is left unchanged and an error is returned.

fortran
subroutine get_option(self, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
valclass(*)inoutValue.
errorinteger(kind=I4P)outoptionalError code.

Call graph

get_a_option ​

Get option data values (array).

If val cannot hold all the values, or a value cannot be converted to the type of val, val is left unchanged and an error is returned.

fortran
subroutine get_a_option(self, val, delimiter, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
valclass(*)inoutValue.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.
errorinteger(kind=I4P)outoptionalError code.

Call graph

parse_comment ​

Parse option inline comment trimming it out from pure value string.

Attributes: elemental

fortran
subroutine parse_comment(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.

Call graph

parse_name ​

Parse option name from a source string.

Attributes: elemental

fortran
subroutine parse_name(self, sep, source, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inString containing option data.
errorinteger(kind=I4P)outError code.

Call graph

parse_value ​

Parse option value from a source string.

Attributes: elemental

fortran
subroutine parse_value(self, sep, source, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inString containing option data.
errorinteger(kind=I4P)outError code.

Call graph

Print data with a pretty format.

fortran
subroutine print_option(self, unit, retain_comments, pref, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
unitinteger(kind=I4P)inLogic unit.
retain_commentslogicalinFlag for retaining eventual comments.
prefcharacter(len=*)inoptionalPrefixing string.
iostatinteger(kind=I4P)outoptionalIO error.
iomsgcharacter(len=*)outoptionalIO error message.

set_option ​

Set option data value (scalar).

If the type of val is not supported the option value is left unchanged and an error is returned.

Attributes: pure

fortran
subroutine set_option(self, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.
valclass(*)inValue.
errorinteger(kind=I4P)outoptionalError code.

Call graph

set_a_option ​

Set option data value (array).

If the type of val is not supported the option value is left unchanged and an error is returned.

Attributes: pure

fortran
subroutine set_a_option(self, val, delimiter, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inoutOption data.
valclass(*)inValue.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.
errorinteger(kind=I4P)outoptionalError code.

Call graph

save_option ​

Save data.

fortran
subroutine save_option(self, unit, retain_comments, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
unitinteger(kind=I4P)inLogic unit.
retain_commentslogicalinFlag for retaining eventual comments.
iostatinteger(kind=I4P)outoptionalIO error.
iomsgcharacter(len=*)outoptionalIO error message.

assign_option ​

Assignment between two options.

Attributes: elemental

fortran
subroutine assign_option(lhs, rhs)

Arguments

NameTypeIntentAttributesDescription
lhsclass(option)inoutLeft hand side.
rhstype(option)inRigth hand side.

assign_default ​

Assign a default value to a value of one of the supported types.

A complex val accepts a complex, real or integer default of any supported kind. A real val accepts a real or integer default of any supported kind, an integer val accepts an integer default of any supported kind (that it can represent), a logical or character val accepts a default of the same type. For any other combination val is left unchanged and an error is returned.

fortran
subroutine assign_default(val, default, error)

Arguments

NameTypeIntentAttributesDescription
valclass(*)inoutValue.
defaultclass(*)inDefault value.
errorinteger(kind=I4P)outError code.

Call graph

convert ​

Convert a string into a value of one of the supported types.

If the string cannot be converted, or the type of val is not supported, val is left unchanged and an error is returned.

fortran
subroutine convert(source, val, error, check_only)

Arguments

NameTypeIntentAttributesDescription
sourcecharacter(len=*)inString to be converted.
valclass(*)inoutValue.
errorinteger(kind=I4P)outError code.
check_onlylogicalinoptionalCheck the conversion without modifying val.

Call graph

split_complex ​

Split a list of complex values in the Fortran notation, e.g. (1.0, 2.0) (3.0, 4.0), into its values.

Whatever is between the values is ignored: the delimiter can be also inside the values.

Attributes: pure

fortran
subroutine split_complex(source, tokens)

Arguments

NameTypeIntentAttributesDescription
sourcecharacter(len=*)inString to be split.
tokenstype(string)outallocatableComplex values.

Call graph

Functions ​

count_values ​

Get the number of values of option data.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function count_values(self, delimiter) result(Nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.

Call graph

name_len ​

Return option name length.

Attributes: elemental

Returns: integer

fortran
function name_len(self) result(length)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.

Call graph

values_len ​

Return option values length.

Attributes: elemental

Returns: integer

fortran
function values_len(self) result(length)

Arguments

NameTypeIntentAttributesDescription
selfclass(option)inOption data.

Call graph

option_eq_string ​

Equal to string logical operator.

Attributes: elemental

Returns: logical

fortran
function option_eq_string(lhs, rhs) result(is_it)

Arguments

NameTypeIntentAttributesDescription
lhsclass(option)inLeft hand side.
rhstype(string)inRight hand side.

option_eq_character ​

Equal to character logical operator.

Attributes: elemental

Returns: logical

fortran
function option_eq_character(lhs, rhs) result(is_it)

Arguments

NameTypeIntentAttributesDescription
lhsclass(option)inLeft hand side.
rhscharacter(kind=CK, len=*)inRight hand side.

integer_string_I8P ​

Return the string representing an integer number (I8P), without the plus sign of positive numbers.

Attributes: pure

Returns: character(len=:)

fortran
function integer_string_I8P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I8P)inNumber.

integer_string_I4P ​

Return the string representing an integer number (I4P), without the plus sign of positive numbers.

Attributes: pure

Returns: character(len=:)

fortran
function integer_string_I4P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inNumber.

integer_string_I2P ​

Return the string representing an integer number (I2P), without the plus sign of positive numbers.

Attributes: pure

Returns: character(len=:)

fortran
function integer_string_I2P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I2P)inNumber.

integer_string_I1P ​

Return the string representing an integer number (I1P), without the plus sign of positive numbers.

Attributes: pure

Returns: character(len=:)

fortran
function integer_string_I1P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I1P)inNumber.

is_complex ​

Return true if the values are of complex type.

Attributes: pure

Returns: logical

fortran
function is_complex(val)

Arguments

NameTypeIntentAttributesDescription
valclass(*)inValues.

Call graph

is_complex_list ​

Return true if the string is a list of complex values in the Fortran notation, e.g. (1.0, 2.0) (3.0, 4.0).

Attributes: pure

Returns: logical

fortran
function is_complex_list(source)

Arguments

NameTypeIntentAttributesDescription
sourcecharacter(len=*)inString to be checked.

Call graph

real_string_R8P ​

Return the shortest string representing a real number (R8P) that is read back exactly.

It is the compact string of PENF without the plus sign of the not negative numbers.

Attributes: pure

Returns: character(len=:)

fortran
function real_string_R8P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
nreal(kind=R8P)inNumber.

real_string_R4P ​

Return the shortest string representing a real number (R4P) that is read back exactly.

It is the compact string of PENF without the plus sign of the not negative numbers.

Attributes: pure

Returns: character(len=:)

fortran
function real_string_R4P(n) result(string)

Arguments

NameTypeIntentAttributesDescription
nreal(kind=R4P)inNumber.

new_option ​

Return a new (initiliazed) option instance.

Attributes: elemental

Returns: type(option)

fortran
function new_option(option_name, option_values, option_comment)

Arguments

NameTypeIntentAttributesDescription
option_namecharacter(len=*)inoptionalOption name.
option_valuescharacter(len=*)inoptionalOption values.
option_commentcharacter(len=*)inoptionalOption comment.