Attached are a script for writing a compound data type in HDF5
format and its "h5dump" output named "cc_res.txt". As you might see in
the output file, the second group of variables are written erroneously
if H5T_NATIVE_DOUBLE is used for real(8) type variable named
"wdata%b". However, if I convert the data type to real(4) and use
H5T_NATIVE_REAL instead, it is written correctly to the output file .
I could not figure out the problem. I would be glad to hear if you
have an idea on this. Thank you in advance.
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 suggestions. The script now works perfectly. However, I have one more question with respect to the usage of H5OFFSETOF. How should I use it to determine the size of the compound type if the compound type "wdata" has more than two dims, i.e. wdata(7)?
Ok, I have found out that H5OFFSETOF works for all size of dims by only specifying the "c_loc" for the first 2 dims. So please disregard my previous question. But the problem is now that I have an extended version of the script (please see the attached file) that writes data to an HDF file, which is formatted in a similar logic like the small script I have sent before. However, it gives error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past end of compound type
major: Datatype
minor: Unable to insert object
on line 113 when it is time for the call to"H5Tinsert_f(s_tid, "Wage", offset, s10_tid, hdferr)". I could not figure out where I have mistaken. I would be glad if you could help me on this. The data I want to write is attached as an MS Excel file. In the first two columns, I named the fields for your reference. Those are not going to be written to the HDF file.
Thank you for your suggestions. The script now works perfectly. However, I have one more question with respect to the usage of H5OFFSETOF. How should I use it to determine the size of the compound type if the compound type "wdata" has more than two dims, i.e. wdata(7)?
Thank you.
Ekin
On 03/21/2012 12:36 AM, brtnfld@hdfgroup.org wrote:
Ok, I have found out that H5OFFSETOF works for all size of dims by
only specifying the "c_loc" for the first 2 dims. So please disregard
my previous question. But the problem is now that I have an extended
version of the script (please see the attached file) that writes data
to an HDF file, which is formatted in a similar logic like the small
script I have sent before. However, it gives error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past
end of compound type
major: Datatype
minor: Unable to insert object
on line 113 when it is time for the call to"H5Tinsert_f(s_tid,
"Wage", offset, s10_tid, hdferr)". I could not figure out where I have
mistaken. I would be glad if you could help me on this. The data I
want to write is attached as an MS Excel file. In the first two
columns, I named the fields for your reference. Those are not going to
be written to the HDF file.
Thank you in advance.
Regards,
Ekin
On 03/21/2012 09:57 AM, Ekin Akoglu wrote:
Dear brtnfld,
Thank you for your suggestions. The script now works perfectly.
However, I have one more question with respect to the usage of
H5OFFSETOF. How should I use it to determine the size of the
compound type if the compound type "wdata" has more than two dims,
i.e. wdata(7)?
I overcame my problem by using "H5OFFSETOF(c_loc(ms_data(1)),c_loc(ms_data(1)%biomass))" instead of using calculated "offset" values while inserting fields. Not the code correctly writes the scalar variables but not arrays of the user-derived FORTRAN type. Arrays cannot be inserted with error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past end of compound type
major: Datatype
minor: Unable to insert object
I declared the data type of my variable "ms_data" in a module file and in my h5write script I use that module with a "use" statement. Apparently, my h5write script cannot see the fields that are arrays but only scalars of derived type "ms_data". How can I overcome this problem?
Thanks,
Ekin
···
On 03/21/2012 01:22 PM, Ekin Akoglu wrote:
Dear brtnfld,
Ok, I have found out that H5OFFSETOF works for all size of dims by only specifying the "c_loc" for the first 2 dims. So please disregard my previous question. But the problem is now that I have an extended version of the script (please see the attached file) that writes data to an HDF file, which is formatted in a similar logic like the small script I have sent before. However, it gives error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past end of compound type
major: Datatype
minor: Unable to insert object
on line 113 when it is time for the call to"H5Tinsert_f(s_tid, "Wage", offset, s10_tid, hdferr)". I could not figure out where I have mistaken. I would be glad if you could help me on this. The data I want to write is attached as an MS Excel file. In the first two columns, I named the fields for your reference. Those are not going to be written to the HDF file.
Thank you in advance.
Regards,
Ekin
On 03/21/2012 09:57 AM, Ekin Akoglu wrote:
Dear brtnfld,
Thank you for your suggestions. The script now works perfectly. However, I have one more question with respect to the usage of H5OFFSETOF. How should I use it to determine the size of the compound type if the compound type "wdata" has more than two dims, i.e. wdata(7)?
Sorry for I have mistaken. Second sentence in my previous e-mail should read:
BUT the code correctly writes the scalar variables but not arrays of the user-derived FORTRAN type.
instead of:
NOT the code correctly writes the scalar variables but not arrays of the user-derived FORTRAN type.
Thanks,
Ekin
···
On 03/21/2012 03:41 PM, Ekin Akoglu wrote:
Dear all,
I overcame my problem by using "H5OFFSETOF(c_loc(ms_data(1)),c_loc(ms_data(1)%biomass))" instead of using calculated "offset" values while inserting fields. Not the code correctly writes the scalar variables but not arrays of the user-derived FORTRAN type. Arrays cannot be inserted with error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past end of compound type
major: Datatype
minor: Unable to insert object
I declared the data type of my variable "ms_data" in a module file and in my h5write script I use that module with a "use" statement. Apparently, my h5write script cannot see the fields that are arrays but only scalars of derived type "ms_data". How can I overcome this problem?
Thanks,
Ekin
On 03/21/2012 01:22 PM, Ekin Akoglu wrote:
Dear brtnfld,
Ok, I have found out that H5OFFSETOF works for all size of dims by only specifying the "c_loc" for the first 2 dims. So please disregard my previous question. But the problem is now that I have an extended version of the script (please see the attached file) that writes data to an HDF file, which is formatted in a similar logic like the small script I have sent before. However, it gives error:
HDF5-DIAG: Error detected in HDF5 (1.8.8) thread 0: #000: H5Tcompound.c line 374 in H5Tinsert(): unable to insert member
major: Datatype
minor: Unable to insert object #001: H5Tcompound.c line 466 in H5T_insert(): member extends past end of compound type
major: Datatype
minor: Unable to insert object
on line 113 when it is time for the call to"H5Tinsert_f(s_tid, "Wage", offset, s10_tid, hdferr)". I could not figure out where I have mistaken. I would be glad if you could help me on this. The data I want to write is attached as an MS Excel file. In the first two columns, I named the fields for your reference. Those are not going to be written to the HDF file.
Thank you in advance.
Regards,
Ekin
On 03/21/2012 09:57 AM, Ekin Akoglu wrote:
Dear brtnfld,
Thank you for your suggestions. The script now works perfectly. However, I have one more question with respect to the usage of H5OFFSETOF. How should I use it to determine the size of the compound type if the compound type "wdata" has more than two dims, i.e. wdata(7)?