      PROGRAM PROB01
C
C     PROBLEM 1
C
C  REFERENCE:  PROBLEMS TO TEST PARALLEL AND VECTOR LANGUAGES
C              CSD-TR 516, COMPUTER SCIENCE, PURDUE UNIVERSITY
C              JOHN R. RICE, MAY 1, 1985
C
C              REVISED BY JOHN R. RICE AND J. JING, OCT. 1, 1990
C
C
C      *************************************************
C      *      Adapted for FORTRAN D benchmarking       *
C      *    by  T. HAUPT  (haupt@sccs.npac.syr.edu)    *
C      *                                               *
C      *    Northeast Parallel Architectures Center    *
C      *   at Syracuse University, Syracuse, NY, USA   *
C      *************************************************
C
C
C       VERSION SIMD/DECmpp-1.00
C       ==================================================
C
      INTEGER KASES,K,NK
      PARAMETER (KASES=6)
      INTEGER N(KASES)
      REAL TN
      REAL A,B,H
      DATA A,B / 0.0,1.0 /
      DATA N /  8192, 65536,
     X          131072, 262144, 524288, 1048576/
      INTEGER ITIME
      REAL TIME
C
C               LOOP OVER KASES
C
      DO  K = 1, KASES
         NK=N(K)
      CALL mpTIMERstart()
         DO MANY=1,100

         H = (B-A)/(NK-1)
         CALL DOIT(NK-1,A,H,TN)
         TN = H*((EXP(A)+EXP(B))/2.+TN)

         ENDDO
      ITIME=mpTIMERelapsed()

         PRINT 30,A,B,NK
   30    FORMAT ('PROBLEM 1 WITH A,B,N = ',2F10.3,5X,I8)
         PRINT 40,TN
   40    FORMAT ('GIVES TN =',F10.6)

      TIME=FLOAT(ITIME)/1000
      PRINT *, 'DECmpp ELAPSED TIME:',TIME,' SECONDS'

      ENDDO

      STOP
      END



      SUBROUTINE DOIT(N,A,H,FSUM)
      INTEGER N
      REAL A,H,FSUM
      FSUM=SUM(EXP(A+H*[1:N]))

      RETURN
      END
