Try using H5OFFSETOF for the offset in H5Tinsert_f instead of calculating it yourself.

offset = H5OFFSETOF(C_LOC(ms_data(1)),C_LOC(ms_data(1)%biomass))
call H5Tinsert_f(s_tid, "biomass", offset, s1_tid, hdferr)

etc..


On 2012-03-21 07:22, 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)?

Thank you.

Ekin

On 03/21/2012 12:36 AM, [email protected] [1] wrote:

sz = H5OFFSETOF(C_LOC(wdata(1)%a(1)), C_LOC(wdata(2)%a(1)))

--
EKIN AKOGLU

Research Assistant

Institute of Marine Sciences
Middle East Technical University
P.O. Box 28, 33731
Erdemli, Mersin
Turkey

Web: www.ims.metu.edu.tr [2]
Email: [email protected] [3]
Phone: +90 324 521 34 34
GSM: +90 506 554 03 90
Fax: +90 324 521 23 27

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
 EKIN AKOGLU

 Research Assistant

 Institute of Marine Sciences
 Middle East Technical University
 P.O. Box 28, 33731
 Erdemli, Mersin
 Turkey

 Web: www.ims.metu.edu.tr [4]
 Email: [email protected] [5]
 Phone: +90 324 521 34 34
 GSM: +90 506 554 03 90
 Fax: +90 324 521 23 27

Links:
------
[1] mailto:[email protected]
[2] http://webmail.hdfgroup.org/www.ims.metu.edu.tr
[3] mailto:[email protected]
[4] http://webmail.hdfgroup.org/www.ims.metu.edu.tr
[5] mailto:[email protected]


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to