<!-- hamlet
<!-- copytar
examples/marray1.f                                                                                     644    1107     770         1127  5552345201   7517                                                                                                                                                                                                                                                                                                                                                                      C Illustrates two-dimensional arrays

C Created:  Joe Zachary, November 15, 1992
C Modified:


      PROGRAM TABLE1

      IMPLICIT NONE
      INTEGER ROW, COL, TABLE(9,9)

C First we create the multiplication table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLE(ROW,COL) = ROW*COL
         ENDDO
      ENDDO

C And next we print it out

      PRINT *, '      1  2  3  4  5  6  7  8  9'
      PRINT *, '   +---------------------------'

      DO ROW = 1, 9
         WRITE (UNIT=*, FMT=100) ROW, (TABLE(ROW,COL), COL=1,9)
      ENDDO

 100  FORMAT (I2,' |', 9I3)

      STOP
      END
 N>  cs367      7  cs376 n     cs431 n1    >  cs451 rt  0 6G  cs677  	  @ d>  cs506 L  P o+  cs507 d  ` 	d3  cs508 o-  p z  cs509 n1   
X  cs511 rt   n  cs531  	   D  cs537    C  cs539     D  cs541 gi   8  cs542      cs546     ɥ  cs547 n2    d%  cs100 rt   !e  cs561      *  cs562 5   0 	ӧ  cs565 @  @ .examples/marray2.f                                                                                     644    1107     770         2713  5552345341   7527                                                                                                                                                                                                                                                                                                                                                                      C Illustrates three-dimensional arrays

C Created:  Joe Zachary, November 15, 1992
C Modified:


      PROGRAM TABLE2

      IMPLICIT NONE
      INTEGER ROW, COL, TABLES(9,9,3)

C First we create the addition table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,1) = ROW+COL
         ENDDO
      ENDDO

C Next we create the subtraction table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,2) = ROW-COL
         ENDDO
      ENDDO

C Finally we create the multiplication table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,3) = ROW*COL
         ENDDO
      ENDDO


C Now we print out the three tables

      PRINT *, 'The addition table'
      PRINT *
      CALL PTABLE(TABLES, 1)

      PRINT *
      PRINT *, 'The subtraction table'
      PRINT *
      CALL PTABLE(TABLES, 2)

      PRINT *
      PRINT *, 'The multiplication table'
      PRINT *
      CALL PTABLE(TABLES, 3)

      STOP
      END


C Here's a subroutine to print out an arithmetic table.  Notice that
C the third index into the "table of tables" is passed as the
C second argument.

      SUBROUTINE PTABLE(TABLE, WHICH)

      IMPLICIT NONE
      INTEGER TABLE(9,9,*), WHICH
      INTEGER ROW, COL

      PRINT *, '      1  2  3  4  5  6  7  8  9'
      PRINT *, '   +---------------------------'

      DO ROW = 1, 9
         WRITE (UNIT=*, FMT=100) ROW, (TABLE(ROW,COL,WHICH), COL=1,9)
      ENDDO

 100  FORMAT (I2,' |', 9I3)

      END

  .mvclass ort      lsp       cs548 Wexamples/marray3.f                                                                                     644    1107     770         2317  5552345413   7530                                                                                                                                                                                                                                                                                                                                                                      C Illustrates array trickery

C Created:  Joe Zachary, November 15, 1992
C Modified:


      PROGRAM TABLE3

      IMPLICIT NONE
      INTEGER ROW, COL, TABLES(9,9,3)

C First we create the addition table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,1) = ROW+COL
         ENDDO
      ENDDO

C Next we create the subtraction table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,2) = ROW-COL
         ENDDO
      ENDDO

C Finally we create the multiplication table

      DO ROW = 1, 9
         DO COL = 1, 9
            TABLES(ROW,COL,3) = ROW*COL
         ENDDO
      ENDDO


C Now we print out the addition table

      PRINT *, 'The addition table'
      PRINT *
      CALL PTABLE(TABLES)

      STOP
      END


C Here's a subroutine to print out an arithmetic table.  Notice that
C the subroutine expects a 9x9 array as its only argument.

      SUBROUTINE PTABLE(TABLE)

      IMPLICIT NONE
      INTEGER TABLE(9,9)
      INTEGER ROW, COL

      PRINT *, '      1  2  3  4  5  6  7  8  9'
      PRINT *, '   +---------------------------'

      DO ROW = 1, 9
         WRITE (UNIT=*, FMT=100) ROW, (TABLE(ROW,COL), COL=1,9)
      ENDDO

 100  FORMAT (I2,' |', 9I3)

      END

ROW, COL

      PRINT *, '      1  2  3  4  5  6  7  8  9'
      PRINT *, '   +---------------------------'

      DO ROW = 1, 9
         WRITE (UNIT=*, FMT=100) ROW, (TABLE(ROW,COL,WHICH), COL=1,9)
      ENDDO

 100  FORMAT (I2,' |', 9I3)

      END

  .mvclass ort      lsp       cs548 W                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                