Anonymous avatar Anonymous committed a071927 Merge

Merging again?

Comments (0)

Files changed (13)

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);

src/enzo/ExternalBoundary_ReadExternalBoundary.C

 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
- 
+#ifdef USE_HDF4
+#include <df.h>
+#endif 
 
 
  
  
     file_id = H5Fopen(hdfname, H5F_ACC_RDONLY, H5P_DEFAULT);
     if (io_log) fprintf(log_fptr, "H5Fopen id: %"ISYM"\n", file_id);
-    if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+    //    if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+    if( file_id == h5_error ){return FAIL;}
  
     /* loop over faces, reading each */
  
   return SUCCESS;
  
 }
+
+
+
+#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
+

src/enzo/Grid_Group_ReadGrid.C

     }
  
     if (fscanf(fptr, "GridRank = %"ISYM"\n", &GridRank) != 1) {
-      fprintf(stderr, "Error reading GridRank.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridRank.");
     }
  
     if (fscanf(fptr, "GridDimension = ") != 0) {
-      fprintf(stderr, "Error reading GridDimension(0).\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridDimension(0).");
     }
  
     if (ReadListOfInts(fptr, GridRank, GridDimension) == FAIL) {
-      fprintf(stderr, "Error reading GridDimension(1).\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridDimension(1).");
     }
  
     fscanf(fptr, "GridStartIndex = ");
  
     if (ReadListOfInts(fptr, GridRank, GridStartIndex) == FAIL) {
-      fprintf(stderr, "Error reading GridStartIndex.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridStartIndex.");
     }
  
     fscanf(fptr, "GridEndIndex = ");
  
     if (ReadListOfInts(fptr, GridRank, GridEndIndex) == FAIL) {
-      fprintf(stderr, "Error reading GridEndIndex.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridEndIndex.");
     }
  
     fscanf(fptr, "GridLeftEdge = ");
  
     if (ReadListOfFloats(fptr, GridRank, GridLeftEdge) == FAIL) {
-      fprintf(stderr, "Error reading GridLeftEdge.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridLeftEdge.");
     }
  
     fscanf(fptr, "GridRightEdge = ");
  
     if (ReadListOfFloats(fptr, GridRank, GridRightEdge) == FAIL) {
-      fprintf(stderr, "Error reading GridRightEdge.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading GridRightEdge.");
     }
  
     if (fscanf(fptr, "Time = %"PSYM"\n", &Time) != 1) {
-      fprintf(stderr, "Error reading Time.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading Time.");
     }
  
     if (fscanf(fptr, "SubgridsAreStatic = %"ISYM"\n", &SubgridsAreStatic) != 1) {
-      fprintf(stderr, "Error reading SubgridsAreStatic.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading SubgridsAreStatic.");
     }
  
     /* Read baryon field quantities. */
  
     if (fscanf(fptr, "NumberOfBaryonFields = %"ISYM"\n",
 	       &NumberOfBaryonFields) != 1) {
-      fprintf(stderr, "Error reading NumberOfBaryonFields.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error reading NumberOfBaryonFields.");
     }
     if (NumberOfBaryonFields > 0) {
  
       fscanf(fptr, "FieldType = ");
  
       if (ReadListOfInts(fptr, NumberOfBaryonFields, FieldType) == FAIL) {
-	fprintf(stderr, "Error reading FieldType.\n");
-	ENZO_FAIL("");
+		ENZO_FAIL("Error reading FieldType.");
       }
  
       fgetpos(fptr, &BaryonFileNamePosition); //AK
  
       if (fscanf(fptr, "BaryonFileName = %s\n", procfilename) != 1) {
-	fprintf(stderr, "Error reading BaryonFileName.\n");
-	ENZO_FAIL("");
+		ENZO_FAIL("Error reading BaryonFileName.");
       }
  
       fscanf(fptr, "CourantSafetyNumber    = %"FSYM"\n", &CourantSafetyNumber);
     /* 3) Read particle info */
  
     if (fscanf(fptr, "NumberOfParticles = %"ISYM"\n", &NumberOfParticles) != 1) {
-      fprintf(stderr, "error reading NumberOfParticles.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("error reading NumberOfParticles.");
     }
  
     if (NumberOfParticles > 0) {
       /* Read particle file name. */
     
       if (fscanf(fptr, "ParticleFileName = %s\n", procfilename) != 1) {
-	fprintf(stderr, "Error reading ParticleFileName.\n");
-	ENZO_FAIL("");
+		ENZO_FAIL("Error reading ParticleFileName.");
       }
     }
  
  
     if (SelfGravity)
       if (fscanf(fptr, "GravityBoundaryType = %"ISYM"\n",&GravityBoundaryType) != 1) {
-	fprintf(stderr, "Error reading GravityBoundaryType.\n");
-	ENZO_FAIL("");
+		ENZO_FAIL("Error reading GravityBoundaryType.");
       }
   }
 

src/enzo/Grid_ReadGrid.C

 ************************************************************************/
  
 //  Input a grid from file pointer fpt
- 
+
+#ifdef USE_HDF4
+#include "mfhdf.h"
+#endif /* USE_HDF4 */
 #include <hdf5.h>
 #include <string.h>
 #include <stdio.h>
 int ReadListOfFloats(FILE *fptr, int N, FLOAT floats[]);
 int ReadListOfInts(FILE *fptr, int N, int nums[]);
  
+// extern int ParticleTypeInFile; // declared and set in ReadParameterFile
+ 
+#ifdef USE_HDF4
+int ReadField(float *temp, int Dims[], int Rank, char *name,
+	      char *field_name);
+static int32 sd_id, sds_index; // HDF4 (SD) handlers                                               
+#endif 
+ 
 int grid::ReadGrid(FILE *fptr, int GridID, 
 		   int ReadText, int ReadData)
 {
     {"particle_velocity_x", "particle_velocity_y", "particle_velocity_z"};
   char *ParticleAttributeLabel[] = {"creation_time", "dynamical_time",
                                     "metallicity_fraction", "alpha_fraction"};
+
+#ifdef USE_HDF4
+    int32 TempIntArray2[MAX_DIMENSION];
+    int32 sds_id, num_type2, attributes, TempInt;  
+    sds_index = 0;  // start at first SDS                                                                            
+#endif 
  
 #ifdef IO_LOG
   int         io_log = 1;
     if (ReadListOfFloats(fptr, GridRank, GridRightEdge) == FAIL) {
             ENZO_FAIL("Error reading GridRightEdge.");
     }
- 
+
     if (fscanf(fptr, "Time = %"PSYM"\n", &Time) != 1) {
             ENZO_FAIL("Error reading Time.");
     }
  
     if (MyProcessorNumber == ProcessorNumber){
 
+#ifdef USE_HDF4
+      if ((sd_id = SDstart(name, DFACC_RDONLY)) == HDF_FAIL) {
+	fprintf(stderr, "Error opening file %s.\n", name);
+	return FAIL;
+      }
+
+      sds_id = SDselect(sd_id, sds_index++);
+      while (SDiscoordvar(sds_id)) {
+	SDendaccess(sds_id);
+	sds_id = SDselect(sd_id, sds_index++);
+      }
+      if (SDgetinfo(sds_id, dummy, &TempInt, TempIntArray2, &num_type2, 
+		    &attributes) == HDF_FAIL) {
+	fprintf(stderr, "Error reading dims0 from %s.\n", name);
+	return FAIL;
+      }
+      SDendaccess(sds_id);
+      sds_index--;
+
+      if (TempInt != GridRank) {
+	fprintf(stderr, "HDF rank (%d) does not match GridRank.\n", TempInt);
+	return FAIL;
+      }
+#else
       if(!ReadText){
 	// build filename from grid id
 	char id[MAX_GRID_TAG_SIZE];
       file_id = H5Fopen(name,  H5F_ACC_RDONLY, H5P_DEFAULT);
       if (io_log) fprintf(log_fptr, "H5Fopen id: %"ISYM"\n", file_id);
       if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
-      
+#endif
 
       /* fill in ActiveDim for dims up to 3d */
  
  
       /* allocate temporary space */
  
+#ifdef USE_HDF4
+      float *temp = new float[active_size];
+#else
       io_type *temp = new io_type[active_size];
+#endif
  
       /* loop over fields, reading each one */
  
       for (field = 0; field < NumberOfBaryonFields; field++) {
  
 	/* get data into temporary array */
- 
+
+#ifdef USE_HDF4
+	if (ReadField(temp, ActiveDim, GridRank, name, 
+		      DataLabel[field]) == FAIL) {
+	  fprintf(stderr, "Error reading field %d.\n", field);
+	  return FAIL;
+	}
+#else
 	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);}
 	h5_status = H5Dread(dset_id, float_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) temp);
         if (io_log) fprintf(log_fptr, "H5Dread: %"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);}
+#endif 
  
 	/* copy active region into whole grid */
  
 		float(temp[(i-GridStartIndex[0])                         +
 			   (j-GridStartIndex[1])*ActiveDim[0]            +
 			   (k-GridStartIndex[2])*ActiveDim[0]*ActiveDim[1] ]);
- 
+
       } // end: loop over fields
  
       delete [] temp;
  
     if (MyProcessorNumber == ProcessorNumber) {
 
+#ifdef USE_HDF4
+#else
       if(!ReadText){
 	// build filename from grid id
 	char id[MAX_GRID_TAG_SIZE];
 	strcpy(name, ".grid");
 	strcat(name, id);
       }
+#endif
  
       /* Open file if not already done (note: particle name must = grid name). */
  
       if (NumberOfBaryonFields == 0) {
  
+#ifdef USE_HDF4
+	if ((sd_id = SDstart(name, DFACC_RDONLY)) == HDF_FAIL) {
+	  fprintf(stderr, "Error opening file %s.\n", name);
+	  return FAIL;
+	}
+#else
 	if (MyProcessorNumber == ProcessorNumber)
 	  {
 	    strcpy(logname, name);
 	file_id = H5Fopen(name, H5F_ACC_RDONLY, H5P_DEFAULT);
         if (io_log) fprintf(log_fptr, "H5Fopen id: %"ISYM"\n", file_id);
         if( file_id == h5_error ){my_exit(EXIT_FAILURE);}
+#endif
  
       } // end: if (NumberOfBaryonFields == 0)
  
       /* Allocate room for particles. */
  
       this->AllocateNewParticles(NumberOfParticles);
- 
+
       TempIntArray[0] = NumberOfParticles;
- 
+      
+#ifdef USE_HDF4
+
+      float *temp = new float[active_size];
+
+      int32 HDFDataType = (sizeof(Eflt) == 4) ? DFNT_FLOAT32 : DFNT_FLOAT64;
+      if (sizeof(Eflt) == 16) HDFDataType = DFNT_FLOAT128;
+
+      /* Read dims.
+	 If Rank != 1, we may have just read some other field SDS.  If so,
+	 then try again. */
+      
+      TempInt = 0;
+      while (TempInt != 1) {
+	sds_id = SDselect(sd_id, sds_index++);
+	while (SDiscoordvar(sds_id)) {
+	  SDendaccess(sds_id);
+	  sds_id = SDselect(sd_id, sds_index++);
+	}
+	if (SDgetinfo(sds_id, dummy, &TempInt, TempIntArray2, &num_type2, 
+		      &attributes) == HDF_FAIL) {
+	  fprintf(stderr, "Error reading dims1 from %s.\n", name);
+	  return FAIL;
+	}
+	SDendaccess(sds_id);
+      }
+      sds_index--; 
+
+      /* Check dims. */
+
+      if (TempInt != 1 || TempIntArray2[0] != NumberOfParticles) {
+	fprintf(stderr, "HDF particle dims do not match NumberOfParticles.\n");
+	fprintf(stderr, "  (HDF dim[0] = %d, NumberOfParticles = %d)\n",
+		int(TempIntArray2[0]), NumberOfParticles);
+	return FAIL;  
+      }
+
+      /* Read ParticlePosition (use temporary buffer). */ 
+      
+      for (dim = 0; dim < GridRank; dim++) {
+
+	if (num_type2 == HDFDataType) {
+
+	  /* same data type: just read. */
+
+	  if (ReadField((float *) ParticlePosition[dim], &NumberOfParticles, 1, name, 
+			ParticlePositionLabel[dim]) == FAIL) {
+	    fprintf(stderr, "Error reading ParticlePosition %d\n", dim);
+	    return FAIL;
+	  }
+	
+	} else {
+
+	  /* convert data: Read into temporary buffer and copy. */
+
+	  if (ReadField(temp, &NumberOfParticles, 1, name, 
+			ParticlePositionLabel[dim]) == FAIL) {
+	    fprintf(stderr, "Error reading ParticlePosition %d\n", dim);
+	    return FAIL;
+	  }
+
+	  float64 *temp64 = (float64 *) temp;
+	  long_double *temp128 = (long_double *) temp;
+	  
+	  if (num_type2 == DFNT_FLOAT32)
+	    for (i = 0; i < NumberOfParticles; i++)
+	      ParticlePosition[dim][i] = Eflt(temp[i]);
+	  if (num_type2 == DFNT_FLOAT64)
+	    for (i = 0; i < NumberOfParticles; i++)
+	      ParticlePosition[dim][i] = Eflt(temp64[i]);
+	  if (num_type2 == DFNT_FLOAT128)
+	    for (i = 0; i < NumberOfParticles; i++)
+	      ParticlePosition[dim][i] = Eflt(temp128[i]);
+	}
+      } // end: loop over dims
+
+      delete [] temp;
+
+      /* Read ParticleVelocity. */
+
+      for (dim = 0; dim < GridRank; dim++) {
+	if (ReadField(ParticleVelocity[dim], &NumberOfParticles, 1, name,
+		      ParticleVelocityLabel[dim]) == FAIL) {
+	  fprintf(stderr, "Error reading ParticleVelocity %d\n", dim);
+	  return FAIL;
+	}
+      }
+
+      /* Read ParticleMass. */
+
+      if (ReadField(ParticleMass, &NumberOfParticles, 1, name,
+		    "particle_mass") == FAIL)
+	return FAIL;
+
+      /* Read ParticleNumber */
+      
+      if (ReadField((float *) ParticleNumber, &NumberOfParticles, 1, name,
+		    "particle_index") == FAIL)
+	return FAIL;
+
+      /* Read particle type if present */
+      
+      if (ParticleTypeInFile == TRUE) {
+	
+	if (ReadField((float *) ParticleType, &NumberOfParticles, 1, name,
+		      "particle_type") == FAIL)
+	  return FAIL;
+
+#define NO_CHECK_PARTICLE_TYPE
+#ifdef CHECK_PARTICLE_TYPE
+	for (i = 0; i < NumberOfParticles; i++)
+	  if (ParticleType[i] < PARTICLE_TYPE_GAS ||
+	      ParticleType[i] > NUM_PARTICLE_TYPES-1) {
+	  fprintf(stderr, "file: %s: particle %d has unknown type %d\n",
+		  name, i, ParticleType[i]);
+	  return FAIL;
+	  }
+#endif
+
+    }
+
+      /* Read ParticleAttributes. */
+
+#define NO_RESTART_WITH_ATTRIBUTES
+      for (j = 0; j < NumberOfParticleAttributes; j++) {
+#ifdef RESTART_WITH_ATTRIBUTES
+	for (i=0; i < NumberOfParticles; i++)
+	  ParticleAttribute[j][i] = 0;
+#else
+	if (ReadField(ParticleAttribute[j], &NumberOfParticles, 1, name,
+		      ParticleAttributeLabel[j]) == FAIL) {
+	  fprintf(stderr, "Error reading ParticleAttribute %d\n", j);
+	  return FAIL;
+	}
+#endif
+      }
+      
+      /* If the particle type is not in the file, then set it according
+	 to the value of the attributes. */
+
+      if (ParticleTypeInFile != TRUE)
+	for (i = 0; i < NumberOfParticles; i++)
+	  ParticleType[i] = ReturnParticleType(i);
+
+#else /* USE_HDF4 */
+
       /* Create a temporary buffer (32 bit or twice the size for 64). */
- 
+      
       io_type *temp = NULL;
- 
+      
       jj = sizeof(FLOAT);
  
       switch(jj)
 	{
- 
+	  
 	case 4:
 	  temp = new io_type[NumberOfParticles];
 	  break;
  
       if (temp == NULL)
 	temp = new io_type[NumberOfParticles];
- 
+  
       /* Read ParticlePosition (use temporary buffer). */
  
       for (dim = 0; dim < GridRank; dim++) {
  
       }
  
- 
       /* Read ParticleVelocity. */
  
       for (dim = 0; dim < GridRank; dim++) {
 	for (i = 0; i < NumberOfParticles; i++)
 	  ParticleVelocity[dim][i] = float(temp[i]);
       }
- 
- 
+  
       /* Read ParticleMass into temporary buffer and Copy to ParticleMass. */
  
       file_dsp_id = H5Screate_simple((Eint32) 1, TempIntArray, NULL);
       for (i = 0; i < NumberOfParticles; i++)
 	ParticleNumber[i] = tempint[i];
  
- 
-      // Read ParticleType if present
+       // Read ParticleType if present
  
       if (ParticleTypeInFile == TRUE) {
  
 	for (i = 0; i < NumberOfParticles; i++)
 	  ParticleType[i] = ReturnParticleType(i);
  
-      }
- 
+      } 
  
       /* Read ParticleAttributes. */
       if (AddParticleAttributes) {
 
       delete [] temp;
       delete [] tempint;
+
+#endif /* USE_HDF4 */
  
     } // end: if (MyProcessorNumber == ProcessorNumber)
   } // end: if (NumberOfParticles > 0 && ReadData)
   if ( (MyProcessorNumber == ProcessorNumber) &&
        (NumberOfParticles > 0 || NumberOfBaryonFields > 0) 
        && ReadData ){
+
+#ifdef USE_HDF4
+    SDend(sd_id);
+#else
     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);}
