PROGRAM SAMPLE

        use hdf5   ! This module contains all necessary modules

        CHARACTER(LEN=64), PARAMETER :: filename =&
            "../data/GPM/DPR/GPMCOR_DPR_2603_M_L3S_D3M_08A.nc"
        CHARACTER(LEN=34), PARAMETER :: dsetname = "/FS/G1/precipRateESurface/mean"

        INTEGER(HID_T) :: file_id       ! File identifier
        INTEGER(HID_T) :: dset_id       ! Dataset identifier
        REAL*4, DIMENSION(28,72,3,3,3) :: precipRateESurface ! Data buffers
        REAL*4 lat, lon
        INTEGER(HSIZE_T), DIMENSION(5) :: data_dims
	    INTEGER error 


        ! Initialize FORTRAN interface.
        CALL h5open_f(error)

        ! Open an existing file.
        CALL h5fopen_f (filename, H5F_ACC_RDWR_F, file_id, error)

        ! Open an existing dataset.
        CALL h5dopen_f(file_id, dsetname, dset_id, error)
        ! write(*,*) "h5dopen_f","error =",error 

        ! Read precipRateESurface.
        data_dims(1) = 28 
        data_dims(2) = 72 
        data_dims(3) = 3 
        data_dims(4) = 3 
        data_dims(5) = 3 
        CALL h5dread_f(dset_id, H5T_NATIVE_REAL, precipRateESurface, data_dims, error)
        ! write(*,*) "h5dread_f","error =",error 

        ! print the value
        write(*,*) "filename=",filename 
        write(*,*) "dataset name=",dsetname 
        lat = (140.0/28.0) * (15-1) - 70.0 + (140.0/28.0/2)
        lon = (360.0/72.0) * (64-1) - 180.0 + (360.0/72.0/2)
        write(*,*) "lat=",lat,"lon=",lon
        write(*,*) "precipRateESurface.mean(15,64,1,1,1)=",precipRateESurface(15,64,1,1,1) 
        write(*,*) "precipRateESurface.mean(15,64,1,2,1)=",precipRateESurface(15,64,1,2,1) 

        ! Close the dataset.
        CALL h5dclose_f(dset_id, error)

        ! Close the file.
        CALL h5fclose_f(file_id, error)

        ! Close FORTRAN interface.
        CALL h5close_f(error)

	    STOP
END
	
