Enum key: a string restricted to an allowed list, validated case-insensitively and assigned its canonical spelling.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | allowed(:) | |||
| 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. |
||
| character(len=:), | public, | allocatable | :: | default | |||
| 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 | :: | retired(:) |
Spellings that USED to be legal and no longer are (renamed or
withdrawn). A namelist still carrying one must not fall
through to the bare “not in allowed set {…}” message — that
tells the reader the value is wrong but not what replaced it.
Matching one of these fails loud with |
||
| character(len=:), | public, | allocatable | :: | retired_hint |
What to say when a retired spelling is used. Name the replacement; this string IS the migration instruction. |
||
| character(len=:), | public, | pointer | :: | tgt | => | null() | |
| character(len=:), | public, | allocatable | :: | units |
Optional units string, default ‘’. |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_string_key_t), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_string_key_t), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_enum_key_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | values(:) | |||
| character(len=:), | intent(out), | allocatable | :: | err_msg |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_string_key_t), | intent(in) | :: | this |
type, extends(nml_string_key_t) :: nml_enum_key_t !! Enum key: a string restricted to an allowed list, validated !! case-insensitively and assigned its canonical spelling. character(len=:), allocatable :: allowed(:) character(len=:), allocatable :: retired(:) !! Spellings that USED to be legal and no longer are (renamed or !! withdrawn). A namelist still carrying one must not fall !! through to the bare "not in allowed set {…}" message — that !! tells the reader the value is wrong but not what replaced it. !! Matching one of these fails loud with `retired_hint` instead. character(len=:), allocatable :: retired_hint !! What to say when a retired spelling is used. Name the !! replacement; this string IS the migration instruction. contains procedure :: parse_tokens => enum_parse end type nml_enum_key_t