aboutsummaryrefslogtreecommitdiff
path: root/src/Output2D.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-12-28 21:35:17 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2001-12-28 21:35:17 +0000
commit592c4e9343f94dca0d37de7c7f34fa8b8fb4394e (patch)
tree29d1f9be74e4fa06c2f7490e8273d9f98475c847 /src/Output2D.c
parent91eb9c5c135c85a14c103c2e02fa6acf3b61ec20 (diff)
Fixed return codes of I/O methods.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@222 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output2D.c')
-rw-r--r--src/Output2D.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Output2D.c b/src/Output2D.c
index b738784..a6d2dde 100644
--- a/src/Output2D.c
+++ b/src/Output2D.c
@@ -50,11 +50,11 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg);
int IOFlexIO_Output2DGH (const cGH *GH)
{
- DECLARE_CCTK_PARAMETERS
- int i;
+ int i, retval;
flexioGH *myGH;
const char *name;
char *fullname;
+ DECLARE_CCTK_PARAMETERS
/* Get the GH extension for IOFlexIO */
@@ -66,7 +66,7 @@ int IOFlexIO_Output2DGH (const cGH *GH)
return (0);
/* Loop over all variables */
- for (i = 0; i < CCTK_NumVars (); i++) {
+ for (i = retval = 0; i < CCTK_NumVars (); i++) {
if (IOFlexIO_TimeFor2D (GH, i)) {
@@ -77,18 +77,18 @@ int IOFlexIO_Output2DGH (const cGH *GH)
CCTK_VInfo (CCTK_THORNSTRING, "IOFlexIO_Output2DGH: "
"fullname / name = %s / %s", fullname, name);
- IOFlexIO_Output2DVarAs (GH, fullname, name);
+ if (IOFlexIO_Output2DVarAs (GH, fullname, name) == 0)
+ {
+ /* Register GF as having 2D output this iteration */
+ myGH->out2D_last[i] = GH->cctk_iteration;
+ retval++;
+ }
free (fullname);
-
- /* Register GF as having 2D output this iteration */
- myGH->out2D_last[i] = GH->cctk_iteration;
}
}
- return (0);
-
-
+ return (retval);
}
@@ -122,11 +122,11 @@ int IOFlexIO_Output2DGH (const cGH *GH)
@vcomment
@endvar
@@*/
-
int IOFlexIO_Output2DVarAs (const cGH *GH, const char *fullname, const char *alias)
{
+ int vindex, retval;
DECLARE_CCTK_PARAMETERS
- int vindex;
+
vindex = CCTK_VarIndex (fullname);
@@ -135,12 +135,13 @@ int IOFlexIO_Output2DVarAs (const cGH *GH, const char *fullname, const char *ali
"fullname, alias, index = (%s, %s, %d)", fullname,alias,vindex);
/* Do the 2D output */
+ retval = -1;
if (CheckOutputVar (vindex) == 0)
{
- IOFlexIO_Write2D (GH, vindex, alias);
+ retval = IOFlexIO_Write2D (GH, vindex, alias);
}
- return (0);
+ return (retval);
}
@@ -169,8 +170,6 @@ int IOFlexIO_Output2DVarAs (const cGH *GH, const char *fullname, const char *ali
@vcomment
@endvar
@@*/
-
-
int IOFlexIO_TimeFor2D (const cGH *GH, int vindex)
{
flexioGH *myGH;
@@ -232,12 +231,12 @@ int IOFlexIO_TimeFor2D (const cGH *GH, int vindex)
@vcomment
@endvar
@@*/
-
int IOFlexIO_TriggerOutput2D (const cGH *GH, int vindex)
{
- DECLARE_CCTK_PARAMETERS
+ int retval;
flexioGH *myGH;
const char *varname;
+ DECLARE_CCTK_PARAMETERS
varname = CCTK_VarName (vindex);
@@ -250,13 +249,15 @@ int IOFlexIO_TriggerOutput2D (const cGH *GH, int vindex)
"name, index = (%s, %d)", varname, vindex);
/* Do the 2D output */
- IOFlexIO_Write2D (GH, vindex, varname);
-
- /* Register GF as having 2D output this iteration */
- myGH->out2D_last [vindex] = GH->cctk_iteration;
+ retval = IOFlexIO_Write2D (GH, vindex, varname);
- return (0);
+ if (retval == 0)
+ {
+ /* Register GF as having 2D output this iteration */
+ myGH->out2D_last [vindex] = GH->cctk_iteration;
+ }
+ return (retval);
}
@@ -285,7 +286,6 @@ static void CheckSteerableParameters (flexioGH *myGH)
/* Save the last setting of 'out2D_vars' parameter */
out2D_vars_lastset = times_set;
}
-
}