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.
| Type | Intent | Optional | 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 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | nxf | ||||
| integer, | private | :: | nyt |
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