C
C     ..................................................................
C
C        SUBROUTINE DQTFE
C
C        PURPOSE
C           TO COMPUTE THE VECTOR OF INTEGRAL VALUES FOR A GIVEN
C           EQUIDISTANT TABLE OF FUNCTION VALUES.
C
C        USAGE
C           CALL DQTFE (H,Y,Z,NDIM)
C
C        DESCRIPTION OF PARAMETERS
C           H      - DOUBLE PRECISION INCREMENT OF ARGUMENT VALUES.
C           Y      - DOUBLE PRECISION INPUT VECTOR OF FUNCTION VALUES.
C           Z      - RESULTING DOUBLE PRECISION VECTOR OF INTEGRAL
C                    VALUES. Z MAY BE IDENTICAL WITH Y.
C           NDIM   - THE DIMENSION OF VECTORS Y AND Z.
C
C        REMARKS
C           NO ACTION IN CASE NDIM LESS THAN 1.
C
C        SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C           NONE
C
C        METHOD
C           BEGINNING WITH Z(1)=0, EVALUATION OF VECTOR Z IS DONE BY
C           MEANS OF TRAPEZOIDAL RULE (SECOND ORDER FORMULA).
C           FOR REFERENCE, SEE
C           F.B.HILDEBRAND, INTRODUCTION TO NUMERICAL ANALYSIS,
C           MCGRAW-HILL, NEW YORK/TORONTO/LONDON, 1956, PP.75.
C
C     ..................................................................
C
      SUBROUTINE DQTFE(H,Y,Z,NDIM)
C
C
      DIMENSION Y(1),Z(1)
      DOUBLE PRECISION Y,Z,H,HH,SUM1,SUM2
C
      SUM2=0.D0
      IF(NDIM-1)4,3,1
    1 HH=.5D0*H
C
C     INTEGRATION LOOP
      DO 2 I=2,NDIM
      SUM1=SUM2
      SUM2=SUM2+HH*(Y(I)+Y(I-1))
    2 Z(I-1)=SUM1
    3 Z(NDIM)=SUM2
    4 RETURN
      END
