      SUBROUTINE oldBUFR_REWIND(kunit, kret)

      implicit none

c
c***  SUBROUTINE BUFR_REWIND(kunit, kret)
c
c     Sami Saarinen, ECMWF, 19/10/95
c
c***  Purpose:
c
c     To rewind the BUFR file
c
c***  Externals:
c
c     PBSEEK    - Repositions file to the beginning
c
c***  Notes:
c
c     Coded in Fortran-90
c
c*** Input variables
      integer, intent(in) :: kunit ! PBIO file pointer
c*** Output variables
      integer, intent(out):: kret  ! Return code
                                   !  0 = OK
                                   ! -1 = File handling error
c-----------------------------------------------------------------------
! === END OF INTERFACE BLOCK ===
      
      integer iret_pbio

c
c     1. Rewind the file to the beginning and set the return code
c        --------------------------------------------------------
c

      call PBSEEK(kunit, 0, 0, iret_pbio)

      if (iret_pbio /= 0) then
         kret = -1
      else
         kret = 0
      endif

      END SUBROUTINE oldBUFR_REWIND
