nml_key_t Derived Type

type, public, abstract :: nml_key_t

Abstract base for a single namelist key descriptor.


Inherited by

type~~nml_key_t~~InheritedByGraph type~nml_key_t nml_key_t type~nml_int_key_t nml_int_key_t type~nml_int_key_t->type~nml_key_t type~nml_key_box_t nml_key_box_t type~nml_key_box_t->type~nml_key_t key type~nml_logical_key_t nml_logical_key_t type~nml_logical_key_t->type~nml_key_t type~nml_real_array_key_t nml_real_array_key_t type~nml_real_array_key_t->type~nml_key_t type~nml_real_key_t nml_real_key_t type~nml_real_key_t->type~nml_key_t type~nml_string_key_t nml_string_key_t type~nml_string_key_t->type~nml_key_t type~nml_enum_key_t nml_enum_key_t type~nml_enum_key_t->type~nml_string_key_t type~nml_group_t nml_group_t type~nml_group_t->type~nml_key_box_t keys type~nml_schema_t nml_schema_t type~nml_schema_t->type~nml_group_t groups

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: dead_reason

Unallocated/empty = live. Non-empty = this knob is registered (accepted, type/range-validated) but does NOT reach any ocean-path behaviour – e.g. &vcoord_nml zstar_stretching is captured on cfg but never copied onto ocean_state%vcoord (rdb_ocean_vcoord.F90:179,182). Carried into the JSON emitter (render_json) so a generated caller-side layer can warn on assignment instead of presenting a dead knob as live.

character(len=:), public, allocatable :: doc

Human-readable description (FORD-style synthesis doc).

logical, public :: found = .false.

Parse-state: set true when the key is seen in the file.

character(len=:), public, allocatable :: name

Key name (matched case-insensitively).

logical, public :: required = .false.

If true, the key must appear whenever its group appears.

character(len=:), public, allocatable :: units

Optional units string, default ‘’.


Type-Bound Procedures

procedure(default_string_iface), public, deferred :: default_string

  • function default_string_iface(this) result(str) Prototype

    Captured default value, formatted for namelist output.

    Arguments

    Type IntentOptional Attributes Name
    class(nml_key_t), intent(in) :: this

    Return Value character(len=:), allocatable

procedure(is_default_iface), public, deferred :: is_default

  • function is_default_iface(this) result(yes) Prototype

    True if the current target value equals the captured default.

    Arguments

    Type IntentOptional Attributes Name
    class(nml_key_t), intent(in) :: this

    Return Value logical

procedure(parse_tokens_iface), public, deferred :: parse_tokens

  • subroutine parse_tokens_iface(this, values, err_msg) Prototype

    Validate values and assign through the target pointer. On success err_msg is left unallocated.

    Arguments

    Type IntentOptional Attributes Name
    class(nml_key_t), intent(inout) :: this
    character(len=*), intent(in) :: values(:)
    character(len=:), intent(out), allocatable :: err_msg

procedure(value_string_iface), public, deferred :: value_string

  • function value_string_iface(this) result(str) Prototype

    Current target value, formatted for namelist output.

    Arguments

    Type IntentOptional Attributes Name
    class(nml_key_t), intent(in) :: this

    Return Value character(len=:), allocatable

Source Code

   type, abstract :: nml_key_t
      !! Abstract base for a single namelist key descriptor.
      character(len=:), allocatable :: name
         !! Key name (matched case-insensitively).
      character(len=:), allocatable :: doc
         !! Human-readable description (FORD-style synthesis doc).
      character(len=:), allocatable :: units
         !! Optional units string, default ''.
      logical :: required = .false.
         !! If true, the key must appear whenever its group appears.
      logical :: found = .false.
         !! Parse-state: set true when the key is seen in the file.
      character(len=:), allocatable :: dead_reason
         !! Unallocated/empty = live. Non-empty = this knob is registered
         !! (accepted, type/range-validated) but does NOT reach any
         !! ocean-path behaviour -- e.g. `&vcoord_nml zstar_stretching`
         !! is captured on `cfg` but never copied onto `ocean_state%vcoord`
         !! (rdb_ocean_vcoord.F90:179,182). Carried into the JSON emitter
         !! (`render_json`) so a generated caller-side layer can warn on
         !! assignment instead of presenting a dead knob as live.
   contains
      procedure(parse_tokens_iface), deferred :: parse_tokens
      procedure(value_string_iface), deferred :: value_string
      procedure(default_string_iface), deferred :: default_string
      procedure(is_default_iface), deferred :: is_default
   end type nml_key_t