validate_config Subroutine

public subroutine validate_config(cfg, is_valid, message)

Validate that all namelist parameters are physically and numerically sensible.

normalize_config is called first so that scheme names are compared case-insensitively. Three outcomes are possible:

  • Error stop (default): if validation fails and neither optional argument is present, error stop is called with a descriptive message.
  • Return flag + message: if is_valid and/or message are present, the result is returned in those arguments and execution continues.
  • Silent pass: if validation succeeds, is_valid = .true. (when present) and message is set to an empty string (when present).

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(inout) :: cfg

Configuration to validate (normalised in-place).

logical, intent(out), optional :: is_valid

.true. on success, .false. on the first violation found.

character(len=*), intent(out), optional :: message

Human-readable description of the first violation, or ''.