*     G05DRF Example Program Text
*     Mark 20 Revised. NAG Copyright 2001.
*     .. Parameters ..
      INTEGER          NIN, NOUT
      PARAMETER        (NIN=5,NOUT=6)
*     .. Local Scalars ..
      DOUBLE PRECISION A
      INTEGER          IFAIL, X
*     .. External Functions ..
      INTEGER          G05DRF
      EXTERNAL         G05DRF
*     .. External Subroutines ..
      EXTERNAL         G05CBF, G05ZAF
*     .. Executable Statements ..
      CALL G05ZAF('O')
      WRITE (NOUT,*) 'G05DRF Example Program Results'
      WRITE (NOUT,*)
*     Skip heading in data file
      READ (NIN,*)
      IFAIL = 0
      CALL G05CBF(0)
   20 CONTINUE
      READ (NIN,*,END=40,ERR=40) A
*
      IF (A.LE.0.0D0) GO TO 40
      X = G05DRF(A,IFAIL)
*
      WRITE (NOUT,99999) X
      GO TO 20
   40 CONTINUE
      STOP
*
99999 FORMAT (1X,I10)
      END
