aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2001-03-21 11:41:20 +0000
committertradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2001-03-21 11:41:20 +0000
commit04cc8587308160f963f85fead68e556d1d98adc9 (patch)
tree2c04145533ceabdbc8219d86ad2c42c6e2ff19de
parent6a03f5a8da257678725edfca32f84bf771315897 (diff)
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
-rw-r--r--src/DumpUtils.c19
1 files changed, 18 insertions, 1 deletions
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));
}