    PROGRAM g01etfe

!      G01ETF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : a00acf, g01etf, nag_wp
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nin = 5, nout = 6
!      .. Local Scalars ..
       REAL (KIND=nag_wp)              :: x, y
       INTEGER                         :: ifail
!      .. Executable Statements ..
       WRITE (nout,*) 'G01ETF Example Program Results'
       WRITE (nout,*)

!      Check for valid licence prior to calling G01ETF
       IF ( .NOT. a00acf()) THEN
          WRITE (nout,*) ' ** A valid licence key was not found'

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

!         Display titles
          WRITE (nout,*) '  X          Y'
          WRITE (nout,*)

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

!            Compute the value of the Landau distribution function
             y = g01etf(x)

!            Display the results
             WRITE (nout,99999) x, y
          END DO D_LP
       END IF

99999  FORMAT (1X,F4.1,3X,1P,E12.4)
    END PROGRAM g01etfe
