diff options
Diffstat (limited to 'src/Output.c')
-rw-r--r-- | src/Output.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/src/Output.c b/src/Output.c index 15450c1..576b34f 100644 --- a/src/Output.c +++ b/src/Output.c @@ -17,8 +17,8 @@ #include "ioStreamedHDF5GH.h" /* the rcs ID and its dummy function to use it */ -static const char *rcsid = "$Id$"; -CCTK_FILEVERSION(BetaThorns_IOStreamedHDF5_Output_c) +static const char *rcsid = "$Header$"; +CCTK_FILEVERSION(CactusPUGHIO_IOStreamedHDF5_Output_c) /******************************************************************** @@ -36,7 +36,7 @@ static void CheckSteerableParameters (const cGH *GH); @enddesc @calls IOStreamedHDF5_TimeFor - IOStreamedHDF5_OutputVarAs + IOStreamedHDF5_Write @var GH @vdesc Pointer to CCTK GH @@ -53,44 +53,21 @@ static void CheckSteerableParameters (const cGH *GH); int IOStreamedHDF5_OutputGH (const cGH *GH) { int vindex, retval; - ioStreamedHDF5GH *myGH; - const char *name; - char *fullname; - DECLARE_CCTK_PARAMETERS + const ioStreamedHDF5GH *myGH; - myGH = (ioStreamedHDF5GH *) CCTK_GHExtension (GH, "IOStreamedHDF5"); - - CheckSteerableParameters (GH); - - if (myGH->out_every <= 0) - { - return (0); - } + retval = 0; + myGH = (const ioStreamedHDF5GH *) CCTK_GHExtension (GH, "IOStreamedHDF5"); /* loop over all variables */ - for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++) + for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--) { - if (IOStreamedHDF5_TimeFor (GH, vindex)) + if (IOStreamedHDF5_TimeFor (GH, vindex) && + IOStreamedHDF5_Write (GH, vindex, CCTK_VarName (vindex)) == 0) { - name = CCTK_VarName (vindex); - fullname = CCTK_FullName (vindex); - - if (verbose) - { - CCTK_VInfo (CCTK_THORNSTRING, "IOStreamedHDF5_OutputGH: " - "output of variable (fullname, name) = " - "('%s', '%s')", fullname, name); - } - - if (IOStreamedHDF5_OutputVarAs (GH, fullname, name) == 0) - { - /* register variable as having output this iteration */ - myGH->out_last[vindex] = GH->cctk_iteration; - retval++; - } - - free (fullname); + /* register variable as having output this iteration */ + myGH->out_last[vindex] = GH->cctk_iteration; + retval++; } } @@ -140,7 +117,7 @@ int IOStreamedHDF5_OutputVarAs (const cGH *GH, const char *fullname, vindex = CCTK_VarIndex (fullname); - if (verbose) + if (CCTK_Equals (verbose, "full")) { CCTK_VInfo (CCTK_THORNSTRING, "IOStreamedHDF5_OutputVarAs: " "output of variable (fullname, alias) = " @@ -253,7 +230,7 @@ int IOStreamedHDF5_TriggerOutput (const cGH *GH, int vindex) myGH = (ioStreamedHDF5GH *) CCTK_GHExtension (GH, "IOStreamedHDF5"); - if (verbose) + if (CCTK_Equals (verbose, "full")) { fullname = CCTK_FullName (vindex); CCTK_VInfo (CCTK_THORNSTRING, "IOStreamedHDF5_TriggerOutput: " |