aboutsummaryrefslogtreecommitdiff
path: root/src/Output2D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Output2D.c')
-rw-r--r--src/Output2D.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Output2D.c b/src/Output2D.c
index 8ef97a7..1771cc2 100644
--- a/src/Output2D.c
+++ b/src/Output2D.c
@@ -26,7 +26,6 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Output2D_c)
******************** Internal Routines ************************
********************************************************************/
static int CheckOutputVar (int vindex);
-static void CheckSteerableParameters (asciiioGH *myGH);
static void SetOutputFlag (int vindex, const char *optstring, void *arg);
@@ -165,7 +164,7 @@ int IOASCII_TimeFor2D (const cGH *GH, int vindex)
myGH = (asciiioGH *) CCTK_GHExtension (GH, "IOASCII");
- CheckSteerableParameters (myGH);
+ IOASCII_CheckSteerableParameters2D (myGH);
/* check if this variable should be output */
retval = myGH->out2D_every[vindex] > 0 &&
@@ -233,9 +232,22 @@ int IOASCII_TriggerOutput2D (const cGH *GH, int vindex)
}
-/**************************** local functions ******************************/
-/* check if steerable parameters have changed */
-static void CheckSteerableParameters (asciiioGH *myGH)
+/*@@
+ @routine IOASCII_CheckSteerableParameters2D
+ @date Tue 8 June 2004
+ @author Thomas Radke
+ @desc
+ Check if steerable IOASCII 2D parameters have changed
+ @enddesc
+ @calls CCTK_TraverseString
+
+ @var myGH
+ @vdesc Pointer to IOASCII GH
+ @vtype asciiioGH *
+ @vio inout
+ @endvar
+@@*/
+void IOASCII_CheckSteerableParameters2D (asciiioGH *myGH)
{
int i, num_vars;
char *fullname, *msg;
@@ -251,12 +263,12 @@ static void CheckSteerableParameters (asciiioGH *myGH)
{
if (myGH->out2D_every_default > 0)
{
- CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Periodic output every %d "
+ CCTK_VInfo (CCTK_THORNSTRING, "Periodic 2D output every %d "
"iterations", myGH->out2D_every_default);
}
else
{
- CCTK_INFO ("IOASCII_2D: Periodic output turned off");
+ CCTK_INFO ("Periodic 2D output turned off");
}
}
@@ -265,7 +277,12 @@ static void CheckSteerableParameters (asciiioGH *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 'IOASCII::out2D_vars'");
+ }
if (myGH->out2D_every_default == i || ! CCTK_Equals (verbose, "none"))
{
@@ -277,7 +294,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
fullname = CCTK_FullName (i);
if (! msg)
{
- Util_asprintf (&msg, "IOASCII_2D: Periodic output requested for "
+ Util_asprintf (&msg, "Periodic 2D output requested for "
"'%s'", fullname);
}
else
@@ -301,6 +318,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
}
+/**************************** local functions ******************************/
/* check if this variable can be output (static conditions) */
static int CheckOutputVar (int vindex)
{
@@ -350,6 +368,7 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg)
if (optstring)
{
IOUtil_ParseOutputFrequency ("2D IOASCII", "IOASCII::out2D_vars",
+ myGH->stop_on_parse_errors,
vindex, optstring,
&myGH->out2D_every[vindex]);
}