aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-03-26 20:54:52 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-03-26 20:54:52 +0000
commit4fe7022285df1d103a666cb61e1b3b6c610b3b78 (patch)
tree75a9c86cfe1da42925c52643c47e77b1c13f8a98
parent0a0388cea315e84a880723a94432d18ec3320344 (diff)
Write file information to output files only if IO::out_fileinfo is set.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@181 ebee0441-1374-4afa-a3b5-247f3ba15b9a
-rw-r--r--src/DumpVar.c10
-rw-r--r--src/Write2D.c34
-rw-r--r--src/Write3D.c34
3 files changed, 42 insertions, 36 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index 2c3b93d..59ea530 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -56,7 +56,6 @@ typedef struct {
#endif
} dumpInfo_t;
-static char *char_time_date = NULL;
/* local function prototypes */
static void IOFlexIO_DumpGS (cGH *GH, int vindex, int timelevel, IOFile iof,
@@ -303,11 +302,6 @@ static void IOFlexIO_DumpGA (cGH *GH, int vindex, int timelevel, IOFile iof,
CCTK_INT4 *geom; /* Lower bounds, size and global size of data we send */
void *outme; /* pointer to the data to be dumped */
int free_outme; /* indicates whether data buffer needs freeing */
-#ifdef SGI
- /* Get the date if we can */
- time_t t = time (NULL);
- char_time_date = asctime (localtime (&t));
-#endif
#ifdef CCTK_MPI
int i, j;
MPI_Status ms;
@@ -503,10 +497,6 @@ static void IOFlexIO_AddCommonAttributes (cGH *GH, int vindex, int timelevel,
CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "timelevel", FLEXIO_INT4,
1, &i_to_IO));
- if (char_time_date && out3D_datestamp)
- CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "date", FLEXIO_CHAR,
- strlen (char_time_date) + 1, char_time_date));
-
CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "time", FLEXIO_REAL, 1,&GH->cctk_time));
CCTK_CoordRange (GH, &d3_to_IO [0], &dummy, -1, "x", "cart3d");
diff --git a/src/Write2D.c b/src/Write2D.c
index 01b4b6f..c808592 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -183,19 +183,27 @@ void IOFlexIO_Write2D (cGH *GH, int vindex, const char *alias)
/* add the parameter filename and the creation date
as file identification attributes */
- buffer[0] = 0;
- CCTK_ParameterFilename (sizeof (buffer), buffer);
- CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir],
- "parameter file", FLEXIO_CHAR,
- strlen (buffer) + 1, buffer));
- buffer[0] = 0;
- Util_CurrentDate (sizeof (buffer), buffer);
- len = strlen (buffer) + 1;
- buffer[len-1] = ' ';
- Util_CurrentTime (sizeof (buffer) - len, buffer + len);
- CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir],
- "creation date", FLEXIO_CHAR,
- strlen (buffer) + 1, buffer));
+ if (CCTK_Equals (out_fileinfo, "parameter filename") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ CCTK_ParameterFilename (sizeof (buffer), buffer);
+ CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir],
+ "parameter file", FLEXIO_CHAR,
+ strlen (buffer) + 1, buffer));
+ }
+ if (CCTK_Equals (out_fileinfo, "creation date") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ Util_CurrentDate (sizeof (buffer), buffer);
+ len = strlen (buffer) + 1;
+ buffer[len-1] = ' ';
+ Util_CurrentTime (sizeof (buffer) - len, buffer + len);
+ CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_2D[dir],
+ "creation date", FLEXIO_CHAR,
+ strlen (buffer) + 1, buffer));
+ }
}
/* store file desriptors in database */
diff --git a/src/Write3D.c b/src/Write3D.c
index 404ba5c..f24724e 100644
--- a/src/Write3D.c
+++ b/src/Write3D.c
@@ -170,19 +170,27 @@ void IOFlexIO_Write3D (cGH *GH, int vindex, const char *alias)
/* add the parameter filename and the creation date
as file identification attributes */
- buffer[0] = 0;
- CCTK_ParameterFilename (sizeof (buffer), buffer);
- CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_3D->iofile,
- "parameter file", FLEXIO_CHAR,
- strlen (buffer) + 1, buffer));
- buffer[0] = 0;
- Util_CurrentDate (sizeof (buffer), buffer);
- len = strlen (buffer) + 1;
- buffer[len-1] = ' ';
- Util_CurrentTime (sizeof (buffer) - len, buffer + len);
- CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_3D->iofile,
- "creation date", FLEXIO_CHAR,
- strlen (buffer) + 1, buffer));
+ if (CCTK_Equals (out_fileinfo, "parameter filename") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ CCTK_ParameterFilename (sizeof (buffer), buffer);
+ CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_3D->iofile,
+ "parameter file", FLEXIO_CHAR,
+ strlen (buffer) + 1, buffer));
+ }
+ if (CCTK_Equals (out_fileinfo, "creation date") ||
+ CCTK_Equals (out_fileinfo, "all"))
+ {
+ buffer[0] = 0;
+ Util_CurrentDate (sizeof (buffer), buffer);
+ len = strlen (buffer) + 1;
+ buffer[len-1] = ' ';
+ Util_CurrentTime (sizeof (buffer) - len, buffer + len);
+ CACTUS_IEEEIO_ERROR (IOwriteAttribute (IEEEfile_3D->iofile,
+ "creation date", FLEXIO_CHAR,
+ strlen (buffer) + 1, buffer));
+ }
}
else
{