! (c) Copyright 2008 The Portland Group, Inc. (PGI)  All rights reserved.
! Licensed under terms described at http://www.pgroup.com/doc/ccff.xsd

      subroutine daxpy(n,a,x,y)
      real*8 a(n),x,y(n)
      do i = 1, n
        y(i) = a(i) * x + y(i)
      end do
      return
      end


      program daxpytest

      implicit none
      integer n, i
      parameter(n=50)
      real*8 a(n), y(n), x

      ! init
      x = 42.86
      do i=1, n
          a(i) = dble(i)
          y(i) = dble(i)
      enddo

      call daxpy(n, a, x, y)

      print *, 'result...'
      do i=1, n, 2
          print *, y(i), y(i+1)
      enddo

      end
