aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2001-03-26 20:48:39 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2001-03-26 20:48:39 +0000
commit55e80b4dc1af49f96e59f085f9c00d134d708a52 (patch)
treeee840777bdd6f8a02db9fba844ea41db8dc6ad38
parent0a02d46650311ecc08f71dc4751cb41ad9370788 (diff)
Write file information to output files only if IO::out_fileinfo is set.
For testsuite parameter files such information should not be output. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@86 b589c3ab-70e8-4b4d-a09f-cba2dd200880
-rw-r--r--src/Write.c30
-rw-r--r--src/WriteGF.c32
2 files changed, 45 insertions, 17 deletions
diff --git a/src/Write.c b/src/Write.c
index 3117170..6eb155a 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -121,14 +121,28 @@ void IOBasic_Write (cGH *GH, int vindex, const char *alias)
IOUtil_AdvertiseFile (GH, fname, &advertised_file);
/* write the file info and the header */
- CCTK_ParameterFilename (sizeof (buffer), buffer);
- fprintf (file, "%cParameter file %s\n", comment_char, buffer);
- Util_CurrentDate (sizeof (buffer), buffer);
- fprintf (file, "%cCreated %s ", comment_char, buffer);
- Util_CurrentTime (sizeof (buffer), buffer);
- fprintf (file, "%s\n", buffer);
- fprintf (file, "%cx-label time\n", comment_char);
- fprintf (file, "%cy-label %s\n", comment_char, advertised_file.varname);
+ if (CCTK_Equals (out_fileinfo, "parameter filename") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ CCTK_ParameterFilename (sizeof (buffer), buffer);
+ fprintf (file, "%cParameter file %s\n", comment_char, buffer);
+ }
+ if (CCTK_Equals (out_fileinfo, "creation date") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ Util_CurrentDate (sizeof (buffer), buffer);
+ fprintf (file, "%cCreated %s ", comment_char, buffer);
+ Util_CurrentTime (sizeof (buffer), buffer);
+ fprintf (file, "%s\n", buffer);
+ }
+ if (CCTK_Equals (out_fileinfo, "axis labels") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ fprintf (file, "%cx-label time\n", comment_char);
+ fprintf (file, "%cy-label %s\n", comment_char, advertised_file.varname);
+ }
fprintf (file, "%c%s v time\n", comment_char, alias);
free (advertised_file.varname);
diff --git a/src/WriteGF.c b/src/WriteGF.c
index a0aec07..d5c7d18 100644
--- a/src/WriteGF.c
+++ b/src/WriteGF.c
@@ -241,15 +241,29 @@ void IOBasic_WriteGF (cGH *GH,
IOUtil_AdvertiseFile (GH, filename, &advertised_file);
- CCTK_ParameterFilename (sizeof (buffer), buffer);
- fprintf (file, "%cParameter file %s\n", comment_char, buffer);
- Util_CurrentDate (sizeof (buffer), buffer);
- fprintf (file, "%cCreated %s ", comment_char, buffer);
- Util_CurrentTime (sizeof (buffer), buffer);
- fprintf (file, "%s\n", buffer);
- fprintf (file, "%cx-label time\n", comment_char);
- fprintf (file, "%cy-label %s\n",
- comment_char, advertised_file.varname);
+ if (CCTK_Equals (out_fileinfo, "parameter filename") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ CCTK_ParameterFilename (sizeof (buffer), buffer);
+ fprintf (file, "%cParameter file %s\n", comment_char, buffer);
+ }
+ if (CCTK_Equals (out_fileinfo, "creation date") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ Util_CurrentDate (sizeof (buffer), buffer);
+ fprintf (file, "%cCreated %s ", comment_char, buffer);
+ Util_CurrentTime (sizeof (buffer), buffer);
+ fprintf (file, "%s\n", buffer);
+ }
+ if (CCTK_Equals (out_fileinfo, "axis labels") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ fprintf (file, "%cx-label time\n", comment_char);
+ fprintf (file, "%cy-label %s\n",
+ comment_char, advertised_file.varname);
+ }
fprintf (file, "%c%s %s v time\n", comment_char, alias,
reduction_op);