diff options
Diffstat (limited to 'src/OutputInfo.c')
-rw-r--r-- | src/OutputInfo.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/OutputInfo.c b/src/OutputInfo.c index 5bc12b1..8a813c2 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -196,29 +196,25 @@ int IOBasic_TimeForInfoOutput (const cGH *GH, int vindex) DECLARE_CCTK_PARAMETERS - /* get the GH extensions for IOBasic */ - myGH = (iobasicGH *) CCTK_GHExtension (GH, "IOBasic"); - /* check if steerable parameters changed */ + myGH = (iobasicGH *) CCTK_GHExtension (GH, "IOBasic"); CheckSteerableParameters (myGH); - /* return if no output requested */ - if (myGH->outInfo_every <= 0 || GH->cctk_iteration % myGH->outInfo_every || - myGH->info_reductions[vindex].num_reductions == 0) - { - retval = 0; - } - else + /* check if this variable should be output */ + retval = myGH->outInfo_every > 0 && + GH->cctk_iteration % myGH->outInfo_every && + myGH->info_reductions[vindex].num_reductions > 0; + if (retval) { - /* check if not already output this iteration */ - retval = myGH->outInfo_last[vindex] != GH->cctk_iteration; - if (! retval) + /* check if variable was not already output this iteration */ + if (myGH->outInfo_last[vindex] == GH->cctk_iteration) { fullname = CCTK_FullName (vindex); CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, "Already done Info output for '%s' in current iteration " "(probably via triggers)", fullname); free (fullname); + retval = 0; } } @@ -317,7 +313,7 @@ static void CheckSteerableParameters (iobasicGH *myGH) myGH->outInfo_every = outInfo_every >= 0 ? outInfo_every : out_every; /* report if frequency changed */ - if (myGH->outInfo_every != out_old && ! CCTK_Equals (newverbose, "none")) + if (myGH->outInfo_every != out_old && ! CCTK_Equals (verbose, "none")) { if (myGH->outInfo_every > 0) { @@ -417,7 +413,7 @@ static void PrintHeader (iobasicGH *myGH, int num_vars) num_columns += myGH->info_reductions[vindex].num_reductions; if (myGH->info_reductions[vindex].num_reductions > 0 && - ! CCTK_Equals (newverbose, "none")) + ! CCTK_Equals (verbose, "none")) { fullname = CCTK_FullName (vindex); if (! msg) |