Physical-cell index range for a grid-location tag: the ghost
ring excluded. Face locations carry one MORE physical entry
than cell centres in their staggered direction (an x-face array
spans nx_phys + 1 faces), which is why LOC_U/LOC_Q extend
i1 by one and LOC_V/LOC_Q extend j1.
A face on an MPI seam belongs to BOTH tiles’ ranges, so a tile
whose west (south) edge is not the grid’s west (south) edge —
global offset > 0 — drops its first face column (row): every face
is then counted exactly once over the ranks, as on one rank, and
the face bits are decomposition-invariant too. (A periodic seam
face is counted twice — as the first and the last face — on EVERY
decomposition alike.)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in) | :: | loc | |||
| integer, | intent(out) | :: | i0 | |||
| integer, | intent(out) | :: | i1 | |||
| integer, | intent(out) | :: | j0 | |||
| integer, | intent(out) | :: | j1 |
pure subroutine chksum_loc_interior(grid, loc, i0, i1, j0, j1) !! Physical-cell index range for a grid-location tag: the ghost !! ring excluded. Face locations carry one MORE physical entry !! than cell centres in their staggered direction (an x-face array !! spans `nx_phys + 1` faces), which is why `LOC_U`/`LOC_Q` extend !! `i1` by one and `LOC_V`/`LOC_Q` extend `j1`. !! !! A face on an MPI seam belongs to BOTH tiles' ranges, so a tile !! whose west (south) edge is not the grid's west (south) edge — !! global offset > 0 — drops its first face column (row): every face !! is then counted exactly once over the ranks, as on one rank, and !! the face `bits` are decomposition-invariant too. (A periodic seam !! face is counted twice — as the first and the last face — on EVERY !! decomposition alike.) type(hgrid_t), intent(in) :: grid integer, intent(in) :: loc integer, intent(out) :: i0, i1, j0, j1 i0 = grid%nghost + 1 j0 = grid%nghost + 1 i1 = grid%nghost + grid%nx_phys j1 = grid%nghost + grid%ny_phys select case (loc) case (LOC_U) i1 = i1 + 1 if (grid%i_offset_global > 0) i0 = i0 + 1 case (LOC_V) j1 = j1 + 1 if (grid%j_offset_global > 0) j0 = j0 + 1 case (LOC_Q) i1 = i1 + 1 j1 = j1 + 1 if (grid%i_offset_global > 0) i0 = i0 + 1 if (grid%j_offset_global > 0) j0 = j0 + 1 case default ! LOC_H (and any unknown tag): plain cell-centre range, already set. end select end subroutine chksum_loc_interior