+#endif
+
   }
  
   if (MyProcessorNumber == ProcessorNumber)
   return SUCCESS;
  
 }
+
+
+
+
+
+
+
+#ifdef USE_HDF4
+/* ----------------------------------------------------------------------                                          
+   This routine reads one data field from the file using the appropriate                                           
+   data model.  Note that it uses file pointers/handlers that are statically                                       
+   declared above. */
+
+int ReadField(float *temp, int Dims[], int Rank, char *name,
+	      char *field_name)
+{
+  int dim;
+
+  int32 sds_id, start[] = {0, 0, 0};
+  int32 TempInt, TempIntArray[MAX_DIMENSION], attributes, num_type;
+  char dummy[MAX_LINE_LENGTH];
+
+  /* Find the next SDS which is not a coordinate variable. */
+
+  sds_id = SDselect(sd_id, sds_index++);
+  while (SDiscoordvar(sds_id)) {
+    SDendaccess(sds_id);
+    sds_id = SDselect(sd_id, sds_index++);
+  }
+
+  if (SDgetinfo(sds_id, dummy, &TempInt, TempIntArray, &num_type, &attributes) == HDF_FAIL) {
+    fprintf(stderr, "error getting info from file %s (filed %s)\n", name, field_name);
+    return FAIL;
+  }
+  
+  /* check rank against this grid */
+  
+  if (TempInt != Rank) {
+    fprintf(stderr, "HDF rank (%d) does not match GridRank.\n", TempInt);
+    return FAIL;
+  }
+
+  /* check dimensions of HDF file against this grid */
+  
+  for (dim = 0; dim < Rank; dim++)
+    if (TempIntArray[Rank-dim-1] != Dims[dim]) {
+      fprintf(stderr, "HDF file dimensions do not match GridDimensions.\n");
+      return FAIL;
+    }
+
+  if (SDreaddata(sds_id, start, (int32 *) NULL, TempIntArray, (void *) temp)
+      == HDF_FAIL) {
+    fprintf(stderr, "Error reading data from file %s (field %s).\n", name, field_name);
+    return FAIL;
+  }
+  SDendaccess(sds_id);
+
+  return SUCCESS;
+}
+#endif /* USE_HDF4 */
+

