config_schema Module

This module exposes the solver-owned metadata needed by adapters: parameter names, groups, value kinds, bounds, and choice lists. It also provides typed getters/setters so higher-level integrations do not need to know the layout of config_t.

Internals are derived from the shared config_engine field-descriptor table (built once per process by config.build_field_table) rather than a hand-maintained select case per field; the public API is unchanged.



Variables

Type Visibility Attributes Name Initial
type(config_t), private, save, target :: schema_defaults

Static schema state: one saved table bound to a saved default instance.

type(field_desc_t), private, save :: schema_fields(n_config_fields)
logical, private, save :: schema_ready = .false.

Derived Types

type, public ::  config_schema_entry_t

Metadata published for one runtime-queryable configuration key.

Read more…

Components

Type Visibility Attributes Name Initial
character(len=32), public :: key = ''
character(len=32), public :: group = ''
integer, public :: value_kind = 0
character(len=256), public :: help = ''
logical, public :: has_min = .false.
real(kind=wp), public :: min_value = 0.0_wp
logical, public :: has_max = .false.
real(kind=wp), public :: max_value = 0.0_wp
integer, public :: choice_set = 0

Functions

public function config_schema_count() result(count)

Return the number of published schema entries.

Arguments

None

Return Value integer

public function find_config_schema_entry(key) result(index)

Find a schema entry by key and return its 1-based index.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key

Return Value integer

public function config_schema_choice_count(index) result(count)

Return the number of allowed choices for a choice-valued schema entry.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: index

Return Value integer

private pure function normalize_key(key) result(normalized)

Normalise a user-provided parameter key to lowercase trimmed form. Thin wrapper over lowercase_token (from string_utils) fixing the result to the schema's 32-character key field width.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key

Return Value character(len=32)


Subroutines

public subroutine get_config_schema_entry(index, entry, found)

Copy one schema entry by its 1-based index.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: index
type(config_schema_entry_t), intent(out) :: entry
logical, intent(out) :: found

public subroutine get_config_schema_choice(index, choice_index, value, found)

Copy one allowed string token from a schema entry's choice list.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: index
integer, intent(in) :: choice_index
character(len=*), intent(out) :: value
logical, intent(out) :: found

public subroutine config_default_integer(key, value, is_ok, message)

Read the compiled-in default integer value for a schema key.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
integer, intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_default_real(key, value, is_ok, message)

Read the compiled-in default scalar real value for a schema key.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
real(kind=wp), intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_default_logical(key, value, is_ok, message)

Read the compiled-in default logical value for a schema key.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
logical, intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_default_string(key, value, is_ok, message)

Read the compiled-in default string or choice token for a schema key.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
character(len=*), intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_default_real3(key, value, is_ok, message)

Read the compiled-in default length-3 real vector for a schema key.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
real(kind=wp), intent(out) :: value(3)
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_get_integer(cfg, key, value, is_ok, message)

Read one integer-valued field from cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
character(len=*), intent(in) :: key
integer, intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_get_real(cfg, key, value, is_ok, message)

Read one scalar real-valued field from cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
character(len=*), intent(in) :: key
real(kind=wp), intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_get_logical(cfg, key, value, is_ok, message)

Read one logical field from cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
character(len=*), intent(in) :: key
logical, intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_get_string(cfg, key, value, is_ok, message)

Read one string or choice token from cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
character(len=*), intent(in) :: key
character(len=*), intent(out) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_get_real3(cfg, key, value, is_ok, message)

Read one fixed-length real-3 field from cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in) :: cfg
character(len=*), intent(in) :: key
real(kind=wp), intent(out) :: value(3)
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_set_integer(cfg, key, value, is_ok, message)

Write one integer-valued field in cfg by schema key.

Read more…

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout), target :: cfg
character(len=*), intent(in) :: key
integer, intent(in) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_set_real(cfg, key, value, is_ok, message)

Write one scalar real-valued field in cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout), target :: cfg
character(len=*), intent(in) :: key
real(kind=wp), intent(in) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_set_logical(cfg, key, value, is_ok, message)

Write one logical field in cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout), target :: cfg
character(len=*), intent(in) :: key
logical, intent(in) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_set_string(cfg, key, value, is_ok, message)

Write one string or choice token in cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout), target :: cfg
character(len=*), intent(in) :: key
character(len=*), intent(in) :: value
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

public subroutine config_set_real3(cfg, key, value, is_ok, message)

Write one fixed-length real-3 field in cfg by schema key.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout), target :: cfg
character(len=*), intent(in) :: key
real(kind=wp), intent(in) :: value(3)
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message

private subroutine ensure_schema()

Populate the saved schema table on first use, bound to a saved default config_t instance (the single-source-of-defaults property the spec requires).

Arguments

None

private subroutine copy_choice(values, index, value, found)

Copy one 1-based choice-list item into value.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: values(:)
integer, intent(in) :: index
character(len=*), intent(out) :: value
logical, intent(out) :: found

private subroutine set_status(ok, err, is_ok, message)

Fan out a success flag and optional message to caller-provided outputs.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: ok
character(len=*), intent(in) :: err
logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message