reading compound hdf5 data

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, "RESQML/xyz", dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

[cid:image001.jpg@01D1CD5D.4A2E0E80]

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

···

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, “RESQML/xyz”, dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use

  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

[cid:image001.jpg@01D1CD75.E9C3B540][cid:image002.jpg@01D1CD75.E9C3B540]

-----Opprinnelig melding-----

···

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables

  CALL h5dopen_f (file, "RESQML/xyz", dset, ierr)

  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?

  !

  ! Get dataspace.

  !

  CALL h5dget_space_f(dset, space, ierr)

  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with —enable-fortran —enable-fortran2003.
For 1.10, you just have to use —enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &
                       mem_space_id, file_space_id, xfer_prp)
    INTEGER(HID_T), INTENT(IN) :: dset_id
    INTEGER(HID_T), INTENT(IN) :: mem_type_id
    TYPE(C_PTR) , INTENT(INOUT) :: buf
    INTEGER , INTENT(OUT) :: hdferr
    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id
    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id
    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----

···

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, “RESQML/xyz”, dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Øyvind

···

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with -enable-fortran -enable-fortran2003.
For 1.10, you just have to use -enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, "RESQML/xyz", dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Out of curiosity, does the example work with your current setup? I don’t recall having any issues with 2011 Intel fortran. Does the Fortran “make check” pass?

No set date yet for 1.10.1, so this is not for certain, but it should be in the next few months.

Øyvind

···

On Jun 24, 2016, at 3:57 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with —enable-fortran —enable-fortran2003.
For 1.10, you just have to use —enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, “RESQML/xyz”, dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Hello,

I still get the same message, and it seems to be related to f_ptr (see below). I use the following code sequence (I have removed code that should not be relevant):

   USE HDF5
   USE ISO_C_BINDING

  TYPE sensor_t
       double precision:: xx,yy,zz
   END TYPE sensor_t

   TYPE(sensor_t), DIMENSION(1:dimes), TARGET :: rdata
   TYPE(C_PTR) :: f_ptr

   CALL h5dopen_f (file, cname, dset, ierr)
  f_ptr = C_LOC(rdata(1))
  CALL h5dread_f(dset, H5T_NATIVE_DOUBLE, f_ptr , ierr )

Then I get the following message when building:

Error 1 error #6285: There is no matching specific subroutine for this generic subroutine call. [H5DREAD_F]

I do use the h5dread_f() call other places in the program, so I know that it works. In these places I use it with a normal array and a dim variable, e.g.:

   CALL h5dopen_f (file, cname, dset, ierr)
   CALL h5dread_f(dset, H5T_NATIVE_REAL, rresult, dims, ierr)

Which works fine. It is only when I add the code containing the f_ptr (which I seem to need for the compound data) that I get problems. This is what confuses me.

Øyvind

···

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 18:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Emne: Re: [Hdf-forum] reading compound hdf5 data

On Jun 24, 2016, at 3:57 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Out of curiosity, does the example work with your current setup? I don't recall having any issues with 2011 Intel fortran. Does the Fortran "make check" pass?

No set date yet for 1.10.1, so this is not for certain, but it should be in the next few months.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with -enable-fortran -enable-fortran2003.
For 1.10, you just have to use -enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, "RESQML/xyz", dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Can you send the config.log file?

Hello,

I still get the same message, and it seems to be related to f_ptr (see below). I use the following code sequence (I have removed code that should not be relevant):

   USE HDF5
   USE ISO_C_BINDING

  TYPE sensor_t
       double precision:: xx,yy,zz
   END TYPE sensor_t

   TYPE(sensor_t), DIMENSION(1:dimes), TARGET :: rdata
   TYPE(C_PTR) :: f_ptr

   CALL h5dopen_f (file, cname, dset, ierr)
  f_ptr = C_LOC(rdata(1))
  CALL h5dread_f(dset, H5T_NATIVE_DOUBLE, f_ptr , ierr )

Then I get the following message when building:

Error 1 error #6285: There is no matching specific subroutine for this generic subroutine call. [H5DREAD_F]

I do use the h5dread_f() call other places in the program, so I know that it works. In these places I use it with a normal array and a dim variable, e.g.:

   CALL h5dopen_f (file, cname, dset, ierr)
   CALL h5dread_f(dset, H5T_NATIVE_REAL, rresult, dims, ierr)

Which works fine. It is only when I add the code containing the f_ptr (which I seem to need for the compound data) that I get problems. This is what confuses me.

Øyvind

···

On Jun 24, 2016, at 11:39 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 18:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

On Jun 24, 2016, at 3:57 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Out of curiosity, does the example work with your current setup? I don’t recall having any issues with 2011 Intel fortran. Does the Fortran “make check” pass?

No set date yet for 1.10.1, so this is not for certain, but it should be in the next few months.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with —enable-fortran —enable-fortran2003.
For 1.10, you just have to use —enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, “RESQML/xyz”, dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Sorry, I can't find any config.log file. Where should it be?

Øyvind

···

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 19:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Can you send the config.log file?

On Jun 24, 2016, at 11:39 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Hello,

I still get the same message, and it seems to be related to f_ptr (see below). I use the following code sequence (I have removed code that should not be relevant):

   USE HDF5
   USE ISO_C_BINDING

  TYPE sensor_t
       double precision:: xx,yy,zz
   END TYPE sensor_t

   TYPE(sensor_t), DIMENSION(1:dimes), TARGET :: rdata
   TYPE(C_PTR) :: f_ptr

   CALL h5dopen_f (file, cname, dset, ierr)
  f_ptr = C_LOC(rdata(1))
  CALL h5dread_f(dset, H5T_NATIVE_DOUBLE, f_ptr , ierr )

