          program AA
C         =======================================================
C         array assignments kernel
C         taken from the Livermore Loops, kernel 9
C         =======================================================
C         please send comments to haupt@npac.syr.edu

          parameter ( N = 100000 )
          real PX(13,N), Q
          real DM22, DM23, DM24, DM25, DM26, DM27, DM28, C0
          integer i, k, it, nit
          data nit /23/
CHPF$     processors p(8)
CHPF$     template d(N)
CHPF$     distribute d(block) onto p
CHPF$     align PX(*,I) with d(I)

C          start_timer

C      Initialise the arrays and scalars
           DM22 = 1.0
           DM23 = 2.5
           DM24 = 0.11
           DM25 = 0.25
           DM26 = 2.6
           DM27 = 0.2
           DM28 = 10.0
           C0   = 0.5
           FORALL(I=1:13,J=1:N) PX(I,J) = I+1.E-07*J

           DO IT=1,NIT
C***************************************************************************
C***  KERNEL 9      INTEGRATE PREDICTORS
C***************************************************************************
C
C
	    FORALL ( i = 1:N ) 
     *  PX(1,i) =      DM28 * PX(13,i) + DM27 * PX(12,i) + 
     *                 DM26 * PX(11,i) + DM25 * PX(10,i) +
     *                 DM24 * PX(9,i)  + DM23 * PX(8,i)  +
     *                 DM22 * PX(7,i)  + C0 * (PX(5,i)  + 
     *                 PX(6,i))        + PX(3,i) 
C
C***************************************************************************
          ENDDO
C
C         stop_timer

      print *,' ' 
      print *,'*******************************'
      print *,'         PARKBENCH '
      print *,' LOW LEVEL HPF BENCHMARK SUITE'
      print *,'         AA  KERNEL'
      print *,' PROBLEM SIZE: N =', N
      print *,' FINAL RESULT = ', PX(1,N/2)
      print *,' EXPECTED VALUE FOR SIZE 1000000' 
      print *,' IS  200.083 +/- 0.001'
      print *,'*******************************'

c     print execution time

      STOP
      END






