Translate a namelist/registration-time string into a
DATA_TIME_* code. Fail-loud on anything not covered by
data_input_time_mode_is_implemented — an unrecognised tag
must never silently fall back to a default mode.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | tag |
function data_input_time_mode_from_string(tag) result(mode) !! Translate a namelist/registration-time string into a !! `DATA_TIME_*` code. Fail-loud on anything not covered by !! `data_input_time_mode_is_implemented` — an unrecognised tag !! must never silently fall back to a default mode. character(len=*), intent(in) :: tag integer :: mode select case (to_lower(trim(tag))) case ("linear") mode = DATA_TIME_LINEAR case ("cyclic") mode = DATA_TIME_CYCLIC case ("static") mode = DATA_TIME_STATIC case default call logger%error("ocean_data_input: unimplemented time_mode '"//trim(tag)// & "' (implemented: linear, cyclic, static)") error stop "ocean_data_input: unimplemented time_mode" end select end function data_input_time_mode_from_string