src/enzo/Group_ReadAllData.C

     ENZO_FAIL("");
   }
   if (ReadParameterFile(fptr, MetaData, &dummy) == FAIL) {
-    fprintf(stderr, "Error in ReadParameterFile.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in ReadParameterFile.");
   }
  
   /* Close main file. */
 	    MetaData.BoundaryConditionName);
     ENZO_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
+
   if(LoadGridDataAtStart){    
     if (Exterior->ReadExternalBoundary(fptr) == FAIL) {
       fprintf(stderr, "Error in ReadExternalBoundary (%s).\n",
 	      MetaData.BoundaryConditionName);
-      ENZO_FAIL("");
+      return FAIL;
+      //ENZO_FAIL("");  
     }
   }else{
     if (Exterior->ReadExternalBoundary(fptr, TRUE, FALSE) == FAIL) {
       fprintf(stderr, "Error in ReadExternalBoundary (%s).\n",
 	      MetaData.BoundaryConditionName);
-      ENZO_FAIL("");
+      return FAIL;
+      //ENZO_FAIL("");
     }
   }
   strcat(MetaData.BoundaryConditionName, hdfsuffix);
   ntask = i;
 
   if (AssignGridToTaskMap(GridIndex, Mem, ntask) == FAIL) {
-    fprintf(stderr, "Error in AssignGridToTaskMap.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in AssignGridToTaskMap.");
   }
 
   fclose(mptr);
   /* Read StarParticle data. */
  
   if (ReadStarParticleData(fptr) == FAIL) {
-    fprintf(stderr, "Error in ReadStarParticleData.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in ReadStarParticleData.");
   }
  
   /* Create radiation name and read radiation data. */
       ENZO_FAIL("");
     }
     if (ReadRadiationData(Radfptr) == FAIL) {
-      fprintf(stderr, "Error in ReadRadiationData.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error in ReadRadiationData.");
     }
     fclose(Radfptr);
   }

