Set the index range over which the cell metrics are known. With an even number of ghost cells this is just the ghosted block; with an odd number (or a staggered grid) ghost-cell prolongation needs one extra layer.
subroutine set_geometry_index_ranges() use mod_global_parameters integer :: icase icase = mod(nghostcells,2) if (stagger_grid) icase = 1 select case (icase) case (0) ixGextmin1=ixGlo1;ixGextmin2=ixGlo2;ixGextmin3=ixGlo3 ixGextmax1=ixGhi1;ixGextmax2=ixGhi2;ixGextmax3=ixGhi3; case (1) ixGextmin1=ixGlo1-1;ixGextmin2=ixGlo2-1;ixGextmin3=ixGlo3-1 ixGextmax1=ixGhi1+1;ixGextmax2=ixGhi2+1;ixGextmax3=ixGhi3+1; case default call mpistop("no such case") end select end subroutine set_geometry_index_ranges