diff options
author | tradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2002-05-28 14:48:46 +0000 |
---|---|---|
committer | tradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350> | 2002-05-28 14:48:46 +0000 |
commit | 2a224e81b3d8491dcea3ac7022c64a326cb24030 (patch) | |
tree | 5afc8bc053941bcbe0edc81c410ee82d55bd3f8a /src/Output2D.c | |
parent | 89725a801685d2fb33cdf08ddc24f4dc9d9c64d2 (diff) |
Allow the 'out_every' option in option strings to set the output frequency
for individual variables.
You also need to update CactusBase/IOUtil now.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@120 94b1c47f-dcfd-45ef-a468-0854c0e9e350
Diffstat (limited to 'src/Output2D.c')
-rw-r--r-- | src/Output2D.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/Output2D.c b/src/Output2D.c index 80788a7..a830e42 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 "CactusBase/IOUtil/src/ioutil_Utils.h" #include "ioASCIIGH.h" /* the rcs ID and its dummy function to use it */ @@ -258,7 +259,7 @@ static void CheckSteerableParameters (asciiioGH *myGH) if (strcmp (out2D_vars, myGH->out2D_vars) || myGH->out2D_every_default != i) { num_vars = CCTK_NumVars (); - memset (myGH->out2D_every, 0, num_vars * sizeof (int)); + memset (myGH->out2D_every, 0, num_vars * sizeof (CCTK_INT)); CCTK_TraverseString (out2D_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR); if (myGH->out2D_every_default == i || ! CCTK_Equals (verbose, "none")) @@ -334,27 +335,18 @@ static int CheckOutputVar (int vindex) for the given variable */ static void SetOutputFlag (int vindex, const char *optstring, void *arg) { - char *endptr; - asciiioGH *myGH = (asciiioGH *) arg; + const asciiioGH *myGH = (const asciiioGH *) arg; if (CheckOutputVar (vindex) == 0) { myGH->out2D_every[vindex] = myGH->out2D_every_default; + if (optstring) { - endptr = "error"; - if (strncmp ("out_every=", optstring, 10) == 0) - { - myGH->out2D_every[vindex] = strtol (optstring + 10, &endptr, 10); - } - if (endptr && *endptr) - { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "SetOutputFlag: Optional string '%s' could not be parsed", - optstring); - myGH->out2D_every[vindex] = 0; - } + IOUtil_ParseOutputFrequency ("2D IOASCII", "IOASCII::out2D_vars", + vindex, optstring, + &myGH->out2D_every[vindex]); } } } |