The top-level schema: validated groups plus external (skipped) group names.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | external_names(:) |
Names of groups whose bodies are skipped without validation. |
||
| type(nml_group_t), | public, | allocatable | :: | groups(:) |
Registered, validated groups. |
Register a group name the schema knows exists but does NOT validate (its body is skipped silently).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
MOVE a locally-built group into the schema — g is consumed
(allocatables transferred). Move semantics on purpose: intrinsic
assignment deep-copies the polymorphic key boxes, which NVHPC
miscompiles (heap corruption); move_alloc transfers descriptors
only. Error stop on duplicate name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(inout) | :: | this | |||
| type(nml_group_t), | intent(inout) | :: | g |
Index of name in the schema’s groups, 0 if absent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
True if name is a registered external group.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
Parse and validate the namelist file at path.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | path | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=:), | intent(out), | optional, | allocatable | :: | errors(:) |
In-memory sibling of schema_parse: validate + apply a namelist
already held as a lines(:) character array (no file touch).
Same error-return convention as schema_parse.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | lines(:) | |||
| integer, | intent(in) | :: | n_lines | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=:), | intent(out), | optional, | allocatable | :: | errors(:) |
Emit the schema as JSON: one object per group, nesting one object
per key. This is the ONLY thing tools/gen_python_config.py
reads – it parses no Fortran source, mirroring the precedent
schema_render_markdown already set for docs/generated_nml_knobs.md.
&ocean_bc_nml is NOT here – it is registered via
add_external_group (see rdb_config.F90), so it carries no keys
on this schema; python/rdb/_config_bc.py is a hand-written
stub with its own drift test (see docs D5.7).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | path |
Render the schema as Markdown: per group a heading, doc line, and a knob table.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | path |
Write every group and key as valid namelist with aligned docs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | path |
Write only non-default keys (MOM6 parameter_doc.short). Groups with no non-default keys are omitted entirely.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nml_schema_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | path |
type :: nml_schema_t !! The top-level schema: validated groups plus external (skipped) !! group names. type(nml_group_t), allocatable :: groups(:) !! Registered, validated groups. character(len=:), allocatable :: external_names(:) !! Names of groups whose bodies are skipped without validation. contains procedure :: add_group => schema_add_group procedure :: add_external_group => schema_add_external_group procedure :: parse => schema_parse procedure :: parse_lines => schema_parse_lines procedure :: write_doc_all => schema_write_doc_all procedure :: write_doc_short => schema_write_doc_short procedure :: render_markdown => schema_render_markdown procedure :: render_json => schema_render_json procedure :: find_group => schema_find_group procedure :: is_external => schema_is_external end type nml_schema_t