obc_tide_nodal_fill Subroutine

public pure subroutine obc_tide_nodal_fill(face, f_all, u_all, v_all, ierr)

Bake the nodal/astronomical correction into one edge’s per-constituent tidal_fnodal / tidal_arg. For each of face%n_tidal_constituents, resolve the constituent by frequency (obc_match_constituent) and set tidal_fnodal(nc) = f_all(ic), tidal_arg(nc) = v_all(ic) + u_all(ic). f_all / u_all come from nodal_fu, v_all from equilibrium_arguments, all sized TIDES_CATALOG_SIZE. On an unmatched constituent it leaves that entry untouched and returns ierr = nc (the 1-based edge slot that failed) so the caller can fail loud; ierr = 0 on success. pure — no logging / no error stop.

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)
integer, intent(out) :: ierr

Calls

proc~~obc_tide_nodal_fill~~CallsGraph proc~obc_tide_nodal_fill obc_tide_nodal_fill proc~obc_match_constituent obc_match_constituent proc~obc_tide_nodal_fill->proc~obc_match_constituent

Called by

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

Source Code

   pure subroutine obc_tide_nodal_fill(face, f_all, u_all, v_all, ierr)
      !! Bake the nodal/astronomical correction into one edge's per-constituent
      !! `tidal_fnodal` / `tidal_arg`.  For each of `face%n_tidal_constituents`,
      !! resolve the constituent by frequency (`obc_match_constituent`) and set
      !! `tidal_fnodal(nc) = f_all(ic)`, `tidal_arg(nc) = v_all(ic) + u_all(ic)`.
      !! `f_all` / `u_all` come from `nodal_fu`, `v_all` from
      !! `equilibrium_arguments`, all sized `TIDES_CATALOG_SIZE`.  On an
      !! unmatched constituent it leaves that entry untouched and returns
      !! `ierr = nc` (the 1-based edge slot that failed) so the caller can fail
      !! loud; `ierr = 0` on success.  `pure` — no logging / no `error stop`.
      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)
      integer, intent(out) :: ierr
      integer :: nc, ic
      ierr = 0
      do nc = 1, face%n_tidal_constituents
         ic = obc_match_constituent(face%tidal_omega(nc))
         if (ic == 0) then
            ierr = nc
            return
         end if
         face%tidal_fnodal(nc) = f_all(ic)
         face%tidal_arg(nc) = v_all(ic) + u_all(ic)
      end do
   end subroutine obc_tide_nodal_fill