aboutsummaryrefslogtreecommitdiff
path: root/src/Output2D.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2004-06-09 10:42:17 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2004-06-09 10:42:17 +0000
commit50c54f5cd9648dc48090748e2859d6d76db19872 (patch)
tree728be75ed78e25a1e6ec53526f61b34d2c8393a0 /src/Output2D.c
parent2441627f997a6f069e85d83afad0f51d35695122 (diff)
After setup, do an initial I/O parameter parsing and warn/stop on parsing errors
(depending on IO::strict_io_parameter_check). You will also need to update CactusBase/IOUtil. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@326 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output2D.c')
-rw-r--r--src/Output2D.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/Output2D.c b/src/Output2D.c
index 8d54346..4f1ee8e 100644
--- a/src/Output2D.c
+++ b/src/Output2D.c
@@ -22,7 +22,6 @@ CCTK_FILEVERSION(CactusPUGHIO_IOFlexIO_Output2D_c)
/* prototypes of routines defined in this source file */
static int CheckOutputVar (int vindex, int warn);
-static void CheckSteerableParameters (flexioGH *myGH);
static void SetOutputFlag (int vindex, const char *optstring, void *arg);
@@ -161,7 +160,7 @@ int IOFlexIO_TimeFor2D (const cGH *GH, int vindex)
result = 0;
myGH = (flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
- CheckSteerableParameters (myGH);
+ IOFlexIO_CheckSteerableParameters2D (myGH);
/* check if this variable should be output */
if (myGH->out2D_every[vindex] > 0 &&
@@ -240,9 +239,22 @@ int IOFlexIO_TriggerOutput2D (const cGH *GH, int vindex)
}
-/**************************** local functions ******************************/
-/* check if steerable parameters have changed */
-static void CheckSteerableParameters (flexioGH *myGH)
+/*@@
+ @routine IOFlexIO_CheckSteerableParameters2D
+ @date Tue 8 June 2004
+ @author Thomas Radke
+ @desc
+ Check if steerable IOFlexIO 2D parameters have changed
+ @enddesc
+ @calls CCTK_TraverseString
+
+ @var myGH
+ @vdesc Pointer to IOFlexIO GH
+ @vtype flexioGH *
+ @vio inout
+ @endvar
+@@*/
+void IOFlexIO_CheckSteerableParameters2D (flexioGH *myGH)
{
int i, num_vars;
char *fullname, *msg;
@@ -272,7 +284,12 @@ static void CheckSteerableParameters (flexioGH *myGH)
{
num_vars = CCTK_NumVars ();
memset (myGH->out2D_every, 0, num_vars * sizeof (CCTK_INT));
- CCTK_TraverseString (out2D_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR);
+ if (CCTK_TraverseString (out2D_vars, SetOutputFlag, myGH,
+ CCTK_GROUP_OR_VAR) < 0)
+ {
+ CCTK_WARN (myGH->stop_on_parse_errors ? 0 : 1,
+ "error while parsing parameter 'IOFlexIO::out2D_vars'");
+ }
if (myGH->out2D_every_default == i || ! CCTK_Equals (verbose, "none"))
{
@@ -308,6 +325,7 @@ static void CheckSteerableParameters (flexioGH *myGH)
}
+/**************************** local functions ******************************/
/* check if this variable can be output (static conditions) */
static int CheckOutputVar (int vindex, int warn)
{
@@ -344,6 +362,7 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg)
if (optstring)
{
IOUtil_ParseOutputFrequency ("2D IOFlexIO", "IOFlexIO::out2D_vars",
+ myGH->stop_on_parse_errors,
vindex, optstring,
&myGH->out2D_every[vindex]);
}