Fortran API for HDF5

Hello everyone,

My name is Vikas Sharma. I use Modern Fortran to develop frameworks for finite element methods. Recently, I have decided to use HDF5 technology for IO in my FEM framework. After some online search, I found following two popular fortran APIs for HDF5.

It would be a great help for all of us if people can share their experiences (both positives and negatives) about working with these APIs.

Thanking you in advance!

2 Likes

I am also interested in trying HDF5 for saving data (which seems pretty commonly used in various programs). E.g., it is also used in some MD tools:
http://mdtraj.org/1.9.3/hdf5_format.html

I am wondering if this format is mainly used in the field of computational fluid dynamics…?

Hi. While I have no experience with these frameworks. However, by just looking at their repos one can deduce:

  • H5Fortran needs F2008. OO_HDF 2003.
  • H5Fortran is maintained
  • OO_HDF indicates in the README that it is compatible with HDF 1.8 series. While H5Fortra indicates it is compatible with 1.8, 1.10, 1.12

While I have no experience with any of them, here is what I can tell you from the above. If you have to use a F2003 compiler, then OO_HDF. Otherwise H5Fortran.

Regards,

Fer

1 Like

Hi @septc, I don’t think we can use HDF5 for any application where we need to perform I/O. May I know which file format do you use for I/O for your application?

@Irvise Thank you for your response. I want to add that I am using H5Fortran for couple of months. It integrates very well with my source code. The structure of the code is simple and intuitive, therefore, one can easily modify it according to one’s need. May I know which file format do you use for I/O in your application?

Regards
Vikas

Hi, the I/O I choose depends on the project’s needs. HDF is very nice in general for scientific applications, but in Fortran there is also JSON, XML and TOML among others.

I tend to favour human readable formats if there is not a lot of information or if a human is supposed to modify the file (either directly or indirectly).

Regards,
Fer

@Irvise Recently, my friend had also suggested me about JSON for pre and post processing IO applications. Do we have a fortran library to parse JSON? If so can I ask you to send me the link.

Regards
Vikas

Not @Irvise, but perhaps I can reply instead.

There a great library for this purpose:

I can also recommend this tutorial:

I have a Fortran library for utilizing JSON that I’ve had great success in using.

Let me know if you have any questions about it.

@ivanpribec Thank you very much. I will look into this lib.

Regards
Vikas

@everythingfunctional Thank you very much I will have a look at your lib.

Regards
Vikas