From 55e80b4dc1af49f96e59f085f9c00d134d708a52 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 26 Mar 2001 20:48:39 +0000 Subject: 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 --- src/Write.c | 30 ++++++++++++++++++++++-------- src/WriteGF.c | 32 +++++++++++++++++++++++--------- 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); -- cgit v1.2.3