aboutsummaryrefslogtreecommitdiff
path: root/src/OutputScalar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/OutputScalar.c')
-rw-r--r--src/OutputScalar.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/OutputScalar.c b/src/OutputScalar.c
index a744164..4ac6c5f 100644
--- a/src/OutputScalar.c
+++ b/src/OutputScalar.c
@@ -24,11 +24,21 @@ CCTK_FILEVERSION(CactusBase_IOBasic_OutputScalar_c)
/********************************************************************
+ ******************** Static Variables ************************
+ ********************************************************************/
+/* flag whether CheckSteerableParameters() needs to be called */
+static int check_steerable_parameters = 1;
+
+
+/********************************************************************
******************** Internal Routines ************************
********************************************************************/
static void CheckSteerableParameters (iobasicGH *myGH);
+/********************************************************************
+ ******************** External Routines ************************
+ ********************************************************************/
/*@@
@routine IOBasic_ScalarOutputGH
@date Sat March 6 1999
@@ -57,6 +67,7 @@ int IOBasic_ScalarOutputGH (const cGH *GH)
iobasicGH *myGH;
+ /* check if any steerable parameters have changed */
myGH = CCTK_GHExtension (GH, "IOBasic");
CheckSteerableParameters (myGH);
@@ -68,6 +79,9 @@ int IOBasic_ScalarOutputGH (const cGH *GH)
retval = 0;
+ /* disable the check for steerable parameters during the following loop */
+ check_steerable_parameters = 0;
+
/* loop over all variables */
for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
{
@@ -80,6 +94,9 @@ int IOBasic_ScalarOutputGH (const cGH *GH)
}
}
+ /* enable the check for steerable parameters for following calls */
+ check_steerable_parameters = 1;
+
return (retval);
}
@@ -218,7 +235,11 @@ int IOBasic_TimeForScalarOutput (const cGH *GH, int vindex)
/* Get the GH extension for IOBasic */
myGH = CCTK_GHExtension (GH, "IOBasic");
- CheckSteerableParameters (myGH);
+ /* only need to check steerable parameters if this flag is set */
+ if (check_steerable_parameters)
+ {
+ CheckSteerableParameters (myGH);
+ }
/* check if any output was requested */
if (myGH->outScalar_every <= 0 || GH->cctk_iteration % myGH->outScalar_every