Translate a namelist string into a TDRAG_* code. An
unrecognised string returns TDRAG_INVALID — a typo must abort
rather than silently select one of two laws with different
coefficient dimensions. Accepts the same spellings as
parse_bdrag_variant, deliberately: the two groups mirror.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
pure function parse_tdrag_variant(name) result(code) !! Translate a namelist string into a `TDRAG_*` code. An !! unrecognised string returns `TDRAG_INVALID` — a typo must abort !! rather than silently select one of two laws with different !! coefficient dimensions. Accepts the same spellings as !! `parse_bdrag_variant`, deliberately: the two groups mirror. character(len=*), intent(in) :: name integer :: code select case (trim(adjustl(name))) case ("quadratic", "QUADRATIC", "cd", "CD") code = TDRAG_QUADRATIC case ("linear", "LINEAR", "rayleigh", "RAYLEIGH") code = TDRAG_LINEAR case default code = TDRAG_INVALID end select end function parse_tdrag_variant