aboutsummaryrefslogtreecommitdiff
path: root/src/GHExtension.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r--src/GHExtension.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 3cfaa02..3313abc 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -15,6 +15,7 @@
#include "cctk.h"
#include "cctk_parameters.h"
+#include "cctk_ParameterFunctions.h"
#include "CactusBase/IOUtil/src/ioGH.h"
#include "iobasicGH.h"
@@ -29,11 +30,11 @@ void *IOBasic_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
for (i=0;i<CCTK_NumVars ();i++)
newGH->infovals[i] = (CCTK_REAL *) malloc (2 * sizeof (CCTK_REAL));
- newGH->Scalarnum = (int *) malloc (CCTK_NumVars () * sizeof (int));
- newGH->Scalarlast = (int *) malloc (CCTK_NumVars () * sizeof (int));
+ newGH->do_outScalar = (char *) malloc (CCTK_NumVars () * sizeof (char));
+ newGH->outScalar_last = (int *) malloc (CCTK_NumVars () * sizeof (int));
- newGH->infonum = (int *) malloc (CCTK_NumVars () * sizeof (int));
- newGH->infolast = (int *) malloc (CCTK_NumVars () * sizeof (int));
+ newGH->do_outInfo = (char *) malloc (CCTK_NumVars () * sizeof (char));
+ newGH->outInfo_last = (int *) malloc (CCTK_NumVars () * sizeof (int));
return newGH;
}
@@ -43,39 +44,40 @@ int IOBasic_InitGH (cGH *GH)
DECLARE_CCTK_PARAMETERS
int i;
iobasicGH *myGH;
+ t_param_prop *param_prop;
/* get the handles for IOBasic extensions */
myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")];
myGH->filenameListScalar = NULL;
/* How often to output */
- myGH->infoevery = out_every > 0 ? out_every : -1;
+ myGH->outInfo_every = out_every > 0 ? out_every : -1;
if (outInfo_every > 0)
- myGH->infoevery = outInfo_every;
+ myGH->outInfo_every = outInfo_every;
- myGH->Scalarevery = out_every > 0 ? out_every : -1;
+ myGH->outScalar_every = out_every > 0 ? out_every : -1;
if (outScalar_every > 0)
- myGH->Scalarevery = outScalar_every;
+ myGH->outScalar_every = outScalar_every;
- InitIONum(myGH->infonum,outInfo_vars);
- InitIONum(myGH->Scalarnum,outScalar_vars);
+ ParseVarsForOutput (outInfo_vars, myGH->do_outInfo);
+ ParseVarsForOutput (outScalar_vars, myGH->do_outScalar);
- /* Deal with the output directories */
- myGH->outpfx_Scalar = outdir;
- if (!CCTK_Equals(outdirScalar,"outdir"))
- myGH->outpfx_Scalar = outdirScalar;
+ /* Check whether "outdirScalar" was set.
+ If so take this dir otherwise default to "IO::outdir" */
+ param_prop = CCTK_ParameterInfo ("outdirScalar", CCTK_THORNSTRING);
+ if (param_prop && param_prop->n_set > 0)
+ myGH->outdirScalar = outdirScalar;
+ else
+ myGH->outdirScalar = outdir;
- /* Create the output directories */
- if (myGH->Scalarevery > 0) {
- if (CCTK_MyProc (GH) == 0) {
- CCTK_mkdir(myGH->outpfx_Scalar);
- }
- }
+ /* create the output dir */
+ if (CCTK_MyProc (GH) == 0)
+ CCTK_mkdir (myGH->outdirScalar);
for (i=0; i<CCTK_NumVars(); i++)
- myGH->Scalarlast[i] = -1;
+ myGH->outScalar_last[i] = -1;
for (i=0; i<CCTK_NumVars(); i++)
- myGH->infolast [i] = -1;
+ myGH->outInfo_last [i] = -1;
for (i=0; i<CCTK_NumVars(); i++)
{