ocean_bc_type_from_string Function

public pure function ocean_bc_type_from_string(name) result(bc_type)

Convert a config-namelist edge string → integer OBC tag. Case-INSENSITIVE (to_lower), so “OPEN”/”Open”/”open” all parse to OBC_OPEN. An unrecognised name returns OBC_INVALID (PR-6 fail-loud): a typo must NOT silently close the boundary to a wall. validate_config rejects OBC_INVALID (naming the edge) before configure_ocean_bc consumes any parse result, so no production caller ever sees the sentinel at a live edge.

Arguments

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

Return Value integer


Calls

proc~~ocean_bc_type_from_string~~CallsGraph proc~ocean_bc_type_from_string ocean_bc_type_from_string to_lower to_lower proc~ocean_bc_type_from_string->to_lower

Called by

proc~~ocean_bc_type_from_string~~CalledByGraph proc~ocean_bc_type_from_string ocean_bc_type_from_string proc~configure_ocean_bc configure_ocean_bc proc~configure_ocean_bc->proc~ocean_bc_type_from_string proc~engine_setup engine_setup proc~engine_setup->proc~ocean_bc_type_from_string proc~engine_setup->proc~configure_ocean_bc proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~engine_setup->proc~ocean_state_seed_from_cfg proc~configure_ocean_metrics configure_ocean_metrics proc~engine_setup->proc~configure_ocean_metrics proc~ocean_state_seed_from_cfg->proc~ocean_bc_type_from_string proc~tags_north_fold tags_north_fold proc~tags_north_fold->proc~ocean_bc_type_from_string proc~tags_periodic_x tags_periodic_x proc~tags_periodic_x->proc~ocean_bc_type_from_string proc~validate_config validate_config proc~validate_config->proc~ocean_bc_type_from_string proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~validate_config proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~configure_ocean_metrics->proc~tags_north_fold proc~configure_ocean_metrics->proc~tags_periodic_x 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~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

Source Code

   pure function ocean_bc_type_from_string(name) result(bc_type)
      !! Convert a config-namelist edge string → integer OBC tag.
      !! Case-INSENSITIVE (`to_lower`), so "OPEN"/"Open"/"open" all parse
      !! to `OBC_OPEN`.  An unrecognised name returns `OBC_INVALID`
      !! (PR-6 fail-loud): a typo must NOT silently close the boundary to
      !! a wall.  `validate_config` rejects `OBC_INVALID` (naming the
      !! edge) before `configure_ocean_bc` consumes any parse result, so
      !! no production caller ever sees the sentinel at a live edge.
      character(len=*), intent(in) :: name
      integer :: bc_type
      select case (to_lower(trim(name)))
      case ("wall")
         bc_type = OBC_WALL
      case ("open")
         bc_type = OBC_OPEN
      case ("tidal")
         bc_type = OBC_TIDAL
      case ("nested")
         bc_type = OBC_NESTED
      case ("inflow")
         bc_type = OBC_INFLOW
      case ("discharge")
         bc_type = OBC_DISCHARGE
      case ("clamped")
         bc_type = OBC_CLAMPED
      case ("sponge")
         bc_type = OBC_SPONGE
      case ("chapman")
         bc_type = OBC_CHAPMAN
      case ("periodic")
         bc_type = OBC_PERIODIC
      case ("tripolar_fold")
         bc_type = OBC_TRIPOLAR_FOLD
      case default
         bc_type = OBC_INVALID
      end select
   end function ocean_bc_type_from_string