candice_38 | Bonjour,
pour lire un fichier h5 avec fortran, j'utilise la routine suivante :
Code :
- PROGRAM H5_RDWT
- USE HDF5 ! This module contains all necessary modules
- IMPLICIT NONE
- CHARACTER(LEN=12), PARAMETER :: filename = "f1tab_WOF.h5" ! File name
- CHARACTER(LEN=5), PARAMETER :: dsetname = "dset1" ! Dataset name
- INTEGER(HID_T) :: file_id ! File identifier
- INTEGER(HID_T) :: dset_id ! Dataset identifier
- INTEGER :: error ! Error flag
- REAL, DIMENSION(21,63) :: data_out ! Data buffers
- INTEGER, DIMENSION(21,63) :: dset_data
- INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
- ! Initialize FORTRAN interface.
- CALL h5open_f(error)
- ! Open an existing file.
- CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
- ! Open an existing dataset.
- CALL h5dopen_f(file_id, dsetname, dset_id, error)
- data_dims(1) = 21
- data_dims(2) = 63
- CALL h5dread_f(dset_id, H5T_NATIVE_REAL,data_out, data_dims, error)
- print*,'data',data_out(:,1)
- !
- ! Close the dataset.
- !
- CALL h5dclose_f(dset_id, error)
- !
- ! Close the file.
- !
- CALL h5fclose_f(file_id, error)
- !
- ! Close FORTRAN interface.
- !
- CALL h5close_f(error)
- END PROGRAM H5_RDWT
|
Mais ça me renvoie comme erreur :
DF5-DIAG: Error detected in HDF5 (1.8.10-patch1) thread 0:
#000: ../../src/H5Dio.c line 174 in H5Dread(): can't read data
major: Dataset
minor: Read failed
#001: ../../src/H5Dio.c line 337 in H5D__read(): unable to set up type info
major: Dataset
minor: Unable to initialize object
#002: ../../src/H5Dio.c line 838 in H5D__typeinfo_init(): unable to convert between src and dest datatype
major: Dataset
minor: Feature is unsupported
#003: ../../src/H5T.c line 4523 in H5T_path_find(): no appropriate function for conversion path
major: Datatype
minor: Unable to initialize object
Ca vient de la fonction READ : quelqu'un a une idée sur l'option à modifier
De plus que veut dire HID_T dans INTEGER(HID_T)
Merci Beaucoup |