poison_face_x_2d Subroutine

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

Poison x-face 2D ghost bands. fld has shape (nx_total+1, ny_total) = (nxl+2ng+1, nyl+2ng). NEVER poison i = ng+1 (west seam face) or i = ng+nxl+1 (east seam face): these carry ownership/wrap-direction asymmetries that make it unsafe to overwrite them. West ghost faces: i = 1..ng. East ghost faces: i = ng+nxl+2..nx_face. Y-bands centre-type.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: fld(nxl+2*ng+1,nyl+2*ng)
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_x_2d~~CalledByGraph proc~poison_face_x_2d poison_face_x_2d proc~ocean_poison_ghost_bands ocean_poison_ghost_bands proc~ocean_poison_ghost_bands->proc~poison_face_x_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 :: nxf
integer, private :: nyt

Source Code

   subroutine poison_face_x_2d(fld, nxl, nyl, ng, qnan, pw, pe, ps, pn)
      !! Poison x-face 2D ghost bands.
      !! fld has shape (nx_total+1, ny_total) = (nxl+2*ng+1, nyl+2*ng).
      !! NEVER poison i = ng+1 (west seam face) or i = ng+nxl+1 (east seam face):
      !! these carry ownership/wrap-direction asymmetries that make it unsafe
      !! to overwrite them.  West ghost faces: i = 1..ng.
      !! East ghost faces: i = ng+nxl+2..nx_face.  Y-bands centre-type.
      integer, intent(in) :: nxl, nyl, ng
      real(wp), intent(inout) :: fld(nxl + 2*ng + 1, nyl + 2*ng)
      real(wp), intent(in) :: qnan
      logical, intent(in) :: pw, pe, ps, pn

      integer :: nxf, nyt, i, j

      nxf = nxl + 2*ng + 1
      nyt = nyl + 2*ng

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