Hello,
this looks like a simple problem but it got me stuck. I am trying to read
a dataset but to my understanding there is some problem with conversion of
data between file format (big endian) and my linux (little endian)
h5dump output looks like that
HDF5
"IVAOT_npp_d20151206_t0500124_e0501366_b21279_c20151206065638288374_noaa_ops.h5"
{
GROUP "/" {
...
GROUP "All_Data" {
GROUP "VIIRS-Aeros-Opt-Thick-IP_All" {
....
DATASET "faot550" {
DATATYPE H5T_IEEE_F32BE
DATASPACE SIMPLE { ( 768, 3200 ) / ( H5S_UNLIMITED,
H5S_UNLIMITED ) }
}
...
I want to read content of faot550.
The program looks like below and all seems to work fine until I attempt to
read the dataset
Thanks for any suggestions/help
Mark
...
CHARACTER(LEN=80), PARAMETER :: dataset_aod = &
&"/All_Data/VIIRS-Aeros-Opt-Thick-IP_All/faot550"
TYPE(C_PTR) :: f_ptr_aod
INTEGER(HID_T) :: file_aod, filetype_aod, memtype_aod, space_aod,
dset_aod, &
&group_aod, attr_aod ! Handles
REAL, DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata_aod
INTEGER(HSIZE_T), DIMENSION(1:2) :: dims_aod,maxdims
TYPE(C_PTR) :: f_ptr_aod
REAL, DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata_aod
...
CALL h5open_f(hdferr)
PRINT *,hdferr
CALL h5fopen_f(filename_aod, H5F_ACC_RDONLY_F, file_aod, hdferr)
PRINT *,hdferr
CALL h5dopen_f(file_aod, dataset_aod, dset_aod, hdferr)
PRINT *,hdferr
CALL h5dget_space_f (dset_aod, space_aod, hdferr)
PRINT *,hdferr
CALL h5sget_simple_extent_ndims_f(space_aod, rank_aod, hdferr)
PRINT *,hdferr,rank_aod
CALL h5sget_simple_extent_dims_f(space_aod, dims_aod, maxdims, hdferr)
PRINT *,hdferr,dims_aod,maxdims
CALL h5tarray_create_f(H5T_NATIVE_REAL, rank_aod, dims_aod, memtype_aod,
hdferr)
PRINT *,hdferr,memtype_aod, rank_aod, dims_aod
ALLOCATE(rdata_aod(dims_aod(1),dims_aod(2)))
PRINT *,SIZE(rdata_aod(1,:)),SIZE(rdata_aod(:,1))
f_ptr_aod = C_LOC(rdata_aod(1,1))
CALL h5dread_f (dset_aod, memtype_aod, f_ptr_aod, hdferr)
PRINT *,hdferr
....
0
0
0
0
0 2
2 3200 768
-1
-1
0 50331790 2 3200
768
768 3200
HDF5-DIAG: Error detected in HDF5 (1.8.14) thread 0:
#000: H5Dio.c line 173 in H5Dread(): can't read data
major: Dataset
minor: Read failed
#001: H5Dio.c line 425 in H5D__read(): unable to set up type info
major: Dataset
minor: Unable to initialize object
#002: H5Dio.c line 957 in H5D__typeinfo_init(): unable to convert between
src and dest datat\
ype
major: Dataset
minor: Feature is unsupported
#003: H5T.c line 4532 in H5T_path_find(): no appropriate function for
conversion path
major: Datatype
minor: Unable to initialize object
#002: H5Dio.c line 957 in H5D__typeinfo_init(): unable to convert between
src and dest datat\
ype
major: Dataset
minor: Feature is unsupported
#003: H5T.c line 4532 in H5T_path_find(): no appropriate function for
conversion path
major: Datatype
minor: Unable to initialize object
-1