diff options
Diffstat (limited to 'src/Output.c')
-rw-r--r-- | src/Output.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/src/Output.c b/src/Output.c index 9f91ae0..02ef16e 100644 --- a/src/Output.c +++ b/src/Output.c @@ -68,7 +68,7 @@ int IOHDF5_OutputGH (const cGH *GH) return (0); } - /* Loop over all variables */ + /* loop over all variables */ for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++) { @@ -153,7 +153,7 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) IOHDF5Util_ParseVarsForOutput (fullname, myGH->out_geo); } - /* Do the output */ + /* do the output */ retval = IOHDF5_Write (GH, vindex, alias); if (oneshot && myGH->out_geo[vindex]) @@ -171,7 +171,7 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) @author Gabrielle Allen @desc Decides if it is time to output a variable - using the IOHDF5 output method. + using the IOHDF5 I/O method. @enddesc @calls CheckSteerableParameters @@ -195,38 +195,34 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) @@*/ int IOHDF5_TimeFor (const cGH *GH, int vindex) { + int retval; ioHDF5GH *myGH; char *fullname; - /* Get the GH extension for IOHDF5 */ + /* get the GH extension for IOHDF5 */ myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5"); CheckSteerableParameters (myGH); - /* Check if any output was requested */ - if(myGH->out_every <= 0) - { - return (0); - } - - /* Check this variable should be output */ - if (! (myGH->out_geo[vindex] && GH->cctk_iteration % myGH->out_every == 0)) - { - return (0); - } - - /* Check variable not already output this iteration */ - if (myGH->out_last[vindex] == GH->cctk_iteration) + /* check if this variable should be output */ + retval = myGH->out_every > 0 && myGH->out_geo[vindex] && + GH->cctk_iteration % myGH->out_every == 0; + if (retval) { - fullname = CCTK_FullName (vindex); - CCTK_VWarn (6, __LINE__, __FILE__, CCTK_THORNSTRING, - "Already done IOHDF5 output for variable '%s'", fullname); - free (fullname); - return (0); + /* check if variable was not already output this iteration */ + if (myGH->out_last[vindex] == GH->cctk_iteration) + { + fullname = CCTK_FullName (vindex); + CCTK_VWarn (6, __LINE__, __FILE__, CCTK_THORNSTRING, + "Already done IOHDF5 output for variable '%s' in current " + "iteration (probably via triggers)", fullname); + free (fullname); + retval = 0; + } } - return (1); + return (retval); } @@ -235,7 +231,7 @@ int IOHDF5_TimeFor (const cGH *GH, int vindex) @date Sat March 6 1999 @author Gabrielle Allen @desc - Triggers the output of a variable using the IOHDF5 output. + Triggers the output of a variable using the IOHDF5 I/O method. @enddesc @calls IOHDF5_Write @@ -278,12 +274,12 @@ int IOHDF5_TriggerOutput (const cGH *GH, int vindex) free (fullname); } - /* Do the output */ + /* do the output */ retval = IOHDF5_Write (GH, vindex, varname); if (retval == 0) { - /* Register variable as having output this iteration */ + /* register variable as having output this iteration */ myGH->out_last[vindex] = GH->cctk_iteration; } |