src/enzo/Make.config.assemble

 	$(error Illegal value '$(CONFIG_FLUX_FIX)' for $$(CONFIG_FLUX_FIX))
     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
 
 
 #=======================================================================
               $(ASSEMBLE_TPVEL_DEFINES) \
               $(ASSEMBLE_PHOTON_DEFINES) \
               $(ASSEMBLE_FAST_SIB_DEFINES) \
-              $(ASSEMBLE_FLUX_FIX_DEFINES)
+              $(ASSEMBLE_FLUX_FIX_DEFINES) \
+              $(ASSEMBLE_HDF4_DEFINES)
 
     INCLUDES = $(MACH_INCLUDES) \
     	       $(ASSEMBLE_MPI_INCLUDES) \

src/enzo/Make.config.settings

 #    CONFIG_OPT
 #    CONFIG_TESTING
 #    CONFIG_TPVEL
+#    CONFIG_USE_HDF4	
 #
 #=======================================================================
 
 
      CONFIG_PHOTON = no
 
-
 #=======================================================================
 # CONFIG_FAST_SIB
 #=======================================================================
 #-----------------------------------------------------------------------
 
      CONFIG_FLUX_FIX = yes
+
+#======================================================================= 
+# CONFIG_USE_HDF4
+#======================================================================= 
+#    yes           For some users (hdf4)
+#    no            For most of the users (hdf5)
+#----------------------------------------------------------------------- 
+ 
+     CONFIG_USE_HDF4 = no

