diff options
author | reisswig <schnetter@cct.lsu.edu> | 2008-01-31 15:18:00 +0000 |
---|---|---|
committer | reisswig <schnetter@cct.lsu.edu> | 2008-01-31 15:18:00 +0000 |
commit | a511a0413ed7a5e8c409e3fcb08d32ae378b51c3 (patch) | |
tree | e6943e276f7ad81a9f90cac782594940207b435b /Carpet/CarpetIOHDF5/src/Output.cc | |
parent | a912c1e35abf498fe89af20f4dc68e9c49cbbc8a (diff) |
Bugfix to MapIsCartesian-Attribute
Without this bugfix, whenever there is an aliased function "Multipatch_MapIsCartesian" function,
the corresponding write call of this attribute fails because the attribute's scalar dataspace was already closed.
darcs-hash:20080131151816-79e7e-3678879958c776fc1240e8b93f054732c64b62c5.gz
Diffstat (limited to 'Carpet/CarpetIOHDF5/src/Output.cc')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Output.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc index c9b6aa346..c534e3cf1 100644 --- a/Carpet/CarpetIOHDF5/src/Output.cc +++ b/Carpet/CarpetIOHDF5/src/Output.cc @@ -628,6 +628,16 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname, HDF5_ERROR (H5Awrite (attr, datatype, fullname)); HDF5_ERROR (H5Aclose (attr)); HDF5_ERROR (H5Tclose (datatype)); + + // Specify whether the coordinate system is Cartesian or not + if (CCTK_IsFunctionAliased ("MultiPatch_MapIsCartesian")) { + int const map_is_cartesian = MultiPatch_MapIsCartesian (Carpet::map); + HDF5_ERROR (attr = H5Acreate (dataset, "MapIsCartesian", H5T_NATIVE_INT, + dataspace, H5P_DEFAULT)); + HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, & map_is_cartesian)); + HDF5_ERROR (H5Aclose (attr)); + } + HDF5_ERROR (H5Sclose (dataspace)); // store cctk_bbox and cctk_nghostzones (for grid arrays only) @@ -664,14 +674,7 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname, free (groupname); } - // Specify whether the coordinate system is Cartesian or not - if (CCTK_IsFunctionAliased ("MultiPatch_MapIsCartesian")) { - int const map_is_cartesian = MultiPatch_MapIsCartesian (Carpet::map); - HDF5_ERROR (attr = H5Acreate (dataset, "MapIsCartesian", H5T_NATIVE_INT, - dataspace, H5P_DEFAULT)); - HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, & map_is_cartesian)); - HDF5_ERROR (H5Aclose (attr)); - } + hsize_t size = vdim; HDF5_ERROR (dataspace = H5Screate_simple (1, &size, NULL)); |