Fortran : Probleme de lecture

Fortran : Probleme de lecture - Divers - Programmation

Marsh Posté le 20-12-2013 à 09:29:24    

Bonjour,
 pour lire un fichier h5 avec fortran, j'utilise la routine suivante :
 

Code :
  1. PROGRAM H5_RDWT
  2. USE HDF5 ! This module contains all necessary modules
  3. IMPLICIT NONE
  4. CHARACTER(LEN=12), PARAMETER :: filename = "f1tab_WOF.h5" ! File name
  5. CHARACTER(LEN=5), PARAMETER :: dsetname = "dset1" ! Dataset name
  6. INTEGER(HID_T) :: file_id ! File identifier
  7. INTEGER(HID_T) :: dset_id ! Dataset identifier
  8. INTEGER :: error ! Error flag
  9. REAL, DIMENSION(21,63) :: data_out ! Data buffers
  10. INTEGER, DIMENSION(21,63) :: dset_data
  11. INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
  12. ! Initialize FORTRAN interface.
  13. CALL h5open_f(error)
  14. ! Open an existing file.
  15. CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)
  16. ! Open an existing dataset.
  17. CALL h5dopen_f(file_id, dsetname, dset_id, error)
  18. data_dims(1) = 21
  19. data_dims(2) = 63
  20. CALL h5dread_f(dset_id, H5T_NATIVE_REAL,data_out, data_dims, error)
  21. print*,'data',data_out(:,1)
  22. !
  23. ! Close the dataset.
  24. !
  25. CALL h5dclose_f(dset_id, error)
  26. !
  27. ! Close the file.
  28. !
  29. CALL h5fclose_f(file_id, error)
  30. !
  31. ! Close FORTRAN interface.
  32. !
  33. CALL h5close_f(error)
  34. 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

Reply

Marsh Posté le 20-12-2013 à 09:29:24   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed