C
C     ..................................................................
C
C        SUBROUTINE DQG12
C
C        PURPOSE
C           TO COMPUTE INTEGRAL(FCT(X), SUMMED OVER X FROM XL TO XU)
C
C        USAGE
C           CALL DQG12 (XL,XU,FCT,Y)
C           PARAMETER FCT REQUIRES AN EXTERNAL STATEMENT
C
C        DESCRIPTION OF PARAMETERS
C           XL     - DOUBLE PRECISION LOWER BOUND OF THE INTERVAL.
C           XU     - DOUBLE PRECISION UPPER BOUND OF THE INTERVAL.
C           FCT    - THE NAME OF AN EXTERNAL DOUBLE PRECISION FUNCTION
C                    SUBPROGRAM USED.
C           Y      - THE RESULTING DOUBLE PRECISION INTEGRAL VALUE.
C
C        REMARKS
C           NONE
C
C        SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C           THE EXTERNAL DOUBLE PRECISION FUNCTION SUBPROGRAM FCT(X)
C           MUST BE FURNISHED BY THE USER.
C
C        METHOD
C           EVALUATION IS DONE BY MEANS OF 12-POINT GAUSS QUADRATURE
C           FORMULA, WHICH INTEGRATES POLYNOMIALS UP TO DEGREE 23
C           EXACTLY. FOR REFERENCE, SEE
C           V.I.KRYLOV, APPROXIMATE CALCULATION OF INTEGRALS,
C           MACMILLAN, NEW YORK/LONDON, 1962, PP.100-111 AND 337-340.
C
C     ..................................................................
C
      SUBROUTINE DQG12(XL,XU,FCT,Y)
C
C
      DOUBLE PRECISION XL,XU,Y,A,B,C,FCT
C
      A=.5D0*(XU+XL)
      B=XU-XL
      C=.49078031712335963D0*B
      Y=.23587668193255914D-1*(FCT(A+C)+FCT(A-C))
      C=.45205862818523743D0*B
      Y=Y+.53469662997659215D-1*(FCT(A+C)+FCT(A-C))
      C=.38495133709715234D0*B
      Y=Y+.8003916427167311D-1*(FCT(A+C)+FCT(A-C))
      C=.29365897714330872D0*B
      Y=Y+.10158371336153296D0*(FCT(A+C)+FCT(A-C))
      C=.18391574949909010D0*B
      Y=Y+.11674626826917740D0*(FCT(A+C)+FCT(A-C))
      C=.62616704255734458D-1*B
      Y=B*(Y+.12457352290670139D0*(FCT(A+C)+FCT(A-C)))
      RETURN
      END
