4 SUBROUTINE gadap2(A0,B0,FL,FU,F,EPS,SUM)
27 common/gadap1/
num,ifu
32 REAL aa,bb,f1f,f2f,f3f
33 REAL a0,b0,fl,fu,f,
eps,sum,a,b,f1,
f2,f3,
s
34 REAL dsum,red,
c,
x,ay,by,w1,u2,ss,sold
37 dimension a(300),b(300),f1(300),
f2(300),f3(300),
s(300),
n(300)
38 1
FORMAT(16h
gadap:i too big)
39 dsum(f1f,f2f,f3f,aa,bb)=5./18.*(bb-aa)*(f1f+1.6*f2f+f3f)
40 IF(
eps.LT.1.0e-8)
eps=1.0e-8
48 x=0.5*(1+
c)*a0+0.5*(1-
c)*b0
56 x=0.5*(1-
c)*a0+0.5*(1+
c)*b0
61 s(1)= dsum(f1(1),
f2(1),f3(1),a0,b0)
66 a(i+1)=a(i)+
c*(b(i)-a(i))
68 a(i+2)=a(i)+b(i)-a(i+1)
72 w1=a(i)+(b(i)-a(i))/5.
73 u2=2.*w1-(a(i)+a(i+2))/2.
102 IF(ifu.GT.5000) goto 130
103 s(i+1)= dsum(f1(i+1),
f2(i+1),f3(i+1),a(i+1),b(i+1))
104 s(i+2)= dsum(f1(i+2),
f2(i+2),f3(i+2),a(i+2),b(i+2))
105 s(i+3)= dsum(f1(i+3),
f2(i+3),f3(i+3),a(i+3),b(i+3))
106 ss=
s(i+1)+
s(i+2)+
s(i+3)
110 IF(abs(sold-ss).GT.
eps*(1.+abs(ss))/2.) goto 100
119 IF(
n(l).NE.0) goto 100