      PROGRAM BENCH2
C      (INPUT,OUTPUT,TAPE5=INPUT,TAPE6=OUTPUT)
C----------------------------------------------------------------------C
C            P O W E R  S H A P E  M O N I T O R I N G  S Y S T E M    C
C                                                                      C
C  BENCHMARK NUMBER  TWO                                               C
C                                                                      C
C  THIS BENCHMARK TESTS ANY LOCAL OR GLOBAL OPTIMIZATION OF            C
C  THE FORTRAN COMPILER                                                C
C                                                                      C
C  THIS BENCHMARK USED TO EVALUATE MINICOMPUTER PERFORMANCES FOR       C
C  POSSIBLE APPLICATION TO THE POWER SHAPE MONITORING SYSTEM BEING     C
C  DEVELOPED BY NUCLEAR SERVICES CORPORATION FOR THE ELECTRIC POWER    C
C  RESEARCH INSTITUTE UNDER PROJECT RP-895                             C
C                                                                      C
C----------------------------------------------------------------------C
C                                                                      C
      DIMENSION BUF ( 1000 )
	CALL HEADER(' BENCHMARK NSC2')
      DO 10 I = 1 , 1000
10    BUF ( I ) = 1001.0 - I
C
C
      WRITE (06 , 20 )
20    FORMAT (1H0,24HSTART OF REAL CALC TIME )
      TIME1=SECNDS(0.)
C     WRITE (6,30)TIME1
C 30    FORMAT(1X,/,' CPU TIME IS  ',F10.4)
      DO 40 L = 1 , 10
      DO 40 I = 1 , 32766
40    CALC = 2.2 * BUF (1000) / 113.3 + ( 999. - BUF (500) )
      TIME2=SECNDS(0.)
      CALL TIMER(TIME1,TIME2)
      WRITE (06 , 50  )
50    FORMAT (1H0,22HEND OF REAL CALC TIME )
C
C
      WRITE (06 , 60 )
60    FORMAT (1H0,27HSTART OF INTEGER CALC TIME )
      TIME3=SECNDS(0.)
C     WRITE(06,30)TIME3
      IT = 512
      DO 70 L = 1 , 10
      DO 70 I = 1 , 32766
      INTEG = 16 * 4
      ID = 256 / 4
70    ITEMP = 16 * IT / 2 + ( 8 - 3 )
      TIME4=SECNDS(0.)
      CALL TIMER(TIME3,TIME4)
      WRITE (06 , 80  )
80    FORMAT (1H0,25HEND OF INTEGER CALC TIME )
      WRITE (06 , 90 ) BUF ( 1 ) , BUF ( 500  ) , BUF (1000)
90    FORMAT (1X,3(F7.1,2X))
      WRITE (06 , 100 ) CALC , INTEG , ID , ITEMP
100   FORMAT (1X,F13.5,3(I6))
      STOP
      END
      SUBROUTINE TIMER(TIME1,TIME2)
      DELTA = TIME2 - TIME1
C
C  WRITE OUT TIMING RESULTS
C
      WRITE(06,10) TIME1 , TIME2 , DELTA
10    FORMAT(' BEGIN TIME = ' ,F12.6,' END TIME = ',F12.6
     1 , ' DIFFERENCE = ' , F12.6 )
      RETURN
      END

80    FORMAT (1H0,25HEND OF INTEGER CALC TIME )
      WRITE (06 , 90 ) BUF ( 1 ) , BUF ( 500  ) , BUF (1000)
90    FORMAT (1X,3(F7.1,2X))
      WRITE (06 , 100 ) CALC , INTEG , ID , ITEMP
100   FORMAT (1X,F13.5,3(I6))
      STOP
      END
      SUBROUTINE TIMER(TIME1,TIME2)
      DELTA = TIME2 - TIME1
C
C  WRITE OUT TIMING RESULTS
C
      WRITE(06,10) TIME1 , TIME2 , DELTA
10    FORMAT(' BEGIN TIME = ' ,F12.6,' END TIME = ',F12.6
     1 , ' DIFFERENCE = ' , F12.6 )
      R