1 subroutine qk21(f,a,b,result,abserr,resabs,resasc,ierr)
52 real a,absc,abserr,b,centr,dhlgth,epmach,fc,fsum,fval1,fval2,
53 * fv1,fv2,hlgth,resabs,resg,resk,reskh,result,r1mach,uflow,wg,wgk,
58 dimension fv1(10),fv2(10),wg(5),wgk(11),xgk(11)
74 data xgk(1),xgk(2),xgk(3),xgk(4),xgk(5),xgk(6),xgk(7),
75 * xgk(8),xgk(9),xgk(10),xgk(11)/
76 * 0.9956571630258081e+00, 0.9739065285171717e+00,
77 * 0.9301574913557082e+00, 0.8650633666889845e+00,
78 * 0.7808177265864169e+00, 0.6794095682990244e+00,
79 * 0.5627571346686047e+00, 0.4333953941292472e+00,
80 * 0.2943928627014602e+00, 0.1488743389816312e+00,
81 * 0.0000000000000000e+00/
83 data wgk(1),wgk(2),wgk(3),wgk(4),wgk(5),wgk(6),wgk(7),
84 * wgk(8),wgk(9),wgk(10),wgk(11)/
85 * 0.1169463886737187e-01, 0.3255816230796473e-01,
86 * 0.5475589657435200e-01, 0.7503967481091995e-01,
87 * 0.9312545458369761e-01, 0.1093871588022976e+00,
88 * 0.1234919762620659e+00, 0.1347092173114733e+00,
89 * 0.1427759385770601e+00, 0.1477391049013385e+00,
90 * 0.1494455540029169e+00/
92 data wg(1),wg(2),wg(3),wg(4),wg(5)/
93 * 0.6667134430868814e-01, 0.1494513491505806e+00,
94 * 0.2190863625159820e+00, 0.2692667193099964e+00,
95 * 0.2955242247147529e+00/
121 centr = 0.5e+00*(a+b)
122 hlgth = 0.5e+00*(b-a)
129 call f(centr, ierr, fc)
130 if (ierr .lt. 0)
return
135 absc = hlgth*xgk(jtw)
136 call f(centr-absc,ierr,fval1)
137 if (ierr .lt. 0)
return
138 call f(centr+absc,ierr,fval2)
139 if (ierr .lt. 0)
return
143 resg = resg+wg(j)*fsum
144 resk = resk+wgk(jtw)*fsum
145 resabs = resabs+wgk(jtw)*(
abs(fval1)+
abs(fval2))
149 absc = hlgth*xgk(jtwm1)
150 call f(centr-absc,ierr,fval1)
151 if (ierr .lt. 0)
return
152 call f(centr+absc,ierr,fval2)
153 if (ierr .lt. 0)
return
157 resk = resk+wgk(jtwm1)*fsum
158 resabs = resabs+wgk(jtwm1)*(
abs(fval1)+
abs(fval2))
161 resasc = wgk(11)*
abs(fc-reskh)
163 resasc = resasc+wgk(j)*(
abs(fv1(j)-reskh)+
abs(fv2(j)-reskh))
166 resabs = resabs*dhlgth
167 resasc = resasc*dhlgth
168 abserr =
abs((resk-resg)*hlgth)
169 if(resasc.ne.0.0e+00.and.abserr.ne.0.0e+00)
170 * abserr = resasc*amin1(0.1e+01,
171 * (0.2e+03*abserr/resasc)**1.5e+00)
172 if(resabs.gt.uflow/(0.5e+02*epmach)) abserr = amax1
173 * ((epmach*0.5e+02)*resabs,abserr)
subroutine qk21(f, a, b, result, abserr, resabs, resasc, ierr)