aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2003-08-22 11:26:31 +0000
committertradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2003-08-22 11:26:31 +0000
commit5fbb1a2ddf5382f7c8966c84db53678db7448c83 (patch)
tree591c3c614af57a8cc82c061b9952b4c9317a994c
parent15bb8257e05270ca8e2fa7118c04b70557d677c7 (diff)
In IOBasic_ScalarOutputGH(), check only once whether steerable parameters
have changed. This closes PR Cactus/1585. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@143 b589c3ab-70e8-4b4d-a09f-cba2dd200880
-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