Parse and validate the namelist file at path.
Error-return convention: if BOTH status and errors are present,
collected messages return in errors (unallocated when none) and
status = error count (0 = clean), no stop. If either is absent and
any error occurs, each is logged via global_logger%error and the
routine error stops.
| 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(:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | private, | allocatable | :: | err_buf(:) | |||
| integer, | private | :: | n_err |
subroutine schema_parse(this, path, status, errors) !! Parse and validate the namelist file at `path`. !! !! Error-return convention: if BOTH `status` and `errors` are present, !! collected messages return in `errors` (unallocated when none) and !! `status` = error count (0 = clean), no stop. If either is absent and !! any error occurs, each is logged via `global_logger%error` and the !! routine `error stop`s. class(nml_schema_t), intent(inout) :: this character(len=*), intent(in) :: path integer, intent(out), optional :: status character(len=:), allocatable, intent(out), optional :: errors(:) character(len=:), allocatable :: err_buf(:) integer :: n_err n_err = 0 call reset_state(this) call parse_file(this, path, err_buf, n_err) call post_parse_validate(this, path, err_buf, n_err, status, errors) end subroutine schema_parse