Translate an exchange-law string into a CAVITY_LAW_* code.
RESERVED laws parse successfully — the refusal belongs to
cavity_exchange_velocities, which returns
CAVITY_MELT_NOT_IMPLEMENTED — so that a typo
(CAVITY_LAW_INVALID) and an honest request for unwritten
physics stay distinguishable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | private, | allocatable | :: | key |
pure function parse_cavity_exchange_law(name) result(code) !! Translate an exchange-law string into a `CAVITY_LAW_*` code. !! RESERVED laws parse successfully — the refusal belongs to !! `cavity_exchange_velocities`, which returns !! `CAVITY_MELT_NOT_IMPLEMENTED` — so that a typo !! (`CAVITY_LAW_INVALID`) and an honest request for unwritten !! physics stay distinguishable. character(len=*), intent(in) :: name character(len=:), allocatable :: key integer :: code key = trim(adjustl(name)) select case (key) case ("const_gamma", "CONST_GAMMA", "const", "isomip") code = CAVITY_LAW_CONST_GAMMA case ("hj99", "HJ99", "holland_jenkins99") code = CAVITY_LAW_HJ99 case ("jenkins91", "JENKINS91") code = CAVITY_LAW_JENKINS91 case ("yung25", "YUNG25", "stratfeedback") code = CAVITY_LAW_YUNG25 case ("rosevear22", "ROSEVEAR22") code = CAVITY_LAW_ROSEVEAR22 case ("vt19", "VT19") code = CAVITY_LAW_VT19 case ("mk18", "MK18") code = CAVITY_LAW_MK18 case ("burchard22", "BURCHARD22") code = CAVITY_LAW_BURCHARD22 case ("jenkins21", "JENKINS21") code = CAVITY_LAW_JENKINS21 case default code = CAVITY_LAW_INVALID end select end function parse_cavity_exchange_law