src/enzo/Make.config.targets

 	@echo "      gmake photon-yes"
 	@echo "      gmake photon-no"
 	@echo 
+	@echo "   Set whether to use HDF4"
+	@echo
+	@echo "      gmake use-hdf4-yes"
+	@echo "      gmake use-hdf4-no"
+	@echo
 
 #-----------------------------------------------------------------------
 
 	@echo "   CONFIG_TESTING:               $(CONFIG_TESTING)"
 	@echo "   CONFIG_TPVEL:                 $(CONFIG_TPVEL)"
 	@echo "   CONFIG_PHOTON:                $(CONFIG_PHOTON)"
+	@echo "   CONFIG_USE_HDF4:              $(CONFIG_USE_HDF4)"
 	@echo
 
 #-----------------------------------------------------------------------
 	@echo
 
 
+VALID_USE-HDF4 = use-hdf4-yes use-hdf4-no
+.PHONY: $(VALID_USE-HDF4)
 
-#-----------------------------------------------------------------------
-
-VALID_FLUX_FIX = flux_fix-yes flux_fix_no
-.PHONY: $(VALID_PHOTON)
-
-photon-yes: CONFIG_PHOTON-yes
-photon-no: CONFIG_PHOTON-no
-photon-%:
-	@printf "\n\tInvalid target: $@\n\n\tValid targets: [$(VALID_PHOTON)]\n\n"
-CONFIG_PHOTON-%:
+use-hdf4-yes: CONFIG_USE-HDF4-yes
+use-hdf4-no: CONFIG_USE-HDF4-no
+use-hdf4-%:
+	@printf "\n\tInvalid target: $@\n\n\tValid targets: [$(VALID_USE-HDF4)]\n\n"
+CONFIG_USE-HDF4-%: suggest-clean
 	@tmp=.config.temp; \
-        grep -v CONFIG_PHOTON $(MAKE_CONFIG_OVERRIDE) > $${tmp}; \
+        grep -v CONFIG_USE_HDF4 $(MAKE_CONFIG_OVERRIDE) > $${tmp}; \
         mv $${tmp} $(MAKE_CONFIG_OVERRIDE); \
