1 REAL*8 FUNCTION s21bbf(X, Y, Z, IFAIL)
85 REAL*8 acc, c1, c2, c3, cxn, cyn, czn, e2, e3, lamda, lolim,
87 * mu, rscale, rtx, rty, rtz, uplim, xn, yn, zn
103 sqrt(xarg)=dsqrt(xarg)
157 IF (yn.LE.zn) go to 60
163 IF (xn.LE.yn) go to 60
175 IF (xn.LT.0.0) go to 180
179 IF (yn.LE.0.0) go to 180
191 lolim = 16.0*
x02abf(0.0d0)
195 uplim = 0.0625*
x02acf(0.0d0)
201 IF (zn.LE.uplim) go to 120
207 IF (yn.LE.lolim) go to 80
211 IF (xn.LE.lolim) go to 100
217 80 lamda = (sqrt(xn)+sqrt(yn))*(sqrt(zn)*0.25)
231 lamda = rtz*rty + ((rtz+rty)*0.25)*sqrt(xn)
241 120
IF (zn.GT.lolim) go to 140
255 140 mu = (xn+yn+zn)/3.0
257 czn = 2.0 - (zn+mu)/mu
259 cxn = 2.0 - (xn+mu)/mu
261 IF (dmax1(cxn,-czn).LE.acc) go to 160
269 lamda = rtz*(rtx+rty) + rtx*rty
291 e2 = cxn*cyn - czn*czn
297 s21bbf = rscale*(1.0+(c1*e2-0.1-c2*e3)*e2+c3*e3)/sqrt(mu)
305 180 ifail =
p01aae(ifail,ind,srname)
401 REAL*8 acc, c1, c2, c3, c4, c5, c6, cxn, cyn, czn, ea, eb, ec,
403 * ed, ef, lamda, lolim, mu, pow4, rtx, rty, rtz, sigma, uplim,
421 sqrt(xarg)=dsqrt(xarg)
463 IF (x.LT.0.0 .OR. y.LT.0.0 .OR. x+y.EQ.0.0) go to 60
467 IF (z.LE.0.0) go to 60
473 lolim = 2.0/
x02acf(0.0d0)**0.66667
475 IF (dmin1(x+y,z).LT.lolim) go to 60
481 uplim = (0.1*acc/
x02abf(0.0d0))**0.66667
483 IF (dmax1(x,y,z).GE.uplim) go to 60
505 20 mu = (xn+yn+3.0*zn)*0.2
513 IF (dmax1(abs(cxn),abs(cyn),abs(czn)).LT.acc) go to 40
521 lamda = rtx*rty + rty*rtz + rtz*rtx
525 sigma = sigma + pow4/(rtz*zn)
565 s21bcf = 3.0*sigma + pow4*(1.0+ef*(c2*ef-c1-c3*ec*czn)+czn*
567 * (c4*ec+czn*(czn*c6*ea-c5*ed)))/(mu*sqrt(mu))
575 60 ifail =
p01aae(ifail,ind,srname)
585 INTEGER FUNCTION p01aae(IFAIL, ERROR, SRNAME)
599 INTEGER error, ifail, nout
609 IF (error.EQ.0) go to 20
617 IF (mod(ifail,10).EQ.1) go to 10
621 WRITE (nout,99999) srname, error
631 10
IF (mod(ifail/10,10).EQ.0) go to 20
633 WRITE (nout,99999) srname, error
639 99999
FORMAT (1h0, 38herror detected by nag library routine , a8,
641 * 11h - ifail = , i5//)
771 IF (i.EQ.0) nerr = nerr1
773 IF (i.EQ.1) nerr1 = nerr
781 SUBROUTINE f02aff(A, IA, N, RR, RI, INTGER, LFAIL)
797 INTEGER p01aae, isave, lfail, n, ia, intger(n)
801 REAL*8 acc, xxxx, a(ia,n), rr(n), ri(n),
x02aae
803 DATA srname /
' F02AFE'/
811 CALL
f01akf(n, 1, n, a, ia, intger)
813 CALL
f02apf(n, acc, a, ia, rr, ri, intger, lfail)
815 IF (lfail.NE.0) lfail =
p01aae(isave,lfail,srname)
823 SUBROUTINE f02apf(NN, ACC, H, IH, WR, WI, ICNT, LFAIL)
861 INTEGER p01aae, isave, lfail, n, nn, its, na, l, ll, i, m,
863 * n2, mm, m2, m3, k, j, ih, icnt(nn), nhs, itn
867 REAL*8 t, acc, x, y, w, s, z, r,
p, q, h(ih,nn), wr(nn), wi(nn)
873 DATA srname /
' F02APE'/
895 norm = norm + abs(h(i,j))
903 nhs = n*(n+1)/2 + n - 1
905 20
IF (n.EQ.0) go to 600
921 s = abs(h(l-1,l-1)) + abs(h(l,l))
923 IF (s.LT.
x02ade(0.0d0)) s = norm/float(nhs)
925 IF (abs(h(l,l-1)).LE.acc*s) go to 100
933 IF (l.EQ.n) go to 520
939 IF (l.EQ.na) go to 540
941 IF (itn.GT.0) go to 120
943 lfail =
p01aae(isave,1,srname)
947 120
IF ((its.EQ.10) .OR. (its.EQ.20)) go to 140
955 IF (na.LT.1) go to 180
965 s = abs(h(n,na)) + abs(h(na,n-2))
979 IF (l.GT.(n-2)) go to 240
995 p = (r*s-w)/h(m+1,m) + h(m,m+1)
997 q = h(m+1,m+1) - z - r - s
1001 s = abs(
p) + abs(q) + abs(r)
1009 IF (m.EQ.l) go to 240
1011 IF ((abs(h(m,m-1))*(abs(q)+abs(r))).LE.(acc*abs(
p)*
1013 * (abs(h(m-1,m-1))+abs(z)+abs(h(m+1,m+1))))) go to 240
1019 IF (m2.GT.n) go to 280
1029 IF (m3.GT.n) go to 320
1037 320
IF (m.GT.na) go to 40
1045 IF (k.EQ.na) notlst = .false.
1047 IF (k.EQ.m) go to 340
1055 IF (notlst) r = h(k+2,k-1)
1057 x = abs(
p) + abs(q) + abs(r)
1059 IF (x.EQ.0.0) go to 500
1067 340 s = sqrt(
p**2+q**2+r**2)
1069 IF (
p.LT.0.0) s = -s
1071 IF (k.NE.m) go to 360
1073 IF (l.NE.m) h(k,k-1) = -h(k,k-1)
1091 IF (k.GT.n) go to 440
1097 p = h(k,j) + q*h(k+1,j)
1099 IF (.NOT.notlst) go to 400
1103 h(k+2,j) = h(k+2,j) -
p*z
1105 400 h(k+1,j) = h(k+1,j) -
p*y
1107 h(k,j) = h(k,j) -
p*x
1113 IF ((k+3).LT.n) j = k + 3
1115 IF (l.GT.j) go to 500
1121 p = x*h(i,k) + y*h(i,k+1)
1123 IF (.NOT.notlst) go to 460
1127 h(i,k+2) = h(i,k+2) -
p*r
1129 460 h(i,k+1) = h(i,k+1) -
p*q
1165 IF (q.GT.0.0) go to 560
1181 560
IF (
p.LT.0.0) y = -y
1239 INTEGER ifail1, k1, k, l, j, m, i, n, j1, ia, ij, intger(n)
1241 REAL*8 x, y, d2, a(ia,n)
1255 IF (j.GT.l) go to 120
1259 IF (abs(a(i,j-1)).LE.abs(x)) go to 20
1269 IF (m.EQ.j) go to 80
1293 80
IF (x.EQ.0.0) go to 120
1295 IF (j.EQ.l) go to 120
1301 a(i,j-1) = a(i,j-1)/x
1311 IF (x.EQ.0.0) go to 140
1313 IF (j.GE.l) go to 140
1317 CALL
x03aaf(a(i,j1), (n-j)*ia-i+1, a(j1,j-1),
1319 * (n-j+2)*ia-j, l-j, ia, 1, y, d2, y, d2, .true., ifail1)
1323 IF (i.LE.j) ij = i - 1
1329 IF ((k+1).GT.ij) go to 160
1331 CALL
x03aaf(a(i,k), (n-k+1)*ia-i+1, a(k1,j),
1333 * (n-j+1)*ia-k, ij-k, ia, 1, y, d2, y, d2, .true.,
1353 SUBROUTINE x03aaf(A, ISIZEA, B, ISIZEB, N, ISTEPA, ISTEPB,
1355 * c1, c2, d1, d2, sw, ifail)
1373 INTEGER p01aae, isave, isizea, isizeb, istepa, istepb, ifail,
1377 DOUBLE PRECISION sum
1385 REAL*8 a(isizea), b(isizeb), c1, c2, d1, d2, x
1389 DATA srname /8h x03aae /
1395 IF (istepa.GT.0 .AND. istepb.GT.0) go to 20
1397 ifail =
p01aae(isave,1,srname)
1409 IF (n.LT.1) go to 60
1429 IF (n.LT.1) go to 120
1437 sum = sum + dble(a(is))*b(it)
1441 120 sum = sum + (dble(c1)+c2)
1443 d1 = sum + sum - dble(sngl(sum))
1537 SUBROUTINE e04abe(FUN, EPS, T, A, B, MAXCAL, X, F, IFAIL)
1603 REAL*8 a, b, eps, f, t, x
1605 INTEGER ifail, maxcal
1617 REAL*8 b1, d, e, epsmch, f1, f2, fa, fu, fv, fw, gtest1,
1619 * gtest2, gu, oldf, pt2, pt4, pt6, rr, rteps, scxbd, ss, tol,
1621 * u, x1, x2, xlamda, xv, xw, sftbnd
1623 INTEGER iflag, iloc, isave, numf
1627 REAL*8 sqrt, xarg,
x02aae
1631 sqrt(xarg)=dsqrt(xarg)
1641 DATA srname /
' E04ABE'/
1655 rteps = sqrt(epsmch)
1657 IF (eps.LT.epsmch) eps = rteps
1659 IF (t.LT.epsmch) t = rteps
1669 IF (a+t.GE.b .OR. maxcal.LT.3 .OR. ifail.LT.0 .OR.
1671 * ifail.GT.1) go to 140
1691 IF (f1.GT.f2) go to 20
1727 b = pt4 + eps*abs(xlamda) + t
1767 tol = eps*abs(x) + t
1785 60 CALL
abze04(eps, t, 0.0d+0, sftbnd, xlamda, u, fu, gu, x, f,
1787 * xw, fw, xv, fv, a, fa, b, oldf, b1, scxbd, e, d, rr, ss,
1789 * gtest1, gtest2, tol, iloc, iflag)
1791 IF (iflag.NE.1) go to 100
1793 IF (numf.GE.maxcal) go to 80
1815 IF (ifail.EQ.0)
RETURN
1817 ifail =
p01aae(isave,ifail,srname)
1829 SUBROUTINE abze04(EPS, T, ETA, SFTBND, XLAMDA, U, FU, GU,
1831 * xmin, fmin, xw, fw, xv, fv, a, fa, b, oldf, b1, scxbd, e, d,
1833 * rr, ss, gtest1, gtest2, tol, iloc, itest)
1891 REAL*8 a, b1, b, d, e, eps, eta, fa, fmin, fu, fv, fw, gtest1,
1893 * gtest2, gu, oldf, rr, scxbd, sftbnd, ss, t, tol, u, xlamda,
1903 REAL*8 a1, d1, d2, q, r, s, t2, xm
1909 sqrt(xarg)=dsqrt(xarg)
1925 go to(20, 40, 40, 460, 440), iloc
1943 IF (u.LE.0.0e+0 .OR. xlamda.LE.t2 .OR. gu.GT.0.0e+0)
RETURN
2017 b = scxbd + eps*abs(scxbd) + t
2055 40
IF (fu.GT.fmin) go to 100
2065 IF (u.LT.0.0e+0) go to 60
2071 IF (xw.EQ.xv .AND. fmin.EQ.fu) rr = 1.0e+0
2107 tol = eps*abs(xmin) + t
2119 100
IF (u.GE.0.0e+0) go to 120
2131 140
IF (fu.GT.fw .AND. xw.NE.0.0e+0) go to 160
2157 IF (abs(xm).LE.t2-5.0e-1*(b-a) .OR. xmin+b.LE.sftbnd .OR.
2159 * fa-fmin.LE.abs(a)*gtest2 .AND. fmin.LT.oldf .AND.
2161 * (abs(xmin-xlamda).GT.tol .OR. rr.LT.0.0e+0)) go to 420
2169 IF (abs(e).LE.tol) go to 240
2177 IF (iloc.NE.2) go to 200
2187 q = 2.0e+0*(fw-fmin-xw*gu)
2191 IF (xmin.NE.0.0e+0) s = (2.0e+0*(fmin-fw)+xw*gu)*xw
2195 200 r = xw*(fv-fmin)
2203 220
IF (q.GT.0.0e+0) s = -s
2205 IF (q.LE.0.0e+0) q = -q
2217 IF (d.NE.b1 .OR. rr.GT.0.0e+0) e = d
2229 IF (xmin.NE.a) go to 260
2235 260
IF (rr.GT.0.0e+0) go to 280
2239 IF (d.GE.scxbd) d = scxbd
2255 IF (abs(d2).GT.tol .AND. (xw.LE.0.0e+0 .OR. abs(d1).LE.tol))
2267 IF (u.GE.1.0e+0) d = 5.0e+0*d2*(1.0e-1+1.0e+0/u)/1.1e+1
2269 IF (u.LT.1.0e+0) d = 5.0e-1*d2*sqrt(u)
2279 320
IF (xw.LT.0.0e+0 .AND. xv.GT.0.0e+0 .OR. xw.GT.0.0e+0 .AND.
2281 * xv.LT.0.0e+0) go to 330
2291 IF (d.LE.0.0e+0) a1 = d
2293 IF (d.GT.0.0e+0) b1 = d
2305 330
IF (abs(s).GE.abs(5.0e-1*q*r) .OR. s.LE.q*a1 .OR. s.GE.q*b1)
2323 IF (d-a.GE.t2 .AND. b-d.GE.t2) go to 360
2327 IF (xm.LE.0.0e+0) d = -tol
2339 IF (xm.LE.0.0e+0) e = a
2351 380
IF (d.LT.scxbd) go to 400
2369 scxbd = (scxbd - tol)/(1.0e+0 + eps)
2373 IF (abs(d).LT.tol .AND. d.LE.0.0e+0) u = -tol
2375 IF (abs(d).LT.tol .AND. d.GT.0.0e+0) u = tol
2399 IF (xmin.EQ.0.0e+0) xmin = t
2409 440
IF (abs(xmin-xlamda).GE.tol .OR. xmin.EQ.t) go to 460
2411 IF (scxbd.LT.0.0e+0 .AND. xw.LT.0.0e+0 .AND. xv.LT.0.0e+0)
2415 IF (d.LT.0.0e+0) go to 460
2435 460
IF (xmin+b.GT.sftbnd) go to 480
2449 480
IF (oldf-fu.LE.gtest1*xmin) go to 500
2465 500
IF (xmin.NE.t) go to 520
2491 IF (xmin.LT.t) xmin = t
2511 SUBROUTINE e01baf(M, X, Y, K, C, LCK, WRK, LWRK, IFAIL)
2635 INTEGER ifail, lck, lwrk, m
2639 REAL*8 c(lck), k(lck), wrk(lwrk), x(m), y(m)
2655 INTEGER i, ierror, m1, m2
2669 DATA srname /
' E01BAE'/
2681 IF (lwrk.LT.6*m+16 .OR. m.LT.4) go to 80
2683 IF (lck.LT.m+4) go to 80
2695 IF (x(i).LE.x(i-1)) go to 80
2713 IF (m.EQ.4) go to 60
2735 CALL
e02baf(m, m+4, x, y, wrk, k, wrk(m1), wrk(m2), c, ss,
2749 80 ifail =
p01aae(ifail,ierror,srname)
2761 SUBROUTINE e02bcf(NCAP7, K, C, X, LEFT, S, IFAIL)
2801 INTEGER ifail, left, ncap7
2805 REAL*8 c(ncap7), k(ncap7), s(4)
2815 REAL*8 c1, c2, c3, c4, d1n41, d1n42, d1n43, d1n44, d2n41,
2817 * d2n42, d2n43, d2n44, d3n41, d3n42, d3n43, d3n44, e2, e3, e4,
2819 * e5, half, k1, k2, k3, k4, k5, k6, m11, m21, m22, m32, n41,
2821 * n42, n43, n44, p4, p5, p6, six, three
2823 INTEGER ierror, j1, j, l
2831 DATA srname /
' E02BCE'/
2851 IF (ncap7.LT.8) go to 80
2863 IF (k(4).GE.k(ncap7-3)) go to 80
2871 IF (x.LT.k(4) .OR. x.GT.k(ncap7-3)) go to 80
2913 IF (j-j1.LE.1) go to 60
2915 IF (left.NE.1 .AND. x.GE.k(l)) go to 40
2917 IF (left.EQ.1 .AND. x.GT.k(l)) go to 40
2989 d3n42 = -d3n41 - m32
3003 d2n42 = -d2n41 - m32
3013 m32 = (e2*m21+e5*m22)/p5
3017 d1n42 = -d1n41 - m32
3021 n41 = -e4*d1n41/three
3023 n42 = (-(x-k1)*d1n41+e5*m32)/three
3025 n43 = (e2*m32+(k6-x)*d1n44)/three
3027 n44 = e3*d1n44/three
3043 s(1) = c1*n41 + c2*n42 + c3*n43 + c4*n44
3045 s(2) = c1*d1n41 + c2*d1n42 + c3*d1n43 + c4*d1n44
3047 s(3) = c1*d2n41 + c2*d2n42 + c3*d2n43 + c4*d2n44
3049 s(4) = c1*d3n41 + c2*d3n42 + c3*d3n43 + c4*d3n44
3057 80 ifail =
p01aae(ifail,ierror,srname)
3069 SUBROUTINE e02baf(M, NCAP7, X, Y, W, K, WORK1, WORK2, C, SS,
3153 INTEGER ifail, m, ncap7
3157 REAL*8 c(ncap7), k(ncap7), w(m), work1(m), work2(4,ncap7),
3169 REAL*8 acol, arow, ccol, cosine, crow, d4, d5, d6, d7, d8, d9,
3171 * d, dprime, e2, e3, e4, e5, k0, k1, k2, k3, k4, k5, k6, n1,
3173 * n2, n3, relemt, s, sigma, sine, wi, xi
3175 INTEGER i, ierror, iplusj, iu, j, jold, jplusl, jrev, l4,
3177 * l, lplus1, lplusu, ncap3, ncap, ncapm1, r
3187 DATA srname /
' E02BAE'/
3193 IF (ncap7.LT.8 .OR. m.LT.ncap7-4) go to 420
3235 IF (k(5).LE.x(1) .OR. k(ncap3).GE.x(m)) go to 420
3239 IF (k(j).GT.k(j+1)) go to 420
3253 IF (w(i).LE.0.0) go to 420
3277 IF (x(i).LT.work1(j-1)) go to 420
3279 IF (x(i).EQ.work1(j-1)) go to 80
3299 IF (r.LT.ncap3) go to 420
3313 IF (j.GE.ncap) go to 160
3319 IF (work1(j).GE.k(j+4) .OR. k(i).GE.work1(l)) go to 420
3329 IF (ncap.LE.5) go to 160
3343 IF (work1(i).LE.k4) go to 120
3345 IF (i.GT.r .OR. work1(i).GE.k0) go to 420
3365 160
DO 200 i=1,ncap3
3403 220
IF (xi.LT.k(j+4) .OR. j.GT.ncapm1) go to 240
3409 240
IF (j.EQ.jold) go to 260
3473 n2 = (e2*n1+e5*n2)*d5
3479 work1(3) = e2*n2 + (k6-xi)*n3
3481 work1(2) = (xi-k1)*n1 + e5*n2
3499 relemt = work1(lplus1)
3501 IF (relemt.EQ.0.0) go to 320
3509 IF (abs(relemt).GE.d) dprime =
3511 * abs(relemt)*sqrt(1.0+(d/relemt)**2)
3513 IF (abs(relemt).LT.d) dprime = d*sqrt(1.0+(relemt/d)**2)
3515 work2(1,jplusl) = dprime
3519 sine = relemt/dprime
3521 IF (l4.LT.2) go to 300
3527 acol = work2(iu,jplusl)
3529 arow = work1(lplusu)
3531 work2(iu,jplusl) = cosine*acol + sine*arow
3533 work1(lplusu) = cosine*arow - sine*acol
3537 300 ccol = c(jplusl)
3539 c(jplusl) = cosine*ccol + sine*crow
3541 crow = cosine*crow - sine*ccol
3545 sigma = sigma + crow**2
3573 j = ncap3 - jrev + 1
3577 IF (d.EQ.0.0) go to 420
3579 IF (l.LT.3) l = l + 1
3583 IF (l.EQ.0) go to 380
3589 s = s - work2(i+1,j)*c(iplusj)
3599 420
IF (ierror) 440, 460, 440
3601 440 ifail =
p01aae(ifail,ierror,srname)
REAL *8 function s21bbf(X, Y, Z, IFAIL)
subroutine e02bcf(NCAP7, K, C, X, LEFT, S, IFAIL)
REAL *8 function x02aae(X)
subroutine f02apf(NN, ACC, H, IH, WR, WI, ICNT, LFAIL)
subroutine x03aaf(A, ISIZEA, B, ISIZEB, N, ISTEPA, ISTEPB,
subroutine e01baf(M, X, Y, K, C, LCK, WRK, LWRK, IFAIL)
INTEGER function p01aae(IFAIL, ERROR, SRNAME)
subroutine e04abe(FUN, EPS, T, A, B, MAXCAL, X, F, IFAIL)
REAL *8 function x02ade(X)
subroutine f01akf(N, K, L, A, IA, INTGER)
subroutine abze04(EPS, T, ETA, SFTBND, XLAMDA, U, FU, GU,
subroutine f02aff(A, IA, N, RR, RI, INTGER, LFAIL)
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
REAL *8 function x02abf(X)
subroutine x04aae(I, NERR)
subroutine e02baf(M, NCAP7, X, Y, W, K, WORK1, WORK2, C, SS,
REAL *8 function s21bcf(X, Y, Z, IFAIL)
REAL *8 function x02acf(X)