      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 F90D-1.00
C       ==================================================
C
      INTEGER N,NPROC0 
      PARAMETER (NPROC0=4)
      PARAMETER (N=8192)
      REAL TN
      REAL A,B,H,FSUM
      DATA A,B / 0.0,1.0 /

      REAL, ARRAY(N) :: FX

C$      DECOMPOSITION XX(8192)
C$      DISTRIBUTE XX(CYCLIC)  
C$      ALIGN FX(I) WITH XX(I)

      H = (B-A)/(N-1)
      FX=EXP(A+H*[1:N]) 
      FSUM=SUM(FX)
      TN = H*((EXP(A)+EXP(B))/2.+TN)
 
      PRINT 30,A,B
   30 FORMAT ('PROBLEM 1 WITH A,B,N = ',2F10.3,5X)
      PRINT 40,TN
   40 FORMAT ('GIVES TN =',F10.6)
      write(6,*) 'the right answer is: 1.718 +/- 0.001'

      STOP
      END


