aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);