There are two issues:
1) I get this error when trying to use max_dims for the dataspace with HDF5.
*HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0:
#000: H5D.c line 171 in H5Dcreate2(): unable to create dataset
major: Dataset
minor: Unable to initialize object
#001: H5Dint.c line 428 in H5D_create_named(): unable to create and link
to dataset
major: Dataset
minor: Unable to initialize object
#002: H5L.c line 1639 in H5L_link_object(): unable to create new link to
object
major: Links
minor: Unable to initialize object
#003: H5L.c line 1862 in H5L_create_real(): can't insert link
major: Symbol table
minor: Unable to insert object
#004: H5Gtraverse.c line 877 in H5G_traverse(): internal path traversal
failed
major: Symbol table
minor: Object not found
#005: H5Gtraverse.c line 703 in H5G_traverse_real(): traversal operator
failed
major: Symbol table
minor: Callback failed
#006: H5L.c line 1685 in H5L_link_cb(): unable to create object
major: Object header
minor: Unable to initialize object
#007: H5O.c line 2677 in H5O_obj_create(): unable to open object
major: Object header
minor: Can't open object
#008: H5Doh.c line 296 in H5O_dset_create(): unable to create dataset
major: Dataset
minor: Unable to initialize object
#009: H5Dint.c line 1030 in H5D_create(): unable to construct layout
information
major: Dataset
minor: Unable to initialize object
#010: H5Dcontig.c line 406 in H5D_contig_construct(): extendible
contiguous non-external dataset
major: Dataset
minor: Feature is unsupported
HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 0:
#000: H5D.c line 378 in H5Dclose(): not a dataset
major: Invalid arguments to routine
minor: Inappropriate type*
This is the code that I use
* use hdf5
implicit real(KIND=real8) (a-h,o-z)
INTEGER :: error
INTEGER(HID_T) :: file_id, dspace_id, dset_opc_id
INTEGER, PARAMETER :: rank = 2
INTEGER(HSIZE_T), DIMENSION(rank) :: dims, max_dims
dims = (/ 10, 3000 /)
max_dims = (/ 10, 10000 /)
! i get error if I use unlimited size like
**! max_dims = (/ 10, H5S_UNLIMITED_F* /)
···
*
print *, "H5S_UNLIMITED_F = ", H5S_UNLIMITED_F
!initialize and create HDF
call h5open_f(error)
call h5fcreate_f('mydata.h5', H5F_ACC_TRUNC_F, file_id, error)
call h5screate_simple_f(rank, dims, dspace_id, error, max_dims)
! It works okay if I use the below instead
! call h5screate_simple_f(rank, dims, dspace_id, error)
call h5dcreate_f(file_id, "opc", H5T_NATIVE_DOUBLE, dspace_id,
dset_opc_id, error)
!close HDF file and clean up
call h5dclose_f(dset_opc_id, error)
call h5sclose_f(dspace_id, error)
call h5fclose_f(file_id, error)
call h5close_f(error)
stop *
2) One more things, I got H5S_UNLIMITED_F = 0 when compiling with PGI
Fortran 10.1. It means that I could not specify the unlimited size of the
dataset.
Could any one give me a suggestion?
Best,
Tuan
GMU