Fill the north halo of a 2D cell-centred field by the T-fold.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | fld(nx_total,ny_total) |
Cell-centred field, shape (nx_total, ny_total). |
||
| integer, | intent(in) | :: | nx_total | |||
| integer, | intent(in) | :: | ny_total | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nghost |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | isum | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | j_lo | ||||
| integer, | private | :: | jsum |
pure subroutine fold_north_centre_2d(fld, nx_total, ny_total, & nx_phys, ny_phys, nghost) !! Fill the north halo of a 2D cell-centred field by the T-fold. integer, intent(in) :: nx_total, ny_total, nx_phys, ny_phys, nghost real(wp), intent(inout) :: fld(nx_total, ny_total) !! Cell-centred field, shape (nx_total, ny_total). integer :: i, j, isum, jsum, j_lo isum = 2*nghost + nx_phys + 1 jsum = 2*nghost + 2*ny_phys + 1 j_lo = nghost + ny_phys + 1 ! first north halo row (storage) do concurrent(j=j_lo:ny_total, i=1:nx_total) fld(i, j) = fld(isum - i, jsum - j) end do end subroutine fold_north_centre_2d