aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5/src/Output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetIOHDF5/src/Output.cc')
-rw-r--r--Carpet/CarpetIOHDF5/src/Output.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Output.cc b/Carpet/CarpetIOHDF5/src/Output.cc
index 3c44d87ac..1b5bf8eec 100644
--- a/Carpet/CarpetIOHDF5/src/Output.cc
+++ b/Carpet/CarpetIOHDF5/src/Output.cc
@@ -809,7 +809,17 @@ static int AddAttributes (const cGH *const cctkGH, const char *fullname,
HDF5_ERROR (H5Aclose (attr));
}
- ivect iorigin = bbox.lower() / bbox.stride();
+ ivect const ioffsetdenom = bbox.stride();
+ HDF5_ERROR (attr = H5Acreate (dataset, "ioffsetdenom", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT));
+ HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, &ioffsetdenom[0]));
+ HDF5_ERROR (H5Aclose (attr));
+ ivect const ioffset = ((bbox.lower() % bbox.stride()) + bbox.stride()) % bbox.stride();
+ HDF5_ERROR (attr = H5Acreate (dataset, "ioffset", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT));
+ HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, &ioffset[0]));
+ HDF5_ERROR (H5Aclose (attr));
+ ivect const iorigin = (bbox.lower() - ioffset) / bbox.stride();
HDF5_ERROR (attr = H5Acreate (dataset, "iorigin", H5T_NATIVE_INT,
dataspace, H5P_DEFAULT));
HDF5_ERROR (H5Awrite (attr, H5T_NATIVE_INT, &iorigin[0]));