c===========================================================
c     Program to test understanding of Fortran 77 array
c     storage scheme.
c===========================================================
      program     t2d

      implicit    none

      integer     n
      parameter ( n = 3 )

      real*8      a(n,n),   aij
      integer     i,        j

      aij = 0.0d0
      do i = 1 , n
         do j = 1 , n
            aij = aij + 1.0d0
            a(i,j) = aij
         end do
      end do

      write(0,*) 'main: a(2,2) = ', a(2,2)

      call sub(a,2,2)

      stop

      end

      subroutine sub(a,n,m)

         implicit      none
         integer       n,      m
         real*8        a(n,m)

         write(0,*) 'sub: a(2,2) = ', a(2,2)

         return

      end
