parse_frhat_scheme Function

public pure function parse_frhat_scheme(str, default_code) result(scheme)

Convert an &ocean_bt_nml frhat_scheme namelist string to a FRHAT_* constant. Unrecognised ⇒ default_code if given, else FRHAT_ARITHMETIC.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str
integer, intent(in), optional :: default_code

Return Value integer


Called by

proc~~parse_frhat_scheme~~CalledByGraph proc~parse_frhat_scheme parse_frhat_scheme proc~configure_ocean_bt configure_ocean_bt proc~configure_ocean_bt->proc~parse_frhat_scheme proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_bt 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~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 proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: fallback

Source Code

   pure integer function parse_frhat_scheme(str, default_code) result(scheme)
      !! Convert an `&ocean_bt_nml frhat_scheme` namelist string to a
      !! `FRHAT_*` constant.  Unrecognised ⇒ `default_code` if given,
      !! else `FRHAT_ARITHMETIC`.
      character(len=*), intent(in) :: str
      integer, intent(in), optional :: default_code
      integer :: fallback
      fallback = FRHAT_ARITHMETIC
      if (present(default_code)) fallback = default_code
      select case (trim(adjustl(str)))
      case ("arithmetic", "ARITHMETIC")
         scheme = FRHAT_ARITHMETIC
      case ("hybrid", "HYBRID")
         scheme = FRHAT_HYBRID
      case default
         scheme = fallback
      end select
   end function parse_frhat_scheme