aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DumpUtils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/DumpUtils.c b/src/DumpUtils.c
index 4023dd2..182f063 100644
--- a/src/DumpUtils.c
+++ b/src/DumpUtils.c
@@ -128,9 +128,10 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file)
request->vindex < first_vindex + gdata.numvars;
request->vindex++)
{
- /* loop over all timelevels of this variable */
+ /* loop over all allocated timelevels of this variable */
for (request->timelevel = 0;
- request->timelevel < gdata.numtimelevels;
+ request->timelevel < gdata.numtimelevels &&
+ GH->data[request->vindex][request->timelevel];
request->timelevel++)
{
if (CCTK_Equals (verbose, "full") && file >= 0)