1 SUBROUTINE droots (NG, HMIN, JFLAG, X0, X1, G0, G1, GX, X, JROOT,
2 * IMAX, LAST, ALPHA, X2)
11 IMPLICIT DOUBLE PRECISION(a-h,o-z)
12 INTEGER NG, JFLAG, JROOT, IMAX, LAST
13 DOUBLE PRECISION HMIN, X0, X1, G0, G1, GX, X, ALPHA, X2
14 dimension g0(ng), g1(ng), gx(ng), jroot(ng)
93 INTEGER I, IMXOLD, NXLAST
94 DOUBLE PRECISION T2, TMAX, ZERO
95 LOGICAL ZROOT, SGNCHG, XROOT
98 IF (jflag .EQ. 1)
GO TO 200
104 IF (dabs(g1(i)) .GT. zero)
GO TO 110
108 110
IF (dsign(1.0d0,g0(i)) .EQ. dsign(1.0d0,g1(i)))
GO TO 120
109 t2 = dabs(g1(i)/(g1(i)-g0(i)))
110 IF (t2 .LE. tmax)
GO TO 120
114 IF (imax .GT. 0)
GO TO 130
118 140
IF (.NOT. sgnchg)
GO TO 400
127 IF (nxlast .EQ. last)
GO TO 160
130 160
IF (last .EQ. 0)
GO TO 170
133 170 alpha = 2.0d0*alpha
134 180 x2 = x1 - (x1-x0)*g1(imax)/(g1(imax) - alpha*g0(imax))
135 IF ((dabs(x2-x0) .LT. hmin) .AND.
136 1 (dabs(x1-x0) .GT. 10.0d0*hmin)) x2 = x0 + 0.1d0*(x1-x0)
147 IF (dabs(gx(i)) .GT. zero)
GO TO 210
151 210
IF (dsign(1.0d0,g0(i)) .EQ. dsign(1.0d0,gx(i)))
GO TO 220
152 t2 = dabs(gx(i)/(gx(i) - g0(i)))
153 IF (t2 .LE. tmax)
GO TO 220
157 IF (imax .GT. 0)
GO TO 230
163 IF (.NOT. sgnchg)
GO TO 250
166 CALL dcopy (ng, gx, 1, g1, 1)
170 250
IF (.NOT. zroot)
GO TO 260
173 CALL dcopy (ng, gx, 1, g1, 1)
178 CALL dcopy (ng, gx, 1, g0, 1)
182 270
IF (dabs(x1-x0) .LE. hmin) xroot = .true.
188 CALL dcopy (ng, g1, 1, gx, 1)
191 IF (dabs(g1(i)) .GT. zero)
GO TO 310
194 310
IF (dsign(1.0d0,g0(i)) .NE. dsign(1.0d0,g1(i))) jroot(i) = 1
199 400
IF (.NOT. zroot)
GO TO 420
203 CALL dcopy (ng, g1, 1, gx, 1)
206 IF (dabs(g1(i)) .LE. zero) jroot(i) = 1
212 420
CALL dcopy (ng, g1, 1, gx, 1)
subroutine droots(NG, HMIN, JFLAG, X0, X1, G0, G1, GX, X, JROOT, IMAX, LAST, ALPHA, X2)