parse_pv_variant Function

public pure function parse_pv_variant(name) result(code)

Translate a namelist string into a PV_VARIANT_* code. An unrecognised string returns PV_VARIANT_INVALID (PR-6: fail-loud — a typo must NOT silently degrade to SADOURNY, which is a materially different conservation law). "al81" still maps to PV_VARIANT_AL81 (the reservation), but that code is rejected by pv_variant_is_implemented at configure.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Return Value integer


Called by

proc~~parse_pv_variant~~CalledByGraph proc~parse_pv_variant parse_pv_variant proc~configure_ocean_forcing configure_ocean_forcing proc~configure_ocean_forcing->proc~parse_pv_variant proc~validate_config validate_config proc~validate_config->proc~parse_pv_variant proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~validate_config proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_forcing proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_from_string->proc~complete_ocean_create proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create

Source Code

   pure function parse_pv_variant(name) result(code)
      !! Translate a namelist string into a `PV_VARIANT_*` code.
      !! An unrecognised string returns `PV_VARIANT_INVALID` (PR-6:
      !! fail-loud — a typo must NOT silently degrade to `SADOURNY`,
      !! which is a materially different conservation law).  `"al81"`
      !! still maps to `PV_VARIANT_AL81` (the reservation), but that
      !! code is rejected by `pv_variant_is_implemented` at configure.
      character(len=*), intent(in) :: name
      integer :: code
      select case (trim(adjustl(name)))
      case ("sadourny", "SADOURNY")
         code = PV_VARIANT_SADOURNY
      case ("sadourny_hk", "SADOURNY_HK", "hk", "HK")
         code = PV_VARIANT_SADOURNY_HK
      case ("sadourny_energy", "SADOURNY_ENERGY", "energy", "ENERGY")
         code = PV_VARIANT_SADOURNY_ENERGY
      case ("al81", "AL81")
         code = PV_VARIANT_AL81
      case default
         code = PV_VARIANT_INVALID
      end select
   end function parse_pv_variant