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.



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: cfg_kind_int = 1

Schema kind tag for integer-valued parameters.

integer, public, parameter :: cfg_kind_real = 2

Schema kind tag for scalar real-valued parameters.

integer, public, parameter :: cfg_kind_logical = 3

Schema kind tag for logical .true. / .false. parameters.

integer, public, parameter :: cfg_kind_choice = 4

Schema kind tag for string parameters constrained to a published choice list.

integer, public, parameter :: cfg_kind_string = 5

Schema kind tag for free-form string parameters such as file paths.

integer, public, parameter :: cfg_kind_real3 = 6

Schema kind tag for fixed-length real vectors of length 3.

integer, private, parameter :: choice_none = 0
integer, private, parameter :: choice_flux = 1
integer, private, parameter :: choice_recon = 2
integer, private, parameter :: choice_time = 3
integer, private, parameter :: choice_limiter = 4
integer, private, parameter :: choice_problem = 5
integer, private, parameter :: choice_bc = 6
integer, private, parameter :: choice_char_proj = 7
integer, private, parameter :: choice_nrbc_mode = 8
integer, private, parameter :: choice_hybrid_sensor = 9
integer, private, parameter :: n_schema_entries = 58
type(config_schema_entry_t), private, save :: schema_entries(n_schema_entries)
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 = choice_none

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.

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) :: 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) :: 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) :: 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) :: 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) :: 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 schema table on first use.

Read more…

Arguments

None

private subroutine set_entry(index, key, group, value_kind, help, has_min, min_value, has_max, max_value, choice_set)

Fill one slot in the lazily initialised schema table.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: index
character(len=*), intent(in) :: key
character(len=*), intent(in) :: group
integer, intent(in) :: value_kind
character(len=*), intent(in) :: help
logical, intent(in), optional :: has_min
real(kind=wp), intent(in), optional :: min_value
logical, intent(in), optional :: has_max
real(kind=wp), intent(in), optional :: max_value
integer, intent(in), optional :: choice_set

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