From 865c6119880db372582f9919220d3f017c555697 Mon Sep 17 00:00:00 2001 From: tradke Date: Sun, 22 Apr 2001 16:00:42 +0000 Subject: Checkpoint the current timelevel and all others except the eldest (in case there's more than just one). git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@28 7842ec3a-9562-4be5-9c5b-06ba18f2b668 --- src/DumpUtils.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/DumpUtils.c') diff --git a/src/DumpUtils.c b/src/DumpUtils.c index 8c1a052..947f17a 100644 --- a/src/DumpUtils.c +++ b/src/DumpUtils.c @@ -156,19 +156,16 @@ int IOHDF5Util_DumpGH (cGH *GH, CCTK_VInfo (CCTK_THORNSTRING, " %s", CCTK_VarName (vindex)); } - /* get the current timelevel */ - current_timelevel = CCTK_NumTimeLevelsFromVarI (vindex) - 1; - if (current_timelevel > 0) - { - current_timelevel--; - } - request.sdim = request.vdim = CCTK_GroupDimFromVarI (vindex); - /* now dump all timelevels up to the current */ - for (timelevel = 0; timelevel <= current_timelevel; timelevel++) + /* get timelevels to dump away */ + current_timelevel = CCTK_NumTimeLevelsFromVarI (vindex) - 1; + timelevel = current_timelevel > 0 ? 1 : 0; + + /* now dump away all timelevels */ + while (timelevel <= current_timelevel) { - IOHDF5Util_DumpVar (GH, vindex, timelevel, &request, file, 0); + IOHDF5Util_DumpVar (GH, vindex, timelevel++, &request, file, 0); } } /* end of loop over all variables */ -- cgit v1.2.3