Commits

Matthew Turk  committed e3b4bc9

Many changes to strip out the non-group and HDF4 output types. I have also
replaced the extraction with an ENZO_FAIL for now, as it was hard coded to use
a lot of very old unmaintained routines (and I am moderately skeptical that it
gets used very often, and if it needs to be replaced it should be replaced with
a newer version of the routine.)

  • Participants
  • Parent commits 9c18eba

Comments (0)

Files changed (31)

File src/enzo/AnalysisBaseClass.C

 #include "AnalysisBaseClass.h"
 
 std::map<HierarchyEntry *, int> OriginalGridID;
-#ifdef USE_HDF5_GROUPS
 std::map<HierarchyEntry *, int> OriginalTaskID;
-#endif
 
 void my_exit(int exit_status);
 int CosmologyComputeExpansionFactor(FLOAT time, FLOAT *a, FLOAT *dadt);

File src/enzo/CheckForOutput.C

 #endif
  
 /* function prototypes */
-//#ifdef USE_HDF5_GROUPS
-int Group_WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
+int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
 		 TopGridData &MetaData, ExternalBoundary *Exterior,
 #ifdef TRANSFER
 	         ImplicitProblemABC *ImplicitSolver,
 #endif
 		 FLOAT WriteTime = -1, int RestartDump = FALSE);
-//#else
-/* 
-int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
-		 TopGridData &MetaData, ExternalBoundary *Exterior,
-#ifdef TRANSFER
-	         ImplicitProblemABC *ImplicitSolver,
-#endif
-		 FLOAT WriteTime = -1);
-*/
-//#endif
 
 double ReturnWallTime(void);
 void my_exit(int status);
     MetaData.CycleLastRestartDump = MetaData.CycleNumber;
 
     if (debug) printf("Writing restart dump.\n");
-    Group_WriteAllData(MetaData.RestartDumpName, MetaData.RestartDumpNumber++,
+    WriteAllData(MetaData.RestartDumpName, MetaData.RestartDumpNumber++,
 		       TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
     SavedCPUTime = MetaData.CPUTime;
     MetaData.CPUTime = 0.0;
     if (debug) printf("CPUtime-based output!\n");
-    Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
+    WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
 		       TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
     MetaData.CPUTime = 0.0;
     MetaData.TimeLastDataDump += MetaData.dtDataDump;
 
-    //#ifdef USE_HDF5_GROUPS
-    Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
+    WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
 		       TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
 #endif
 		       );
-// #else
-//     if (WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
-// 		        TopGrid, MetaData, Exterior
-//#ifdef TRANSFER
-//			, ImplicitSolver
-//#endif
-//		        ) == FAIL {
-// 	ENZO_FAIL("Error in WriteAllData.\n");
-//     }
-// #endif
-
     MetaData.CPUTime = SavedCPUTime;
     MetaData.WroteData = TRUE;
   }
     MetaData.CPUTime = 0.0;
     MetaData.CycleLastDataDump += MetaData.CycleSkipDataDump;
 
-    //#ifdef USE_HDF5_GROUPS
-    Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
+    WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
 		       TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
 #endif
 		       );
-// #else
-//     if (WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
-// 		        TopGrid, MetaData, Exterior
-//#ifdef TRANSFER
-//			, ImplicitSolver
-//#endif
-//                      ) == FAIL) {
-// 	ENZO_FAIL("Error in WriteAllData.\n");
-//     }
-// #endif
 
     MetaData.CPUTime = SavedCPUTime;
     MetaData.WroteData = TRUE;
 
 	  SavedCPUTime = MetaData.CPUTime;
 	  MetaData.CPUTime = 0.0;
-	  //#ifdef USE_HDF5_GROUPS
-	  Group_WriteAllData(Name, Number, TopGrid, MetaData, Exterior
+	  WriteAllData(Name, Number, TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 			     , ImplicitSolver
 #endif
 			     );
-// #else
-// 	  if (WriteAllData(Name, Number, TopGrid, MetaData, Exterior
-//#ifdef TRANSFER
-//			   , ImplicitSolver
-//#endif
-//                         ) == FAIL) {
-// 	    ENZO_FAIL("Error in WriteAllData.\n");
-// 	  }
-// #endif
 
 	  MetaData.CPUTime = SavedCPUTime;
 	  MetaData.WroteData = TRUE;
 	}
 
-#ifdef UNUSED
-  /* Check for output: when the MBH jets haven't been ejected for too long 
-                       this is currently a test - Ji-hoon Kim, Mar.2010 */  
- 
-  if ((MBHFeedback >= 2 && MBHFeedback <= 5) && 
-      OutputWhenJetsHaveNotEjected == TRUE) {
-
-    fprintf(stdout, "CheckForOutput: MBH_JETS - file output complete; restart with the dump!\n");
-    Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber++,
-		       TopGrid, MetaData, Exterior);
-
-    OutputWhenJetsHaveNotEjected = FALSE;
-    MetaData.WroteData = TRUE;
-    my_exit(EXIT_SUCCESS);
-
-  }
-#endif   
 
   if (MetaData.NumberOfOutputsBeforeExit && MetaData.WroteData) {
     MetaData.OutputsLeftBeforeExit--;

File src/enzo/EvolveHierarchy.C

 #ifdef TRANSFER
 		 ImplicitProblemABC *ImplicitSolver,
 #endif		 
-		 FLOAT WriteTime = -1);
-
-int Group_WriteAllData(char *basename, int filenumber,
-		 HierarchyEntry *TopGrid, TopGridData &MetaData,
-		 ExternalBoundary *Exterior, 
-#ifdef TRANSFER
-		 ImplicitProblemABC *ImplicitSolver,
-#endif		 
 		 FLOAT WriteTime = -1,
 		 int RestartDump = FALSE);
 
           fprintf(stderr, "Error in EvolveLevel.\n");
           fprintf(stderr, "--> Dumping data (output number %d).\n",
                   MetaData.DataDumpNumber);
-	Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
+	WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
 		     &TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 		     , ImplicitSolver
 	    fprintf(stderr, "Error in EvolveLevel_RK2.\n");
 	    fprintf(stderr, "--> Dumping data (output number %d).\n",
 		    MetaData.DataDumpNumber);
-	    Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
+	    WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
 			       &TopGrid, MetaData, Exterior
 #ifdef TRANSFER
 			       , ImplicitSolver
  
   if ((MetaData.dtDataDump != 0.0 || MetaData.CycleSkipDataDump != 0) &&
       !MetaData.WroteData)
-    //#ifdef USE_HDF5_GROUPS
-    if (Group_WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
+    if (WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
 			   &TopGrid, MetaData, Exterior, 
 #ifdef TRANSFER
 			   ImplicitSolver, 
 #endif		 
 			   -666) == FAIL)
-      ENZO_FAIL("Error in Group_WriteAllData.");
-// #else
-//     if (WriteAllData(MetaData.DataDumpName, MetaData.DataDumpNumber,
-// 		     &TopGrid, MetaData, Exterior, 
-//#ifdef TRANSFER
-//		     ImplicitSolver, 
-//#endif		 
-//                   -666) == FAIL) {
-//       ENZO_FAIL("Error in WriteAllData.\n");
-//     }
-// #endif
+      ENZO_FAIL("Error in WriteAllData.");
  
   /* Write a file to indicate that we're finished. */
 

File src/enzo/ExternalBoundary.h

 //
   int ReadExternalBoundary(FILE *fptr, int ReadText = TRUE, int ReadData = TRUE);
 //
-// Read an external boundary for hdf4
-//
-  int ReadExternalBoundaryHDF4(FILE *fptr);
-//
 // Write an external boundary
 //
   int WriteExternalBoundary(FILE *fptr, char *hdfname);

File src/enzo/ExternalBoundary_ReadExternalBoundary.C

 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef USE_HDF4
-#include <df.h>
-#endif 
-
 
  
 #include "ErrorExceptions.h"
  
 }
 
