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,      m 
      parameter ( n = 3,  m = 4 )

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

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