    PROGRAM g05kcfe

!      G05KCF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. Use Statements ..
       USE nag_library, ONLY : a00acf, g05kaf, g05kcf, nag_wp
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nout = 6
!      .. Local Scalars ..
       REAL (KIND=nag_wp)              :: x
       INTEGER                         :: i, igen
!      .. Local Arrays ..
       INTEGER                         :: iseed(4)
!      .. Executable Statements ..
       WRITE (nout,*) 'G05KCF Example Program Results'
       WRITE (nout,*)
       IF (a00acf()) THEN
!         Initialize the seed
          iseed(1) = 1762543
          iseed(2) = 9324783
          iseed(3) = 42344
          iseed(4) = 742355
!         IGEN identifies the stream.
          igen = 1
          CALL g05kcf(igen,iseed)

          DO i = 1, 5
             x = g05kaf(igen,iseed)
             WRITE (nout,99999) x
          END DO
       ELSE
          WRITE (nout,*) ' ** No valid licence key was found'
       END IF

99999  FORMAT (1X,F10.4)
    END PROGRAM g05kcfe