-
-
-#ifdef USE_HDF4
-int ExternalBoundary::ReadExternalBoundaryHDF4(FILE *fptr)
-{
-
-  /* declarations */
-
-  int Dims[MAX_DIMENSION], index, size, i;
-  int BoundaryValuePresent[2*MAX_DIMENSION];
-  int field, j;
-  intn TempInt2;
-  int32 TempIntArray[MAX_DIMENSION];
-  float32 *buffer;
-  char hdfname[MAX_LINE_LENGTH];
-
-  /* read general class data */
-
-  if (fscanf(fptr, "BoundaryRank = %d\n", &BoundaryRank) != 1) {
-    fprintf(stderr, "Error reading BoundaryRank.\n");
-    return FAIL;
-  }
-
-  fscanf(fptr, "BoundaryDimension =");
-  if (ReadListOfInts(fptr, BoundaryRank, BoundaryDimension) == FAIL) {
-    fprintf(stderr, "Error reading BoundaryDimension.\n");
-    return FAIL;
-  }
-
-  /* read baryon field quantities */
-
-  if (fscanf(fptr, "NumberOfBaryonFields = %d\n", 
-	     &NumberOfBaryonFields) != 1) {
-    fprintf(stderr, "Error reading NumberOfBaryonFields.\n");
-    return FAIL;
-  }
-
-  /* Read particle boundary type. */
-
-  if (fscanf(fptr, "ParticleBoundaryType = %d\n",&ParticleBoundaryType) != 1) {
-    fprintf(stderr, "Error reading ParticleBoundaryType.\n");
-    return FAIL;
-  }
-
-  if (NumberOfBaryonFields > 0) {
-
-    /* read field types */
-
-    fscanf(fptr, "BoundaryFieldType = ");
-    if (ReadListOfInts(fptr, NumberOfBaryonFields, BoundaryFieldType) 
-        == FAIL) {
-      fprintf(stderr, "Error reading BoundaryFieldType.\n");
-      return FAIL;
-    }
-
-    /* read hdf file name */
-
-    if (fscanf(fptr, "BaryonFileName = %s\n", hdfname) != 1) {
-      fprintf(stderr, "Error reading BaryonFileName.\n");
-      return FAIL;
-    }    
-
-    /* read BoundaryValue present line */
-
-    fscanf(fptr, "BoundaryValuePresent = ");
-    if (ReadListOfInts(fptr, BoundaryRank*2, BoundaryValuePresent) == FAIL) {
-      fprintf(stderr, "Error reading BoundaryValuePresent.\n");
-      return FAIL;
-    }
-
-    /* loop over faces, reading each */
-
-    for (int dim = 0; dim < BoundaryRank; dim++)
-      if (BoundaryDimension[dim] > 1) {
-
-	/* calculate size and dims of flux plane */
-	
-	index = 0;
-	size  = 1;
-	Dims[0] = 1;
-	for (i = 0; i < BoundaryRank; i++)
-	  if (i != dim) {
-	    Dims[index++] = BoundaryDimension[i];
-	    size *= BoundaryDimension[i];
-	  }
-	index = max(BoundaryRank-1, 1);   // make index at least 1
-
-	/* Read HDF dims */
-
-	if (DFSDgetdims(hdfname, &TempInt2, TempIntArray, BoundaryRank) 
-	    == HDF_FAIL) {
-	  fprintf(stderr, "Error in DFSDgetdims.\n");
-	  return FAIL;
-	}
-
-	/* Check rank and dimensions (dims are stored backwards for us). */
-
-	if (TempInt2 != index) {
-	  fprintf(stderr, "HDF file rank does not match BoundaryRank.\n");
-	  return FAIL;
-	}
-
-	for (i = 0; i < index; i++)
-	  if (TempIntArray[index-i-1] != Dims[i]) {
-	    fprintf(stderr, "HDF file dims do not match BoundaryDims.\n");
-	    fprintf(stderr, " Dims[%d] = %d   HDF Dims[%d] = %d\n", i, Dims[i],
-		    index-i-1, TempIntArray[index-i-1]);
-	    return FAIL;
-	  }
-
-	/* Allocate temporary space. */
-	
-	buffer = new float32[size];
-
-	/* loop over fields, reading each */
-
-	for (field = 0; field < NumberOfBaryonFields; field++)
-	  for (i = 0; i < 2; i++) {
-
-	    /* allocate room for BoundaryType */
-
-	    BoundaryType[field][dim][i] = new boundary_type[size];
-
-	    /* read BoundaryType (then convert to int) */
-
-	    if (DFSDgetdata(hdfname, TempInt2, TempIntArray, (VOIDP) buffer)
-		== HDF_FAIL) {
-	      fprintf(stderr, "Error in DFSDgetdata(0).\n");
-	      return FAIL;
-	    }
-
-	    for (j = 0; j < size; j++)
-	      BoundaryType[field][dim][i][j] = 
-		                      (boundary_type) nint(buffer[j]);
-
-	    /* read BoundaryValue */
-
-	    if (BoundaryValuePresent[2*dim+i]) {
-	      BoundaryValue[field][dim][i] = new float[size];
-	      if (DFSDgetdata(hdfname, TempInt2, TempIntArray, (VOIDP)
-			      buffer) == HDF_FAIL) {
-		fprintf(stderr, "Error in DFSDgetdata(1).\n");
-		fprintf(stderr, "dim = %d field = %d i = %d\n", dim, field, i);
-		return FAIL;
-	      }
-	      for (j = 0; j < size; j++){
-		BoundaryValue[field][dim][i][j] = float(buffer[j]);
-	        if(i==0&&j==0) fprintf(stderr,"BoundaryValue[%d][%d][0][0]=%f\n", field, dim, BoundaryValue[field][dim][0][0]);
-	      }		
-	    }
-	  }  // end of loop over fields
-
-	delete buffer;
-	
-      }   // end of loop over dims
-
-  }
-
-  return SUCCESS;
-
-}
-#endif
-

