diff options
-rw-r--r-- | src/DumpVar.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c index 190787c..1d7c3f6 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -26,7 +26,7 @@ /* local function prototypes */ static void StreamedHDF5_Dump (cGH *GH, int index, int timelevel, void *outme, - int *hsizes, int hdf5_type, hid_t fid); + int hdim, int *hsizes, int hdf5_type, hid_t fid); static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, hid_t dataset); static int GetHDF5type (StreamedHDF5GH *myGH, int vtype, hid_t *hdf5_type); @@ -132,7 +132,7 @@ int StreamedHDF5_DumpVar (cGH *GH, int index, int timelevel, hid_t fid) if (fid >= 0) { - StreamedHDF5_Dump (GH, index, timelevel, data, hsizes, hdf5_type, fid); + StreamedHDF5_Dump (GH, index, timelevel, data, geo.sdim, hsizes, hdf5_type, fid); } if (data) @@ -329,24 +329,21 @@ static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, @endvar @@*/ static void StreamedHDF5_Dump (cGH *GH, int index, int timelevel, void *outme, - int *hsizes, int hdf5_type, hid_t fid) + int hdim, int *hsizes, int hdf5_type, hid_t fid) { DECLARE_CCTK_PARAMETERS - int i, dim; + int i; hid_t dataset, memspace; char *name, *datasetname; hsize_t *dims; - /* get the dimension of the variable */ - dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (index)); - - dims = (hsize_t *) malloc (dim * sizeof (hsize_t)); + dims = (hsize_t *) malloc (hdim * sizeof (hsize_t)); /* HDF5 needs it in reverse order */ - for (i = 0; i < dim; i++) + for (i = 0; i < hdim; i++) { - dims [i] = hsizes [dim - 1 - i]; + dims [i] = hsizes [hdim - 1 - i]; } /* build the unique dataset name */ @@ -357,7 +354,7 @@ static void StreamedHDF5_Dump (cGH *GH, int index, int timelevel, void *outme, free (name); /* create the memspace according to chunk dims */ - CACTUS_IOHDF5_ERROR (memspace = H5Screate_simple (dim, dims, NULL)); + CACTUS_IOHDF5_ERROR (memspace = H5Screate_simple (hdim, dims, NULL)); /* create the dataset */ CACTUS_IOHDF5_ERROR (dataset = H5Dcreate (fid, datasetname, hdf5_type, |