diff options
Diffstat (limited to 'src/Startup.c')
-rw-r--r-- | src/Startup.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/Startup.c b/src/Startup.c index de7dfb4..8d3494c 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -44,16 +44,16 @@ static void *IOASCII_SetupGH (tFleshConfig *config, void IOASCII_Startup (void) { /* check that thorn IOUtil was activated */ - if (CCTK_GHExtensionHandle ("IO") < 0) + if (CCTK_GHExtensionHandle ("IO") >= 0) + { + CCTK_RegisterGHExtensionSetupGH (CCTK_RegisterGHExtension ("IOASCII"), + IOASCII_SetupGH); + } + else { CCTK_WARN (1, "IOASCII_Startup: Thorn IOUtil was not activated. " "No IOASCII IO methods will be enabled."); - return; } - - CCTK_RegisterGHExtensionSetupGH (CCTK_RegisterGHExtension ("IOASCII"), - IOASCII_SetupGH); - } @@ -128,8 +128,7 @@ static void *IOASCII_SetupGH (tFleshConfig *config, CCTK_RegisterIOMethodTimeToOutput (i, IOASCII_TimeFor3D); CCTK_RegisterIOMethodTriggerOutput (i, IOASCII_TriggerOutput3D); - if (CCTK_Equals (newverbose, "standard") || - CCTK_Equals( newverbose, "full")) + if (! CCTK_Equals (newverbose, "none")) { CCTK_INFO ("I/O Method 'IOASCII_1D' registered"); CCTK_INFO ("IOASCII_1D: Output of 1D lines of grid functions/arrays " @@ -145,12 +144,12 @@ static void *IOASCII_SetupGH (tFleshConfig *config, /* allocate the GH extension and its components */ newGH = (asciiioGH *) malloc (sizeof (asciiioGH)); - if(newGH) + if (newGH) { numvars = CCTK_NumVars (); - newGH->do_out1D = (char *) malloc (numvars * sizeof (char)); - newGH->do_out2D = (char *) malloc (numvars * sizeof (char)); - newGH->do_out3D = (char *) malloc (numvars * sizeof (char)); + newGH->out1D_every = (int *) malloc (numvars * sizeof (int)); + newGH->out2D_every = (int *) malloc (numvars * sizeof (int)); + newGH->out3D_every = (int *) malloc (numvars * sizeof (int)); newGH->out1D_last = (int *) malloc (numvars * sizeof (int)); newGH->out2D_last = (int *) malloc (numvars * sizeof (int)); newGH->out3D_last = (int *) malloc (numvars * sizeof (int)); @@ -162,6 +161,13 @@ static void *IOASCII_SetupGH (tFleshConfig *config, newGH->out3D_last[i] = -1; } + newGH->out1D_vars = strdup (""); + newGH->out2D_vars = strdup (""); + newGH->out3D_vars = strdup (""); + newGH->out1D_every_default = 0; + newGH->out2D_every_default = 0; + newGH->out3D_every_default = 0; + newGH->filenameList1D = NULL; newGH->fileList_2D = NULL; newGH->fileList_3D = NULL; @@ -236,7 +242,6 @@ static void *IOASCII_SetupGH (tFleshConfig *config, CCTK_VInfo (CCTK_THORNSTRING, "IOASCII_3D: Output to directory '%s'", newGH->outdir3D); } - } else { |