File src/enzo/ExtractSection.C

  
   if (ExtractFieldsOnly)
   {
-    if (Grids[ExtractLevel]->WriteGridX(output, ExtractOutputName, 0) == FAIL) {
-      fprintf(stderr, "Error in grid->WriteGridX.\n");
+    if (Grids[ExtractLevel]->WriteGridExtract(output, ExtractOutputName, 0) == FAIL) {
+      fprintf(stderr, "Error in grid->WriteGridExtract.\n");
       my_exit(EXIT_FAILURE);
     }
   }
   else
   {
-    if (Grids[ExtractLevel]->WriteGrid(output, ExtractOutputName, 0) == FAIL) {
+    ENZO_FAIL("This functionality is not currently implemented.");
+    /*if (Grids[ExtractLevel]->WriteGrid(output, ExtractOutputName, 0) == FAIL) {
       fprintf(stderr, "Error in grid->WriteGrid.\n");
       my_exit(EXIT_FAILURE);
-    }
+    }*/
   }
  
   /* If using particles, open a file to output particle data. */

File src/enzo/Grid.h

 
 /* Read grid data from a group file (returns: success/failure) */
 
-   int ReadGrid(FILE *fptr, int GridID, HDF5_hid_t file_id, 
+   int ReadGrid(FILE *main_file_pointer, int GridID, HDF5_hid_t file_id, 
 		      char DataFilename[],
-		      int ReadText, int ReadData, bool ReadParticlesOnly=false);
+		      int ReadText = TRUE, int ReadData = TRUE, 
+		      bool ReadParticlesOnly=false, int ReadEverything = FALSE);
    
 /* Get field or particle data based on name or integer 
    defined in typedefs.h. Details are in Grid_CreateFieldArray.C. */
 
 /* Write grid data to separate files (returns: success/failure) */
 
-   int WriteGridX(FILE *main_file_pointer, char *base_name, int grid_id);
+   int WriteGridExtract(FILE *main_file_pointer, char *base_name, int grid_id);
 
 /* Write task memory map */
 

File src/enzo/Grid_ReadGrid.C

 static int GridReadDataGridCounter = 0;
  
  
-#ifdef NEW_GRID_IO
-int grid::Group_ReadGrid(FILE *fptr, int GridID, HDF5_hid_t file_id, 
+int grid::ReadGrid(FILE *fptr, int GridID, HDF5_hid_t file_id, 
 			 char DataFilename[],
 			 int ReadText, int ReadData, bool ReadParticlesOnly,
 			 int ReadEverything)
     int ghosts =DEFAULT_GHOST_ZONES;
     if (GridStartIndex[0] != ghosts)  {
 	if (GridID < 2)
-     fprintf(stderr,"Grid_Group_ReadGrid: Adjusting Ghostzones which in the hierarchy file did not match the selected HydroMethod.\n");
+     fprintf(stderr,"Grid_ReadGrid: Adjusting Ghostzones which in the hierarchy file did not match the selected HydroMethod.\n");
       for (int dim=0; dim < GridRank; dim++) {
 	GridDimension[dim]  = GridEndIndex[dim]-GridStartIndex[dim]+1+2*ghosts;
 	GridStartIndex[dim] = ghosts;
   return SUCCESS;
  
 }
-#endif
 
 int grid::read_dataset(int ndims, hsize_t *dims, char *name, hid_t group,
                   hid_t data_type, void *read_to, int copy_back_active,

File src/enzo/Grid_WriteGrid.C

 	     float *TemperatureUnits, float *TimeUnits,
 	     float *VelocityUnits, FLOAT Time);
 
-#ifdef NEW_GRID_IO
-int grid::Group_WriteGrid(FILE *fptr, char *base_name, int grid_id, HDF5_hid_t file_id,
+int grid::WriteGrid(FILE *fptr, char *base_name, int grid_id, HDF5_hid_t file_id,
                           int WriteEverything)
 {
 
   return SUCCESS;
   
 }
-#endif
 
 int grid::write_dataset(int ndims, hsize_t *dims, char *name, hid_t group,
                   hid_t data_type, void *data, int active_only,

File src/enzo/Grid_WriteGridExtract.C

+/***********************************************************************
+/
+/  GRID CLASS (WRITE OUT GRID)
+/
+/  written by: Greg Bryan
+/  date:       November, 1994
+/  modified1:  Robert Harkness, July 2002
+/  modified2:  Robert Harkness, April 2008
+/  modified3:  Robert Harkness, May 2008
+/
+/  PURPOSE:
+/
+************************************************************************/
+ 
+//  Write grid to file pointer fptr
+//     (we assume that the grid is at an appropriate stopping point,
+//      where the Old values aren't required)
+ 
+#include <hdf5.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+ 
+
+
+ 
+#include "ErrorExceptions.h"
+#include "macros_and_parameters.h"
+#include "typedefs.h"
+#include "global_data.h"
+#include "Fluxes.h"
+#include "GridList.h"
+#include "ExternalBoundary.h"
+#include "Grid.h"
+void my_exit(int status);
+ 
+// HDF5 function prototypes
+ 
+
+ 
+// function prototypes
+ 
+void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
+void WriteListOfInts(FILE *fptr, int N, int nums[]);
+int WriteStringAttr(hid_t dset_id, char *Alabel, char *String, FILE *log_fptr);
+ 
+ 
+ 
+ 
+int grid::WriteGridExtract(FILE *fptr, char *base_name, int grid_id)
+{
+ 
+  int i, j, k, dim, field, size, ActiveDim[MAX_DIMENSION];
+  int file_status;
+ 
+  float32 *temp;
+ 
+  FILE *log_fptr;
+ 
+  hid_t       file_id, dset_id;
+  hid_t       float_type_id, FLOAT_type_id;
+  hid_t       file_type_id, FILE_type_id;
+  hid_t       file_dsp_id;
+ 
+  hsize_t     OutDims[MAX_DIMENSION];
+  hsize_t     TempIntArray[1];
+ 
+  herr_t      h5_status;
+  herr_t      h5_error = -1;
+ 
+  char *ParticlePositionLabel[] =
+     {"particle_position_x", "particle_position_y", "particle_position_z"};
+  char *ParticleVelocityLabel[] =
+     {"particle_velocity_x", "particle_velocity_y", "particle_velocity_z"};
+  char *ParticleAttributeLabel[] = {"creation_time", "dynamical_time",
+				    "metallicity_fraction", "particle_jet_x", "particle_jet_y", "particle_jet_z", "alpha_fraction"};
+  /*  char *ParticleAttributeLabel[] = {"creation_time", "dynamical_time",
+      "metallicity_fraction", "alpha_fraction"};*/
+#ifdef IO_LOG
+  int         io_log = 1;
+#else
+  int         io_log = 0;
+#endif
+ 
+  printf("THIS IS WGX \n");
+ 
+  /* initialize */
+ 
+  char id[MAX_GRID_TAG_SIZE];
+  sprintf(id, "%"GRID_TAG_FORMAT""ISYM, grid_id);
+ 
+  /* make sure quantities defined at least for 3d */
+ 
+  for (dim = GridRank; dim < 3; dim++) {
+    GridDimension[dim] = 1;
+    GridStartIndex[dim] = 0;
+    GridEndIndex[dim] = 0;
+  }
+ 
+  for (dim = 0; dim < 3; dim++)
+    ActiveDim[dim] = GridEndIndex[dim] - GridStartIndex[dim] +1;
+ 
+  /* ------------------------------------------------------------------- */
+  /* 1) Save general grid class data */
+ 
+  if (MyProcessorNumber == ROOT_PROCESSOR) {
+ 
+    fprintf(fptr, "GridRank          = %"ISYM"\n", GridRank);
+ 
+    fprintf(fptr, "GridDimension     = ");
+    WriteListOfInts(fptr, GridRank, GridDimension);
+ 
+    fprintf(fptr, "GridStartIndex    = ");
+    WriteListOfInts(fptr, GridRank, GridStartIndex);
+ 
+    fprintf(fptr, "GridEndIndex      = ");
+    WriteListOfInts(fptr, GridRank, GridEndIndex);
+ 
+    fprintf(fptr, "GridLeftEdge      = ");
+    WriteListOfFloats(fptr, GridRank, GridLeftEdge);
+ 
+    fprintf(fptr, "GridRightEdge     = ");
+    WriteListOfFloats(fptr, GridRank, GridRightEdge);
+ 
+    fprintf(fptr, "Time              = %"GOUTSYM"\n", Time);
+ 
+    fprintf(fptr, "SubgridsAreStatic = %"ISYM"\n", SubgridsAreStatic);
+ 
+    fprintf(fptr, "NumberOfBaryonFields = %"ISYM"\n", NumberOfBaryonFields);
+ 
+  }
+ 
+  char *name = new char[MAX_NAME_LENGTH];
+  strcpy(name, base_name);
+  strcat(name, id);
+ 
+  if (MyProcessorNumber == ProcessorNumber)
+  {
+    char *logname = new char[MAX_NAME_LENGTH];
+    strcpy(logname, base_name);
+    strcat(logname, id);
+    strcat(logname, ".log");
+    if (io_log) log_fptr = fopen(logname, "a");
+    delete logname;
+ 
+    if (io_log) fprintf(log_fptr, "Grid_WriteGrid\n");
+    if (io_log) fprintf(log_fptr, "  ID %"ISYM"  %s\n", grid_id, id);
+    if (io_log) fprintf(log_fptr, "  BASE %s\n", base_name);
+    if (io_log) fprintf(log_fptr, "  HDF %s\n", name);
+  }
+ 
+  /* Open HDF file for writing. */
+ 
+ 
+//  if (MyProcessorNumber == ProcessorNumber)
+//  {
+//    if (io_log) fprintf(log_fptr, "H5Fcreate with Name = %s\n", name);
+//
+//    file_id = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+//
+//    fprintf(stderr,"GPFS create: file_id = %"ISYM"  %s\n", file_id, name);
+//
+//    if (io_log) fprintf(log_fptr,"H5Fcreate id: %"ISYM"\n",file_id);
+//    if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+//  }
+ 
+ 
+  /* ------------------------------------------------------------------- */
+  /* 2) save baryon field quantities (including fields). */
+ 
+  int ii = sizeof(float32);
+ 
+  switch(ii)
+  {
+ 
+    case 4:
+      float_type_id = HDF5_R4;
+      file_type_id = HDF5_FILE_R4;
+      break;
+ 
+    case 8:
+      float_type_id = HDF5_R8;
+      file_type_id = HDF5_FILE_R8;
+      break;
+ 
+    default:
+      float_type_id = HDF5_R4;
+      file_type_id = HDF5_FILE_R4;
+ 
+  }
+ 
+  int jj = sizeof(FLOAT);
+ 
+  switch(jj)
+  {
+ 
+    case 4:
+      FLOAT_type_id = HDF5_R4;
+      FILE_type_id = HDF5_FILE_R4;
+      break;
+ 
+    case 8:
+      FLOAT_type_id = HDF5_R8;
+      FILE_type_id = HDF5_FILE_R8;
+      break;
+ 
+    case 16:
+      FLOAT_type_id = HDF5_R16;
+      FILE_type_id = H5Tcopy(HDF5_FILE_B8);
+                     H5Tset_size(FILE_type_id,16);
+      break;
+ 
+    default:
+      fprintf(stderr, "INCORRECT FLOAT DEFINITION in Grid_WriteGridX\n");
+ 
+  }
+ 
+  if (NumberOfBaryonFields > 0) {
+ 
+    if (MyProcessorNumber == ROOT_PROCESSOR) {
+ 
+      fprintf(fptr, "FieldType = ");
+      WriteListOfInts(fptr, NumberOfBaryonFields, FieldType);
+ 
+      fprintf(fptr, "BaryonFileName = %s\n", name);
+ 
+      fprintf(fptr, "CourantSafetyNumber    = %"FSYM"\n", CourantSafetyNumber);
+      fprintf(fptr, "PPMFlatteningParameter = %"ISYM"\n", PPMFlatteningParameter);
+      fprintf(fptr, "PPMDiffusionParameter  = %"ISYM"\n", PPMDiffusionParameter);
+      fprintf(fptr, "PPMSteepeningParameter = %"ISYM"\n", PPMSteepeningParameter);
+ 
+    }
+ 
+    if (MyProcessorNumber == ProcessorNumber) {
+ 
+    /* 2a) Set HDF file dimensions (use FORTRAN ordering). */
+ 
+    for (dim = 0; dim < GridRank; dim++)
+      OutDims[GridRank-dim-1] = ActiveDim[dim];
+ 
+    /* 2b) Write out co-ordinate values.  Use the centre of each cell. */
+ 
+    size = 1;
+    float32 *tempdim[MAX_DIMENSION];
+ 
+    for (dim = GridRank-1; dim >= 0; dim--) {
+ 
+      /* Compute cell centers and put them in temp. */
+ 
+      tempdim[dim] = new float32[GridDimension[dim]];
+
+      for (i = 0; i <= GridEndIndex[dim] - GridStartIndex[dim]; i++)
+	tempdim[dim][i] = CellLeftEdge[dim][GridStartIndex[dim] + i] +
+	          0.5 * CellWidth[dim][GridStartIndex[dim] + i];
+
+      size *= GridDimension[dim];
+    }
+ 
+    /* create temporary buffer */
+ 
+    temp = new float32[size];
+ 
+    /* 2c) Loop over fields, writing each one. */
+ 
+    for (field = 0; field < NumberOfBaryonFields; field++) {
+ 
+      /* copy active part of field into grid */
+ 
+      for (k = GridStartIndex[2]; k <= GridEndIndex[2]; k++)
+	for (j = GridStartIndex[1]; j <= GridEndIndex[1]; j++)
+	  for (i = GridStartIndex[0]; i <= GridEndIndex[0]; i++)
+	    temp[(i-GridStartIndex[0])                           +
+	         (j-GridStartIndex[1])*ActiveDim[0]              +
+	         (k-GridStartIndex[2])*ActiveDim[0]*ActiveDim[1] ] =
+		       float32(
+	      BaryonField[field][i + j*GridDimension[0] +
+		                     k*GridDimension[0]*GridDimension[1]]
+                              );
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) GridRank, OutDims, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = %s\n", DataLabel[field]);
+ 
+      file_id = H5Fcreate(DataLabel[field], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = %s\n", DataLabel[field]);
+ 
+      dset_id =  H5Dcreate(file_id, DataLabel[field], file_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      /* set datafield name and units, etc. */
+ 
+      if ( DataUnits[field] == NULL )
+      {
+        DataUnits[field] = "none";
+      }
+ 
+      WriteStringAttr(dset_id, "Label", DataLabel[field], log_fptr);
+      WriteStringAttr(dset_id, "Units", DataUnits[field], log_fptr);
+      WriteStringAttr(dset_id, "Format", "e10.4", log_fptr);
+      WriteStringAttr(dset_id, "Geometry", "Cartesian", log_fptr);
+ 
+      h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    }   // end of loop over fields
+ 
+    /* If this is cosmology, compute the temperature field as well since
+       its such a pain to compute after the fact. */
+ 
+    if (OutputTemperature) {
+ 
+      /* Allocate field and compute temperature. */
+ 
+      float *temperature = new float[size];
+      if (this->ComputeTemperatureField(temperature) == FAIL) {
+	ENZO_FAIL("Error in grid->ComputeTemperatureField.\n");
+      }
+ 
+      /* Copy active part of field into grid */
+ 
+      for (k = GridStartIndex[2]; k <= GridEndIndex[2]; k++)
+	for (j = GridStartIndex[1]; j <= GridEndIndex[1]; j++)
+	  for (i = GridStartIndex[0]; i <= GridEndIndex[0]; i++)
+	    temp[(i-GridStartIndex[0])                           +
+	         (j-GridStartIndex[1])*ActiveDim[0]              +
+	         (k-GridStartIndex[2])*ActiveDim[0]*ActiveDim[1] ] =
+		     float32(
+		   temperature[(k*GridDimension[1] + j)*GridDimension[0] + i]
+			     );
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) GridRank, OutDims, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = Temperature\n");
+ 
+      file_id = H5Fcreate("Temperature", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = Temperature\n");
+ 
+      dset_id = H5Dcreate(file_id, "Temperature", file_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if ( DataUnits[field] == NULL )
+      {
+        DataUnits[field] = "none";
+      }
+ 
+      WriteStringAttr(dset_id, "Label", "Temperature", log_fptr);
+      WriteStringAttr(dset_id, "Units", "K", log_fptr);
+      WriteStringAttr(dset_id, "Format", "e10.4", log_fptr);
+      WriteStringAttr(dset_id, "Geometry", "Cartesian", log_fptr);
+ 
+      h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      delete temperature;
+ 
+    } // end: if (ComovingCoordinates)
+ 
+    /* Make sure that there is a copy of dark matter field to save
+       (and at the right resolution). */
+ 
+    if (SelfGravity && NumberOfParticles > 0) {
+      float SaveGravityResolution = GravityResolution;
+      GravityResolution = 1;
+      this->InitializeGravitatingMassFieldParticles(RefineBy);
+      this->ClearGravitatingMassFieldParticles();
+      this->DepositParticlePositions(this, Time,
+				     GRAVITATING_MASS_FIELD_PARTICLES);
+      GravityResolution = SaveGravityResolution;
+    }
+ 
+    /* If present, write out the GravitatingMassFieldParticles. */
+ 
+    if (GravitatingMassFieldParticles != NULL) {
+ 
+      /* Set dimensions. */
+ 
+      int StartIndex[] = {0,0,0}, EndIndex[] = {0,0,0};
+      for (dim = 0; dim < GridRank; dim++) {
+	StartIndex[dim] = nint((GridLeftEdge[dim] -
+				GravitatingMassFieldParticlesLeftEdge[dim])/
+			       GravitatingMassFieldParticlesCellSize);
+	EndIndex[dim] = nint((GridRightEdge[dim] -
+			      GravitatingMassFieldParticlesLeftEdge[dim])/
+			     GravitatingMassFieldParticlesCellSize) - 1;
+      }
+ 
+      /* Copy active part of field into grid */
+ 
+      for (k = StartIndex[2]; k <= EndIndex[2]; k++)
+	for (j = StartIndex[1]; j <= EndIndex[1]; j++)
+	  for (i = StartIndex[0]; i <= EndIndex[0]; i++)
+	    temp[(i-StartIndex[0])                           +
+	         (j-StartIndex[1])*ActiveDim[0]              +
+	         (k-StartIndex[2])*ActiveDim[0]*ActiveDim[1] ] =
+		     float32(
+			     GravitatingMassFieldParticles[ i +
+			       j*GravitatingMassFieldParticlesDimension[0] +
+			       k*GravitatingMassFieldParticlesDimension[0]*
+			         GravitatingMassFieldParticlesDimension[1]]
+			     );
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) GridRank, OutDims, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = Dark_Matter_Density\n");
+ 
+      file_id = H5Fcreate("Dark_Matter_Density", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = Dark_Matter_Density\n");
+ 
+      dset_id = H5Dcreate(file_id, "Dark_Matter_Density", file_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if ( DataUnits[field] == NULL )
+      {
+        DataUnits[field] = "none";
+      }
+ 
+      WriteStringAttr(dset_id, "Label", "Dark_Matter_Density", log_fptr);
+      WriteStringAttr(dset_id, "Units", "", log_fptr);
+      WriteStringAttr(dset_id, "Format", "e10.4", log_fptr);
+      WriteStringAttr(dset_id, "Geometry", "Cartesian", log_fptr);
+ 
+      h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      /* Clean up if we modified the resolution. */
+ 
+      if (SelfGravity && GravityResolution != 1)
+	this->DeleteGravitatingMassFieldParticles();
+ 
+    } // end of (if GravitatingMassFieldParticles != NULL)
+ 
+    delete temp;
+    for (dim = 0; dim < GridRank; dim++)
+      delete tempdim[dim];
+ 
+    /* Write BoundaryFluxes info (why? it's just recreated when the grid
+                                  is read in) */
+ 
+   }  // end: if (ProcessorNumber == MyProcessorNumber)
+  } // end: if (NumberOfBaryonFields > 0)
+ 
+ 
+//  DISABLE PARTICLE SORT & OUTPUT FOR NOW
+ 
+if (MyProcessorNumber == ROOT_PROCESSOR)
+  printf("Particle sort & output DISABLED\n");
+ 
+if ( 0 == 1 )
+{
+ 
+  /* ------------------------------------------------------------------- */
+  /* 3) Save particle quantities. */
+ 
+  if (MyProcessorNumber == ROOT_PROCESSOR)
+    fprintf(fptr, "NumberOfParticles   = %"ISYM"\n", NumberOfParticles);
+ 
+  if (NumberOfParticles > 0) {
+ 
+    if (MyProcessorNumber == ROOT_PROCESSOR)
+      fprintf(fptr, "ParticleFileName = %s\n", name); // must be same as above
+ 
+    if (MyProcessorNumber == ProcessorNumber) {
+ 
+    /* Sort particles according to their identifier. */
+ 
+    this->SortParticlesByNumber();
+ 
+    /* Create a temporary buffer (32 bit). */
+ 
+    float32 *temp = new float32[NumberOfParticles];
+ 
+    /* Particle positions are not converted to 32 bit first.
+       (128 bit numbers are not supported by HDF so convert to 64). */
+ 
+    float64 *temp_pointer = NULL;
+ 
+    if (sizeof(FLOAT) == 16)
+      temp_pointer = new float64[NumberOfParticles];
+ 
+    TempIntArray[0] = NumberOfParticles;
+ 
+    for (dim = 0; dim < GridRank; dim++) {
+ 
+      /* Convert to 64 if 128, either just write out. */
+ 
+      if (sizeof(FLOAT) == 16)
+	for (i = 0; i < NumberOfParticles; i++)
+	  temp_pointer[i] = float64(ParticlePosition[dim][i]);
+      else
+	temp_pointer = (float64*) ParticlePosition[dim];
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = %s\n", ParticlePositionLabel[dim]);
+ 
+      file_id = H5Fcreate(ParticlePositionLabel[dim], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = %s\n", ParticlePositionLabel[dim]);
+ 
+      dset_id =  H5Dcreate(file_id, ParticlePositionLabel[dim],  FILE_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dwrite(dset_id, FLOAT_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp_pointer);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    }
+ 
+    if (sizeof(FLOAT) == 16)
+      delete [] temp_pointer;  /* clean up if allocated. */
+ 
+    /* Copy particle velocities to temp and write them. */
+ 
+    for (dim = 0; dim < GridRank; dim++) {
+ 
+      for (i = 0; i < NumberOfParticles; i++)
+	temp[i] = float32(ParticleVelocity[dim][i]);
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n",file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = %s\n", ParticleVelocityLabel[dim]);
+ 
+      file_id = H5Fcreate(ParticleVelocityLabel[dim], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = %s\n", ParticleVelocityLabel[dim]);
+ 
+      dset_id = H5Dcreate(file_id, ParticleVelocityLabel[dim], file_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    }
+ 
+    /* Copy mass to temp and write it. */
+ 
+    for (i = 0; i < NumberOfParticles; i++)
+      temp[i] = float32(ParticleMass[i]);
+ 
+ 
+    file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
+      if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+      if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    if (io_log) fprintf(log_fptr, "H5Fcreate with Name = particle_mass\n");
+ 
+    file_id = H5Fcreate("particle_mass", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+      if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+      if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    if (io_log) fprintf(log_fptr, "H5Dcreate with Name = particle_mass\n");
+ 
+    dset_id = H5Dcreate(file_id, "particle_mass", file_type_id, file_dsp_id, H5P_DEFAULT);
+      if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+      if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+      if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Sclose(file_dsp_id);
+      if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Dclose(dset_id);
+      if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Fclose(file_id);
+      if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    /* Copy number (ID) to temp and write it. */
+ 
+    PINT *tempPINT = new PINT[NumberOfParticles];
+ 
+    for (i = 0; i < NumberOfParticles; i++)
+      tempPINT[i] = ParticleNumber[i];
+ 
+ 
+    file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
+      if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+    if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    if (io_log) fprintf(log_fptr, "H5Fcreate with Name = particle_index\n");
+ 
+    file_id = H5Fcreate("particle_index", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+      if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+      if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    if (io_log) fprintf(log_fptr, "H5Dcreate with Name = particle_index\n");
+ 
+    dset_id = H5Dcreate(file_id, "particle_index", HDF5_FILE_PINT, file_dsp_id, H5P_DEFAULT);
+      if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+      if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Dwrite(dset_id, HDF5_PINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) tempPINT);
+      if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Sclose(file_dsp_id);
+      if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Dclose(dset_id);
+      if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    h5_status = H5Fclose(file_id);
+      if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+      if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    /* Copy particle attributes to temp and write them. */
+ 
+    for (j = 0; j < NumberOfParticleAttributes; j++) {
+ 
+      for (i = 0; i < NumberOfParticles; i++)
+	temp[i] = float32(ParticleAttribute[j][i]);
+ 
+ 
+      file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
+        if (io_log) fprintf(log_fptr, "H5Screate file_dsp_id: %"ISYM"\n", file_dsp_id);
+        if( file_dsp_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Fcreate with Name = %s\n", ParticleAttributeLabel[j]);
+ 
+      file_id = H5Fcreate(ParticleAttributeLabel[j], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Fcreate id: %"ISYM"\n", file_id);
+        if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      if (io_log) fprintf(log_fptr, "H5Dcreate with Name = %s\n", ParticleAttributeLabel[j]);
+ 
+      dset_id = H5Dcreate(file_id, ParticleAttributeLabel[j], file_type_id, file_dsp_id, H5P_DEFAULT);
+        if (io_log) fprintf(log_fptr, "H5Dcreate id: %"ISYM"\n", dset_id);
+        if( dset_id == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dwrite(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
+        if (io_log) fprintf(log_fptr, "H5Dwrite: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Sclose(file_dsp_id);
+        if (io_log) fprintf(log_fptr, "H5Sclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Dclose(dset_id);
+        if (io_log) fprintf(log_fptr, "H5Dclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+      h5_status = H5Fclose(file_id);
+        if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+        if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+ 
+    }
+ 
+    /* clean up */
+ 
+    delete temp;
+    delete tempPINT;
+ 
+  } // end: if (MyProcessorNumber...)
+  } // end: if (NumberOfParticles > 0)
+ 
+}
+ 
+// PARTICLE OUTPUT DISABLED
+ 
+  /* Close HDF file. */
+ 
+ 
+//  if (MyProcessorNumber == ProcessorNumber)
+//  {
+//     h5_status = H5Fclose(file_id);
+//       if (io_log) fprintf(log_fptr, "H5Fclose: %"ISYM"\n", h5_status);
+//       if( h5_status == h5_error ){my_exit(EXIT_FAILURE);}
+//  }
+ 
+  if (MyProcessorNumber == ProcessorNumber)
+  {
+    if (io_log) fclose(log_fptr);
+  }
+ 
+  /* 4) Save Gravity info. */
+ 
+  if (MyProcessorNumber == ROOT_PROCESSOR)
+    if (SelfGravity)
+
+      fprintf(fptr, "GravityBoundaryType = %"ISYM"\n", GravityBoundaryType);
+ 
+  /* Clean up. */
+ 
+  delete name;
+ 
+  return SUCCESS;
+ 
+}

File src/enzo/Grid_WriteGridInterpolate.C

  
   FLOAT SavedTime = Time;
   Time = WriteTime;
-  if (this->Group_WriteGrid(fptr, base_name, grid_id, file_id) == FAIL) {
-    ENZO_FAIL("Error in grid->Group_WriteGrid.\n");
+  if (this->WriteGrid(fptr, base_name, grid_id, file_id) == FAIL) {
+    ENZO_FAIL("Error in grid->WriteGrid.\n");
   }
   Time = SavedTime;
  

File src/enzo/Make.config.assemble

     endif
 
 #-----------------------------------------------------------------------
-# DETERMINE HDF4 USAGE
-#-----------------------------------------------------------------------
-
-    ERROR_USE_HDF4 = 1
-
-    # compilers and settings if USE_HDF4 is yes
-
-    ifeq ($(CONFIG_USE_HDF4),yes)
-        ERROR_USE_HDF4 = 0
-        ASSEMBLE_HDF4_DEFINES  = -DUSE_HDF4
-    endif
-
-    # compilers and settings if USE_HDF4 is no
-
-    ifeq ($(CONFIG_USE_HDF4),no)
-        ERROR_USE_HDF4 = 0
-        ASSEMBLE_HDF4_DEFINES  =
-    endif
-
-    # error if CONFIG_USE_HDF4 is incorrect
-
-    ifeq ($(ERROR_USE_HDF4),1)
-       .PHONY: error_compilers
-       error_compilers:
-	$(error Illegal value '$(CONFIG_USE_HDF4)' for $$(CONFIG_USE_HDF4))
-    endif
-
-#-----------------------------------------------------------------------
 # DETERMINE GRAVITY SOLVER
 #-----------------------------------------------------------------------
 
               $(ASSEMBLE_FLUX_FIX_DEFINES) \
               $(ASSEMBLE_ECUDA_DEFINES) \
               $(ASSEMBLE_CUDADEBUG_DEFINES) \
-              $(ASSEMBLE_HDF4_DEFINES) \
               $(ASSEMBLE_GRAVITY_4S_DEFINES) \
               $(ASSEMBLE_ACCELERATION_BOUNDARY_DEFINES)
 

File src/enzo/Make.config.objects

         Grid_GetEnclosedMassInShell.o \
         Grid_GetProjectedBoundaryFluxes.o \
         Grid_GravityEquilibriumTestInitializeGrid.o \
+        Grid_WriteGridExtract.o \
         Grid_WriteGrid.o \
         Grid_ReadGrid.o \
 	Grid_IdentifyColourFields.o \
 	Grid_RadHydroStreamTestInitializeGrid.o \
 	Grid_RadiationComputeDensities.o \
 	Grid_RadiatingShockInitializeGrid.o \
-	Grid_ReadGrid.o \
         Grid_CosmologyReadParticles3D.o \
         Grid_ReadHierarchyInformationHDF5.o \
 	Grid_ReadRandomForcingFields.o \

File src/enzo/Make.config.settings

 #    CONFIG_EMISSIVITY
 #    CONFIG_FAST_SIB
 #    CONFIG_FLUX_FIX
-#    CONFIG_USE_HDF4	
 #    CONFIG_BITWISE_IDENTICALITY
 #    CONFIG_USE_ECUDA
 #    CONFIG_SET_ACCELERATION_BOUNDARY
      CONFIG_FLUX_FIX = yes
 
 #======================================================================= 
-# CONFIG_USE_HDF4
-#======================================================================= 
-#    yes           For some users (hdf4)
-#    no            For most of the users (hdf5)
-#----------------------------------------------------------------------- 
- 
-     CONFIG_USE_HDF4 = no
-
-#======================================================================= 
 # CONFIG_BITWISE_IDENTICALITY
 #======================================================================= 
 #    yes           Use blocking potential solves in the gravity solver

File src/enzo/Make.config.targets

 	@echo "      gmake fluxfix-yes"
 	@echo "      gmake fluxfix-no"
 	@echo 
-	@echo "   Set whether to use HDF4"
-	@echo
-	@echo "      gmake use-hdf4-yes"
-	@echo "      gmake use-hdf4-no"
-	@echo
 	@echo "   Set whether to use inline python"
 	@echo
 	@echo "      gmake python-yes"

File src/enzo/Options.C

     fprintf(opf, "  Fast sibiling search disabled\n");
 #endif
 
-#ifdef USE_HDF4
-    fprintf(opf, "  HDF4 reading enabled\n");
-#else
-    fprintf(opf, "  HDF4 reading disabled\n");
-#endif
-
 #ifdef FLUX_FIX
     fprintf(opf, "  Flux fix for subgrid siblings enabled\n");
 #else

File src/enzo/OutputCoolingTimeOnly.C

 #endif
 #include "CosmologyParameters.h"
 
-int Group_WriteAllData(char *basename, int filenumber,
+int WriteAllData(char *basename, int filenumber,
 		       HierarchyEntry *TopGrid, TopGridData &MetaData,
 		       ExternalBoundary *Exterior, 
 #ifdef TRANSFER
   // parameter, and only compute the cooling time.
   OutputCoolingTime = -1;
 
-  Group_WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
+  WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
 #endif

File src/enzo/OutputFromEvolveLevel.C

 int WriteTracerParticleData(char *basename, int filenumber,
 		   LevelHierarchyEntry *LevelArray[], TopGridData *MetaData,
 		   FLOAT WriteTime);
-//#ifdef USE_HDF5_GROUPS
-int Group_WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
+int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
 		       TopGridData &MetaData, ExternalBoundary *Exterior,
 #ifdef TRANSFER
 		       ImplicitProblemABC *ImplicitSolver,
 #endif
 		       FLOAT WriteTime = -1, int CheckpointDump = FALSE);
-// #else
-// int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
-//                  TopGridData &MetaData, ExternalBoundary *Exterior,
-//#ifdef TRANSFER
-//	            ImplicitProblemABC *ImplicitSolver,
-//#endif
-//                  FLOAT WriteTime = -1);
-// #endif
 void my_exit(int status);
 int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
 		      HierarchyEntry **Grids[]);
     LevelHierarchyEntry *Temp2 = LevelArray[0];
     while (Temp2->NextGridThisLevel != NULL)
       Temp2 = Temp2->NextGridThisLevel; /* ugh: find last in linked list */
-    //#ifdef USE_HDF5_GROUPS
-    if (Group_WriteAllData(MetaData->DataDumpName, MetaData->DataDumpNumber++,
+    if (WriteAllData(MetaData->DataDumpName, MetaData->DataDumpNumber++,
 			   Temp2->GridHierarchyEntry, *MetaData, Exterior,
 #ifdef TRANSFER
 			   ImplicitSolver,
 #endif
 			   LevelArray[level]->GridData->ReturnTime(), CheckpointDump) == FAIL) {
-            ENZO_FAIL("Error in Group_WriteAllData.");
+            ENZO_FAIL("Error in WriteAllData.");
     }
-// #else
-//     if (WriteAllData(MetaData->DataDumpName, MetaData->DataDumpNumber++,
-// 		     Temp2->GridHierarchyEntry, *MetaData, Exterior, 
-// #ifdef TRANSFER
-// 		     ImplicitSolver,
-// #endif
-// 		     LevelArray[level]->GridData->ReturnTime()) == FAIL) {
-//       ENZO_FAIL("Error in WriteAllData.\n");
-//     }
-// #endif
   }//WriteOutput == TRUE
 
   if( ExitEnzo == TRUE ){

File src/enzo/OutputPotentialFieldOnly.C

 int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
 		      HierarchyEntry **Grids[]);
 
-int Group_WriteAllData(char *basename, int filenumber,
+int WriteAllData(char *basename, int filenumber,
 		       HierarchyEntry *TopGrid, TopGridData &MetaData,
 		       ExternalBoundary *Exterior, 
 #ifdef TRANSFER
   if (OutputDM == TRUE)
     OutputSmoothedDarkMatter = -2;
 
-  Group_WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
+  WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
 #endif

File src/enzo/OutputSmoothedDarkMatterOnly.C

 
 int RebuildHierarchy(TopGridData *MetaData,
 		     LevelHierarchyEntry *LevelArray[], int level);
-int Group_WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
+int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
 		 TopGridData &MetaData, ExternalBoundary *Exterior,
 #ifdef TRANSFER
 		       ImplicitProblemABC *ImplicitSolver,
   if (OutputSmoothedDarkMatter == FALSE)
     OutputSmoothedDarkMatter = -2;
 
-  Group_WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
+  WriteAllData(DumpName, DumpNumber, TopGrid, MetaData, &Exterior
 #ifdef TRANSFER
 		       , ImplicitSolver
 #endif

File src/enzo/PhotonTestRestartInitialize.C

  
 void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 int ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
-		ExternalBoundary *Exterior, float *Initialdt);
-int Group_ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
 		      ExternalBoundary *Exterior, float *Initialdt,
 		      bool ReadParticlesOnly=false);
 void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
   if (debug)
     printf("reading restart parameter file %s\n", PhotonTestRestartName);
  
-#ifdef USE_HDF5_GROUPS
-  if (Group_ReadAllData(PhotonTestRestartName, &TopGrid, MetaData, &Exterior, &dummyf) == FAIL) {
+  if (ReadAllData(PhotonTestRestartName, &TopGrid, MetaData, &Exterior, &dummyf) == FAIL) {
     if (MyProcessorNumber == ROOT_PROCESSOR) {
-      fprintf(stderr, "Error in Group_ReadAllData %s\n",PhotonTestRestartName );
-      fprintf(stderr, "Probably not in a packed-HDF5 format. Trying other read routines.\n");
+      fprintf(stderr, "Error in ReadAllData %s\n",PhotonTestRestartName );
+      ENZO_FAIL("");
     }
-#endif
-    // If not packed-HDF5, then try usual HDF5 or HDF4
-    if (ReadAllData(PhotonTestRestartName, &TopGrid, MetaData, &Exterior, &dummyf)
-	== FAIL) {
-      if (MyProcessorNumber == ROOT_PROCESSOR)
-      ENZO_VFAIL("Error in ParameterFile %s.\n", PhotonTestRestartName)
-    }
-#ifdef USE_HDF5_GROUPS
   }
-#endif
 
   if (MyProcessorNumber == ROOT_PROCESSOR)
     fprintf(stderr, "Successfully read restart file %s.\n",

File src/enzo/PutSinkRestartInitialize.C

  
 void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 int ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
-		ExternalBoundary *Exterior, float *Initialdt);
-int Group_ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
 		      ExternalBoundary *Exterior, float *Initialdt,
 		      bool ReadParticlesOnly=false);
 void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
   if (debug)
     printf("reading restart parameter file %s\n", PutSinkRestartName);
  
-#ifdef USE_HDF5_GROUPS
-  if (Group_ReadAllData(PutSinkRestartName, &TopGrid, MetaData, &Exterior, &dummyf) == FAIL) {
+  if (ReadAllData(PutSinkRestartName, &TopGrid, MetaData, &Exterior, &dummyf) == FAIL) {
     if (MyProcessorNumber == ROOT_PROCESSOR) {
-      fprintf(stderr, "Error in Group_ReadAllData %s\n",PutSinkRestartName );
-      fprintf(stderr, "Probably not in a packed-HDF5 format. Trying other read routines.\n");
+      fprintf(stderr, "Error in ReadAllData %s\n",PutSinkRestartName );
+      ENZO_FAIL("");
     }
-#endif
-    // If not packed-HDF5, then try usual HDF5 or HDF4
-    if (ReadAllData(PutSinkRestartName, &TopGrid, MetaData, &Exterior, &dummyf)
-	== FAIL) {
-      if (MyProcessorNumber == ROOT_PROCESSOR)
-      ENZO_VFAIL("Error in ParameterFile %s.\n", PutSinkRestartName)
-    }
-#ifdef USE_HDF5_GROUPS
   }
-#endif
 
   if (MyProcessorNumber == ROOT_PROCESSOR)
     fprintf(stderr, "Successfully read restart file %s.\n",

File src/enzo/ReadAllData.C

 
 /* function prototypes */
  
-int Group_ReadDataHierarchy(FILE *fptr, hid_t Hfile_id, HierarchyEntry *TopGrid, int GridID,
+int ReadDataHierarchy(FILE *fptr, hid_t Hfile_id, HierarchyEntry *TopGrid, int GridID,
 			    HierarchyEntry *ParentGrid, hid_t file_id,
 			    int NumberOfRootGrids, int *RootGridProcessors,
 			    bool ReadParticlesOnly=false, FILE *log_fptr=NULL);
 int HDF5_ReadAttribute(hid_t group_id, const char *AttributeName, int &Attribute, FILE *log_fptr);
 int HDF5_ReadDataset(hid_t group_id, const char *DatasetName, int Dataset[], FILE *log_fptr);
 
-int Group_ReadAllData(char *name, HierarchyEntry *TopGrid, TopGridData &MetaData,
+int ReadAllData(char *name, HierarchyEntry *TopGrid, TopGridData &MetaData,
 		      ExternalBoundary *Exterior, float *Initialdt,
 		      bool ReadParticlesOnly)
  
     return FAIL;
   }
 
-  // Below, ENZO_FAIL is changed to "return FAIL" to deal with various data formats including HDF4, HDF5, packed-HDF5
-  // because boundary should be the one that distinguishes these different data formats.
-  // This will allow a graceful exit when the dataformat is not packed-HDF5.
-  // - Ji-hoon Kim
   // Try to read external boundaries. If they don't fit grid data we'll set them later below
     if(LoadGridDataAtStart){    
       if (Exterior->ReadExternalBoundary(fptr) == FAIL) {
-	fprintf(stderr, "Error in ReadExternalBoundary (%s).\n",
-		MetaData.BoundaryConditionName);
-	return FAIL;
+	ENZO_VFAIL("Error in ReadExternalBoundary (%s).", MetaData.BoundaryConditionName)
       }
     }else{
       if (Exterior->ReadExternalBoundary(fptr, TRUE, FALSE) == FAIL) {
   }
 
   GridID = 1;
-  if (Group_ReadDataHierarchy(fptr, Hfile_id, TopGrid, GridID, NULL, file_id,
+  if (ReadDataHierarchy(fptr, Hfile_id, TopGrid, GridID, NULL, file_id,
 			      NumberOfRootGrids, RootGridProcessors,
 			      ReadParticlesOnly, log_fptr) == FAIL) {
     fprintf(stderr, "Error in ReadDataHierarchy (%s).\n", hierarchyname);

File src/enzo/ReadDataHierarchy.C

 #include "TopGridData.h"
 
 extern std::map<HierarchyEntry *, int> OriginalGridID;
-#ifdef USE_HDF5_GROUPS
 extern std::map<HierarchyEntry *, int> OriginalTaskID;
-#endif
 
 /* function prototypes */
  
 static int ReadDataGridCounter = 0;
 
 
-int Group_ReadDataHierarchy(FILE *fptr, hid_t Hfile_id, HierarchyEntry *Grid, int GridID,
+int ReadDataHierarchy(FILE *fptr, hid_t Hfile_id, HierarchyEntry *Grid, int GridID,
 			    HierarchyEntry *ParentGrid, hid_t file_id,
 			    int NumberOfRootGrids, int *RootGridProcessors,
 			    bool ReadParticlesOnly, FILE *log_fptr)
 
   /* We pass in the global here as a parameter to the function */
   if(LoadGridDataAtStart){ 
-    if (Grid->GridData->Group_ReadGrid(fptr, GridID, file_id, DataFilename, 
-				       TRUE, TRUE, ReadParticlesOnly
-#ifdef NEW_GRID_IO
-                , CheckpointRestart
-#endif
-        ) == FAIL) {
-      ENZO_VFAIL("Error in grid->Group_ReadGrid (grid %"ISYM").\n", GridID)
+    if (Grid->GridData->ReadGrid(fptr, GridID, file_id, DataFilename, 
+				       TRUE, TRUE, ReadParticlesOnly, CheckpointRestart)
+         == FAIL) {
+      ENZO_VFAIL("Error in grid->ReadGrid (grid %"ISYM").\n", GridID)
     }
   }else{
-    if (Grid->GridData->Group_ReadGrid(fptr, GridID, file_id, DataFilename, TRUE, FALSE) == FAIL) {
-      ENZO_VFAIL("Error in grid->Group_ReadGrid (grid %"ISYM").\n", GridID)
+    if (Grid->GridData->ReadGrid(fptr, GridID, file_id, DataFilename, TRUE, FALSE) == FAIL) {
+      ENZO_VFAIL("Error in grid->ReadGrid (grid %"ISYM").\n", GridID)
     }
     // Store grid and task id for later grid opening
     if (Grid->GridData->ReturnProcessorNumber() == MyProcessorNumber){
       OriginalGridID[Grid] = GridID;
-#ifdef USE_HDF5_GROUPS
       OriginalTaskID[Grid] = Task;
-#endif
     }
   }
  
  
   if (NextGridThisLevelID != 0) {
     Grid->NextGridThisLevel = new HierarchyEntry;
-    if (Group_ReadDataHierarchy(fptr, Hfile_id, Grid->NextGridThisLevel, NextGridThisLevelID,
+    if (ReadDataHierarchy(fptr, Hfile_id, Grid->NextGridThisLevel, NextGridThisLevelID,
 				ParentGrid, file_id, NumberOfRootGrids,
 				RootGridProcessors, ReadParticlesOnly, log_fptr) == FAIL)
-      ENZO_FAIL("Error in Group_ReadDataHierarchy(1).");
+      ENZO_FAIL("Error in ReadDataHierarchy(1).");
   }
 
 
  
   if (NextGridNextLevelID != 0) {
     Grid->NextGridNextLevel = new HierarchyEntry;
-    if (Group_ReadDataHierarchy(fptr, Hfile_id, Grid->NextGridNextLevel, NextGridNextLevelID, 
+    if (ReadDataHierarchy(fptr, Hfile_id, Grid->NextGridNextLevel, NextGridNextLevelID, 
 
 				Grid, file_id, NumberOfRootGrids, 
 				RootGridProcessors, ReadParticlesOnly, log_fptr) == FAIL)
-      ENZO_FAIL("Error in Group_ReadDataHierarchy(2).");
+      ENZO_FAIL("Error in ReadDataHierarchy(2).");
   }
  
   return SUCCESS;

File src/enzo/ReduceFragmentation.C

 /* function prototypes */
  
 int ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
-		ExternalBoundary *Exterior, float *Initialdt);
+		      ExternalBoundary *Exterior, float *Initialdt,
+		      bool ReadParticlesOnly=false);
 void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
 char LastFileNameWritten[MAX_LINE_LENGTH];
 int CopyOverlappingZones(grid* CurrentGrid, TopGridData *MetaData,

File src/enzo/SupernovaRestartInitialize.C

  
 void WriteListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 int ReadAllData(char *filename, HierarchyEntry *TopGrid, TopGridData &tgd,
-		ExternalBoundary *Exterior, float *Initialdt);
+		      ExternalBoundary *Exterior, float *Initialdt,
+		      bool ReadParticlesOnly=false);
 void AddLevel(LevelHierarchyEntry *Array[], HierarchyEntry *Grid, int level);
 int GetUnits(float *DensityUnits, float *LengthUnits,
 	     float *TemperatureUnits, float *TimeUnits,

File src/enzo/Unigrid_EvolveLevel.C

-/***********************************************************************
-/
-/  EVOLVE LEVEL FUNCTION
-/
-/  written by: Greg Bryan
-/  date:       November, 1994
-/  modified1:  February, 1995 by GB
-/              Overhauled to make sure that all the subgrid's of a grid
-/              advance with in lock step (i.e. with the same timestep and
-/              in order).  This was done to allow a subgrid to get it's
-/              boundary values from another subgrid (with the same parent).
-/              Previously, a subgrid' BVs were always interpolated from its
-/              parent.
-/  modified2:  August, 1995 by GB
-/                1) All grids on a level are processed at the same time
-/                 (rather than all the subgrids of one parent).
-/                2) C routines are called to loop over subgrids
-/                 (so parallelizing C compilers can be used).
-/                3) Subgrid timesteps are not constant over top grid step.
-/              June, 1999 by GB -- Clean up somewhat
-/
-/  modified3:  August, 2001 by Alexei Kritsuk
-/                Added 2nd call of PrepareDensityField() to compute
-/                grav. potential (to be written with other baryon fields).
-/  modified4:  January, 2004 by Alexei Kritsuk
-/                Added support for RandomForcing
-/  modified5:  February, 2006 by Daniel Reynolds
-/                Added PotentialBdry to EvolveLevel and 
-/                PrepareDensityField calls, so that it can be used 
-/                within computing isolating BCs for self-gravity.
-/  modified6:  January, 2007 by Robert Harkness
-/                Group and in-core i/o
-/  modified7:  May, 2008 by Robert Harkness
-/                Remove Dan Reynolds' isograv mods
-/
-/  PURPOSE:
-/    This routine is the main grid evolution function.  It assumes that the
-/    grids of level-1 have already been advanced by dt (passed
-/    in the argument) and that their boundary values are properly set.
-/    We then perform a complete update on all grids on level, including:
-/       - for each grid: set the boundary values from parent/subgrids
-/       - for each grid: get a list of its subgrids
-/       - determine the timestep based on the minimum timestep for all grids
-/       - subcycle over the grid timestep and for each grid:
-/           - copy the fields to the old fields
-/           - solve the hydro equations (and save fluxes around subgrid)
-/           - set the boundary values from parent and/or other grids
-/           - update time and check dt(min) for that grid against dt(cycle)
-/           - call EvolveLevel(level+1)
-/           - accumulate flux around this grid
-/       - correct the solution on this grid based on subgrid solutions
-/       - correct the solution on this grid based on improved subgrid fluxes
-/
-/    This routine essentially solves (completely) the grids of this level
-/       and all finer levels and then corrects the solution of
-/       grids on this level based on the improved subgrid solutions/fluxes.
-/
-/    Note: as a convenience, we store the current grid's fluxes (i.e. the
-/          fluxes around the exterior of this grid) as the last entry in
-/          the list of subgrids.
-/
-************************************************************************/
- 
-#include <stdlib.h>
-#include <stdio.h>
-#include "performance.h"
-#include "ErrorExceptions.h"
-#include "macros_and_parameters.h"
-#include "typedefs.h"
-#include "global_data.h"
-#include "Fluxes.h"
-#include "GridList.h"
-#include "ExternalBoundary.h"
-#include "Grid.h"
-#include "Hierarchy.h"
-#include "TopGridData.h"
-#include "LevelHierarchy.h"
- 
-/* function prototypes */
- 
-void DeleteFluxes(fluxes *Fluxes);
-int  RebuildHierarchy(TopGridData *MetaData,
-		      LevelHierarchyEntry *LevelArray[], int level);
-int  ReportMemoryUsage(char *header = NULL);
-int  UpdateParticlePositions(grid *Grid);
-int  CheckEnergyConservation(HierarchyEntry *Grids[], int grid,
-			     int NumberOfGrids, int level, float dt);
-int GenerateGridArray(LevelHierarchyEntry *LevelArray[], int level,
-		      HierarchyEntry **Grids[]);
-int PrepareDensityField(LevelHierarchyEntry *LevelArray[],
-			int level, TopGridData *MetaData, FLOAT When);
-int SetBoundaryConditions(HierarchyEntry *Grids[], int NumberOfGrids,
-			  int level, TopGridData *MetaData,
-			  ExternalBoundary *Exterior, LevelHierarchyEntry * Level);
-int UpdateFromFinerGrids(int level, HierarchyEntry *Grids[], int NumberOfGrids,
-			 int NumberOfSubgrids[],
-			 fluxes **SubgridFluxesEstimate[]);
-int CommunicationUpdateStarParticleCount(HierarchyEntry *Grids[],
-					 TopGridData *MetaData,
-					 int NumberOfGrids);
-int RadiationFieldUpdate(LevelHierarchyEntry *LevelArray[], int level,
-			 TopGridData *MetaData);
-int WriteStreamData(HierarchyEntry *Grids[], int NumberOfGrids, 
-		    TopGridData *MetaData, int CycleCount, int EndStep = FALSE);
-int WriteMovieData(char *basename, int filenumber,
-		   LevelHierarchyEntry *LevelArray[], TopGridData *MetaData,
-		   FLOAT WriteTime);
-int WriteTracerParticleData(char *basename, int filenumber,
-		   LevelHierarchyEntry *LevelArray[], TopGridData *MetaData,
-		   FLOAT WriteTime);
-int WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
-		 TopGridData &MetaData, ExternalBoundary *Exterior,
-#ifdef TRANSFER
-		 ImplicitProblemABC *ImplicitSolver,
-#endif
-		 FLOAT WriteTime = -1);
-int Group_WriteAllData(char *basename, int filenumber, HierarchyEntry *TopGrid,
-		 TopGridData &MetaData, ExternalBoundary *Exterior,
-#ifdef TRANSFER
-		 ImplicitProblemABC *ImplicitSolver,
-#endif
-		 FLOAT WriteTime = -1);
-
-void my_exit(int status);
- 
-int ComputeRandomForcingNormalization(LevelHierarchyEntry *LevelArray[],
-                                      int level, TopGridData *MetaData,
-                                      float * norm, float * pTopGridTimeStep);
- 
- 
-static int LevelCycleCount[MAX_DEPTH_OF_HIERARCHY];
-static float norm = 0.0;            //AK
-static float TopGridTimeStep = 0.0; //AK
- 
- 
-/* EvolveGrid function */
- 
-int EvolveLevel(TopGridData *MetaData, LevelHierarchyEntry *LevelArray[],
-		int level, float dtLevelAbove, ExternalBoundary *Exterior
-#ifdef TRANSFER
-		, ImplicitProblemABC *ImplicitSolver
-#endif
-		)
-
-#ifdef EMISSIVITY
-/* reset Emissivity array here before next step calculate the new values */
-  if (StarMakerEmissivityField > 0) {
-  /* 
-     clear the Emissivity of the level below, after the level below 
-     updated the current level (it's parent) and before the next 
-     timestep at the current level.
-  */
-    LevelHierarchyEntry *Temp;
-    Temp = LevelArray[level+1];
-    while (Temp != NULL) {
-      Temp->GridData->UnigridClearEmissivity();
-      Temp = Temp->NextGridThisLevel;
-    }
-  }
-#endif
-
- 
-      SubgridFluxesEstimate[grid] = new fluxes *[NumberOfSubgrids[grid]];
- 
-      /* Collect the flux data and store it in the newly minted fluxes.
-	 Or rather that's what we should do.  Instead, we create fluxes one
-	 by one in this awkward array of pointers to pointers.  This should be
-	 changed so that all the routines take arrays of flux rather than
-	 arrays of pointers to flux.  Dumb. */
- 
-      counter = 0;
-      NextGrid = Grids[grid]->NextGridNextLevel;
-      while (NextGrid != NULL) {
-	SubgridFluxesEstimate[grid][counter] = new fluxes;
-	Grids[grid]->GridData->ComputeRefinementFactors
-	                              (NextGrid->GridData, RefinementFactors);
-	NextGrid->GridData->ReturnFluxDims
-             (*(SubgridFluxesEstimate[grid][counter++]), RefinementFactors);
-	NextGrid = NextGrid->NextGridThisLevel;
-      }
- 
-      /* Add the external boundary of this subgrid to the subgrid list. This
-	 makes it easy to keep adding up the fluxes of this grid, but we
-	 must keep in mind that the last subgrid should be ignored elsewhere.*/
-