fixed out-of-grid errors in porosity estimation routine on non-periodic grids