Translate a namelist string into a BDRAG_* code. An
unrecognised string returns BDRAG_INVALID (PR-6 fail-loud —
a typo must not silently select the quadratic default over the
linear form or vice versa; the two obey different physics).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
pure function parse_bdrag_variant(name) result(code) !! Translate a namelist string into a `BDRAG_*` code. An !! unrecognised string returns `BDRAG_INVALID` (PR-6 fail-loud — !! a typo must not silently select the quadratic default over the !! linear form or vice versa; the two obey different physics). character(len=*), intent(in) :: name integer :: code select case (trim(adjustl(name))) case ("quadratic", "QUADRATIC", "cd", "CD") code = BDRAG_QUADRATIC case ("linear", "LINEAR", "rayleigh", "RAYLEIGH") code = BDRAG_LINEAR case default code = BDRAG_INVALID end select end function parse_bdrag_variant