c===========================================================
c     Program to test understanding of Fortran 77 array
c     storage scheme.
c
c     EXERCISE:  Predict program output.
c===========================================================
      program     t2d

      implicit    none

      integer     n
      parameter ( n = 3 )

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

      do j = 1 , n
         do i = 1 , n
            a(i,j) = 100.0d0 * j + i
         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
