PROGRAM f16jrfe ! F16JRF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : blas_damin_val, nag_wp ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. REAL (KIND=nag_wp) :: r INTEGER :: i, incx, k, n ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: x(:) ! .. Intrinsic Functions .. INTRINSIC abs ! .. Executable Statements .. WRITE (nout,*) 'F16JRF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) n, incx ALLOCATE (x(1+(n-1)*abs(incx))) READ (nin,*) (x(i),i=1,1+(n-1)*abs(incx),incx) ! Find K = ARGMIN(ABS(X)) and R = MIN(ABS(X)). CALL blas_damin_val(n,x,incx,k,r) WRITE (nout,*) WRITE (nout,99999) k WRITE (nout,99998) r 99999 FORMAT (1X,'Index of absolutely smallest component of X is',I3) 99998 FORMAT (1X,'Absolutely smallest value is',F12.5) END PROGRAM f16jrfe