PROGRAM f16elfe ! F16ELF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : blas_dsum, nag_wp ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. REAL (KIND=nag_wp) :: sumval INTEGER :: i, incx, n ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: x(:) ! .. Intrinsic Functions .. INTRINSIC abs ! .. Executable Statements .. WRITE (nout,*) 'F16ELF 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) ! Sum the elements of X sumval = blas_dsum(n,x,incx) WRITE (nout,*) WRITE (nout,99999) sumval 99999 FORMAT (1X,'Sum of elements of X is',F9.5) END PROGRAM f16elfe