diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 1999-10-27 00:01:40 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 1999-10-27 00:01:40 +0000 |
commit | 9fdeb058697419a6934a71d92987efcbb27f2233 (patch) | |
tree | c42741a4a1348649e29cf5c0f224c27504d12658 /src/Write3D.c | |
parent | 8d56ec8a794219d8f2623133ba5afb59c2f4549b (diff) |
Tidying up several things:
- sp2xyz moved from PUGH's into IOFlexIO's GH extension
call SetupSliceCenter() at startup to set up slice center for 2D output
- fixed wrong indexing on ownership[] which caused buggy 2D output
- use ParseVarsForOutput() instead of InitIONum() for parsing the out_vars
parameter
- decide which output dir shall be used by using CCTK_ParameterInfo()
rather than comparing it with its old "outdir" default value
- outdirs are always created now (not only if out_vars was non-empty)
because IO methods might be invoked via CCTK_OutputVarAs() also
- some variables renamed for better readability
- fixed compiler warnings
- hopefully get rid of empty IEEEIO subdir
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@62 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Write3D.c')
-rw-r--r-- | src/Write3D.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Write3D.c b/src/Write3D.c index e99a870..453559c 100644 --- a/src/Write3D.c +++ b/src/Write3D.c @@ -130,17 +130,15 @@ void IOFlexIO_Write3D_closeFile (cGH *GH, IEEEfile_3D_t *IEEEfile_3D); void IOFlexIO_Write3D (cGH *GH, int index, const char *alias) { DECLARE_CCTK_PARAMETERS - int myproc, nprocs; + int myproc; int timelevel; ioGH *ioUtilGH; - flexioGH *myGH; int isNewFile; IEEEfile_3D_t *IEEEfile_3D; /* Get the handle for IOUtil and IOFlexIO extensions */ ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; if (verbose) { printf ("-------------------------------------------------------\n"); @@ -153,7 +151,6 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias) /* What processor are we on? */ myproc = CCTK_MyProc (GH); - nprocs = CCTK_nProcs (GH); /* Get the filename and descriptor for output */ @@ -410,9 +407,9 @@ IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias, int *isNewFile) /* If necessary create the output directory */ if (myproc == 0) { - outputdir = (char *) malloc (strlen (myGH->outpfx_3D) + + outputdir = (char *) malloc (strlen (myGH->outdir3D) + strlen (alias) + 5); - sprintf (outputdir, "%s/%s_3d", myGH->outpfx_3D, alias); + sprintf (outputdir, "%s/%s_3d", myGH->outdir3D, alias); if (CCTK_mkdir (outputdir) != 0) CCTK_WARN (1, "Problem creating 3D output directory"); @@ -436,12 +433,12 @@ IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias, int *isNewFile) IEEEfile_3D = (IEEEfile_3D_t *) malloc (sizeof (IEEEfile_3D_t)); - IEEEfile_3D->filename = (char *) malloc (strlen (myGH->outpfx_3D) + + IEEEfile_3D->filename = (char *) malloc (strlen (myGH->outdir3D) + strlen (extradir) + strlen (alias) + strlen (extra) + 10); - sprintf (IEEEfile_3D->filename, "%s/%s%s_3d%s.ieee", myGH->outpfx_3D, + sprintf (IEEEfile_3D->filename, "%s/%s%s_3d%s.ieee", myGH->outdir3D, extradir, alias, extra); /* no need to store file info if used only once */ |