aboutsummaryrefslogtreecommitdiff
path: root/src/Write1D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Write1D.c')
-rw-r--r--src/Write1D.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Write1D.c b/src/Write1D.c
index 008e9e3..779a3da 100644
--- a/src/Write1D.c
+++ b/src/Write1D.c
@@ -23,7 +23,6 @@
#include "cctk.h"
#include "cctk_Parameters.h"
#include "util_Table.h"
-#include "CactusBase/IOUtil/src/ioGH.h"
#include "CactusBase/IOUtil/src/ioutil_AdvertisedFiles.h"
#include "ioASCIIGH.h"
@@ -164,7 +163,7 @@ int IOASCII_Write1D (const cGH *GH, int vindex, const char *alias)
return (-1);
}
- /* get the handle for IOASCII extensions */
+ /* get the handle for IOASCII extension */
myGH = CCTK_GHExtension (GH, "IOASCII");
/* get the variable's group information */
@@ -461,7 +460,6 @@ static void OpenFile (const cGH *GH,
{
int i, dir, upper, lower, first_time_through;
asciiioGH *myGH;
- const ioGH *ioUtilGH;
char comment_char;
char *filename, *type_extension;
const char *file_extension;
@@ -472,9 +470,8 @@ static void OpenFile (const cGH *GH,
DECLARE_CCTK_PARAMETERS
- /* get handles for IOUtil and IOASCII extensions */
+ /* get handle for IOASCII extension */
myGH = CCTK_GHExtension (GH, "IOASCII");
- ioUtilGH = CCTK_GHExtension (GH, "IO");
/* set comment character and file extension */
if (CCTK_Equals (out1D_style, "xgraph"))
@@ -576,7 +573,7 @@ static void OpenFile (const cGH *GH,
If restart from recovery, existing files are opened in append mode. */
first_time_through = GetNamedData (myGH->filenameList1D, filename) == NULL;
file[i] = fopen (filename,
- ioUtilGH->recovered || ! first_time_through ? "a" : "w");
+ IO_TruncateOutputFiles (GH) && first_time_through ? "w" : "a");
if (! file[i])
{
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -598,7 +595,7 @@ static void OpenFile (const cGH *GH,
/* mark a restart point with an empty line in the output file,
so that gnuplot/xgraph don't try to connect the last output
before the abort and the first output after the restart */
- if (ioUtilGH->recovered)
+ if (! IO_TruncateOutputFiles (GH))
{
fputc ('\n', file[i]);
}