Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provides a Fortran wrapper for HDF5

License

NotificationsYou must be signed in to change notification settings

cbusta/hdf5-wrapper

Repository files navigation

By: Christian Bustamante
https://cbustamante.co/
GitHub all releasesGitHubGitHub last commit
GitHub forksGitHub Repo stars
follow on Twitter

Table of Contents

  1. About the package
  2. Requirements
  3. Package contents
  4. Usage
  5. License

About

This package provides a Fortran wrapper for HDF5 (.h5 files).It provides a simpler interface that allows easy writing and reading of h5 files for double precision and integer arrays of up to six dimensions.On top of the Fortran wrapper, the package provides a Matlab function that simplifies the process of reading entire h5 files.As opposed to having to read variable by variables, this function reads all variables and put them in a Matlab structure.

Requirements

Using this package requires a Fortran compiler and the HDF5 library.

  • Fortran compiler: tested and built withifort version 19.0.5.281 for Linux and Windows. It has also been tested ingfortran.
  • HDF5 libraries: tested and built using HDF5 1.10.5, but it has also been used with other library versions.

Contents

The following source files are provided with the package:

  • Lib_Rwhdf5.f90: Fortran wrapper that defines interfaces for reading and writing h5 files.
  • Lib_Kind.f90: declares double precision and integer types.
  • exampleh5.f90: example that illustrates the usage of the package. It writes two arrays intodata.h5.
  • Makefile: used to buildexampleh5.f90. It depends ontree.dep that specifies the compilation order.
  • Read_HDF5.m: Matlab function that reads and h5 file.
  • example_readh5.m: example that illustrates how to use the functionRead_HDF5.m to readdata.h5.

Usage

After having the HDF5 library installed, load the two provided Fortran modules into your program.

use lib_kinduse lib_rwhdf5implicit none

The Fortran wrapper provides four major subroutines and one integer type:

  • Subroutineshdf5_openf andhdf5_closef are used to open and close an h5 file. These are only needed when writing into an h5 file (not when reading).
  • Subroutineshdf5_read andhdf5_write are used to read and write data into an h5 file. The write subroutine should be used after an h5 file has been created withhdf5_openf. The file should be closed after all variables have been written to it.
  • Integer typehid_t: needed to "label" an h5 file when opened.

Finally, note that theMakefile specifies theHDF5_PATH variable that needs to be adjusted depending on where theinclude andlib folders of the HDF5 library have been installed.

License

MIT license.

About

Provides a Fortran wrapper for HDF5

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp