10 REAL*8 vi(nmx3),vc(nmx3),ksch,c(5)
11 common/slow1/ tk2(0:nmx),ejump,ksch(nmx),kslow,kcoll
12 common/ccoll2/ qk(nmx4),pk(nmx4),rij(nmx,nmx),
SIZE(nmx),vstar1,
13 & ecoll1,rcoll,qperi,istar(nmx),icoll,isync,ndiss1
14 common/chreg/ timec,tmax,rmaxc,cm(10),namec(6),nstep1,kz27,kz30
15 common/calls/ tpr,tkpr,step,ider,icall,nfn,nreg,iter,imcirc
16 common/clump/ bodys(nmx,5),t0s(5),ts(5),
steps(5),rmaxs(5),
17 & names(nmx,5),isys(5)
27 CALL
ksphys(q(ks1),p(ks1),xc(l1),wc(l1))
28 rk = q(ks1)**2 + q(ks1+1)**2 + q(ks1+2)**2 + q(ks1+3)**2
36 vi(l+k+3) = wc(l+k)/mc(n)
41 vi(l+k) = (wc(l+k-3) - wc(l+k))/mc(i)
45 vc(j) = vi(j+3) - vi(j)
51 if (rinv(i).gt.rm)
then
63 w2 = vc(l+1)**2 + vc(l+2)**2 + vc(l+3)**2
65 amax = 2.0*rinv(i) - w2/mb
70 g1 = 2.0*mc(3)/mb*(rinv(2)/rinv(1))**3
72 g1 = 2.0*mc(i-1)/mb*(rinv(i-1)/rinv(i))**3
74 g1b = 2.0*mc(i+2)/mb*(rinv(i+1)/rinv(i))**3
79 else if (rinv(i).gt.dm)
then
80 w2 = vc(l+1)**2 + vc(l+2)**2 + vc(l+3)**2
82 amax = 2.0*rinv(i) - w2/mb
87 g2 = 2.0*mc(3)/mb*(rinv(2)/rinv(1))**3
89 g2 = 2.0*mc(i-1)/mb*(rinv(i-1)/rinv(i))**3
91 g2b = 2.0*mc(i+2)/mb*(rinv(i+1)/rinv(i))**3
100 eb = -0.5*mc(i1)*mc(i1+1)/a1
102 IF (rm.lt.0.2*a1.or.eb1.gt.0.9)
then
115 CALL
erel(i1,eb,semi)
117 err = (a1 - semi)/semi
118 IF (abs(err).GT.1.0e-05.AND.iwarn.LT.10)
THEN
124 WRITE (6,4) nstep1, zk, g1, rm, semi, err
125 4
FORMAT (
' WARNING! INVERT # K g1 RM SEMI DA/A ',
134 tks = 6.28*ksch(i1)*a1*sqrt(a1/(mc(i1) + mc(i1+1)))
139 dt = min(rm/sqrt(v21),dt)
144 tks = 6.28*ksch(i2)*a2*sqrt(a2/(mc(i2) + mc(i2+1)))
161 mb = mc(i1) + mc(i1+1)
165 eta = xc(li+1)*vc(li+1) + xc(li+2)*vc(li+2) + xc(li+3)*vc(li+3)
171 sum1 = sum1 - 2.0*mc(i1)*mc(i1+1)/(ksch(i1)*rm)
178 y = dt*min(1.0/rm,0.5/abs(a1))
181 y0 = dt - ((zeta*c(3)*y + eta*c(2))*y + rm)*y
197 y0 = dt - ((zeta*c(3)*y + eta*c(2))*y + rm)*y
198 ypr = -((zeta*c(2)*y + eta*c(1))*y + rm)
199 y2pr = -eta*(1.0 - z*c(2)) - zeta*y*c(1)
202 y = y - y0/ypr/sqrt(0.01 + abs(0.99d0 - d))
203 dt1 = ((zeta*c(3)*y + eta*c(2))*y + rm)*y
205 IF (abs(dt - dt1).GT.1.0d-06*abs(dt).AND.it.LT.25) go to 10
208 sum2 = sum2 + 2.0*mc(i1)*mc(i1+1)*y
210 IF (it.GT.15.AND.iwarn.LT.50)
THEN
212 ecc = sqrt((1.0 - rm/a1)**2 + eta**2/(mb*a1))
213 WRITE (6,15) it, ksch(i1), ecc, rm, a1, dt-dt1, dtau
214 15
FORMAT (
' WARNING! INVERT IT K E R A ERR DTAU ',
215 & i4,f7.2,f7.3,1p,5e9.1)
219 IF (i2.ne.i1.and.g2.lt.0.01)
THEN
227 dtau = sum1*dt0 + sum2
228 IF (dtau.LT.0.0)
THEN
230 IF (iwarn.LT.100)
THEN
232 WRITE (6,16) ksch(i1), rm/a1, sum1*dt0, sum2, dtau
233 16
FORMAT (
' INVERT NEGATIVE! KSCH R/A S1*DT0 S2 DTAU ',