c-------------------------------------------------------------------- 
c                           test cpu
c-------------------------------------------------------------------- 
      parameter (N = 400 )
      COMMON /aa/ A(N,N,N)
      real*8    sum

CC SCHEDULE(DYNAMIC,500)
      sum = 0.
      call system_clock(i1,i2,i3)
      call cpu_time(t0)
C$OMP PARALLEL DO DEFAULT(SHARED)
C$OMP+PRIVATE (i,j,k)
C$OMP+REDUCTION(+:sum)
      Do k=1,N
      Do i=1,N
         Do j=1,N
            A(i,k,j) = exp(cos(k*0.11)+sin((i/10.d0)**2+(j/10.d0)**2))
            sum =sum + A(i,k,j)**2
         EndDo 
      EndDo 


      EndDo 
      call cpu_time(t1)
      call system_clock(i1b,i2b,i3b)

       write (*,'(2(a,g12.4))')  ' average=',sqrt(sum/N**2),
     &                                        ' cpu time=',t1-t0
       write(*,*) i1, i2, i3
       write(*,*) ' wall-clock dtime=',float(i1b-i1)/i2b
           stop
           end


