3D x-face (Cu) north-halo fill, per-level identical. See the 2D
twin for the negate (vector vs. scalar) contract.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | u(nx_face,ny_total,nz) |
x-face 3D field, shape (nx_total+1, ny_total, nz). |
||
| integer, | intent(in) | :: | nx_face | |||
| integer, | intent(in) | :: | ny_total | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nghost | |||
| logical, | intent(in), | optional | :: | negate |
|
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | fsum | ||||
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | j_lo | ||||
| integer, | private | :: | jsum | ||||
| integer, | private | :: | k | ||||
| real(kind=wp), | private | :: | sgn |
pure subroutine fold_north_u_face_3d(u, nx_face, ny_total, nz, & nx_phys, ny_phys, nghost, negate) !! 3D x-face (Cu) north-halo fill, per-level identical. See the 2D !! twin for the `negate` (vector vs. scalar) contract. integer, intent(in) :: nx_face, ny_total, nz, nx_phys, ny_phys, nghost real(wp), intent(inout) :: u(nx_face, ny_total, nz) !! x-face 3D field, shape (nx_total+1, ny_total, nz). logical, intent(in), optional :: negate !! `.true.` (default) = true-vector component; `.false.` = scalar. integer :: i, j, k, fsum, jsum, j_lo real(wp) :: sgn sgn = -1.0_wp if (present(negate)) then if (.not. negate) sgn = 1.0_wp end if fsum = 2*nghost + nx_phys + 2 jsum = 2*nghost + 2*ny_phys + 1 j_lo = nghost + ny_phys + 1 do concurrent(k=1:nz, j=j_lo:ny_total, i=1:nx_face) u(i, j, k) = sgn*u(fsum - i, jsum - j, k) end do end subroutine fold_north_u_face_3d