C
C     ..................................................................
C
C        SUBROUTINE DQHSG
C
C        PURPOSE
C           TO COMPUTE THE VECTOR OF INTEGRAL VALUES FOR A GIVEN
C           GENERAL TABLE OF ARGUMENT, FUNCTION, FIRST DERIVATIVE,
C           AND SECOND DERIVATIVE VALUES.
C
C        USAGE
C           CALL DQHSG (X,Y,FDY,SDY,Z,NDIM)
C
C        DESCRIPTION OF PARAMETERS
C           X      - DOUBLE PRECISION INPUT VECTOR OF ARGUMENT VALUES.
C           Y      - DOUBLE PRECISION INPUT VECTOR OF FUNCTION VALUES.
C           FDY    - DOUBLE PRECISION INPUT VECTOR OF FIRST DERIVATIVE.
C           SDY    - DOUBLE PRECISION INPUT VECTOR OF SECOND DERIVATIVE.
C           Z      - RESULTING DOUBLE PRECISION VECTOR OF INTEGRAL
C                    VALUES. Z MAY BE IDENTICAL WITH X, Y, FDY OR SDY.
C           NDIM   - THE DIMENSION OF VECTORS X,Y,FDY,SDY,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 HERMITEAN SIXTH ORDER INTEGRATION FORMULA.
C           FOR REFERENCE, SEE
C           R.ZURMUEHL, PRAKTISCHE MATHEMATIK FUER INGENIEURE UND
C           PHYSIKER, SPRINGER, BERLIN/GOETTINGEN/HEIDELBERG, 1963,
C           PP.227-230.
C
C     ..................................................................
C
      SUBROUTINE DQHSG(X,Y,FDY,SDY,Z,NDIM)
C
C
      DIMENSION X(1),Y(1),FDY(1),SDY(1),Z(1)
      DOUBLE PRECISION X,Y,FDY,SDY,Z,SUM1,SUM2
C
      SUM2=0.D0
      IF(NDIM-1)4,3,1
C
C     INTEGRATION LOOP
    1 DO 2 I=2,NDIM
      SUM1=SUM2
      SUM2=.5D0*(X(I)-X(I-1))
     0SUM2=SUM1+SUM2*((Y(I-1)+Y(I))+.4D0*SUM2*((FDY(I-1)-FDY(I))+
     1     .16666666666666667D0*SUM2*(SDY(I-1)+SDY(I))))
    2 Z(I-1)=SUM1
    3 Z(NDIM)=SUM2
    4 RETURN
      END
