nml_int_key_t Derived Type

type, public, extends(nml_key_t) :: nml_int_key_t

Integer-valued key with optional [min,max] range validation.


Inherits

type~~nml_int_key_t~~InheritsGraph type~nml_int_key_t nml_int_key_t type~nml_key_t nml_key_t type~nml_int_key_t->type~nml_key_t

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.

integer, public :: default = 0
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.

logical, public :: has_max = .false.
logical, public :: has_min = .false.
character(len=:), public, allocatable :: name

Key name (matched case-insensitively).

logical, public :: required = .false.

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

integer, public, pointer :: tgt => null()
character(len=:), public, allocatable :: units

Optional units string, default ‘’.

integer, public :: vmax = 0
integer, public :: vmin = 0

Type-Bound Procedures

procedure, public :: default_string => int_default_string

  • private function int_default_string(this) result(str)

    Arguments

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

    Return Value character(len=:), allocatable

procedure, public :: is_default => int_is_default

  • private function int_is_default(this) result(yes)

    Arguments

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

    Return Value logical

procedure, public :: parse_tokens => int_parse

  • private subroutine int_parse(this, values, err_msg)

    Arguments

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

procedure, public :: value_string => int_value_string

  • private function int_value_string(this) result(str)

    Arguments

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

    Return Value character(len=:), allocatable

Source Code

   type, extends(nml_key_t) :: nml_int_key_t
      !! Integer-valued key with optional [min,max] range validation.
      integer, pointer :: tgt => null()
      integer :: default = 0
      integer :: vmin = 0, vmax = 0
      logical :: has_min = .false., has_max = .false.
   contains
      procedure :: parse_tokens => int_parse
      procedure :: value_string => int_value_string
      procedure :: default_string => int_default_string
      procedure :: is_default => int_is_default
   end type nml_int_key_t