Program f16dpfe

!     F16DPF Example Program Text

!     Mark 25 Release. NAG Copyright 2014.

!     .. Use Statements ..
      Use nag_library, Only: f16dpf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Integer                          :: i, incx, j, k, n
!     .. Local Arrays ..
      Integer, Allocatable             :: x(:)
!     .. Intrinsic Procedures ..
      Intrinsic                        :: abs
!     .. Executable Statements ..
      Write (nout,*) 'F16DPF Example Program Results'

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

      Read (nin,*) n, incx
      Allocate (x(1+(n-1)*abs(incx)))

      Read (nin,*)(x(j),j=1,1+(n-1)*abs(incx),incx)

!     Find K = ARGMIN(X) and I = MIN(X).

      Call f16dpf(n,x,incx,k,i)

      Write (nout,*)
      Write (nout,99999) k
      Write (nout,99998) i

99999 Format (1X,'Index of smallest component of X is',I3)
99998 Format (1X,'Smallest component of X is',I12)
    End Program f16dpfe