diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-01-21 18:00:59 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-01-21 18:00:59 +0000 |
commit | 400e340a12e6019f91ded50e5ba1791ee04edda0 (patch) | |
tree | d1e719baf82aa32efd45d36bf6b3ec7aec66713e /src/Output2D.c | |
parent | d58e1c47d498896b0c1f208724c7d138abce6349 (diff) |
Added several stuff to IOFlexIO:
- checkpointing/recovery of parameters
- made 'out2D_every', 'out2D_vars', 'out3D_every' and 'out3D_vars' steerable
- fixed compiler warnings
- grdocs
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@78 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output2D.c')
-rw-r--r-- | src/Output2D.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/src/Output2D.c b/src/Output2D.c index 3bed335..e88a550 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -17,12 +17,16 @@ #include "cctk.h" #include "cctk_parameters.h" +#include "cctk_ParameterFunctions.h" +#include "CactusBase/IOUtil/src/ioGH.h" #include "ioFlexGH.h" +/* local function prototypes */ int IOFlexIO_Output2DVarAs (cGH *GH, const char *var, const char *alias); int IOFlexIO_TimeFor2D (cGH *GH, int index); + /*@@ @routine IOFlexIO_Output2DGH @date Sat March 6 1999 @@ -30,13 +34,7 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index); @desc Loops over all variables and outputs them if necessary @enddesc - @calls CCTK_GHExtensionHandle - CCTK_NumVars - CCTK_ImplementationFromVar - CCTK_VarName - IOFlexIO_TimeFor2D - IOFlexIO_Output2DVarAs - @calledby + @calledby CCTK_OutputGH ("IOFlexIO_2D") @history @endhistory @@ -54,6 +52,9 @@ int IOFlexIO_Output2DGH (cGH *GH) int i; flexioGH *myGH; char *name, *fullname; + t_param_prop *param_prop; + static int out2D_vars_lastset = 0; + /* Get the GH extension for IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; @@ -61,6 +62,21 @@ int IOFlexIO_Output2DGH (cGH *GH) if (myGH->out2D_every <= 0) return (0); + /* Check the 'out2D_vars' parameter */ + param_prop = CCTK_ParameterInfo ("out2D_vars", CCTK_THORNSTRING); + if (! param_prop) { + CCTK_WARN (2, "Couldn't get info on parameter 'out2D_vars'"); + return (0); + } + + /* re-parse the 'out2D_vars' parameter if it was changed */ + if (param_prop->n_set != out2D_vars_lastset) { + ParseVarsForOutput (out2D_vars, myGH->do_out2D); + + /* Save the last setting of 'out2D_vars' parameter */ + out2D_vars_lastset = param_prop->n_set; + } + /* Loop over all variables */ for (i = 0; i < CCTK_NumVars (); i++) { @@ -86,7 +102,6 @@ int IOFlexIO_Output2DGH (cGH *GH) return (0); USE_CCTK_PARAMETERS - } @@ -97,11 +112,7 @@ int IOFlexIO_Output2DGH (cGH *GH) @desc unconditional output of a variable using the IO 2D output method @enddesc - @calls CCTK_DecomposeName - CCTK_VarIndex - CCTK_GHExtensionHandle - IOFlexIO_Write2D - @calledby IOFlexIO_Output2DGH + @calledby IOFlexIO_Output2DGH, CCTK_OutputVarAsByMethod ("IOFlexIO_2D") @history @endhistory @@ -145,7 +156,6 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) return (0); USE_CCTK_PARAMETERS - } @@ -157,9 +167,7 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) Decides if it is time to output a variable using the IO 2D output method @enddesc - @calls CCTK_GHExtensionHandle - CCTK_WARN - @calledby IOFlexIO_Output2DGH + @calledby IOFlexIO_Output2DGH @history @endhistory @@ -177,11 +185,12 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) @endvar @@*/ - + int IOFlexIO_TimeFor2D (cGH *GH, int index) { flexioGH *myGH; + /* Get the GH extension for IOUtil and IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; @@ -208,10 +217,7 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index) Triggers the output a variable using the IO 2D output method @enddesc - @calls CCTK_GHExtensionHandle - CCTK_VarName - IOFlexIO_Write2D - @calledby + @calledby CCTK scheduler @history @endhistory @@ -235,6 +241,7 @@ int IOFlexIO_TriggerOutput2D (cGH *GH, int index) flexioGH *myGH; char *varname; + varname = CCTK_VarName (index); /* get the handle for IOFlexIO extensions */ @@ -255,5 +262,4 @@ int IOFlexIO_TriggerOutput2D (cGH *GH, int index) return (0); USE_CCTK_PARAMETERS - } |