"zero"/"uniform"/"latitudes" -> ICE_IC_CONC_*; any other
string -> ICE_IC_CONC_INVALID (fail-loud idiom: a pure
function cannot abort, so validate_config V8 turns the
sentinel into a logger%error; nml_enum allowed= is the first
line of defence).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | s |
pure function ice_ic_parse_conc_config(s) result(mode) !! `"zero"`/`"uniform"`/`"latitudes"` -> `ICE_IC_CONC_*`; any other !! string -> `ICE_IC_CONC_INVALID` (fail-loud idiom: a `pure` !! function cannot abort, so `validate_config` V8 turns the !! sentinel into a `logger%error`; `nml_enum allowed=` is the first !! line of defence). character(len=*), intent(in) :: s integer :: mode select case (trim(s)) case ("zero") mode = ICE_IC_CONC_ZERO case ("uniform") mode = ICE_IC_CONC_UNIFORM case ("latitudes") mode = ICE_IC_CONC_LATITUDES case default mode = ICE_IC_CONC_INVALID end select end function ice_ic_parse_conc_config