poison_face_y_2d Subroutine

private subroutine poison_face_y_2d(fld, nxl, nyl, ng, qnan, pw, pe, ps, pn)

Poison y-face 2D ghost bands. fld has shape (nx_total, ny_total+1) = (nxl+2ng, nyl+2ng+1). NEVER poison j = ng+1 (south seam face) or j = ng+nyl+1 (north seam face). South ghost faces: j = 1..ng. North ghost faces: j = ng+nyl+2..ny_face. X-bands are centre-type: i = 1..ng and i = ng+nxl+1..nx_total.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nxl+2*ng,nyl+2*ng+1)
integer, intent(in) :: nxl
integer, intent(in) :: nyl
integer, intent(in) :: ng
real(kind=wp), intent(in) :: qnan
logical, intent(in) :: pw
logical, intent(in) :: pe
logical, intent(in) :: ps
logical, intent(in) :: pn

Called by

proc~~poison_face_y_2d~~CalledByGraph proc~poison_face_y_2d poison_face_y_2d proc~ocean_poison_ghost_bands ocean_poison_ghost_bands proc~ocean_poison_ghost_bands->proc~poison_face_y_2d proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~ocean_poison_ghost_bands proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
integer, private :: i
integer, private :: j
integer, private :: nxt
integer, private :: nyf

Source Code

   subroutine poison_face_y_2d(fld, nxl, nyl, ng, qnan, pw, pe, ps, pn)
      !! Poison y-face 2D ghost bands.
      !! fld has shape (nx_total, ny_total+1) = (nxl+2*ng, nyl+2*ng+1).
      !! NEVER poison j = ng+1 (south seam face) or j = ng+nyl+1 (north seam face).
      !! South ghost faces: j = 1..ng.  North ghost faces: j = ng+nyl+2..ny_face.
      !! X-bands are centre-type: i = 1..ng and i = ng+nxl+1..nx_total.
      integer, intent(in) :: nxl, nyl, ng
      real(wp), intent(inout) :: fld(nxl + 2*ng, nyl + 2*ng + 1)
      real(wp), intent(in) :: qnan
      logical, intent(in) :: pw, pe, ps, pn

      integer :: nxt, nyf, i, j

      nxt = nxl + 2*ng
      nyf = nyl + 2*ng + 1

      ! West band (centre-type): i = 1..ng
      if (pw) then
         do concurrent(j=1:nyf, i=1:ng)
            fld(i, j) = qnan
         end do
      end if
      ! East band (centre-type): i = ng+nxl+1..nxt
      if (pe) then
         do concurrent(j=1:nyf, i=ng + nxl + 1:nxt)
            fld(i, j) = qnan
         end do
      end if
      ! South ghost faces: j = 1..ng  (NOT j = ng+1 — seam face)
      if (ps) then
         do concurrent(j=1:ng, i=1:nxt)
            fld(i, j) = qnan
         end do
      end if
      ! North ghost faces: j = ng+nyl+2..nyf  (NOT j = ng+nyl+1 — seam face)
      if (pn) then
         do concurrent(j=ng + nyl + 2:nyf, i=1:nxt)
            fld(i, j) = qnan
         end do
      end if
   end subroutine poison_face_y_2d