From 04cc8587308160f963f85fead68e556d1d98adc9 Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 21 Mar 2001 11:41:20 +0000 Subject: Added string attributes 'parameter file' and 'creation date' to the output files. These should help identifying your datafiles later on. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@20 7842ec3a-9562-4be5-9c5b-06ba18f2b668 --- src/DumpUtils.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/DumpUtils.c b/src/DumpUtils.c index d0895b3..e5803c8 100644 --- a/src/DumpUtils.c +++ b/src/DumpUtils.c @@ -60,7 +60,6 @@ int IOHDF5Util_DumpGH (cGH *GH, int vindex; int maxdim; int timelevel, current_timelevel; - int *old_downsample; int old_out_single; ioGH *ioUtilGH; const char *thorn; @@ -252,6 +251,9 @@ void IOHDF5Util_DumpCommonAttributes (cGH *GH, ioHDF5UtilGH *myGH; + /* prevent compiler warning about unused parameter */ + timelevel = timelevel; + /* Get the handle for IOHDF5Util extensions */ myGH = (ioHDF5UtilGH *) CCTK_GHExtension (GH, "IOHDF5Util"); @@ -400,6 +402,7 @@ void IOHDF5Util_DumpGHExtensions (cGH *GH, DECLARE_CCTK_PARAMETERS int value; hid_t group; + char buffer[128]; ioGH *ioUtilGH; ioHDF5UtilGH *myGH; @@ -430,5 +433,19 @@ void IOHDF5Util_DumpGHExtensions (cGH *GH, WRITE_ATTRIBUTE ("cctk_iteration", &GH->cctk_iteration, group, myGH->scalar_dataspace, 0, H5T_NATIVE_INT); + /* add the parameter filename and the creation date + as file identification attributes */ + buffer[0] = 0; + CCTK_ParameterFilename (sizeof (buffer), buffer); + WRITE_ATTRIBUTE ("parameter file", buffer, group, + myGH->scalar_dataspace, 0, myGH->IOHDF5_STRING); + buffer[0] = 0; + Util_CurrentDate (sizeof (buffer), buffer); + value = strlen (buffer) + 1; + buffer[value-1] = ' '; + Util_CurrentTime (sizeof (buffer) - value, buffer + value); + WRITE_ATTRIBUTE ("creation date", buffer, group, + myGH->scalar_dataspace, 0, myGH->IOHDF5_STRING); + IOHDF5_ERROR (H5Gclose (group)); } -- cgit v1.2.3