nml_group_t Derived Type

type, public :: nml_group_t

A namelist group: a name, doc, growable key list, parse-state, and an optional cross-key validation callback.


Inherits

type~~nml_group_t~~InheritsGraph type~nml_group_t nml_group_t type~nml_key_box_t nml_key_box_t type~nml_group_t->type~nml_key_box_t keys type~nml_key_t nml_key_t type~nml_key_box_t->type~nml_key_t key

Inherited by

type~~nml_group_t~~InheritedByGraph type~nml_group_t nml_group_t type~nml_schema_t nml_schema_t type~nml_schema_t->type~nml_group_t groups

Components

Type Visibility Attributes Name Initial
procedure(group_check_iface), public, pointer, nopass :: cross_check => null()

Optional cross-key validator (empty string = OK).

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

Group description.

logical, public :: found = .false.

Parse-state: true when the group appears in the file.

type(nml_key_box_t), public, allocatable :: keys(:)

Registered keys.

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

Group name (matched case-insensitively).


Type-Bound Procedures

procedure, public :: add => group_add

  • private subroutine group_add(this, key)

    Add a key to the group (sourced-allocate into a box). Error stop on duplicate key name (programming error).

    Arguments

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

procedure, public :: find_key => group_find_key

  • private function group_find_key(this, name) result(idx)

    Index of name in the group’s key list, 0 if absent.

    Arguments

    Type IntentOptional Attributes Name
    class(nml_group_t), intent(in) :: this
    character(len=*), intent(in) :: name

    Return Value integer

Source Code

   type :: nml_group_t
      !! A namelist group: a name, doc, growable key list, parse-state,
      !! and an optional cross-key validation callback.
      character(len=:), allocatable :: name
         !! Group name (matched case-insensitively).
      character(len=:), allocatable :: doc
         !! Group description.
      type(nml_key_box_t), allocatable :: keys(:)
         !! Registered keys.
      logical :: found = .false.
         !! Parse-state: true when the group appears in the file.
      procedure(group_check_iface), pointer, nopass :: cross_check => null()
         !! Optional cross-key validator (empty string = OK).
   contains
      procedure :: add => group_add
      procedure :: find_key => group_find_key
   end type nml_group_t