There are a few examples at: http://www.hdfgroup.org/HDF5/examples/api18-fortran.html
which you can start from. Take a look in the “Datatypes” section, particularly at h5ex_t_floatatt_F03.f90 Scot > On Mar 28, 2015, at 4:10 AM, Marco Lucchesi <[email protected]> wrote: > > Dear all, > > (first of all hello everybody, this is my first message here. I hope it finds > you well). I am trying to run a very basic code. It reads a HDF5 datafile, > which contents have been printed by a fortran code and have been checked with > a matlab code. Now i am trying to write my first hdf5 code, which reads the > content of this file. Check these lines out: > > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! > integer(HSIZE_T) :: dim(1),datadims(3) > real*8 :: dbl_vec(2),t,dt > > dim=(/2/) > call H5Aopen_f(h5gid,'time_variables',h5attr,h5error) > call H5Aread_f(h5attr,H5T_IEEE_F64BE,dbl_vec(1),dim,h5error) > call H5Aclose_f(h5attr,h5error) > dt=dbl_vec(1) > t=dbl_vec(2) > write(*,*) dt,t > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! > > Before these lines there is code, and it runs fine and i am able to read > integer values from the datafile. If i try to run it, it arrives at the write > instruction and says: > 'Illegal Instruction' > and dies with no print. > > I am compiling it with h5fc and the HDF5 API version is 1.8.9. The datafile > is around 41MB. Have you ever seen this before? > > Thanks in advance, > > Marco > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org > Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
