Couple of things, you should be declaring:

INTEGER(HID_T) :: attr_id

For reading to an array:

INTEGER(HSIZE_T), dimension(2) ::  ndata_dims = (/1,1/)
INTEGER, DIMENSION(1,1) :: aread_data

Or you can read it into a scalar,

INTEGER(HSIZE_T), dimension(1) ::  ndata_dims = (/1/)
INTEGER :: aread_data

Either way, ndata_dims always needs to be an 1D array.

You can also forgo f90 and use f2003 instead:

TYPE(C_PTR) :: f_ptr
INTEGER, target :: aread_data

f_ptr = C_LOC(aread_data)
CALL h5aread_f(attr_id, H5T_NATIVE_INTEGER, f_ptr , error)

Scot


On Oct 19, 2015, at 9:49 AM, Richa Mathur 
<[email protected]<mailto:[email protected]>> wrote:

Hi Scot,

The  attribute I wish to read is

 ATTRIBUTE "N_Number_Of_Scans" {
               DATATYPE  H5T_STD_I32BE
               DATASPACE  SIMPLE { ( 1, 1 ) / ( 1, 1 ) }
               DATA {
               (0,0): 12
               }

Is that an array of dim(1,1) ? or a scalar?
I  use

Integer :: ndata_dims, aread_data,error

CALL h5aread_f(attr_id, H5T_NATIVE_INTEGER, aread_data,ndata_dims , error)

Rgds
Gompie
On Mon, Oct 19, 2015 at 10:38 AM, Scot Breitenfeld 
<[email protected]<mailto:[email protected]>> wrote:
and how did you declare your arguments in h5aread_f in your program?

Scot

> On Oct 19, 2015, at 9:09 AM, 
> [email protected]<mailto:[email protected]> wrote:
>
> All flags in the install script:
>
> export CC=mpicc
> export CXX=mpicxx
> export FC=mpifort
> export LDFLAGS=-lnuma
>
>
>
> Hadi Zolfaghari
> Ph.D. Candidate - Cardiovascular Engineering
> ARTORG Center for Biomedical Engineering Research
> University of Bern
>
> Murtenstrasse 50, CH- 3008 Bern, Switzerland
> Tel:  +41 31 632 7575<tel:%2B41%2031%20632%207575>
> Fax: +41 31 632 7576<tel:%2B41%2031%20632%207576>
> ________________________________________
> From: Hdf-forum 
> [[email protected]<mailto:[email protected]>]
>  on behalf of Scot Breitenfeld 
> [[email protected]<mailto:[email protected]>]
> Sent: Monday, October 19, 2015 3:43 PM
> To: HDF Users Discussion List
> Subject: Re: [Hdf-forum] h5aread_f
>
> Can you show me how you declared your arguments in h5aread_f. Are you using 
> any compile flags to promote any integers or reals?
>
> Thanks,
> Scot
>
>> On Oct 18, 2015, at 7:51 PM, Richa Mathur 
>> <[email protected]<mailto:[email protected]>> wrote:
>>
>> Hi
>> I am trying to read an attribute (N_Number_Of_Scans) that has the following 
>> path in the hdf file
>>
>> /Data_Products/TAMS-SDR/TAMS-SDR_Gran_0/N_Number_Of_Scans
>>
>> I use the following commands
>> use h5df
>> CALL h5dopen_f(file_id, "/Data_Products/TAMS-SDR/TAMS-SDR_Gran_0", dset_id, 
>> error)
>> print *,"DSET ID Gran`", dset_id
>> CALL h5aopen_name_f(dset_id,"N_Number_Of_Scans", attr_id, error)
>> CALL h5aread_f(attr_id, H5T_NATIVE_INTEGER, aread_data,ndata_dims , error)
>>
>> But I get the error
>> CALL h5aread_f(attr_id, H5T_NATIVE_INTEGER, aread_data,ndata_dims , error)
>>                                                                           1
>> Error: There is no specific subroutine for the generic 'h5aread_f' at (1)
>>
>> Any help
>> Gompie
>>
>> _______________________________________________
>> Hdf-forum is for HDF software users discussion.
>> [email protected]<mailto:[email protected]>
>> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
>> Twitter: https://twitter.com/hdf5
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]<mailto:[email protected]>
> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
> Twitter: https://twitter.com/hdf5
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]<mailto:[email protected]>
> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
> Twitter: https://twitter.com/hdf5


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

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

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to