      integer i,j,n,m
      double precision u(4000,4000), L(4000,4000), sum
      data n/4000/, m/4000/

      do 5 j=1,M
      do 5 i=1,N
         u(i,j)=(i-1.0)*(i-1)+(j-1)*(j-1)
 5    continue

      do 12 k=1,10
      call laplace(L,n,m,u)
 12   continue

C      sum=0.0
C      do 15 j=1,M
C      do 15 i=1,N
C         sum=sum+L(i,j)
C 15   continue

C      write(*,*) sum
      stop
      end


      subroutine laplace(L,n,m,u)
      double precision L(n,m),u(n,m)
	  integer i,j,k
      do 10 j=2,M-1
      do 10 i=2,N-1
         L(i,j)=-u(i,j-1)-u(i-1,j)+4.0*u(i,j)-u(i+1,j)-u(i,j+1)
 10   continue
      return
      end
