Determine the shape of a block for output (whether to include ghost cells, and on which sides)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | igrid | |||
| integer, | intent(out) | :: | n_ghost(2*ndim) |
nghost(1:ndim) contains the number of ghost cells on the block's minimum boundaries, and nghost(ndim+1:2*ndim) on the block's maximum boundaries |
||
| integer, | intent(out) | :: | ixOmin1 |
Index range on output block |
||
| integer, | intent(out) | :: | ixOmin2 |
Index range on output block |
||
| integer, | intent(out) | :: | ixOmin3 |
Index range on output block |
||
| integer, | intent(out) | :: | ixOmax1 |
Index range on output block |
||
| integer, | intent(out) | :: | ixOmax2 |
Index range on output block |
||
| integer, | intent(out) | :: | ixOmax3 |
Index range on output block |
||
| integer, | intent(out) | :: | n_values |
Number of cells/values in output |
subroutine block_shape_io(igrid, n_ghost, ixOmin1,ixOmin2,ixOmin3,ixOmax1,& ixOmax2,ixOmax3, n_values) use mod_global_parameters integer, intent(in) :: igrid !> nghost(1:ndim) contains the number of ghost cells on the block's minimum !> boundaries, and nghost(ndim+1:2*ndim) on the block's maximum boundaries integer, intent(out) :: n_ghost(2*ndim) !> Index range on output block integer, intent(out) :: ixOmin1,ixOmin2,ixOmin3,ixOmax1,ixOmax2,ixOmax3 !> Number of cells/values in output integer, intent(out) :: n_values integer :: idim n_ghost(:) = 0 if(save_physical_boundary) then do idim=1,ndim ! Include ghost cells on lower boundary if(ps(igrid)%is_physical_boundary(2*idim-1)) n_ghost(idim)=nghostcells ! Include ghost cells on upper boundary if(ps(igrid)%is_physical_boundary(2*idim)) & n_ghost(ndim+idim)=nghostcells end do end if ixOmin1 = ixMlo1 - n_ghost(1) ixOmin2 = ixMlo2 - n_ghost(2) ixOmin3 = ixMlo3 - n_ghost(3) ixOmax1 = ixMhi1 + n_ghost(ndim+1) ixOmax2 = ixMhi2 + n_ghost(ndim+2) ixOmax3 = ixMhi3 + n_ghost(ndim+3) n_values = count_ix(ixOmin1,ixOmin2,ixOmin3,ixOmax1,ixOmax2,ixOmax3) * nw end subroutine block_shape_io