-        echo "CONFIG_PHOTON = $*" >> $(MAKE_CONFIG_OVERRIDE); \
-	$(MAKE) show-config | grep CONFIG_PHOTON:
+        echo "CONFIG_USE_HDF4 = $*" >> $(MAKE_CONFIG_OVERRIDE); \
+	$(MAKE)  show-config | grep CONFIG_USE_HDF4:
 	@echo
 
 

src/enzo/Make.mach.orange-hdf4

+#=======================================================================
+#
+# FILE:        Make.mach.orange
+#
+# DESCRIPTION: Makefile settings for SLAC's orange
+#
+# AUTHOR:      Matthew Turk
+#
+# DATE:        2009-03-21
+#
+#=======================================================================
+
+MACH_TEXT  = Orange
+MACH_VALID = 1
+MACH_FILE  = Make.mach.orange
+
+#-----------------------------------------------------------------------
+# Commands to run test executables
+#-----------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------
+# Install paths (local variables)
+#-----------------------------------------------------------------------
+
+LOCAL_MPI_INSTALL    = /afs/slac/Packages/OpenMPI/
+LOCAL_MPI_INSTALL    = /afs/slac/package/OpenMPI/1.2.5/amd64_linux26/
+LOCAL_HDF5_INSTALL   = /afs/slac/g/ki/software/hdf5/1.6.6/amd64_linux26/
+LOCAL_HDF4_INSTALL   = /afs/slac/g/ki/software/hdf4/amd64_linux26
+LOCAL_PYTHON_INSTALL = /u/ki/mturk/Research/local/yt-x86_64/
+
+#-----------------------------------------------------------------------
+# Compiler settings
+#-----------------------------------------------------------------------
+
+MACH_CPP       = /usr/bin/cpp 
+
+# With MPI
+
+MACH_CC_MPI    = $(LOCAL_MPI_INSTALL)/bin/mpicc
+MACH_CXX_MPI   = $(LOCAL_MPI_INSTALL)/bin/mpic++ -DMPICH_IGNORE_CXX_SEEK
+MACH_FC_MPI    = $(LOCAL_MPI_INSTALL)/bin/mpif90
+MACH_F90_MPI   = $(LOCAL_MPI_INSTALL)/bin/mpif90
+MACH_LD_MPI    = $(LOCAL_MPI_INSTALL)/bin/mpicc
+
+# Without MPI
+
+MACH_CC_NOMPI  = icc
+MACH_CXX_NOMPI = icc
+MACH_FC_NOMPI  = ifort
+MACH_F90_NOMPI = ifort
+MACH_LD_NOMPI  = icc
+
+#-----------------------------------------------------------------------
+# Machine-dependent defines
+#-----------------------------------------------------------------------
+
+#MACH_DEFINES   = -DXT3 -DNO_IO_LOG -DSYSCALL -DENZO_ANALYSIS
+#MACH_DEFINES   = -DXT3 -DNO_IO_LOG -DSYSCALL -DHAVE_SPRNG
+#MACH_DEFINES   = -DXT3 -DNO_IO_LOG -DSYSCALL -DSFGEN_PERF -DHAVE_SPRNG -DUSE_STOCHASTIC_FORCING
+MACH_DEFINES = -DLINUX -DH5_USE_16_API -DEMBEDDED_PYTHON
+
+#-----------------------------------------------------------------------
+# Compiler flag settings
+#-----------------------------------------------------------------------
+
+MACH_CPPFLAGS = -P -traditional
+MACH_CFLAGS   = -fPIC
+MACH_CXXFLAGS = -fPIC
+MACH_FFLAGS   = -fPIC
+MACH_F90FLAGS = -fPIC
+MACH_LDFLAGS  = -Wl
+#,-static 
+
+#-----------------------------------------------------------------------
+# Precision-related flags
+#-----------------------------------------------------------------------
+
+MACH_FFLAGS_INTEGER_32 = -i4
+MACH_FFLAGS_INTEGER_64 = -i8
+MACH_FFLAGS_REAL_32    = -r4
+MACH_FFLAGS_REAL_64    = -r8
+
+#-----------------------------------------------------------------------
+# Optimization flags
+#-----------------------------------------------------------------------
+
+# *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***
+#
+#  Use optimization -O2 or greater with PGI compilers at your own
+#  risk!  Older versions of Grid_PPMDirectEuler.C compiled with -O2
+#  led to incorrect results on many test problems, and CURRENT
+#  (-r1995) versions of ffte4X.src and ZeusSource.C lead to incorrect
+#  results for ZeldovichPancake and ExtremeAdvectionTest tests,
+#  respectively.  jobordner@ucsd.edu
+#
+# *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***
+
+MACH_OPT_WARN        = 
+MACH_OPT_DEBUG       = -g
+MACH_OPT_HIGH        = -O2
+MACH_OPT_AGGRESSIVE  = -O3
+
+#-----------------------------------------------------------------------
+# Includes
+#-----------------------------------------------------------------------
+
+LOCAL_INCLUDES_MPI    = 
+LOCAL_INCLUDES_HDF5   = -I$(LOCAL_HDF5_INSTALL)/include
+LOCAL_INCLUDES_HDF4   = -I$(LOCAL_HDF4_INSTALL)/include
+LOCAL_INCLUDES_IOBUF  = -I$(IOBUF_INC)
+LOCAL_INCLUDES_PYTHON = -I$(LOCAL_PYTHON_INSTALL)/include/python2.6/ \
+                        -I$(LOCAL_PYTHON_INSTALL)/lib/python2.6/site-packages/numpy/core/include
+
+MACH_INCLUDES         = $(LOCAL_INCLUDES_HDF5) $(LOCAL_INCLUDES_HDF4) $(LOCAL_INCLUDES_SPRNG) $(LOCAL_INCLUDES_PYTHON)
+
+MACH_INCLUDES_MPI     = $(LOCAL_INCLUDES_MPI)
+MACH_INCLUDES_HYPRE   = $(LOCAL_INCLUDES_HYPRE)
+MACH_INCLUDES_JBPERF  = $(LOCAL_INCLUDES_JBPERF)
+
+#-----------------------------------------------------------------------
+# Libraries
+#-----------------------------------------------------------------------
+#
+# make sure to "load module iobuf" before compiling, only then IOBUF environment
+# variables will be properly set
+#
+
+LOCAL_LIBS_MPI    = 
+LOCAL_LIBS_HDF5   = -L$(LOCAL_HDF5_INSTALL)/lib -lhdf5 -lz 
+LOCAL_LIBS_HDF4   = -L$(LOCAL_HDF4_INSTALL)/lib -lm -lmfhdf -lz -ldf -ljpeg 
+LOCAL_LIBS_PYTHON  = $(LOCAL_PYTHON_INSTALL)/lib/python2.6/config/libpython2.6.a
+
+LOCAL_LIBS_MACH   =  -L$(INT_DIR)/fc/lib/ \
+                     -limf -lifcore -lifport \
+                     -L$(INT_DIR)/cc/lib/ \
+                     -lstdc++ -lg2c 
+
+MACH_LIBS         = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_HDF4) $(LOCAL_LIBS_MACH) $(LOCAL_LIBS_PYTHON)
+MACH_LIBS_MPI     = $(LOCAL_LIBS_MPI)

