bridgeW / hdf5_interface

high level fortran interface for HDF5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Build status

Object-oriented Fortran 2018 HDF5 interface

Very simple single-file/module access to HDF5. More advanced object-oriented Fortran HDF5 access also available, but not compatible with HDF5 1.10 like this program.

Read/write integer / real32/64:

  • scalar
  • 1-D
  • 2-D
  • 3-D

via polymorphism.

Tested on systems including Mac OS X (via homebrew), Ubuntu 16.04/18.04 (gfortran ≥ 5.4.1) with HDF5 1.8 and 1.10 and Windows Subsystem for Linux.

Build

Requirements:

and then:

cd app
cmake ../src
make

make test

Usage

Here are a few examples. All of them assume:

use hdf5_interface, only: hdf5_file
type(hdf5_file) :: h5f

Create new HDF5 file, with variable "value1"

call h5f%initialize('test.h5',status='new',action='w')

call h5f%add('/value1', 123.)

call h5f%finalize()

Add variable "value1" to existing HDF5 file "test.h5"

call h5f%initialize('test.h5',status='old',action='rw')

call h5f%add('/value1', 123.)

call h5f%finalize()

About

high level fortran interface for HDF5


Languages

Language:Fortran 90.0%Language:CMake 9.9%Language:Shell 0.1%