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

      write (*,*)  ' Required Memory=',4.*float(N)**3/1024.**2,'Mb'
      sum = 0.
      Do j=1,N
      Do i=1,N
         Do k=1,N
            A(i,k,j) = ((i+j+k)/100.)
            sum =sum + A(i,k,j)**2
         EndDo 
      EndDo 
      EndDo 
      ind = 1
      Do iter=1,5
         write (*,*)  ' Iteration=',iter
      Do j=1,N
      Do i=1,N
         Do k=1,N
            ind = ind+1
            if(ind.gt.N)ind=ind-N
            A(i,k,j) = A(j,k,ind)+A(ind,k,j)+A(i,j,ind)
            sum =sum + A(i,k,j)**2
         EndDo 
      EndDo 
      EndDo 

      EndDo 
      write (*,*)  ' average=',sqrt(sum/N**2)
           stop
           end


