1 SUBROUTINE expel(J1,J2,ICASE)
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 m01,m1,r1,aj1,m02,m2,r2,aj2,sep,mi(2)
13 REAL*8 tscls(20),lums(10),gb(10),tm,tn,lum1,lum2,mc1,mc2,rcc
14 REAL*8 jspin1,jspin2,menv,renv,k2
20 IF(kstar(j1).GE.2.AND.kstar(j1).LE.9.AND.kstar(j1).NE.7)
THEN
29 tev1 = max(tev0(i1),tev0(i2))
35 aj1 = tev1*tstar - epoch(i1)
36 jspin1 = spin(i1)*spnfac
41 aj2 = tev1*tstar - epoch(i2)
42 jspin2 = spin(i2)*spnfac
49 semi0 = -0.5d0*body(i)/h(ipair)
51 ecc2 = (1.d0-r(ipair)/semi0)**2+tdot2(ipair)**2/(semi0*body(i))
59 1 CALL
comenv(m01,m1,mc1,aj1,jspin1,kw1,
60 & m02,m2,mc2,aj2,jspin2,kw2,ecc,sep,coals)
63 CALL
star(kw1,m01,m1,tm,tn,tscls,lums,gb,zpars)
64 CALL
hrdiag(m01,aj1,m1,tm,tn,tscls,lums,gb,zpars,
65 & r1,lum1,kw1,mc1,rcc,menv,renv,k2)
66 IF(kw1.NE.kstar(i1))
THEN
67 WRITE(38,*)
' EXPEL TYPE CHANGE1 ',kstar(i1),kw1
75 CALL
star(kw2,m02,m2,tm,tn,tscls,lums,gb,zpars)
76 CALL
hrdiag(m02,aj2,m2,tm,tn,tscls,lums,gb,zpars,
77 & r2,lum2,kw2,mc2,rcc,menv,renv,k2)
78 IF(kw2.NE.kstar(i2))
THEN
79 WRITE(38,*)
' EXPEL TYPE CHANGE2 ',kstar(i2),kw2
84 IF (sep.LT.r1.OR.sep.LT.r2)
THEN
89 dms = m1 + m2 - body(i)*smu
90 IF (abs(dms).LT.1.0d-10.AND..NOT.coals)
THEN
103 spin(i1) = jspin1/spnfac
104 spin(i2) = jspin2/spnfac
109 zmu0 = body(i1)*body(i2)/body(i)
111 body0(i1) = m01/zmbar
112 body0(i2) = m02/zmbar
115 ecoll = ecoll + zmu0*hi
116 egrav = egrav + zmu0*hi
119 epoch(i1) = tev1*tstar - aj1
125 IF(kstar(i2).GE.13.AND.kw1.GE.13)
THEN
127 WRITE (6,5) kw1, m1, m2
128 5
FORMAT (
' NEW TZ K* M1 M2 ',i4,2f7.2)
130 CALL
coal(ipair,kw1,kw2,mi)
134 epoch(i2) = tev1*tstar - aj2
139 tmdot = min(tmdot,tev1)
144 dm = body(i) - (body(i1) + body(i2))
148 body(i) = body(i) - dm
149 h(ipair) = -0.5d0*body(i)/semi
152 zmu = body(i1)*body(i2)/body(i)
153 ecoll = ecoll - zmu*h(ipair)
154 egrav = egrav - zmu*h(ipair)
157 rx = r(ipair)/(1.0 - ecc)
162 IF (ecc0.LT.1.0)
THEN
168 WRITE (6,10) which1, name(i1), name(i2), kstar(i1),kstar(i2),
169 & kw1, kw2, m1, m2, dm*zmbar, ecc0, ecc, r1, r2,
171 10
FORMAT (a8,
'CE NAM K0* K* M1 M2 DM E0 E R1 R2 A0 A ',
172 & 2i6,4i3,3f5.1,2f8.4,2f7.1,1p,e9.1,0p,f7.1)
175 IF (ecc0.GT.0.001d0.AND.ecc.LE.0.001d0)
THEN
180 IF (r1.GT.rl1*sep.OR.r2.GT.rl2*sep)
THEN
183 WRITE (6,8) rl1*sep, rl2*sep
184 8
FORMAT (
' ENFORCED CE RL*SEP ',1p,2e10.2)
189 IF (dm*smu.LT.0.05)
THEN
201 IF (iter.GT.0) dm = dm2
212 IF (kw1.EQ.15.OR.kw2.EQ.15)
THEN
216 IF (body(i).GT.0.0d0) i = ifirst + 1
219 ri = sqrt(x(1,i)**2 + x(2,i)**2 + x(3,i)**2)
220 vi = sqrt(xdot(1,i)**2 + xdot(2,i)**2 + xdot(3,i)**2)
222 x0(k,i) = min(1.0d+04+x(k,i),1000.0*rscale*x(k,i)/ri)
224 x0dot(k,i) = sqrt(0.004*zmass/rscale)*xdot(k,i)/vi
225 xdot(k,i) = x0dot(k,i)
231 WRITE (6,13) name(i), kstar(i), body(i)*zmbar
232 13
FORMAT (
' MASSLESS GHOST NAM K* M ',i6,i4,1p,e10.2)
234 ELSE IF (kw1.GE.10)
THEN
236 IF (ecc.LE.0.001d0) kstar(n+ipair) = 10
241 vi2 = xdot(1,i)**2 + xdot(2,i)**2 + xdot(3,i)**2
242 kstar(i1) = -kstar(i1)
243 CALL
kick(ipair,0,kw1,dm)
247 ecdot = ecdot + dm*potj + 0.5d0*dm*vi2
250 IF (kz(14).GT.0)
THEN
251 IF (kz(14).LE.2)
THEN
252 ecdot = ecdot - 0.5d0*dm*(tidal(1)*x(1,i)**2 +
253 & tidal(3)*x(3,i)**2)
255 body(i) = body(i) + dm
258 body(i) = body(i) - dm
267 x(k,i) = (body(i1)*x(k,i1) + body(i2)*x(k,i2))/body(i)
268 xdot(k,i) = (body(i1)*xdot(k,i1) +
269 & body(i2)*xdot(k,i2))/body(i)
271 x0dot(k,i) = xdot(k,i)
278 x0dot(k,j) = xdot(k,j)
286 i = i1 + 2*(npairs - ipair)
288 CALL
kick(i,1,kw1,dm)
298 IF (h(npairs).LT.0.0)
THEN
299 semi = -0.5d0*body(i)/h(npairs)
300 WRITE (6,35) kw1, r(npairs)/semi, semi*su,
301 & body(i)*zmbar, (xdot(k,i)*vstar,k=1,3)
302 35
FORMAT (
' WD/NS BINARY KW R/A A M V ',
310 tmdot = min(tev(i),tmdot)
313 IF (ecc.LE.0.001d0)
THEN
319 IF (name(i).EQ.namec(l)) ic = l
326 IF (nchaos.GT.ntmax)
THEN
327 WRITE (6,38) name(i1), nchaos, ecc
328 38
FORMAT (
' FATAL ERROR! EXPEL NM NCH E ',
334 rp(ic) = semi*(1.0 - ecc)
342 IF (t0(i).LT.time.AND.dm.GT.0.0d0)
THEN
345 CALL
dtchck(time,step(i),dtk(40))
348 x0dot(k,i) = xdot(k,i)
357 IF (tdot2(ipair).LT.0.0d0) tdot2(ipair) = 0.0
361 IF (dm*smu.LT.0.05)
THEN
368 IF (dm*smu.GT.0.1)
THEN
380 CALL
dtchck(time,step(j),dtk(40))
382 x0dot(k,j) = xdot(k,j)
399 IF (name(i).EQ.namec(l)) kk = 1
403 IF (kk.EQ.0.AND.kstar(n+ipair).LT.0)
THEN
409 IF (nchaos.LT.nch1) l = l - 1
410 IF (ic.LT.nchaos+1) go to 52