[cig-commits] r4585 - mc/3D/CitcomS/trunk/lib

luis at geodynamics.org luis at geodynamics.org
Thu Sep 21 14:25:45 PDT 2006


Author: luis
Date: 2006-09-21 14:25:44 -0700 (Thu, 21 Sep 2006)
New Revision: 4585

Modified:
   mc/3D/CitcomS/trunk/lib/Output_h5.c
Log:
Allow for optional fields when extending datasets.


Modified: mc/3D/CitcomS/trunk/lib/Output_h5.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-09-21 21:17:46 UTC (rev 4584)
+++ mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-09-21 21:25:44 UTC (rev 4585)
@@ -382,13 +382,20 @@
     status = H5Fclose(E->hdf5.file_id);
 
     /* close fields (deallocate buffers) */
+
     h5close_field(&(E->hdf5.const_vector3d));
     h5close_field(&(E->hdf5.const_vector2d));
+    h5close_field(&(E->hdf5.const_scalar1d));
+
+    if (E->hdf5.tensor3d != NULL)
+        h5close_field(&(E->hdf5.tensor3d));
+
     h5close_field(&(E->hdf5.vector3d));
     h5close_field(&(E->hdf5.vector2d));
     h5close_field(&(E->hdf5.scalar3d));
     h5close_field(&(E->hdf5.scalar2d));
     h5close_field(&(E->hdf5.scalar1d));
+
 #endif
 }
 
@@ -1098,6 +1105,10 @@
 
     for(i = 0; i < 6; i++)
     {
+        /* check for optional fields */
+        if (field[i] == NULL)
+            continue;
+
         /* increase extent of time dimension in file dataspace */
         field[i]->dims[0] += 1;
         field[i]->maxdims[0] += 1;



More information about the cig-commits mailing list