Documentation for module input_val_types

a wrapper for basic fortran types.

source: input_val_types.F
Loading...

public Types:

val_type
a type to have a wrapper that stores any basic fortran type
val_p_type
pointer to a val, to create arrays of pointers

public Subroutines/Functions:

creates a keyword value
creates a copy of the given value
returns the stored values
SUBROUTINE
val_release (val)
releases the given val
SUBROUTINE
val_retain (val)
retains the given val
writes out the valuse stored in the val
Write values to an internal file, i.e. string variable.

Parameters:

INTEGER
:: char_t = 4
INTEGER
:: enum_t = 5
INTEGER
:: integer_t = 2
INTEGER
:: lchar_t = 6
INTEGER
:: logical_t = 1
INTEGER
:: no_t = 0
INTEGER
:: real_t = 3

public Types:

TYPE :: val_p_type

pointer to a val, to create arrays of pointers


TYPE(val_type),
POINTER :: val to pointer to the val

TYPE :: val_type

a type to have a wrapper that stores any basic fortran type


INTEGER
:: ref_count ...
INTEGER
:: id_nr ...
INTEGER
:: type_of_var type stored in the val (should be one of no_t, integer_t, logical_t, real_t, char_t)
LOGICAL,
DIMENSION(:), POINTER :: l_val ...
INTEGER,
DIMENSION(:), POINTER :: i_val ...
DIMENSION(:), POINTER :: c_val ...
REAL(dp),
DIMENSION(:), POINTER :: r_val ...
POINTER :: enum an enumaration to map char to integers

SUBROUTINEval_create(val, l_val, l_vals, l_vals_ptr, i_val, i_vals, i_vals_ptr, r_val, r_vals, r_vals_ptr, c_val, c_vals, c_vals_ptr, lc_val, lc_vals, lc_vals_ptr, enum)

creates a keyword value

Arguments:
TYPE(val_type),
POINTER
:: val the object to be created
LOGICAL,
INTENT(in),
OPTIONAL
:: l_val a logical,integer,real,string, long string to be stored in the val
LOGICAL,
INTENT(in),
OPTIONAL
:: l_vals(:) an array of logicals, integers, reals, characters, long strings to be stored in val
LOGICAL,
OPTIONAL, POINTER
:: l_vals_ptr(:) an array of logicals, ... to be stored in val, val will get the ownership of the pointer
INTEGER,
INTENT(in),
OPTIONAL
:: i_val a logical,integer,real,string, long string to be stored in the val
INTEGER,
INTENT(in),
OPTIONAL
:: i_vals(:) an array of logicals, integers, reals, characters, long strings to be stored in val
INTEGER,
OPTIONAL, POINTER
:: i_vals_ptr(:) an array of logicals, ... to be stored in val, val will get the ownership of the pointer
REAL(dp),
INTENT(in),
OPTIONAL
:: r_val a logical,integer,real,string, long string to be stored in the val
REAL(dp),
INTENT(in),
OPTIONAL
:: r_vals(:) an array of logicals, integers, reals, characters, long strings to be stored in val
REAL(dp),
OPTIONAL, POINTER
:: r_vals_ptr(:) an array of logicals, ... to be stored in val, val will get the ownership of the pointer
CHARACTER(*),
INTENT(in),
OPTIONAL
:: c_val a logical,integer,real,string, long string to be stored in the val
CHARACTER(*),
INTENT(in),
OPTIONAL
:: c_vals(:) an array of logicals, integers, reals, characters, long strings to be stored in val
OPTIONAL, POINTER
:: c_vals_ptr(:) an array of logicals, ... to be stored in val, val will get the ownership of the pointer
CHARACTER(*),
INTENT(in),
OPTIONAL
:: lc_val a logical,integer,real,string, long string to be stored in the val
CHARACTER(*),
INTENT(in),
OPTIONAL
:: lc_vals(:) ...
OPTIONAL, POINTER
:: lc_vals_ptr(:) ...
OPTIONAL, POINTER
:: enum the enumaration type this value is using

SUBROUTINEval_duplicate(val_in, val_out)

creates a copy of the given value

Arguments:
TYPE(val_type),
POINTER
:: val_in the value to copy
TYPE(val_type),
POINTER
:: val_out the value tha will be created

SUBROUTINEval_get(val, has_l, has_i, has_r, has_lc, has_c, l_val, l_vals, i_val, i_vals, r_val, r_vals, c_val, c_vals, len_c, type_of_var, enum)

returns the stored values

Arguments:
TYPE(val_type),
POINTER
:: val the object from which you want to extract the values
LOGICAL,
INTENT(out),
OPTIONAL
:: has_l ...
LOGICAL,
INTENT(out),
OPTIONAL
:: has_i ...
LOGICAL,
INTENT(out),
OPTIONAL
:: has_r ...
LOGICAL,
INTENT(out),
OPTIONAL
:: has_lc ...
LOGICAL,
INTENT(out),
OPTIONAL
:: has_c ...
LOGICAL,
INTENT(out),
OPTIONAL
:: l_val gets a logical from the val
LOGICAL,
OPTIONAL, POINTER
:: l_vals(:) gets an array of logicals from the val
INTEGER,
INTENT(out),
OPTIONAL
:: i_val gets an integer from the val
INTEGER,
OPTIONAL, POINTER
:: i_vals(:) gets an array of integers from the val
REAL(dp),
INTENT(out),
OPTIONAL
:: r_val gets a real from the val
REAL(dp),
OPTIONAL, POINTER
:: r_vals(:) gets an array of reals from the val
CHARACTER(*),
INTENT(out),
OPTIONAL
:: c_val gets a char from the val
OPTIONAL, POINTER
:: c_vals(:) gets an array of chars from the val
INTEGER,
INTENT(out),
OPTIONAL
:: len_c len_trim of c_val (if it was a lc_val, of type lchar_t it might be longet than default_string_length)
INTEGER,
INTENT(out),
OPTIONAL
:: type_of_var ...
OPTIONAL, POINTER
:: enum ...

SUBROUTINEval_release(val)

releases the given val

Arguments:
TYPE(val_type),
POINTER
:: val the val to release

SUBROUTINEval_retain(val)

retains the given val

Arguments:
TYPE(val_type),
POINTER
:: val the val to retain

SUBROUTINEval_write(val, unit_nr, unit, unit_str, fmt)

writes out the valuse stored in the val

Arguments:
TYPE(val_type),
POINTER
:: val the val to write
INTEGER,
INTENT(in)
:: unit_nr the number of the unit to write to
OPTIONAL, POINTER
:: unit the unit of mesure in wich the output should be written (overrides unit_str)
CHARACTER(*),
INTENT(in),
OPTIONAL
:: unit_str the unit of mesure in wich the output should be written
CHARACTER(*),
INTENT(in),
OPTIONAL
:: fmt ...

SUBROUTINEval_write_internal(val, string, unit)

Write values to an internal file, i.e. string variable.

Arguments:
TYPE(val_type),
POINTER
:: val ...
CHARACTER(*),
INTENT(out)
:: string ...
OPTIONAL, POINTER
:: unit ...