pantry/projects/hdfgroup.org/HDF5/test.f90
Andrew 0b3aae1a82
hdfgroup.org/HDF5 (#2314)
* hdfgroup.org/HDF5

* --libdir

* maybe --enable-shared=no

* sed

* HDF5_ROOT & additional test

* sed

* maybe sed -i ''

* modified:   projects/hdfgroup.org/HDF5/package.yml

* sed
2023-06-28 15:52:55 -04:00

25 lines
787 B
Fortran

use hdf5
integer(hid_t) :: f, dspace, dset
integer(hsize_t), dimension(2) :: dims = [2, 2]
integer :: error = 0, major, minor, rel
call h5open_f (error)
if (error /= 0) call abort
call h5fcreate_f ("test.h5", H5F_ACC_TRUNC_F, f, error)
if (error /= 0) call abort
call h5screate_simple_f (2, dims, dspace, error)
if (error /= 0) call abort
call h5dcreate_f (f, "data", H5T_NATIVE_INTEGER, dspace, dset, error)
if (error /= 0) call abort
call h5dclose_f (dset, error)
if (error /= 0) call abort
call h5sclose_f (dspace, error)
if (error /= 0) call abort
call h5fclose_f (f, error)
if (error /= 0) call abort
call h5close_f (error)
if (error /= 0) call abort
CALL h5get_libversion_f (major, minor, rel, error)
if (error /= 0) call abort
write (*,"(I0,'.',I0,'.',I0)") major, minor, rel
end