diff options
Diffstat (limited to 'src/Output2D.c')
-rw-r--r-- | src/Output2D.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/Output2D.c b/src/Output2D.c index c0187e3..535d711 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -14,6 +14,7 @@ #include "cctk.h" #include "cctk_Parameters.h" +#include "util_String.h" #include "ioASCIIGH.h" /* the rcs ID and its dummy function to use it */ @@ -266,12 +267,12 @@ int IOASCII_TriggerOutput2D (cGH *GH, int vindex) /* check if steerable parameters have changed */ static void CheckSteerableParameters (asciiioGH *myGH) { - int i; - int out_old; - int times_set; + int i, out_old, times_set, num_vars; + char *fullname, *msg; static int out2D_vars_lastset = -1; DECLARE_CCTK_PARAMETERS + out_old = myGH->out2D_every; /* How often to output */ @@ -291,27 +292,42 @@ static void CheckSteerableParameters (asciiioGH *myGH) CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output every %d iterations", myGH->out2D_every); } - out_old = myGH->out2D_every; } /* re-parse the 'out2D_vars' parameter if it was changed */ times_set = CCTK_ParameterQueryTimesSet ("out2D_vars", CCTK_THORNSTRING); if (times_set != out2D_vars_lastset) { - memset (myGH->do_out2D, 0, CCTK_NumVars ()); + num_vars = CCTK_NumVars (); + memset (myGH->do_out2D, 0, num_vars); CCTK_TraverseString (out2D_vars, SetOutputFlag, myGH->do_out2D, CCTK_GROUP_OR_VAR); if (CCTK_Equals (newverbose, "standard") || CCTK_Equals (newverbose, "full")) { - for (i=0;i<CCTK_NumVars();i++) + msg = NULL; + for (i = 0; i < num_vars; i++) + { + if (myGH->do_out2D[i]) + { + fullname = CCTK_FullName (i); + if (! msg) + { + Util_asprintf (&msg, "IOASCII_2D: Output requested for %s", + fullname); + } + else + { + Util_asprintf (&msg, "%s %s", msg, fullname); + } + free (fullname); + } + } + if (msg) { - if (myGH->do_out2D[i]) - { - CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_2D: Output requested for %s", - CCTK_FullName(i)); - } + CCTK_INFO (msg); + free (msg); } } |