    Program g01blfe

!     G01BLF Example Program Text

!     Mark 24 Release. NAG Copyright 2012.

!     .. Use Statements ..
      Use nag_library, Only: g01blf, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: peqk, pgtk, plek
      Integer                          :: ifail, k, l, m, n
!     .. Executable Statements ..
      Write (nout,*) 'G01BLF Example Program Results'
      Write (nout,*)

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

!     Display titles
      Write (nout,*) '   N   L   M   K     PLEK      PGTK      PEQK'
      Write (nout,*)

!     Loop over all dta
d_lp: Do
        Read (nin,*,Iostat=ifail) n, l, m, k
        If (ifail/=0) Then
!         All data processed
          Exit d_lp
        End If

!       Calculate probability
        ifail = 0
        Call g01blf(n,l,m,k,plek,pgtk,peqk,ifail)

!       Display results
        Write (nout,99999) n, l, m, k, plek, pgtk, peqk
      End Do d_lp

99999 Format (1X,4I4,3F10.5)
    End Program g01blfe