src/enzo/Make.mach.red

 
 LOCAL_MPI_INSTALL    = /usr
 LOCAL_HDF5_INSTALL   = /u/ki/mturk/Research/local/yt-ia64/
+LOCAL_HDF4_INSTALL   = /usr/work/mturk/local/
 LOCAL_PYTHON_INSTALL = /u/ki/mturk/Research/local/yt-ia64/
 LOCAL_INT_INSTALL     = /afs/slac.stanford.edu/package/intel_tools/compiler9.0/@sys/
 
 # Machine-dependent defines
 #-----------------------------------------------------------------------
 
-MACH_DEFINES = -DLINUX -DH5_USE_16_API -DOPTIMIZED_CTP -DENABLE_LOAD_BALANCE \
-	-DFAST_SIB
-	#-DEMBEDDED_PYTHON
+MACH_DEFINES = -DLINUX -DH5_USE_16_API #-DEMBEDDED_PYTHON
 
 #-----------------------------------------------------------------------
 # Compiler flag settings
 
 LOCAL_INCLUDES_MPI    = -I$(LOCAL_MPI_INSTALL)/include
 LOCAL_INCLUDES_HDF5   = -I$(LOCAL_HDF5_INSTALL)/include
+LOCAL_INCLUDES_HDF4   = -I$(LOCAL_HDF4_INSTALL)/include
 LOCAL_INCLUDES_PYTHON = -I$(LOCAL_PYTHON_INSTALL)/include/python2.6/ \
                         -I$(LOCAL_PYTHON_INSTALL)/lib/python2.6/site-packages/numpy/core/include
 
-MACH_INCLUDES         = $(LOCAL_INCLUDES_HDF5) #$(LOCAL_INCLUDES_PYTHON)
+MACH_INCLUDES         = $(LOCAL_INCLUDES_HDF5) $(LOCAL_INCLUDES_HDF4) #$(LOCAL_INCLUDES_PYTHON)
 
 MACH_INCLUDES_MPI     = $(LOCAL_INCLUDES_MPI)
 MACH_INCLUDES_HYPRE   = $(LOCAL_INCLUDES_HYPRE)
 
 LOCAL_LIBS_MPI    = -L$(LOCAL_MPI_INSTALL)/lib -lmpi -lmpi++
 LOCAL_LIBS_HDF5   = -L$(LOCAL_HDF5_INSTALL)/lib -lhdf5 -lz 
+LOCAL_LIBS_HDF4   = -L$(LOCAL_HDF4_INSTALL)/lib -lm -lmfhdf -lz -ldf -ljpeg     
 LOCAL_LIBS_PYTHON  = $(LOCAL_PYTHON_INSTALL)/lib/python2.6/config/libpython2.6.a -lpthread -lutil
 
 LOCAL_LIBS_MACH   =  -L$(LOCAL_INT_INSTALL)/fc/lib/ \
                      -lifcore -lifport -limf -lcprts \
                      -lstdc++ -lg2c
 
