Calculate GRID values