      PROGRAM NASKER
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C   NAS KERNEL BENCHMARK PROGRAM
C   12/17/84      DAVID H BAILEY
C
      CHARACTER*8 PN(8)
      DOUBLE PRECISION ER(8), FP(8), TM(8), RT(8)
      COMMON /ARRAYS/ DATA(360000)
      external MXMTST,FFTTST,CHOTST,BTRTST,GMTTST,EMITST,VPETST
      DATA PN/'MXM', 'CFFT2D', 'CHOLSKY', 'BTRIX', 'GMTRY', 'EMIT',
     $ 'VPENTA', 'TOTAL'/
C
      WRITE (6, 1)
1     FORMAT (/16X, 'THE NAS KERNEL BENCHMARK PROGRAM'//)
C
      call initim()
      do 123 i=1,7
         write(6,*) 'Running ',PN(i),' ...'
         if (i.eq.1) call runit(MXMTST,er(i),fp(i),tm(i))
         if (i.eq.2) call runit(FFTTST,er(i),fp(i),tm(i))
         if (i.eq.3) call runit(CHOTST,er(i),fp(i),tm(i))
         if (i.eq.4) call runit(BTRTST,er(i),fp(i),tm(i))
         if (i.eq.5) call runit(GMTTST,er(i),fp(i),tm(i))
         if (i.eq.6) call runit(EMITST,er(i),fp(i),tm(i))
         if (i.eq.7) call runit(VPETST,er(i),fp(i),tm(i))
         RT(I) = 1E-6 * FP(I) / TM(I)
         write(6,2000) PN(I)//': ',TM(I),' secs,',RT(I),' Mflop/s'
 2000    format(1x,a,f15.4,a,f10.2,a)
         call shotim()
 123  continue

C
      TE = 0.
      TF = 0.
      TT = 0.
      DO 100 I = 1, 7
        TE = TE + ER(I)
        TF = TF + FP(I)
        TT = TT + TM(I)
        RT(I) = 1E-6 * FP(I) / TM(I)
100   CONTINUE
      ER(8) = TE
      FP(8) = TF
      TM(8) = TT
      RT(8) = 1E-6 * TF / TT
C
      WRITE (6, 2)  (PN(I), ER(I), FP(I), TM(I), RT(I), I = 1, 8)
2     FORMAT (' PROGRAM', 8X, 'ERROR', 10X, 'FP OPS', 7X, 'SECONDS',
     $  6X, 'MFLOPS'// 7(1X, A8, 1P2E15.4, 0PF12.4, F12.2/)/
     $  1X, A8, 1P2E15.4, 0PF12.4, F12.2//)
C
      STOP
      END
c
      subroutine runit(routin,er,fp,tm)
      external routin
      DOUBLE PRECISION er,fp,tm
      call routin(er,fp,tm)
      end
