# Fortran API for HDF5

**URL:** <https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149>\
**Category:** Help\
**Created:** [June 27, 2020, 5:15am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149 "2020-06-27T05:15:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vickysharma0812](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vickysharma0812](https://fortran-lang.discourse.group/u/vickysharma0812)\
**Post date:** [June 27, 2020, 5:15am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/1 "2020-06-27T05:15:14Z")

</div>

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.

- [H5Fortran](https://github.com/geospace-code/h5fortran)
- [OO\_HDF](https://github.com/rjgtorres/oo_hdf/)

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!

---

<div class="post-metadata">

**Author:** ![septc](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/septc/32/77_2.png) [@septc](https://fortran-lang.discourse.group/u/septc)\
**Post date:** [August 14, 2020, 10:38am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/2 "2020-08-14T10:38:19Z")

</div>

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](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…?

---

<div class="post-metadata">

**Author:** ![Irvise](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Irvise](https://fortran-lang.discourse.group/u/Irvise)\
**Post date:** [September 10, 2020, 7:40pm UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/3 "2020-09-10T19:40:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vickysharma0812](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vickysharma0812](https://fortran-lang.discourse.group/u/vickysharma0812)\
**Post date:** [September 23, 2020, 6:00am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/4 "2020-09-23T06:00:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Irvise](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Irvise](https://fortran-lang.discourse.group/u/Irvise)\
**Post date:** [September 24, 2020, 10:30pm UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/5 "2020-09-24T22:30:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vickysharma0812](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vickysharma0812](https://fortran-lang.discourse.group/u/vickysharma0812)\
**Post date:** [October 31, 2020, 4:22am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/6 "2020-10-31T04:22:35Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [October 31, 2020, 10:42am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/7 "2020-10-31T10:42:32Z")

</div>

Not @Irvise, but perhaps I can reply instead.

There a great library for this purpose:

- [https://github.com/jacobwilliams/json-fortran](https://github.com/jacobwilliams/json-fortran)

I can also recommend this tutorial:

- [https://cyber.dabamos.de/programming/modernfortran/json.html](https://cyber.dabamos.de/programming/modernfortran/json.html)

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [November 3, 2020, 1:26pm UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/8 "2020-11-03T13:26:23Z")

</div>

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

> **[Brad Richardson / Json For Fortran](https://gitlab.com/everythingfunctional/jsonff)**
>
> Json For Fortran

Let me know if you have any questions about it.

---

<div class="post-metadata">

**Author:** ![vickysharma0812](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vickysharma0812](https://fortran-lang.discourse.group/u/vickysharma0812)\
**Post date:** [November 4, 2020, 7:03am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/9 "2020-11-04T07:03:44Z")

</div>

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

Regards  
Vikas

---

<div class="post-metadata">

**Author:** ![vickysharma0812](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vickysharma0812](https://fortran-lang.discourse.group/u/vickysharma0812)\
**Post date:** [November 4, 2020, 7:04am UTC](https://fortran-lang.discourse.group/t/fortran-api-for-hdf5/149/10 "2020-11-04T07:04:14Z")

</div>

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

Regards  
Vikas
