      PROGRAM PROB03
C
C     PROBLEM 3
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,NK,MK
      PARAMETER (KASES=3)
      INTEGER N(KASES),M(KASES)
      DATA N / 64,512,1024 /
      DATA M /128,128,1024 /

      REAL S

      INTEGER ITIME
      REAL TIME

      DO 50 K = 1, KASES

      CALL mpTIMERstart()

      DO MANY=1,50

      NK=N(K)
      MK=M(K)
         CALL DOIT(NK,MK,S)


      ENDDO

      ITIME=mpTIMERelapsed()

      PRINT 60, N(K),M(K)
  60  FORMAT ('PROBLEM 3 WITH N,M =',I6,2X,I6)
      PRINT *,'GIVES S =',S

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

   50 CONTINUE
      STOP
      END

      SUBROUTINE DOIT(NK,MK,S)
      INTEGER NK,MK
      REAL S

      REAL, ARRAY(NK,MK) :: A

C
C      intitialization
C
      A=1.0001

C
C     computation
C
      S=SUM(PRODUCT(A,DIM=2))

      RETURN
      END

