C
      SUBROUTINE GAUSS1(FUNC,A,B,N,S,IER)
C
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION Y(6,12),X(6,12),AA(24),U(24)
     1,A1(19),A2(19),A3(19),A4(15)
     2,X1(19),X2(19),X3(19),X4(15)
      DIMENSION NAME$(2)
      EQUIVALENCE (Y(1),A1(1)),(Y(20),A2(1)),(Y(39),A3(1)),(Y(58),A4(1))
     1,           (X(1),X1(1)),(X(20),X2(1)),(X(39),X3(1)),(X(58),X4(1))
      DATA  X1    /               0.86113631159405260D+00
     1,  0.96028985649753620D+00, 0.98156063424671920D+00
     2,  0.98940093499164990D+00, 0.99312859918509490D+00
     3,  0.99518721999702140D+00, 0.33998104358485630D+00
     4,  0.79666647741362670D+00, 0.90411725637047490D+00
     5,  0.94457502307323260D+00, 0.96397192727791380D+00
     6,  0.97472855597130950D+00, 0.00000000000000000D-40
     7,  0.52553240991632900D+00, 0.76990267419430470D+00
     8,  0.86563120238783170D+00, 0.91223442825132590D+00
     9,  0.93827455200273280D+00, 0.00000000000000000D-40 /
      DATA  X2     /              0.18343464249564980D+00
     1,  0.58731795428661740D+00, 0.75540440835500300D+00
     2,  0.83911697182221880D+00, 0.88641552700440100D+00
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.36783149899818020D+00, 0.61787624440264370D+00
     5,  0.74633190646015080D+00, 0.82000198597390290D+00
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.12523340851146890D+00, 0.45801677765722740D+00
     8,  0.63605368072651500D+00, 0.74012419157855440D+00
     9,  0.00000000000000000D-40, 0.00000000000000000D-40 /
      DATA  X3     /              0.00000000000000000D-40
     1,  0.28160355077925890D+00, 0.51086700195082710D+00
     2,  0.64809365193697560D+00, 0.00000000000000000D-40
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.95012509837637440D-01, 0.37370608871541960D+00
     5,  0.54542147138883950D+00, 0.00000000000000000D-40
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.00000000000000000D-40, 0.22778585114164510D+00
     8,  0.43379350762604510D+00, 0.00000000000000000D-40
     9,  0.00000000000000000D-40, 0.00000000000000000D-40 /
      DATA  X4     /              0.51086700195082710D+00
     1,  0.76526521133497330D-01, 0.31504267969616340D+00
     2,  0.00000000000000000D-40, 0.00000000000000000D-40
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.00000000000000000D-40, 0.19111886747361630D+00
     5,  0.00000000000000000D-40, 0.00000000000000000D-40
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.00000000000000000D-40, 0.64056892862605620D-01 /
      DATA  A1    /               0.34785484513745390D+00
     1,  0.10122853629037630D+00, 0.47175336386511830D-01
     2,  0.27152459411754100D-01, 0.17614007139152120D-01
     3,  0.12341229799987200D-01, 0.65214515486254620D+00
     4,  0.22238103445337450D+00, 0.10693932599531840D+00
     5,  0.62253523938647890D-01, 0.40601429800386940D-01
     6,  0.28531388628933660D-01, 0.00000000000000000D-40
     7,  0.31370664587788730D+00, 0.16007832854334620D+00
     8,  0.95158511682492780D-01, 0.62672048334109070D-01
     9,  0.44277438817419810D-01, 0.00000000000000000D-40 /
      DATA  A2     /              0.36268378337836200D+00
     1,  0.20316742672306590D+00, 0.12462897125553390D+00
     2,  0.83276741576704750D-01, 0.59298584915436780D-01
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.23349253653835480D+00, 0.14959598881657670D+00
     5,  0.10193011981724040D+00, 0.73346481411080310D-01
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.24914704581340280D+00, 0.16915651939500250D+00
     8,  0.11819453196151840D+00, 0.86190161531953270D-01
     9,  0.00000000000000000D-40, 0.00000000000000000D-40 /
      DATA  A3     /              0.00000000000000000D-40
     1,  0.18260341504492360D+00, 0.13168863844917660D+00
     2,  0.97618652104113890D-01, 0.00000000000000000D-40
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.18945061045506850D+00, 0.14209610931838210D+00
     5,  0.10744427011596560D+00, 0.00000000000000000D-40
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.00000000000000000D-40, 0.14917298647260380D+00
     8,  0.11550566805372560D+00, 0.00000000000000000D-40
     9,  0.00000000000000000D-40, 0.00000000000000000D-40 /
      DATA  A4     /              0.13168863844917660D+00
     1,  0.15275338713072580D+00, 0.12167047292780340D+00
     2,  0.00000000000000000D-40, 0.00000000000000000D-40
     3,  0.00000000000000000D-40, 0.00000000000000000D-40
     4,  0.00000000000000000D-40, 0.12583745634682830D+00
     5,  0.00000000000000000D-40, 0.00000000000000000D-40
     6,  0.00000000000000000D-40, 0.00000000000000000D-40
     7,  0.00000000000000000D-40, 0.12793819534675220D+00 /
C
      DATA NAME$ /4H$DQB,4HGM  /
      IER=0
      K=N
      IF(N-1) 600,100,100
  100 IF(N-6) 200,200,600
  200 NN=4*N
      C1=(B+A)/2.D0
      C2=(B-A)/2.D0
      N2=N+N
      DO 1 J=1,N2
      U(J)=C1-C2*X(N,J)
      U(NN-J+1)  = C1+C2*X(N,J)
      AA(J)=Y(N,J)
    1 AA(NN-J+1) = Y(N,J)
      S=0.D0
      DO 2 J=1,NN
    2 S=S+AA(J)*FUNC(U(J))
      S=C2*S
      N=K
      RETURN
  600 N=6
      GO TO 200
      END
