From 3e20fef5ee16efe5f722043aa6b03fb5cecf75f6 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 3 Aug 2000 19:02:25 +0000 Subject: Also output the attributes in the dimension of the hyperslab. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOStreamedHDF5/trunk@23 0888f3d4-9f52-45d2-93bc-d00801ff5e46 --- src/DumpVar.c | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/DumpVar.c b/src/DumpVar.c index 1d7c3f6..97fcc1e 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -27,8 +27,7 @@ /* local function prototypes */ static void StreamedHDF5_Dump (cGH *GH, int index, int timelevel, void *outme, int hdim, int *hsizes, int hdf5_type, hid_t fid); -static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, - hid_t dataset); +static void StreamedHDF5_AddCommonAttributes (cGH *GH, int hdim, hid_t dataset); static int GetHDF5type (StreamedHDF5GH *myGH, int vtype, hid_t *hdf5_type); /*@@ @@ -216,15 +215,9 @@ static int GetHDF5type (StreamedHDF5GH *myGH, int vtype, hid_t *hdf5_type) @vio in @endvar @@*/ -static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, - hid_t dataset) +static void StreamedHDF5_AddCommonAttributes (cGH *GH, int hdim, hid_t dataset) { DECLARE_CCTK_PARAMETERS -#if 0 - int dim; - CCTK_INT intAttr; - char *groupname; -#endif CCTK_REAL realAttr [6]; StreamedHDF5GH *myGH; CCTK_REAL dummy; @@ -232,22 +225,6 @@ static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, /* Get the handles for IOUtil and StreamedHDF5 extensions */ myGH = (StreamedHDF5GH *) GH->extensions [CCTK_GHExtensionHandle ("StreamedHDF5")]; -#if 0 - /* get the dimension of the variable */ - dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (index)); - - groupname = CCTK_GroupNameFromVarI (index); - WRITE_ATTRIBUTE ("groupname", groupname, - dataset, myGH->scalarDataspace, 0, myGH->IOHDF5_STRING); - free (groupname); - intAttr = CCTK_GroupTypeFromVarI (index); - WRITE_ATTRIBUTE ("grouptype", &intAttr, dataset, myGH->scalarDataspace, 0, - IOHDF5_INT); - intAttr = CCTK_NumTimeLevelsFromVarI (index); - WRITE_ATTRIBUTE ("ntimelevels", &intAttr, dataset, myGH->scalarDataspace, 0, - IOHDF5_INT); -#endif - WRITE_ATTRIBUTE ("time", &GH->cctk_time, dataset, myGH->scalarDataspace, 0, IOHDF5_REAL); @@ -257,19 +234,19 @@ static void StreamedHDF5_AddCommonAttributes (cGH *GH, int index, int timelevel, CCTK_CoordRange (GH, &realAttr [1], &dummy, -1, "y", "cart3d"); CCTK_CoordRange (GH, &realAttr [2], &dummy, -1, "z", "cart3d"); - WRITE_ATTRIBUTE ("origin", realAttr, dataset, myGH->arrayDataspace, 3, + WRITE_ATTRIBUTE ("origin", realAttr, dataset, myGH->arrayDataspace, hdim, IOHDF5_REAL); CCTK_CoordRange (GH, &realAttr [0], &realAttr [3], -1, "x","cart3d"); CCTK_CoordRange (GH, &realAttr [1], &realAttr [4], -1, "y","cart3d"); CCTK_CoordRange (GH, &realAttr [2], &realAttr [5], -1, "z","cart3d"); - WRITE_ATTRIBUTE ("min_ext", realAttr, dataset, myGH->arrayDataspace, 3, + WRITE_ATTRIBUTE ("min_ext", realAttr, dataset, myGH->arrayDataspace, hdim, IOHDF5_REAL); - WRITE_ATTRIBUTE ("max_ext", realAttr + 3, dataset, myGH->arrayDataspace, 3, + WRITE_ATTRIBUTE ("max_ext", realAttr + 3, dataset, myGH->arrayDataspace, hdim, IOHDF5_REAL); WRITE_ATTRIBUTE ("delta", GH->cctk_delta_space, dataset, myGH->arrayDataspace, - 3, IOHDF5_REAL); + hdim, IOHDF5_REAL); } @@ -363,7 +340,7 @@ static void StreamedHDF5_Dump (cGH *GH, int index, int timelevel, void *outme, CACTUS_IOHDF5_ERROR (H5Dwrite (dataset, hdf5_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, outme)); - StreamedHDF5_AddCommonAttributes (GH, index, timelevel, dataset); + StreamedHDF5_AddCommonAttributes (GH, hdim, dataset); /* close the dataset and the memspace */ CACTUS_IOHDF5_ERROR (H5Dclose (dataset)); -- cgit v1.2.3