diff options
Diffstat (limited to 'src/Startup.c')
-rw-r--r-- | src/Startup.c | 74 |
1 files changed, 41 insertions, 33 deletions
diff --git a/src/Startup.c b/src/Startup.c index 1f27d98..1a02ef4 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -2,9 +2,9 @@ @file Startup.c @date Sat Feb 6 1999 @author Gabrielle Allen - @desc + @desc Startup routines for IOASCII. - @enddesc + @enddesc @version $Id$ @@*/ @@ -26,7 +26,7 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Startup_c) /******************************************************************** ******************** Macro Definitions ************************ ********************************************************************/ -#define CREATE_OUTDIR(method, dir) \ +#define CREATE_OUTDIR(dim, dir) \ { \ const char *_dir = dir; \ \ @@ -53,13 +53,13 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Startup_c) if (i < 0) \ { \ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, \ - "IOASCII_SetupGH: Problem creating %s output " \ - "directory '%s'", method, myGH->dir); \ + "IOASCII_SetupGH: Problem creating directory '%s' " \ + "for %dD output", myGH->dir, dim); \ } \ else if (i >= 0 && CCTK_Equals (verbose, "full")) \ { \ - CCTK_VInfo (CCTK_THORNSTRING, "%s: Output to directory '%s'", \ - method, myGH->dir); \ + CCTK_VInfo (CCTK_THORNSTRING, "%dD output to directory '%s'", \ + dim, myGH->dir); \ } \ } @@ -80,11 +80,11 @@ static void *IOASCII_SetupGH (tFleshConfig *config, int conv_level, cGH *GH); @routine IOASCII_Startup @date Sat Feb 6 1999 @author Gabrielle Allen - @desc + @desc The startup registration routine for IOASCII. Registers the GH extensions needed for IOASCII along with its setup routine. - @enddesc + @enddesc @calls CCTK_RegisterGHExtension CCTK_RegisterGHExtensionSetupGH @@*/ @@ -102,9 +102,9 @@ void IOASCII_Startup (void) @routine IOASCII_SetupGH @date Sat Feb 6 1999 @author Gabrielle Allen - @desc + @desc Allocates and sets up IOASCII's GH extension structure - @enddesc + @enddesc @calls CCTK_RegisterIOMethod CCTK_RegisterIOMethodOutputGH @@ -180,25 +180,6 @@ static void *IOASCII_SetupGH (tFleshConfig *config, int conv_level, cGH *GH) CCTK_RegisterIOMethodTriggerOutput (i, IOASCII_TriggerOutput3D); } - if (! CCTK_Equals (verbose, "none")) - { - CCTK_INFO ("I/O Method 'IOASCII_1D' registered"); - CCTK_INFO ("IOASCII_1D: Output of 1D lines of grid functions/arrays " - "to ASCII files"); - if (maxdim >= 2) - { - CCTK_INFO ("I/O Method 'IOASCII_2D' registered"); - CCTK_INFO ("IOASCII_2D: Output of 2D planes of grid functions/arrays " - "to ASCII files"); - } - if (maxdim >= 3) - { - CCTK_INFO ("I/O Method 'IOASCII_3D' registered"); - CCTK_INFO ("IOASCII_3D: Output of 3D grid functions/arrays " - "to ASCII files"); - } - } - numvars = CCTK_NumVars (); myGH->out1D_every = malloc (numvars * sizeof (CCTK_INT)); myGH->out2D_every = malloc (numvars * sizeof (CCTK_INT)); @@ -225,10 +206,37 @@ static void *IOASCII_SetupGH (tFleshConfig *config, int conv_level, cGH *GH) myGH->fileList_2D = NULL; myGH->fileList_3D = NULL; + myGH->stop_on_parse_errors = strict_io_parameter_check; + if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("I/O Method 'IOASCII_1D' registered: output of 1D lines of grid " + "functions/arrays to ASCII files"); + } + IOASCII_CheckSteerableParameters1D (myGH); + if (maxdim >= 2) + { + if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("I/O Method 'IOASCII_2D' registered: output of 2D planes of " + "grid functions/arrays to ASCII files"); + } + IOASCII_CheckSteerableParameters2D (myGH); + } + if (maxdim >= 3) + { + if (! CCTK_Equals (verbose, "none")) + { + CCTK_INFO ("I/O Method 'IOASCII_3D' registered: output of 3D grid " + "functions/arrays to ASCII files"); + } + IOASCII_CheckSteerableParameters3D (myGH); + } + myGH->stop_on_parse_errors = 0; + /* make sure all output directories exist */ - CREATE_OUTDIR ("IOASCII_1D", out1D_dir); - CREATE_OUTDIR ("IOASCII_2D", out2D_dir); - CREATE_OUTDIR ("IOASCII_3D", out3D_dir); + CREATE_OUTDIR (1, out1D_dir); + CREATE_OUTDIR (2, out2D_dir); + CREATE_OUTDIR (3, out3D_dir); return (myGH); } |