    Program f03acfe

!     F03ACF Example Program Text

!     Mark 24 Release. NAG Copyright 2012.

!     .. Use Statements ..
      Use nag_library, Only: f03acf, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: det
      Integer                          :: i, ifail, lda, ldrl, m, m1, n
!     .. Local Arrays ..
      Real (Kind=nag_wp), Allocatable  :: a(:,:), rl(:,:)
!     .. Executable Statements ..
      Write (nout,*) 'F03ACF Example Program Results'

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

      Read (nin,*) n, m
      lda = n
      ldrl = n
      m1 = m + 1
      Allocate (a(lda,m1),rl(ldrl,m1))

      Read (nin,*)(a(i,1:m1),i=1,n)

      ifail = 0
      Call f03acf(a,lda,n,m,det,rl,ldrl,m1,ifail)

      Write (nout,*)
      Write (nout,99999) 'Value of determinant = ', det

99999 Format (1X,A,F9.4)
    End Program f03acfe
