aboutsummaryrefslogtreecommitdiff
path: root/src/Output1D.c
diff options
context:
space:
mode:
authortradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2002-05-06 09:11:42 +0000
committertradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2002-05-06 09:11:42 +0000
commit84df6a1831d14dcd7a80b7c65758919a78732df0 (patch)
treeb66b71102d27bfaf0b90d5dd5918292041b092d0 /src/Output1D.c
parent76d4e575a9901080e16d0558e9d65f7a1ec8fe22 (diff)
Parameter names changes as announced in today's mail to users@cactuscode.org.
You must also update thorn IOUtil now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@113 94b1c47f-dcfd-45ef-a468-0854c0e9e350
Diffstat (limited to 'src/Output1D.c')
-rw-r--r--src/Output1D.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/src/Output1D.c b/src/Output1D.c
index 5b1a297..8bcdd3d 100644
--- a/src/Output1D.c
+++ b/src/Output1D.c
@@ -54,22 +54,17 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg);
int IOASCII_Output1DGH (const cGH *GH)
{
int vindex, retval;
- asciiioGH *myGH;
+ const asciiioGH *myGH;
- myGH = (asciiioGH *) CCTK_GHExtension (GH, "IOASCII");
+ retval = 0;
+ myGH = (const asciiioGH *) CCTK_GHExtension (GH, "IOASCII");
/* loop over all variables */
- for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++)
+ for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
{
- /* check if this variable should be output */
- if (! IOASCII_TimeFor1D (GH, vindex))
- {
- continue;
- }
-
- /* do the output */
- if (IOASCII_Write1D (GH, vindex, CCTK_VarName (vindex)) == 0)
+ if (IOASCII_TimeFor1D (GH, vindex) &&
+ IOASCII_Write1D (GH, vindex, CCTK_VarName (vindex)) == 0)
{
/* register variable as having 1D output this iteration */
myGH->out1D_last[vindex] = GH->cctk_iteration;
@@ -160,19 +155,17 @@ int IOASCII_Output1DVarAs (const cGH *GH, const char *fullname, const char *alia
int IOASCII_TimeFor1D (const cGH *GH, int vindex)
{
int retval;
- asciiioGH *myGH;
char *fullname;
+ asciiioGH *myGH;
- /* default is not do any output */
- retval = 0;
-
myGH = (asciiioGH *) CCTK_GHExtension (GH, "IOASCII");
CheckSteerableParameters (myGH);
/* check if this variable should be output */
- if (myGH->out1D_every[vindex] > 0 &&
- GH->cctk_iteration % myGH->out1D_every[vindex] == 0)
+ retval = myGH->out1D_every[vindex] > 0 &&
+ GH->cctk_iteration % myGH->out1D_every[vindex] == 0;
+ if (retval)
{
/* check if this variable wasn't already output this iteration */
if (myGH->out1D_last[vindex] == GH->cctk_iteration)
@@ -182,10 +175,7 @@ int IOASCII_TimeFor1D (const cGH *GH, int vindex)
"Already done IOASCII 1D output for '%s' in current "
"iteration (probably via triggers)", fullname);
free (fullname);
- }
- else
- {
- retval = 1;
+ retval = 0;
}
}
@@ -251,7 +241,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
myGH->out1D_every_default = out1D_every >= 0 ? out1D_every : out_every;
/* report if frequency changed */
- if (myGH->out1D_every_default != i && ! CCTK_Equals (newverbose, "none"))
+ if (myGH->out1D_every_default != i && ! CCTK_Equals (verbose, "none"))
{
if (myGH->out1D_every_default > 0)
{
@@ -271,7 +261,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
memset (myGH->out1D_every, 0, num_vars * sizeof (int));
CCTK_TraverseString (out1D_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR);
- if (myGH->out1D_every_default == i || ! CCTK_Equals (newverbose, "none"))
+ if (myGH->out1D_every_default == i || ! CCTK_Equals (verbose, "none"))
{
msg = NULL;
for (i = 0; i < num_vars; i++)