rounding off/promoting data types when write/read hdf5 files in FORTRAN


#1

Hello,

I have a FORTRAN90 application with MPI which reads and writes collectively using HDF5. I need to ramp up the floating point arithmetic precision for a certain case from double precision to quad-precision real type, but apparently this is not among standard data types supported by HDF5.

When I keep the standard H5T_NATIVE_DOUBLE type, I get zeros written as output. How can I read and write the quad precision type?

I am using HDF5 1.12.0 which is configured with GCC 9.3 and OpenMPI 4.0.4

Thank you,
Hadi.


#2

Sorry I donā€™t have a simple example, but take a look in the HDF5 source, fortran/test/tH5T_F03.F90

where we test quad-precision. You would use the h5kind_to_type function; it should be reasonably straight forward to follow.

Scot