Program f16gcfe

!     F16GCF Example Program Text

!     Mark 25 Release. NAG Copyright 2014.

!     .. Use Statements ..
      Use nag_library, Only: blas_zaxpby, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Complex (Kind=nag_wp)            :: alpha, beta
      Integer                          :: incx, incy, n, nx, ny
!     .. Local Arrays ..
      Complex (Kind=nag_wp), Allocatable :: x(:), y(:)
!     .. Intrinsic Procedures ..
      Intrinsic                        :: abs
!     .. Executable Statements ..
      Write (nout,*) 'F16GCF Example Program Results'

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

      Read (nin,*) n
      Read (nin,*) incx, incy

      nx = 1 + (n-1)*abs(incx)
      ny = 1 + (n-1)*abs(incy)
      Allocate (x(nx),y(ny))

      Read (nin,*) alpha, beta
      Read (nin,*) x(1:nx:abs(incx))
      Read (nin,*) y(1:ny:abs(incy))

!     Compute Y = alpha*X + beta*Y

      Call blas_zaxpby(n,alpha,x,incx,beta,y,incy)

      Write (nout,*)
      Write (nout,99999)
      Write (nout,99998) y(1:ny:abs(incy))

99999 Format (1X,'Result of scaled vector addition is')
99998 Format (1X,'Y = ( ',2('(',F9.4,',',F9.4,'), '),'(',F9.4,',',F9.4,') )')
    End Program f16gcfe