Then I get the following message when building:

Error 1 error #6285: There is no matching specific subroutine for this generic subroutine call. [H5DREAD_F]

I do use the h5dread_f() call other places in the program, so I know that it works. In these places I use it with a normal array and a dim variable, e.g.:

   CALL h5dopen_f (file, cname, dset, ierr)
   CALL h5dread_f(dset, H5T_NATIVE_REAL, rresult, dims, ierr)

Which works fine. It is only when I add the code containing the f_ptr (which I seem to need for the compound data) that I get problems. This is what confuses me.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 18:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

On Jun 24, 2016, at 3:57 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Out of curiosity, does the example work with your current setup? I don't recall having any issues with 2011 Intel fortran. Does the Fortran "make check" pass?

No set date yet for 1.10.1, so this is not for certain, but it should be in the next few months.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with -enable-fortran -enable-fortran2003.
For 1.10, you just have to use -enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, "RESQML/xyz", dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

It should be in the directory where you executed the “configure” command.

Sorry, I can’t find any config.log file. Where should it be?

Øyvind

···

On Jun 27, 2016, at 2:47 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 19:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Can you send the config.log file?

On Jun 24, 2016, at 11:39 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Hello,

I still get the same message, and it seems to be related to f_ptr (see below). I use the following code sequence (I have removed code that should not be relevant):

   USE HDF5
   USE ISO_C_BINDING

  TYPE sensor_t
       double precision:: xx,yy,zz
   END TYPE sensor_t

   TYPE(sensor_t), DIMENSION(1:dimes), TARGET :: rdata
   TYPE(C_PTR) :: f_ptr

   CALL h5dopen_f (file, cname, dset, ierr)
  f_ptr = C_LOC(rdata(1))
  CALL h5dread_f(dset, H5T_NATIVE_DOUBLE, f_ptr , ierr )

Then I get the following message when building:

Error 1 error #6285: There is no matching specific subroutine for this generic subroutine call. [H5DREAD_F]

I do use the h5dread_f() call other places in the program, so I know that it works. In these places I use it with a normal array and a dim variable, e.g.:

   CALL h5dopen_f (file, cname, dset, ierr)
   CALL h5dread_f(dset, H5T_NATIVE_REAL, rresult, dims, ierr)

Which works fine. It is only when I add the code containing the f_ptr (which I seem to need for the compound data) that I get problems. This is what confuses me.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 24 June 2016 18:00
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

On Jun 24, 2016, at 3:57 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Thanks,

I think my problem may be related to the version of the compiler (2011 release of Intel fortran) that I am using and the version of hdf (1.8.11) I am using. I will try this again when I have upgraded my compiler to the most recent one and moved to hdf 1.10. I was planning to delay the move to hdf 1.10 until the first couple of bugfix releases were out (1.10.1?). I see that a patch release is now out. Do you have any idea on when 1.10.1 will be released

Out of curiosity, does the example work with your current setup? I don’t recall having any issues with 2011 Intel fortran. Does the Fortran “make check” pass?

No set date yet for 1.10.1, so this is not for certain, but it should be in the next few months.

Øyvind

Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 18:51
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

If you are using the 1.8 version of hdf5 then you have to enable Fortran 2003 features by building with —enable-fortran —enable-fortran2003.
For 1.10, you just have to use —enable-fortran.

Also, there is no dimension argument (dim3) in the F2003 version of h5dread_f:

SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, &

                       mem_space_id, file_space_id, xfer_prp)

    INTEGER(HID_T), INTENT(IN) :: dset_id

    INTEGER(HID_T), INTENT(IN) :: mem_type_id

    TYPE(C_PTR) , INTENT(INOUT) :: buf

    INTEGER , INTENT(OUT) :: hdferr

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id

    INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp

On Jun 23, 2016, at 10:37 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

I guess it ought to work, but I get a compile error: there is no matching specific subroutine for this generic subroutine call,

which refers to h5dread_f() .

If I do not use f_ptr ,it compiles. I use
  TYPE(C_PTR) :: f_ptr

to define p_ptr.

Any comments?

I am using the Intel Fortran compiler

Oyvind

<image001.jpg><image002.jpg>

-----Opprinnelig melding-----
Fra: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] På vegne av Scot Breitenfeld
Sendt: 23 June 2016 15:58
Til: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Emne: Re: [Hdf-forum] reading compound hdf5 data

Does the example h5ex_t_cmpd_F03.f90 at

https://www.hdfgroup.org/HDF5/examples/api18-fortran.html

help?

On Jun 23, 2016, at 7:41 AM, Øyvind Sylta <Sylta@migris.no<mailto:Sylta@migris.no>> wrote:

Is there a simple Fortran90 instruction on reading a hdf5 dataset that uses compound and where the dataset consists of 3 groups (x, y, z) in a 2D array as shown in the figure. It should be easy to load this data into my array(s), but I am stuck here.

  ! file, dset, space, dims3 and ndims3 are initialised as hdf5 variables
  CALL h5dopen_f (file, “RESQML/xyz”, dset, ierr)
  !call h5tget_nmembers_f(dset, members, ierr) !why does this call not work?
  !
  ! Get dataspace.
  !
  CALL h5dget_space_f(dset, space, ierr)
  CALL h5sget_simple_extent_dims_f(space, dims3, ndims3, nrank)

! code to insert after here to load the data?

<image001.jpg>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5