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)?

Thank you.

Ekin

On 03/21/2012 12:36 AM, [email protected] 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
Email: [email protected] <mailto:[email protected]>
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
Email: [email protected] <mailto:[email protected]>
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
Email: [email protected] <mailto:[email protected]>
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

Reply via email to