8 common/modes/ eb0(ntmax),zj0(ntmax),ecrit(ntmax),ar(ntmax),
9 & br(ntmax),eosc(4,ntmax),edec(ntmax),tosc(ntmax),
10 & rp(ntmax),es(ntmax),cm(2,ntmax),iosc(ntmax),
12 REAL*8 ww(6),w(4),wg(2),qg(2),wscale(2),qscale(2)
15 DATA ww /2.119,3.113,8.175,3.742,4.953,9.413/
24 IF (namec(k).EQ.name(i)) ic = k
28 IF (ic.EQ.0.AND.nchaos.GT.0)
THEN
29 WRITE (6,2) nchaos, ipair, kstar(i), name(i1), name(i2),
30 & list(1,i1), step(i1), step(i)
31 2
FORMAT (
' WARNING! CHRECT NCH KS K* NAM NP DT1 DTI ',
32 & 3i4,2i6,i4,1p,2e10.2)
36 nam1 = ksave(2*l) - name(i2)
37 IF (ksave(2*l-1).LT.0.AND.nam1.EQ.name(i1))
THEN
38 nam2 = nzero + name(i2)
45 IF (namec(k).EQ.nam2) ic = k
48 IF (nam2.EQ.namc.OR.ic.LT.nchaos)
THEN
49 WRITE (6,9) ic, nchaos, nam2, namc, name(i)
50 9
FORMAT (
' CHRECT RESTORE IC NCH NM2 NMC NMI ',2i4,3i8)
52 ELSE IF (nchaos.EQ.0)
THEN
53 WRITE (6,3) nchaos, ipair, kstar(i), name(i)
54 3
FORMAT (
' CHRECT RESTORE NCH KS K* NAM ',3i4,i6)
58 namec(nchaos) = name(i)
68 IF (kstar(i).EQ.-2)
THEN
70 IF (abs(tdot2(ipair)).GT.1.0d-12.AND.dmr.GE.0.0)
THEN
74 IF (tdot2(ipair).LT.0.0d0)
THEN
82 semi = -0.5*body(i)/h(ipair)
83 ecc2 = (1.0 - r(ipair)/semi)**2 +
84 & tdot2(ipair)**2/(body(i)*semi)
88 qperi = semi*(1.0d0 - ecc)
93 IF (dmr.GE.0.0d0)
THEN
96 IF (iphase.LT.0.OR.kstar(i).GT.0) go to 30
101 CALL
tcirc(qperi,ecc,i1,i2,icirc,tc)
104 tev(i1) = min(tev(i1),time + 0.5*tc/tstar)
109 semi = -0.5*body(i)/h(ipair)
110 ecc2 = (1.0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(body(i)*semi)
112 qperi = semi*(1.0d0 - ecc)
121 km = max(kstar(i1),kstar(i2))
124 IF (kstar(i2).LT.10)
THEN
126 ELSE IF (kstar(i1).LT.10)
THEN
130 IF (epoch(i2).GT.epoch(i1)) j1 = i2
132 IF (time - tev0(j1).LT.2.0*stepx.AND.tc.GT.3000.0)
THEN
138 IF (iphase.EQ.8)
THEN
140 CALL
tcirc(qperi,ecc,i1,i2,icirc,tc)
141 IF (tc.GT.3000.0)
THEN
142 WRITE (6,4) name(i1), tc
143 4
FORMAT (
' CHAIN SLEEP: NM TC ',i6,1p,e10.2)
149 IF (dmr.GT.0.01.OR.kstar(i).EQ.-1.OR.sleep)
THEN
150 IF (dmr.GT.0.01.AND.tc.GT.100.0.AND.km.LT.5)
THEN
151 WRITE (6,5) name(i1), name(i2), kstar(i1), kstar(i2),
152 & kstar(i), tphys, radius(i1), radius(i2),
153 & qperi, semi, ecc, es0, body(i)*zmbar, tc
154 5
FORMAT (
' CHRECT: NAM K* TP R* QP A E E0 M TC ',
155 & 2i6,3i4,f8.1,1p,4e10.2,0p,3f7.3,f7.1)
162 tk = semi*sqrt(semi/body(i))
164 xp = (time - time0)/(twopi*tk)
165 qps = semi*(1.0 - ecc)/max(radius(i1),radius(i2))
166 WRITE (6,10) ttot, name(i1), name(i2), kstar(i1),
167 & kstar(i2), ecc, es0, qps, semi, tc, tb, xp
168 10
FORMAT (
' SLEEP SPIRAL T NM K* E E0 QP/S A TC TB DTK ',
169 & f9.2,2i6,2i4,2f8.4,1p,5e9.1)
177 zmu = body(i1)*body(i2)/body(i)
178 cj = zmu*sqrt(body(i))
179 eb0(ic) = zmu*h(ipair)
180 zj0(ic) = cj*sqrt(qperi*(1.0 + ecc))
186 IF (kstar(ik).EQ.3.OR.kstar(ik).EQ.5.OR.
187 & kstar(ik).EQ.6.OR.kstar(ik).EQ.9)
THEN
188 CALL
giant(ipair,ik,wg,qg,wscale,qscale,xn,ql)
192 IF (kstar(ik).EQ.0) ip = 1
198 CALL
chaos0(qperi,ecc,eb0(ic),zj0(ic),body(i1),body(i2),
199 & radius(i1),radius(i2),w,ecrit(ic),ar(ic),br(ic),idis)
201 rcoll = radius(i1) + radius(i2)
202 IF (idis.EQ.-1.AND.kstar(i).EQ.-1)
THEN
204 WRITE (6,15) ttot, ipair, name(i1), name(i2), kstar(i1),
205 & kstar(i2), radius(i1), radius(i2), qperi,
207 15
FORMAT (
' CHAOS => SPIRAL T KS NAM K* R* QP A E0 E ',
208 & f9.2,i4,2i6,2i4,1p,4e10.2,0p,2f7.3)
222 IF (idis.GT.0.AND.qperi.LT.rcoll)
THEN
223 r1 = max(radius(i1),radius(i2))
225 IF (kstar(i).EQ.-2) which1 =
' SPIRAL '
226 WRITE (6,20) which1, ipair, name(i1), name(i2),
227 & kstar(i1), kstar(i2), r1, r(ipair), qperi,
229 20
FORMAT (
' DISRUPTED',a8,
' KS NM K* R* R QP A E E0 n ',
230 & i4,2i6,2i4,1p,4e10.2,0p,3f7.3)
233 IF (kstar(i).EQ.-2) iqcoll = 2
243 ELSE IF (kstar(i).EQ.-2)
THEN
246 IF (qperi.LT.2.0*max(radius(i1),radius(i2)))
THEN
249 IF (radius(i2).GT.radius(i1)) j1 = i2
251 q0 = body(j1)/(body(i) - body(j1))
254 rl1 = 0.49*q2/(0.6*q2 + log(1.0d0 + q1))*semi
256 IF (radius(j1).GT.rl1.AND.iphase.NE.7)
THEN
257 WRITE (6,25) name(i1), name(i2), kstar(i1), kstar(i2),
258 & ecc, es0, rcoll, rl1, qperi, semi, tc
259 25
FORMAT (
' DISRUPTED SPIRAL NM K* E E0 RC RL QP A',
260 &
' TC ',2i6,2i4,2f7.3,1p,5e10.2)