Fill ghost faces of a 3D y-face field (e.g. v_face_y_layer).
ny_face = ny_total + 1. no_wait (optional): see
ocean_periodic_wrap_centre_3d. Not pure (async/wait directives).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | fld(nx_total,ny_face,nz) |
y-face field, shape (nx_total, ny_total+1, nz). |
||
| integer, | intent(in) | :: | nx_total | |||
| integer, | intent(in) | :: | ny_face | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nghost | |||
| logical, | intent(in) | :: | wrap_x | |||
| logical, | intent(in) | :: | wrap_y | |||
| logical, | intent(in), | optional | :: | no_wait |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | j_n | ||||
| integer, | private | :: | j_s | ||||
| integer, | private | :: | k | ||||
| logical, | private | :: | lwait |
subroutine ocean_periodic_wrap_face_y_3d(fld, nx_total, ny_face, nz, & nx_phys, ny_phys, nghost, & wrap_x, wrap_y, no_wait) !! Fill ghost faces of a 3D y-face field (e.g. v_face_y_layer). !! ny_face = ny_total + 1. `no_wait` (optional): see !! `ocean_periodic_wrap_centre_3d`. Not `pure` (async/wait directives). integer, intent(in) :: nx_total, ny_face, nz, nx_phys, ny_phys, nghost real(wp), intent(inout) :: fld(nx_total, ny_face, nz) !! y-face field, shape (nx_total, ny_total+1, nz). logical, intent(in) :: wrap_x logical, intent(in) :: wrap_y logical, intent(in), optional :: no_wait integer :: i, j, k integer :: j_s, j_n logical :: lwait lwait = .true. if (present(no_wait)) lwait = .not. no_wait j_s = nghost + 1 j_n = nghost + ny_phys + 1 ! Two-pass: X-wrap first, Y-wrap (+ belt-and-braces) second. if (wrap_x) then !$acc kernels async(1) do concurrent(k=1:nz, j=1:ny_face, i=1:nx_total) if (i <= nghost) then fld(i, j, k) = fld(i + nx_phys, j, k) end if if (i > nx_phys + nghost) then fld(i, j, k) = fld(i - nx_phys, j, k) end if end do !$acc end kernels end if if (wrap_y) then !$acc kernels async(1) do concurrent(k=1:nz, j=1:ny_face, i=1:nx_total) if (j <= nghost) then fld(i, j, k) = fld(i, j + ny_phys, k) end if if (j > ny_phys + nghost + 1) then fld(i, j, k) = fld(i, j - ny_phys, k) end if if (j == j_n) fld(i, j, k) = fld(i, j_s, k) end do !$acc end kernels end if if (lwait) then !$acc wait(1) end if end subroutine ocean_periodic_wrap_face_y_3d