aboutsummaryrefslogtreecommitdiff
path: root/src/Output.c
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>1999-10-26 23:40:17 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>1999-10-26 23:40:17 +0000
commit5b469bd4a94f2cba17ca871a39548eb671dd1da6 (patch)
tree91410deff70a126f690bc06739562a832e496161 /src/Output.c
parent9d52c908265b3b9fcd1ffe8d469095503b051276 (diff)
Tidying up several things:
- use ParseVarsForOutput() instead of InitIONum() for parsing the out_vars parameter - decide which output dir shall be used by using CCTK_ParameterInfo() rather than comparing it with its old "outdir" default value - outdirs are always created now (not only if out_vars was non-empty) because IO methods might be invoked via CCTK_OutputVarAs() also - some variables renamed for better readability git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@14 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/Output.c')
-rw-r--r--src/Output.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/Output.c b/src/Output.c
index 4dea94f..fdfd92c 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -31,7 +31,7 @@ int IOBasic_OutputGH (cGH *GH)
myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")];
/* Return if no output is required */
- if (myGH->Scalarevery < 0)
+ if (myGH->outScalar_every <= 0)
return 0;
/* Loop over all variables */
@@ -40,12 +40,12 @@ int IOBasic_OutputGH (cGH *GH)
grouptype = CCTK_GroupTypeFromVarI (i);
/* Check this GF should be output */
- if ((grouptype == GROUP_GF||grouptype == GROUP_SCALAR)
- && myGH->Scalarnum [i] != 0
- && (GH->cctk_iteration % myGH->Scalarevery == 0)) {
+ if (myGH->do_outScalar [i]
+ && (grouptype == GROUP_GF||grouptype == GROUP_SCALAR)
+ && (GH->cctk_iteration % myGH->outScalar_every == 0)) {
/* Check GF not already output this iteration */
- if (myGH->Scalarlast [i] == GH->cctk_iteration) {
+ if (myGH->outScalar_last [i] == GH->cctk_iteration) {
char *msg, *varname;
varname = CCTK_VarName (i);
@@ -78,8 +78,7 @@ int IOBasic_OutputGH (cGH *GH)
printf("\nIn IOBasic_OutputGH\n----------------\n");
printf(" Index = %d\n",i);
printf(" Variable = -%s-\n",name);
- printf(" Last output iteration was = %d\n",myGH->Scalarlast[i]);
- printf(" Output iteration number = %d\n",myGH->Scalarnum[i]);
+ printf(" Last output iteration was = %d\n",myGH->outScalar_last[i]);
#endif
/* Make the IO call */
@@ -92,11 +91,8 @@ int IOBasic_OutputGH (cGH *GH)
IOBasic_WriteGF (GH, i, name);
}
- /* Register another 0D output for this GF */
- myGH->Scalarnum [i]++;
-
/* Register GF as having 0D output this iteration */
- myGH->Scalarlast [i] = GH->cctk_iteration;
+ myGH->outScalar_last [i] = GH->cctk_iteration;
}
}
}
@@ -179,12 +175,12 @@ int IOBasic_TimeForOutput (cGH *GH, int var)
grouptype = CCTK_GroupTypeFromVarI (var);
/* Check this GF should be output */
- if ((grouptype == GROUP_GF || grouptype == GROUP_SCALAR)
- && myGH->Scalarnum [var] != 0
- && (GH->cctk_iteration % myGH->Scalarevery == 0)) {
+ if (myGH->do_outScalar [var]
+ && (grouptype == GROUP_GF || grouptype == GROUP_SCALAR)
+ && (GH->cctk_iteration % myGH->outScalar_every == 0)) {
/* Check GF not already output this iteration */
- if (myGH->Scalarlast [var] == GH->cctk_iteration)
+ if (myGH->outScalar_last [var] == GH->cctk_iteration)
CCTK_WARN (2, "Already done Scalar output in IO");
else
return_type = 1;
@@ -223,11 +219,8 @@ int IOBasic_TriggerOutput (cGH *GH, int variable)
IOBasic_WriteGF (GH, variable, var);
}
- /* Register another Scalar output for this GF */
- myGH->Scalarnum [variable]++;
-
/* Register variable as having Scalar output this iteration */
- myGH->Scalarlast [variable] = GH->cctk_iteration;
+ myGH->outScalar_last [variable] = GH->cctk_iteration;
return 0;
}