HDF5 documents and links Introduction to HDF5 |
HDF5 User’s Guide HDF5 Reference Manual |
The HDF5 Fortran Library is available in both Fortran 90 and Fortran 2003 environments. A small number of features are available only in Fortran 2003 environments, but most are available in both.
HDF5 Fortran Library documentation includes the following:
Regarding Fortran environments:
If the Fortran compiler being used is Fortran 2003 compliant
and the installed HDF5 Library was configured using both the
--enable-fortran
and
--enable-fortran2003
flags,
the resulting HDF5 Fortran Library is referred to in these
documents as a Fortran 2003 environment.
Without either of the Fortran 2003 compliant compiler
or the --enable-fortran2003
flag, the resulting
HDF5 Fortran Library provides a Fortran 90 environment.
Regarding the HDF5 Reference Manual: Throughout the reference manual, each Fortran subroutine description is presented alongside the corresponding C function description.
H5*ff.f
.
Corresponding C stubs are in the H5*f.c
files.
For example, the Fortran File APIs are in the file H5Fff.f
and the corresponding C stubs are in the file H5Ff.c
.
Each module contains Fortran definitions of the constants, interfaces to the subroutines if needed, and the subroutines themselves.
Users must use constant names in their programs instead of the numerical values, as the numerical values are subject to change without notice.
"_f"
to the name. For example, the name of
the C function to create an HDF5 file is H5Fcreate
;
the corresponding Fortran subroutine is h5fcreate_f
.
For example, the C function to create a dataset has the following prototype:
hid_t H5Dcreate(hid_it loc_id, char *name, hid_t type_id, hid_t space_id, hid_t creation_prp);
The corresponding Fortran subroutine has the following form:
SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, hdferr, creation_prp)
The first four parameters of the Fortran subroutine correspond to the
C function parameters. The fifth parameter, dset_id
,
is an output parameter and contains a valid dataset identifier if the
value of the sixth output parameter hdferr indicates successful completion.
(Error code descriptions are provided with the subroutine descriptions
in the Reference Manual.) The seventh input parameter,
creation_prp
, is optional, and may be omitted when the
default creation property list is used.
H5fortran_types.f90
for KIND
definitions):
hid_t
datatype in the HDF5 C APIs.
INTEGER(HSIZE_T)
compares with
hsize_t
in the HDF5 C APIs.
INTEGER(HSSIZE_T)
compares with
hssize_t
in the HDF5 C APIs.
INTEGER(SIZE_T)
compares with
the C size_t
datatype.
TYPE(HOBJ_REF_T_F)
compares to
hobj_ref_t
in the HDF5 C API.
TYPE(HDSET_REG_REF_T_F)
compares to
hdset_reg_ref_t
in the HDF5 C API.
h5open_f
subroutine to initialize the Fortran interface before calling any
HDF5 Fortran subroutine.
It is a good practice to call the h5close_f
subroutine
after all calls to the HDF5 Fortran Library to close the Fortran
interface.
HDF5 documents and links Introduction to HDF5 |
HDF5 User’s Guide HDF5 Reference Manual |
The HDF Group Help Desk:
Describes HDF5 Release 1.10. |
Copyright by
The HDF Group
and the Board of Trustees of the University of Illinois |