-MACH_LIBS         = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_MACH) #$(LOCAL_LIBS_PYTHON)
+MACH_LIBS         = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_HDF4) $(LOCAL_LIBS_MACH) #$(LOCAL_LIBS_PYTHON)
 MACH_LIBS_MPI     = $(LOCAL_LIBS_MPI)

src/enzo/ReadAllData.C

     ENZO_FAIL("");
   }
   if (ReadParameterFile(fptr, MetaData, &dummy) == FAIL) {
-    fprintf(stderr, "Error in ReadParameterFile.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in ReadParameterFile.");
   }
  
   /* Close main file. */
+  fprintf(stderr, "fclose: opening boundary condition file: %s\n", MetaData.BoundaryConditionName);
  
   fclose(fptr);
  
   /* Read Boundary condition info. */
+  fprintf(stderr, "fopen: opening boundary condition file: %s\n", MetaData.BoundaryConditionName);
  
   if ((fptr = fopen(MetaData.BoundaryConditionName, "r")) == NULL) {
     fprintf(stderr, "Error opening boundary condition file: %s\n",
 	    MetaData.BoundaryConditionName);
     ENZO_FAIL("");
   }
+
+#ifdef USE_HDF4
+  if (Exterior->ReadExternalBoundaryHDF4(fptr) == FAIL) {  
+    fprintf(stderr, "Error in ReadExternalBoundary (%s).\n",           
+            MetaData.BoundaryConditionName);                  
+    return FAIL;                                                                 
+  }
+#else
   if(LoadGridDataAtStart){    
     if (Exterior->ReadExternalBoundary(fptr) == FAIL) {
       fprintf(stderr, "Error in ReadExternalBoundary (%s).\n",
       ENZO_FAIL("");
     }
   }
+#endif
+
   strcat(MetaData.BoundaryConditionName, hdfsuffix);
   fclose(fptr);
 
   ntask = i;
 
   if (AssignGridToTaskMap(GridIndex, Mem, ntask) == FAIL) {
-    fprintf(stderr, "Error in AssignGridToTaskMap.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in AssignGridToTaskMap.");
   }
 
   fclose(mptr);
   /* Read StarParticle data. */
  
   if (ReadStarParticleData(fptr) == FAIL) {
-    fprintf(stderr, "Error in ReadStarParticleData.\n");
-    ENZO_FAIL("");
+        ENZO_FAIL("Error in ReadStarParticleData.");
   }
  
   /* Create radiation name and read radiation data. */
       ENZO_FAIL("");
     }
     if (ReadRadiationData(Radfptr) == FAIL) {
-      fprintf(stderr, "Error in ReadRadiationData.\n");
-      ENZO_FAIL("");
+            ENZO_FAIL("Error in ReadRadiationData.");
     }
     fclose(Radfptr);
   }

src/enzo/ReadDataHierarchy.C

 {
  
   int TestGridID, NextGridThisLevelID, NextGridNextLevelID;
-  int Task;
+  int Task = 0;
  
   /* Read header info for this grid */
  
  
     if (debug) printf("Reading parameter file %s\n", ParameterFile);
 
-#ifdef USE_HDF5_GROUPS
-    if (debug) fprintf(stderr, "Input with Group_ReadAllData\n");
+
+  // First expect to read in packed-HDF5
+
+    if (Group_ReadAllData(ParameterFile, &TopGrid, MetaData, &Exterior) == FAIL) {
+      if (MyProcessorNumber == ROOT_PROCESSOR) {
+	fprintf(stderr, "Error in Group_ReadAllData %s\n", ParameterFile);
+	fprintf(stderr, "Probably not in a packed-HDF5 format. Trying other read routines.\n");
+      }
+      // If not packed-HDF5, then try usual HDF5 or HDF4
+      if (ReadAllData(ParameterFile, &TopGrid, MetaData, &Exterior) == FAIL) {
+	if (MyProcessorNumber == ROOT_PROCESSOR)
+	  fprintf(stderr, "Error in ReadAllData %s.\n", ParameterFile);
+	my_exit(EXIT_FAILURE);
+      }
+    }
+
+
+    /*
+#if defined(USE_HDF5_GROUPS) && !defined(USE_HDF4)
     if (Group_ReadAllData(ParameterFile, &TopGrid, MetaData, &Exterior) == FAIL) {
       if (MyProcessorNumber == ROOT_PROCESSOR)
-	fprintf(stderr, "Error in ParameterFile %s.\n", ParameterFile);
+	fprintf(stderr, "Error in Group_ReadAllData %s.\n", ParameterFile);
       my_exit(EXIT_FAILURE);
     }
 #else 
-    if (debug) fprintf(stderr, "Input with ReadAllData\n");
     if (ReadAllData(ParameterFile, &TopGrid, MetaData, &Exterior) == FAIL) {
       if (MyProcessorNumber == ROOT_PROCESSOR)
-	fprintf(stderr, "Error in ParameterFile %s.\n", ParameterFile);
+	fprintf(stderr, "Error in ReadAllData %s.\n", ParameterFile);
       my_exit(EXIT_FAILURE);
     }
 #endif
+    */
+
  
     if (!ParallelRootGridIO && restart && TopGrid.NextGridThisLevel == NULL) {
       CommunicationPartitionGrid(&TopGrid, 0);  // partition top grid if necessary
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.