1! { dg-do compile }
2! { dg-options "-Ofast" }
3
4      subroutine foo(U,V,R,N,A)
5      integer N
6      real*8 U(N,N,N),V(N,N,N),R(N,N,N),A(0:3)
7      integer I3, I2, I1
8C
9      do I3=2,N-1
10       do I2=2,N-1
11        do I1=2,N-1
12         R(I1,I2,I3)=V(I1,I2,I3)
13     *      -A(0)*( U(I1,  I2,  I3  ) )
14     *      -A(1)*( U(I1-1,I2,  I3  ) + U(I1+1,I2,  I3  )
15     *                 +  U(I1,  I2-1,I3  ) + U(I1,  I2+1,I3  )
16     *                 +  U(I1,  I2,  I3-1) + U(I1,  I2,  I3+1) )
17     *      -A(2)*( U(I1-1,I2-1,I3  ) + U(I1+1,I2-1,I3  )
18     *                 +  U(I1-1,I2+1,I3  ) + U(I1+1,I2+1,I3  )
19     *                 +  U(I1,  I2-1,I3-1) + U(I1,  I2+1,I3-1)
20     *                 +  U(I1,  I2-1,I3+1) + U(I1,  I2+1,I3+1)
21     *                 +  U(I1-1,I2,  I3-1) + U(I1-1,I2,  I3+1)
22     *                 +  U(I1+1,I2,  I3-1) + U(I1+1,I2,  I3+1) )
23     *      -A(3)*( U(I1-1,I2-1,I3-1) + U(I1+1,I2-1,I3-1)
24     *                 +  U(I1-1,I2+1,I3-1) + U(I1+1,I2+1,I3-1)
25     *                 +  U(I1-1,I2-1,I3+1) + U(I1+1,I2-1,I3+1)
26     *                 +  U(I1-1,I2+1,I3+1) + U(I1+1,I2+1,I3+1) )
27        enddo
28       enddo
29      enddo
30      return
31      end
32
33