added writing of spherical flag to grid file