HDF5 object oriented Fortran Library

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HDF5 object oriented Fortran Library

Ricardo Torres
Hello,

I've been developing a set of functions and an OO library that wraps those functions in modern Fortran. It is at: https://github.com/rjgtorres/oo_hdf.

It already covers a lot of use cases such as reading and writing datasets up to 6 dimensions, reading parts of datasets, extending datasets, defining scales, reading and writing attributes, counting number of attributes, counting number of objects (datasets or groups), verifying if an object is a group or a dataset.

I will keep adding more features as I need them, and in a short time I will change the structure of some functions to start returning error messages.

As the library is open source I'll accept any contributions and will consider your requests.

I will gladly help in using or setting it up.

Best regards,
Ricardo Torres

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|

Re: HDF5 object oriented Fortran Library

Scot Breitenfeld
Hi Ricardo,

I just did a quick glance, and I noticed a few things. 

(1) Have you considered passing the C address of the array arguments instead to your functions? That would simplify your interfaces and remove a lot of code duplication. Also, using the F2003 HDF5 functions instead would also help eliminate extra code.  You might want to check your code with -i8 -r8 (or equiv.). 

(2) I would suggest using the size_t, hid_t, etc… definitions instead; those are guaranteed to be compatible with C. 

Looks like a good start.

Scot


On May 31, 2017, at 6:34 AM, Ricardo Torres <[hidden email]> wrote:

Hello,

I've been developing a set of functions and an OO library that wraps those functions in modern Fortran. It is at: https://github.com/rjgtorres/oo_hdf.

It already covers a lot of use cases such as reading and writing datasets up to 6 dimensions, reading parts of datasets, extending datasets, defining scales, reading and writing attributes, counting number of attributes, counting number of objects (datasets or groups), verifying if an object is a group or a dataset.

I will keep adding more features as I need them, and in a short time I will change the structure of some functions to start returning error messages.

As the library is open source I'll accept any contributions and will consider your requests.

I will gladly help in using or setting it up.

Best regards,
Ricardo Torres
_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5


_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
Reply | Threaded
Open this post in threaded view
|

Re: HDF5 object oriented Fortran Library

Ricardo Torres
In reply to this post by Ricardo Torres
Hello Scot,

I didn't look at any C integration features yet, I'm not a C programmer... But if you could show, or direct me, to an example i can implement it.

Some of the functions that i have were developed some time ago for work projects, some by me, others from my colleagues and some from other open source projects. When i'm doing new functions I try to use the best hdf functions, non deprecated at least, and F2003 if they exist. One problem is that the fortran documentation is really not great! I've found routines that are not the same as of the C (see H5Lget_name_by_idx), routines with missing input arguments and others were there are fortran interfaces and in the site says they don't exist (sorry for the lack of examples but I don't remember them).

I will change the kinds to the hdf5 for congruency.

Thank you for your suggestions.

Best regards,
Ricardo

_______________________________________________
Hdf-forum is for HDF software users discussion.
[hidden email]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5