Two-pass X-then-Y halo exchange for a 2D x-face field.
Index map (ng=nghost, nxl=nx_local):
Send EAST (ng+1 per j-row): source i = nxl+1..ng+nxl+1
(last i = ng+nxl+1 is owned seam face; first ng are pre-seam interior)
→ fills east-nbr’s i = 1..ng+1 (west ghosts + seam-copy overwrite)
Recv FROM EAST (ng per j-row):
east-nbr sends its i = ng+2..2*ng+1 → fills OUR east ghosts i = ng+nxl+2..ng+nxl+ng+1
Send WEST (ng per j-row): source i = ng+2..2*ng+1
→ fills west-nbr’s east ghosts
Recv FROM WEST (ng+1 per j-row):
west-nbr sends its owned seam + ng interior → fills OUR i = 1..ng+1
Arguments
Type
Intent
Optional
Attributes
Name
real(kind=wp),
intent(inout)
::
fld(oh_nx_total+1,oh_ny_total)
x-face field (nx_total+1, ny_total)
logical,
intent(in),
optional
::
device_resident
If .false., operate on host memory (no OpenACC directives).
Default (.true.) is the normal device-resident path.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Source Code
subroutine ocean_halo_face_x_2d(fld,device_resident)!! Two-pass X-then-Y halo exchange for a 2D x-face field.!!!! Index map (ng=nghost, nxl=nx_local):!! Send EAST (ng+1 per j-row): source i = nxl+1..ng+nxl+1!! (last i = ng+nxl+1 is owned seam face; first ng are pre-seam interior)!! → fills east-nbr's i = 1..ng+1 (west ghosts + seam-copy overwrite)!!!! Recv FROM EAST (ng per j-row):!! east-nbr sends its i = ng+2..2*ng+1 → fills OUR east ghosts i = ng+nxl+2..ng+nxl+ng+1!!!! Send WEST (ng per j-row): source i = ng+2..2*ng+1!! → fills west-nbr's east ghosts!!!! Recv FROM WEST (ng+1 per j-row):!! west-nbr sends its owned seam + ng interior → fills OUR i = 1..ng+1real(wp),intent(inout)::fld(oh_nx_total+1,oh_ny_total)!! x-face field (nx_total+1, ny_total)logical,intent(in),optional::device_resident!! If .false., operate on host memory (no OpenACC directives).!! Default (.true.) is the normal device-resident path.call oh_count_face_x_2d()call ocean_halo_face_x_2d_impl(fld,oh_nghost,device_resident)end subroutine ocean_halo_face_x_2d