Trailing-Edge
-
PDP-10 Archives
-
FORTRAN-10_V7wLink_Feb83
-
arrays.for
There are 11 other files named arrays.for in the archive. Click here to see a list.
PROGRAM ARRAYS
! This software is furnished under a license and may only be used
! or copied in accordance with the terms of such license.
! Copyright (C) Digital Equipment Corporation 1981, 1983
! Version 7 ARRAYS.FOR
! Basic test of arrays.
! Assignments are made to several arrays of different
! dimensions, then checked for their accuracy.
INTEGER IN(5),IIII(5,5)
REAL XX(5,5,5)
DOUBLE PRECISION DD(5)
DO 100 I=1,5 !Assignment
IN(I)=I
DD(I)=I+.0000000001
DO 200 J=1,5
IIII(I,J)=J+I
DO 300 K=1,5
XX(I,J,K)=IN(I)+K
300 CONTINUE
200 CONTINUE
100 CONTINUE
! Check assignments to the arrays
DO 500 I=1,5
IF (IN(I).NE.I) TYPE 710,I,IN(I),I
D=I+.0000000001
IF (DD(I).NE.(I+.0000000001)) TYPE 720,I,DD(I),D
DO 600 J=1,5
KK=J+I
IF (IIII(I,J).NE.KK) TYPE 730,I,J,IIII(I,J),KK
DO 700 K=1,5
KKK=IN(I)+K
IF (XX(I,J,K).NE.KKK) TYPE 740,
1 I,J,K,XX(I,J,K),KK
700 CONTINUE
600 CONTINUE
500 CONTINUE
710 FORMAT(' ?Error IN('I2')='I', should ='I2)
720 FORMAT(' ?Error DD('I2')='D', Should ='D)
730 FORMAT(' ?Error IIII('I2','I2')='I', should = 'I)
740 FORMAT(' ?Error DD('I2','I2','I2')='D', should = 'D)
STOP
END