    Program f03adfe

!     F03ADF Example Program Text

!     Mark 24 Release. NAG Copyright 2012.

!     .. Use Statements ..
      Use nag_library, Only: f03adf, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: deti, detr
      Integer                          :: i, ifail, lda, n
!     .. Local Arrays ..
      Complex (Kind=nag_wp), Allocatable :: a(:,:)
      Real (Kind=nag_wp), Allocatable  :: wkspce(:)
!     .. Executable Statements ..
      Write (nout,*) 'F03ADF Example Program Results'

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

      Read (nin,*) n
      lda = n
      Allocate (a(lda,n),wkspce(n))

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

      ifail = 0
      Call f03adf(a,lda,n,detr,deti,wkspce,ifail)

      Write (nout,*)
      Write (nout,99999) detr, deti

99999 Format (1X,'Value of determinant = (',F9.4,',',F9.4,')')
    End Program f03adfe
