You will have to compile hdf5 so that 8 byte integers are the default integer type ( FCFLAGS = : -i8 with intel, fdefault-integer-8 with gfortran). In the next release this requirement will be removed and, additionally, you will be able to associated the KIND type with the hdf5 type.

On Tue, 04 Oct 2011 14:22:29 -0500, Denis wrote:
Thank you. You're right, int8 isn't enough. I tried to use int15 and int18. It gives me the following compiling error (both gfortran and ifortran).

-------------------------------------------------------------------------------------------------
In file test2.f90:69
     CALL h5dread_f(dset_id,nat_type_id,data_out,data_dims,error)

                                              1
Error: There is no specific subroutine for the generic 'h5dread_f' at (1)

---------------------------------------------------------------------------------------------------

Thanks,
Denis

On 10/4/2011 10:55 AM, [email protected] wrote:
int8 = selected_int_kind(8) (i.e int range 10^8) will not be big enough to hold the numbers you are trying to read, try selected_int_kind(15) which should give you an 8 byte integer.


On Tue, 04 Oct 2011 09:55:48 -0500, Denis wrote:
Hello,

I ran into a problem reading H5T_STD_I64BE data using f90.
Following is a part of a routine code.


-------------------------------------------------------------------------------------

INTEGER, parameter:: int8 = selected_int_kind(8)
INTEGER(kind=int8), DIMENSION(:), ALLOCATABLE :: data_out

ALLOCATE(data_out(data_dims(1)))
CALL h5dread_f(dset_id,nat_type_id,data_out,dims,error)
...


--------------------------------------------------------------------------------------

Data set I'm trying to read looks like this:

HDF5 "GMODO_npp_d20100906_t2110510.h5" {
DATASET "/All_Data/VIIRS-MOD-GEO_All/MidTime" {
   DATATYPE  H5T_STD_I64BE
   DATASPACE  SIMPLE { ( 48 ) / ( H5S_UNLIMITED ) }
   DATA {
   (0): 1662498685374717, 1662498687161083, 1662498688947446,
   (3): 1662498690733806, 1662498692520176, 1662498694306565,
...


--------------------------------------------------------------------------------------

I think the problem I have is a data type. I also tried to read as =>
CALL h5dread_f(dset_id,H5T_NATIVE_INTEGER,data_out,dims,error)
(I know it supports only 32-bit, but I didn't find anything for 64-bit.)

The result is always the same it gives me some weird numbers.
What data type should I use in Fortran 90?

Thanks,
Denis


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to