diff options
Diffstat (limited to 'src/Output3D.c')
-rw-r--r-- | src/Output3D.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/Output3D.c b/src/Output3D.c index 4cf537f..92a1119 100644 --- a/src/Output3D.c +++ b/src/Output3D.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 */ @@ -259,7 +260,7 @@ static void CheckSteerableParameters (asciiioGH *myGH) if (strcmp (out3D_vars, myGH->out3D_vars) || myGH->out3D_every_default != i) { num_vars = CCTK_NumVars (); - memset (myGH->out3D_every, 0, num_vars * sizeof (int)); + memset (myGH->out3D_every, 0, num_vars * sizeof (CCTK_INT)); CCTK_TraverseString (out3D_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR); if (myGH->out3D_every_default == i || ! CCTK_Equals (verbose, "none")) @@ -336,27 +337,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->out3D_every[vindex] = myGH->out3D_every_default; + if (optstring) { - endptr = "error"; - if (strncmp ("out_every=", optstring, 10) == 0) - { - myGH->out3D_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->out3D_every[vindex] = 0; - } + IOUtil_ParseOutputFrequency ("3D IOASCII", "IOASCII::out3D_vars", + vindex, optstring, + &myGH->out3D_every[vindex]); } } } |