    PROGRAM g01ebfe

!      G01EBF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : g01ebf, nag_wp
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nin = 5, nout = 6
!      .. Local Scalars ..
       REAL (KIND=nag_wp)              :: df, prob, t
       INTEGER                         :: ifail
       CHARACTER (1)                   :: tail
!      .. Executable Statements ..
       WRITE (nout,*) 'G01EBF Example Program Results'
       WRITE (nout,*)

!      Skip heading in data file
       READ (nin,*)

!      Display titles
       WRITE (nout,*) ' TAIL     T       DF      Probability'
       WRITE (nout,*)

D_LP:  DO
          READ (nin,*,IOSTAT=ifail) tail, t, df
          IF (ifail/=0) THEN
             EXIT D_LP
          END IF

!         Calculate probablity
          ifail = 0
          prob = g01ebf(tail,t,df,ifail)

!         Display results
          WRITE (nout,99999) tail, t, df, prob
       END DO D_LP

99999  FORMAT (3X,A1,4X,F6.3,F8.1,7X,F7.4)
    END PROGRAM g01ebfe
