PROGRAM f16dpfe ! F16DPF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. 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 Functions .. 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