From a08a8313d8af566b971d7d88d214cffb294c4291 Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 2 Aug 2000 20:22:15 +0000 Subject: Use the hyperslab dim rather than the variable's dim for outputting stuff. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOStreamedHDF5/trunk@21 0888f3d4-9f52-45d2-93bc-d00801ff5e46 --- src/DumpVar.c | 19 ++++++++----------- 1 file 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, -- cgit v1.2.3