aboutsummaryrefslogtreecommitdiff
path: root/src/GHExtension.c
diff options
context:
space:
mode:
authorallen <allen@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-07-25 11:01:21 +0000
committerallen <allen@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-07-25 11:01:21 +0000
commit56afd6a641869778e18b23754101f819b8de045f (patch)
treecbb01dccc67b273d7be088a85c2712f0695203f6 /src/GHExtension.c
parentf2adb19bfb1515ef99c702be8970b954951857f8 (diff)
Parameter changes: all Flexio parameters are now in flexio
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@20 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r--src/GHExtension.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 67e4908..b11e7ab 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -58,15 +58,53 @@ int IOFlexIO_InitGH (cGH *GH)
DECLARE_CCTK_PARAMETERS
int i;
ioGH *ioUtilGH;
- flexioGH *myGH;
+ flexioGH *myGH;
/* get the handles for IOUtil and IOFlexIO extensions */
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
+ /* How often to output */
+ myGH->IO_2Devery = output_every;
+ myGH->IO_3Devery = output_every;
+ if (output2d_every > 0)
+ myGH->IO_2Devery = output2d_every;
+ if (output3d_every > 0)
+ myGH->IO_3Devery = output3d_every;
+
InitIONum (myGH->IO_2Dnum, output2D);
InitIONum (myGH->IO_3Dnum, output3D);
+ /* Deal with the output directories */
+ myGH->outpfx_2D = outdir;
+ myGH->outpfx_3D = outdir;
+ if (!CCTK_Equals(outdir2d,"outdir"))
+ myGH->outpfx_2D = outdir2d;
+ if (!CCTK_Equals(outdir3d,"outdir"))
+ myGH->outpfx_3D = outdir3d;
+
+ /* Create the output directories */
+ if (myGH->IO_2Devery > 0) {
+ if (CCTK_MyProc (GH) == 0) {
+ char *command = (char *) malloc (1024 * sizeof (char));
+
+ sprintf (command, "mkdir -p %s", myGH->outpfx_2D);
+ if (system (command) < 0)
+ CCTK_WARN (1,"Problem creating IO 2D directory");
+ free (command);
+ }
+ }
+ if (myGH->IO_3Devery > 0) {
+ if (CCTK_MyProc (GH) == 0) {
+ char *command = (char *) malloc (1024 * sizeof (char));
+
+ sprintf (command, "mkdir -p %s", myGH->outpfx_3D);
+ if (system (command) < 0)
+ CCTK_WARN (1,"Problem creating IO 3D directory");
+ free (command);
+ }
+ }
+
for (i=0; i<CCTK_NumVars(); i++)
myGH->IO_2Dlast [i] = myGH->IO_3Dlast [i] = -1;