I cannot read compound data from HDF file. I created the data and wrote it to a HDF file with a FORTRAN subroutine and now trying to read it within another FORTRAN program. Attached are my script, HDF file and its h5dump output. My script halts with an error like:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tarray.c line 142 in H5Tarray_create2(): not an valid base datatype
major: Invalid arguments to routine
minor: Inappropriate type
....
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5S.c line 365 in H5Sclose(): not a dataspace
major: Invalid arguments to routine
minor: Inappropriate type
I would be glad if you can help me on the issue. Thank you all for your concerns.
I cannot read compound data from HDF file. I created the data and
wrote it to a HDF file with a FORTRAN subroutine and now trying to
read it within another FORTRAN program. Attached are my script, HDF
file and its h5dump output. My script halts with an error like:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tarray.c line 142 in H5Tarray_create2(): not an valid base
datatype
major: Invalid arguments to routine
minor: Inappropriate type
....
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5S.c line 365 in H5Sclose(): not a dataspace
major: Invalid arguments to routine
minor: Inappropriate type
I would be glad if you can help me on the issue. Thank you all for
your concerns.
Best regards,
--
EKIN AKOGLU
Research Assistant
Institute of Marine Sciences
Middle East Technical University
P.O. Box 28, 33731
Erdemli, Mersin
Turkey
Thank you for your help. Now it works. In the meantime, I managed to read the data with the attached script without initializing the FORTRAN interface and without defining the compound data type. This seems a shorter approach but I wonder whether this approach might lead to some erroneous results or not while reading data. Is the other one preferable over this one?
Thank you for your help. Now it works. In the meantime, I managed to read the data with the attached script without initializing the FORTRAN interface and without defining the compound data type.
Your program still has h5open_f call (the call is required!
This seems a shorter approach but I wonder whether this approach might lead to some erroneous results or not while reading data. Is the other one preferable over this one?
The program works because you are reading data on the same machine it was written. In general, HDF5 file datatype (returned by h5dget_type_f) cannot be used to describe memory buffer (memory datatype) in the h5dread_f call; this is not portable and may not work if the program runs on another system.
The original program is correct (except the missing h5open_f call) and portable.
Elena
···
On Mar 26, 2012, at 2:48 PM, Ekin Akoglu wrote:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Regards,
Ekin
On 03/26/2012 06:09 PM, brtnfld@hdfgroup.org wrote:
Thank you for your explanation on the issue. It has crucial importance for me to opt for portable code. I have one more question. Is it possible to specify the exact number of digits to be stored in an HDF5 file after the decimal point?
Thank you in advance.
Best regards,
Ekin
···
On 03/29/2012 01:00 AM, Elena Pourmal wrote:
Ekin,
On Mar 26, 2012, at 2:48 PM, Ekin Akoglu wrote:
Thank you for your help. Now it works. In the meantime, I managed to read the data with the attached script without initializing the FORTRAN interface and without defining the compound data type.
Your program still has h5open_f call (the call is required!
This seems a shorter approach but I wonder whether this approach might lead to some erroneous results or not while reading data. Is the other one preferable over this one?
The program works because you are reading data on the same machine it was written. In general, HDF5 file datatype (returned by h5dget_type_f) cannot be used to describe memory buffer (memory datatype) in the h5dread_f call; this is not portable and may not work if the program runs on another system.
The original program is correct (except the missing h5open_f call) and portable.
Elena
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Regards,
Ekin
On 03/26/2012 06:09 PM, brtnfld@hdfgroup.org >> <mailto:brtnfld@hdfgroup.org> wrote: