      PROGRAM CCA8
C
C BENCHMARK CCA8, FOPR01, BIT TEST
C CENTRAL COMPUTER AGENCY PROGRAM FOPR01
C BENCHMARK = BIT TEST   IN NPL REPORT NAC62
C--------------------------------------------------------
C LAWRENCE LIVERMORE LAB. MODIFICATION OF NPL BENCHMARK
C MODIFIED FOR AUTOMATIC TIMING OF BENCHMARK
C  USER  SHALL MODIFY THIS PROGRAM IN THE AREAS INDICATED
C TO PROVIDE AUTOMATIC TIMING. (SEE BELOW)
C  USER  SHALL RUN THIS BENCHMARK TWICE,
C ONCE WITH LOGICAL UNIT 6 SET TO A NULL DEVICE
C AND ONCE WITH LOGICAL UNIT 6 SET TO A PRINTING DEVICE.
C LOGICAL UNIT 7 SHALL ALWAYS BE SET TO A PRINTING DEVICE.
C--------------------------------------------------------
C THIS PROGRAM HAS THREE PARAMETERS, IB, IC AND NB
C SET IC=15, IB=20 AND NB=3 FOR MACHINE 1/10 POWER OF 360/65
C SET IC=31, IB=64 AND NB=15 FOR MACHINE TEN TIMES 360/65
C THE DIMENSION OF THE ARRAY IA SHOULD BE SET TO IB
      DIMENSION IA(64,64)
C------------------------------------------------------------
C  USER  SHALL MODIFY THIS TO SET "STIME" TO A REFERENCE TIME
C IN SECONDS (ACCURATE TO AT LEAST ONE SECOND).
C-------------------------------------------------------------
      STIME=SECNDS(0.0)
      IB = 64
      ID=1
      NA=2
      NB=3
      DO 200 K=1,NB
      KK=K/2*2-K
      WRITE(6,99)KK
   99 FORMAT(I6)
      IC = 31
      IE=IC-1
      DO 120 N=1,IC
      M=N-1
      WRITE(6,99)M
      DO 100 JJ=1,NA
      DO 100 J=1,IB
      DO 100 I=1,IB
      IA(I,J)=KK
  100 CONTINUE
      DO 110 J=1,IB
      DO 110 I=1,IB
      MM=2**M+1
      MM=MM*ID
      IA(I,J)=MM+KK
      M=M+1
      IF(M-IE)110,110,105
  105 M=0
  110 CONTINUE
      DO 120 JJ=1,NA
      M=N-1
      DO 120 J=1,IB
      DO 120 I=1,IB
      MM=2**M+1
      MM=MM*ID+KK
      IF(IA(I,J)-MM)128,130,128
  128 WRITE(6,129)I,J,IA(I,J),MM
  129 FORMAT(2H I,I4,2H J,I4,2X,3HWAS,I10,2X,8HEXPECTED,I10)
  130 M=M+1
      IF(M-IE)120,120,125
  125 M=0
  120 CONTINUE
      IF(ID)145,145,140
  140 ID=-1
      GO TO 200
  145 ID=1
  200 CONTINUE
C------------------------------------------------------------
C  USER  SHALL MODIFY THIS TO SET "TTIME" TO TOTAL AMOUNT OF
C ELAPSED TIME SINCE "STIME" IN SECONDS.
C-------------------------------------------------------------
      TTIME=SECNDS(STIME)
C LLL MODIFICATION TO PRINT TOTAL ELAPSED TIME OF BENCHMARK
      TTIME = TTIME/60.0
      WRITE(6,1000)TTIME
1000  FORMAT(' BENCHMARK 8 EXECUTION TIME IS ',F8.4,' MINUTES')
C--------------------------------------------------------------
      STOP
      END
