configure_obc_edge_nodal Subroutine

private subroutine configure_obc_edge_nodal(face, f_all, u_all, v_all, edge_name, compute_rank, ierr)

Bake the C3 nodal/astronomical correction into one OBC edge, then fail loud (rank-0 error + error stop) if any of the edge’s constituent frequencies matches no tide-catalog entry, else log the resolved constituent → (name, f_c, V_c+u_c) map on rank 0. Host-side setup wrapper around the pure obc_tide_nodal_fill — the pure helper signals the failure via fill_ierr; the loud policy lives here.

Arguments

Type IntentOptional Attributes Name
type(ocean_bc_face_tag_t), intent(inout) :: face
real(kind=wp), intent(in) :: f_all(TIDES_CATALOG_SIZE)
real(kind=wp), intent(in) :: u_all(TIDES_CATALOG_SIZE)
real(kind=wp), intent(in) :: v_all(TIDES_CATALOG_SIZE)
character(len=*), intent(in) :: edge_name
integer, intent(in) :: compute_rank
integer, intent(out), optional :: ierr

Non-zero when an OBC tidal constituent matches no tide-catalog entry, when present; absent behaves as today (error stop).


Calls

proc~~configure_obc_edge_nodal~~CallsGraph proc~configure_obc_edge_nodal configure_obc_edge_nodal info info proc~configure_obc_edge_nodal->info proc~fail fail proc~configure_obc_edge_nodal->proc~fail proc~obc_match_constituent obc_match_constituent proc~configure_obc_edge_nodal->proc~obc_match_constituent proc~obc_tide_nodal_fill obc_tide_nodal_fill proc~configure_obc_edge_nodal->proc~obc_tide_nodal_fill to_string to_string proc~configure_obc_edge_nodal->to_string error error proc~fail->error proc~error_ring_push error_ring_push proc~fail->proc~error_ring_push proc~obc_tide_nodal_fill->proc~obc_match_constituent

Called by

proc~~configure_obc_edge_nodal~~CalledByGraph proc~configure_obc_edge_nodal configure_obc_edge_nodal proc~configure_ocean_bc configure_ocean_bc proc~configure_ocean_bc->proc~configure_obc_edge_nodal proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_bc 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 :: fill_ierr
integer, private :: ic
integer, private :: nc

Source Code

   subroutine configure_obc_edge_nodal(face, f_all, u_all, v_all, edge_name, compute_rank, ierr)
      !! Bake the C3 nodal/astronomical correction into one OBC edge, then
      !! fail loud (rank-0 error + `error stop`) if any of the edge's
      !! constituent frequencies matches no tide-catalog entry, else log the
      !! resolved constituent → (name, f_c, V_c+u_c) map on rank 0.  Host-side
      !! setup wrapper around the `pure` `obc_tide_nodal_fill` — the pure
      !! helper signals the failure via `fill_ierr`; the loud policy lives
      !! here.
      type(ocean_bc_face_tag_t), intent(inout) :: face
      real(wp), intent(in) :: f_all(TIDES_CATALOG_SIZE)
      real(wp), intent(in) :: u_all(TIDES_CATALOG_SIZE)
      real(wp), intent(in) :: v_all(TIDES_CATALOG_SIZE)
      character(len=*), intent(in) :: edge_name
      integer, intent(in) :: compute_rank
      integer, intent(out), optional :: ierr
         !! Non-zero when an OBC tidal constituent matches no tide-catalog
         !! entry, when present; absent behaves as today (`error stop`).

      integer :: fill_ierr, nc, ic

      call obc_tide_nodal_fill(face, f_all, u_all, v_all, fill_ierr)
      if (fill_ierr /= 0) then
         call fail("OBC tides: "//trim(edge_name)//" edge constituent " &
                   //to_string(fill_ierr)//" omega="//to_string(face%tidal_omega(fill_ierr)) &
                   //" rad/s matches no tide-catalog entry (rel tol 1e-4)", ierr, OCEAN_STATUS_ERR_SETUP)
         return
      end if
      if (compute_rank == 0) then
         do nc = 1, face%n_tidal_constituents
            ic = obc_match_constituent(face%tidal_omega(nc))
            call logger%info("OBC tide nodal ["//trim(edge_name)//"]: "//TIDE_NAME(ic) &
                             //" f="//to_string(face%tidal_fnodal(nc)) &
                             //" V+u="//to_string(face%tidal_arg(nc))//" rad")
         end do
      end if
      if (present(ierr)) ierr = OCEAN_STATUS_OK
   end subroutine configure_obc_edge_nodal