For periodic boundary conditions there are NX*NY*(NZ-1) grid cells and (NX+1)*(NY+1)*NZ grid points. The IX=NX+1 column is the same as the IX=1 column, because of the periodicity, but the grid points are repeated. The last grid cell on the "right" has the last column of grid points on the "left" and the repeated "virtual" set of grid points on the "right". For open boundary conditions in X and Y there are (NX+1)*(NY+1)*(NZ-1) grid cells and NX*NY*NZ grid points. Open boundary conditions are done with the lowest "left most" and "right most" X and Y columns being independent "pixels" with their own grid cells (zero width), therefore one extra grid cell is required. Independent pixel mode has NX*NY*(NZ-1) grid cells and NX*NY*NZ grid points