aboutsummaryrefslogtreecommitdiff
path: root/src/Output1D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Output1D.c')
-rw-r--r--src/Output1D.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Output1D.c b/src/Output1D.c
index 34f3477..9e3b538 100644
--- a/src/Output1D.c
+++ b/src/Output1D.c
@@ -26,7 +26,6 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Output1D_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_TimeFor1D (const cGH *GH, int vindex)
myGH = (asciiioGH *) CCTK_GHExtension (GH, "IOASCII");
- CheckSteerableParameters (myGH);
+ IOASCII_CheckSteerableParameters1D (myGH);
/* check if this variable should be output */
retval = myGH->out1D_every[vindex] > 0 &&
@@ -232,9 +231,22 @@ int IOASCII_TriggerOutput1D (const cGH *GH, int vindex)
}
-/**************************** local functions ******************************/
-/* check if steerable parameters have changed */
-static void CheckSteerableParameters (asciiioGH *myGH)
+/*@@
+ @routine IOASCII_CheckSteerableParameters1D
+ @date Tue 8 June 2004
+ @author Thomas Radke
+ @desc
+ Check if steerable IOASCII 1D parameters have changed
+ @enddesc
+ @calls CCTK_TraverseString
+
+ @var myGH
+ @vdesc Pointer to IOASCII GH
+ @vtype asciiioGH *
+ @vio inout
+ @endvar
+@@*/
+void IOASCII_CheckSteerableParameters1D (asciiioGH *myGH)
{
int i, num_vars;
char *fullname, *msg;
@@ -250,12 +262,12 @@ static void CheckSteerableParameters (asciiioGH *myGH)
{
if (myGH->out1D_every_default > 0)
{
- CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_1D: Periodic output every %d "
+ CCTK_VInfo (CCTK_THORNSTRING, "Periodic 1D output every %d "
"iterations", myGH->out1D_every_default);
}
else
{
- CCTK_INFO ("IOASCII_1D: Periodic output turned off");
+ CCTK_INFO ("Periodic 1D output turned off");
}
}
@@ -264,7 +276,12 @@ static void CheckSteerableParameters (asciiioGH *myGH)
{
num_vars = CCTK_NumVars ();
memset (myGH->out1D_every, 0, num_vars * sizeof (CCTK_INT));
- CCTK_TraverseString (out1D_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR);
+ if (CCTK_TraverseString (out1D_vars, SetOutputFlag, myGH,
+ CCTK_GROUP_OR_VAR) < 0)
+ {
+ CCTK_WARN (myGH->stop_on_parse_errors ? 0 : 1,
+ "error while parsing parameter 'IOASCII::out1D_vars'");
+ }
if (myGH->out1D_every_default == i || ! CCTK_Equals (verbose, "none"))
{
@@ -276,7 +293,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
fullname = CCTK_FullName (i);
if (! msg)
{
- Util_asprintf (&msg, "IOASCII_1D: Periodic output requested for "
+ Util_asprintf (&msg, "Periodic 1D output requested for "
"'%s'", fullname);
}
else
@@ -300,6 +317,7 @@ static void CheckSteerableParameters (asciiioGH *myGH)
}
+/**************************** local functions ******************************/
/* check if this variable can be output (static conditions) */
static int CheckOutputVar (int vindex)
{
@@ -338,6 +356,7 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg)
if (optstring)
{
IOUtil_ParseOutputFrequency ("1D IOASCII", "IOASCII::out1D_vars",
+ myGH->stop_on_parse_errors,
vindex, optstring,
&myGH->out1D_every[vindex]);
}