9 common/binary/ bm(4,mmax),xrel(3,mmax),vrel(3,mmax),
10 & hm(mmax),um(4,mmax),umdot(4,mmax),tmdis(mmax),
11 & namem(mmax),nameg(mmax),kstarm(mmax),iflagm(mmax)
12 common/modes/ eb0(ntmax),zj0(ntmax),ecrit(ntmax),ar(ntmax),
13 & br(ntmax),eosc(4,ntmax),edec(ntmax),tosc(ntmax),
14 & rp(ntmax),es(ntmax),cm(2,ntmax),iosc(ntmax),
17 REAL*8 mass(2),massc(2),rad(2),radc(2),lumin(2)
18 REAL*8 age0(2),tm0(2),tbgb(2),menv(2),renv(2),k2str(2)
19 REAL*8 tscls(20),lums(10),gb(10),tm,tn
20 REAL*8 m0,m1,rm,age,lum,mc,rcc,me,re,rnew,lnew,mch
22 REAL*8 m10,rxl1,rxl2,q,rol(2),rlperi,rm0
24 parameter(eps=1.0d-06,alpha2=0.09d0,tol=1.0d-10)
25 REAL*8 dtx(2),dms(2),dma(2),dmx(2),epch0(2),tevk,diff
26 REAL*8 dt,dsep,djmb,djgr,djorb,djt,djti,dtgr,dspin,jspbru,ospbru
27 REAL*8 rj,hj,tj2,vorb2,vwind2,ivsqm,omv2,dtxmin,dmxmax,delet
28 REAL*8 jspin(2),ospin(2),djspin(2),jorb,oorb,aursun
29 parameter(aursun=214.95d0)
30 REAL*8 k2,k3,acc1,acc2,beta,xi
31 parameter(k3=0.21d0,acc1=3.920659d+08,acc2=1.5d0)
32 parameter(beta=0.125d0,xi=1.d0,maxblk=40)
55 IF (iphase.LT.0) ipoly = -1
63 IF (tev(j).LE.time)
THEN
75 10
IF (i.GT.n.AND.name(i).LT.0.AND.kz(34).GT.0)
THEN
84 IF (nwarn.LT.1000)
THEN
85 WRITE(14,900) kspair, name(i), ttot, r(kspair)
86 900
FORMAT(
' MDOT MERGER TERM: KS NAM T R ',
87 & i4,i6,f10.4,1p,e10.2)
98 IF (i.LT.ifirst.AND.kz(28).GT.0)
THEN
100 IF (name(n+ip).LT.0.AND.kstar(i).GE.13)
THEN
102 IF (i.EQ.2*ip-1)
THEN
105 ELSE IF (name(2*ip).LE.nzero)
THEN
107 tev(i) = time + 100.0
122 IF (i.GT.n.AND.kz(34).GT.0.AND.body(i).GT.0.0d0.AND.
123 & kstar(i).GE.10)
THEN
126 IF (mod(kstar(i),2).NE.0)
THEN
128 IF (iqcoll.NE.0.OR.iphase.LT.0) go to 1
130 IF (tev(i).LE.time)
THEN
131 IF (mod(kstar(i),2).NE.0) kstar(i) = kstar(i) + 1
134 WRITE(6,902)i,name(i),ipair,kstar(i),tev(i),ttot
135 902
FORMAT(
' WARNING MDOT NO ROCHE ',3i6,i4,1x,1p,2e13.4)
140 IF (dtr.LT.step(i))
THEN
143 IF (tev(i).LE.time) tev(i) = 1.000002d0*time
156 IF (i.LT.ifirst)
THEN
158 ksx = max(kstar(2*kspair-1),kstar(2*kspair))
161 IF(i2.EQ.i) i2 = i2 - 1
164 IF (name(icm).LT.0.AND.
165 & (i.EQ.2*kspair - 1.OR.name(2*kspair).GT.nzero))
THEN
169 IF (name(icm).LT.-2*nzero)
THEN
170 IF (i.LT.2*kspair.OR.name(i).GT.nzero)
THEN
179 IF (kstar(icm).GT.10.AND.mod(kstar(icm),2).EQ.1)
THEN
180 IF(body(i).EQ.0.0.OR.body(i2).EQ.0.0)
THEN
181 tev(i) = time + min(0.1d0,tev(i)-tev0(i))
186 IF (mod(iwarn,100).EQ.0)
THEN
187 WRITE(6,904) i, kstar(icm), tev(i) - tev(icm)
188 904
FORMAT(
' WARNING! MDOT I K* D(TEV) ',2i5,1p,e9.1)
191 tev(icm) = time + dtr
192 IF (dtr.GT.tstar)
THEN
193 kstar(icm) = kstar(icm) + 1
195 tev(i) = 1.000002d0*time
202 IF (ihdot.GT.0.AND.body(i).GT.0.0d0)
THEN
205 CALL
findj(i,ighost,imerge)
208 WRITE(6,*)
' MDOT GHOST NOT FOUND ',i,name(i),imerge
213 IF (ighost.LE.n)
THEN
214 IF (tev(ighost).LT.tev(i)) i = ighost
215 IF (i.EQ.ighost)
WRITE(6,906) i, name(i), kstar(i),
217 906
FORMAT(
' GHOST SWITCH: I NAM K* TEV BODY ',
223 IF (i.LT.2*kspair)
THEN
224 IF (tev(ighost).LT.tev(i)) i = ighost
229 IF (tev(2*jpair).LT.tev(i)) i = 2*jpair
231 WRITE(6,908) ighost, i0, i, name(i), kstar(i), tev(i)
232 908
FORMAT(
' OUTER GHOST: IG I0 I NM K* TEV',5i6,f9.2)
233 IF(kstar(n+kspair).GE.10)
THEN
239 ELSE IF (body(i).LE.0.0d0.OR.name(i).EQ.0)
THEN
245 IF (i.LT.ifirst) j = n + kvec(i)
249 IF (nameg(k).EQ.name(j)) imerge = k
251 IF (imerge.GT.0)
THEN
253 IF (namem(imerge).EQ.name(k)) icm = k
256 if(icm.eq.0) kspair = j - n
258 IF (namem(imerge).LT.-2*nzero)
THEN
269 IF (ighost.GT.n)
THEN
273 IF (tev(2*jpair).LT.tev(i)) i = 2*jpair
278 tev(i) = tev(i) + 0.01d0
280 IF(kstar(i).LE.1.AND.(tev(i)-tev0(i))*tstar.LT.10.0)
THEN
281 tev(i) = tev(i) + 0.5*(tev(i) - tev0(i))
291 tm = min(tev(i1),tev(i2))
301 IF (kstar(i).LT.10)
THEN
303 ELSE IF (kz(34).GT.0)
THEN
307 IF (dtr.LT.step(i))
THEN
311 tev(i) = max(time + dtr,1.000002d0*time)
313 tev(i) = 1.000002d0*time
327 IF(ighost.EQ.0.AND.ihdot.EQ.0)
THEN
328 mass(1) = body(i)*zmbar
330 IF(name(icm).GT.0)
THEN
333 mass(2) = body(i2)*zmbar
342 IF (i.GE.ifirst) k = 2
343 IF(i.NE.2*kspair)
THEN
347 IF(k.EQ.2) jx(2) = 2*kspair - 1
348 mass(2) = bm(j,imerge)*zmbar
350 rj = rj + um(ii,imerge)*um(ii,imerge)
351 tj2 = tj2 + 2.d0*um(ii,imerge)*umdot(ii,imerge)
357 IF (i.EQ.2*jpair) k = 4
359 mass(1) = bm(k,imerge)*zmbar
364 IF (body(j).EQ.0.0d0)
THEN
369 semi = -0.5d0*body(j)/hj
371 ecc2 = (1.d0 - rj/semi)**2 + tj2**2/(body(j)*semi)
376 rxl1 = radius(jx(1))/rol(1)
379 rxl2 = radius(jx(2))/rol(2)
381 IF(kstar(jx(1)).LE.1.AND.
382 & (kstar(jx(2)).EQ.5.OR.kstar(jx(2)).EQ.6))
THEN
384 ELSEIF(rxl2.GT.rxl1)
THEN
398 vorb2 = acc1*(mass(1)+mass(2))/sep
399 ivsqm = 1.d0/sqrt(1.d0-ecc2)
400 diff = abs(tev0(jx(2)) - tev0(jx(1)))
402 tev(jx(1)) = max(tev0(jx(1)),tev0(jx(2)))
404 tev0(jx(2)) = tev0(jx(1))
405 IF(tev(jx(2)).NE.tev(jx(1)))
THEN
406 tev(jx(1)) = min(tev(jx(1)),tev(jx(2)))
409 tev(jx(2)) = tev(jx(1))
410 diff = abs(tev0(jx(2)) - tev0(jx(1)))
412 oorb = twopi*sqrt((mass(1)+mass(2))/(sep/aursun)**3)
413 jorb = mass(1)*mass(2)/(mass(1)+mass(2))
414 & *sqrt(1.d0-ecc2)*sep*sep*oorb
416 WRITE(6,912)jx,name(n+kspair),sqrt(ecc2),ttot
417 912
FORMAT(
' MDOT ECC2 > 1.0 I1 I2 N(ICM) e T ', 3i6,f6.2,e9.2)
430 dtx(k) = 1.0d+06*(tev(i) - tev0(i))*tstar
438 age = tev0(i)*tstar - epoch(i)
442 CALL
star(kw,m0,m1,tm,tn,tscls,lums,gb,zpars)
443 CALL
hrdiag(m0,age,m1,tm,tn,tscls,lums,gb,zpars,
444 & rm0,lum,kw,mc,rcc,me,re,k2)
456 IF(kw.NE.kstar(i))
THEN
458 WRITE (6,190) i, name(i), kstar(i), kw, mass(k)
459 190
FORMAT (
' NS/BH FORMATION ',2i7,2i4,f7.2)
467 IF(kacc.GT.1) rlperi = rol(k)*(1.d0 - ecc)
468 dmx(k) =
mlwind(kw,lum,rm0,m1,mc,rlperi,zmet)
475 vwind2 = 2.d0*beta*acc1*m1/rm0
476 omv2 = (1.d0 + vorb2/vwind2)**(3.d0/2.d0)
477 dma(3-k) = ivsqm*acc2*dmx(k)*((acc1*mass(3-k)/vwind2)**2)
478 & /(2.d0*sep*sep*omv2)
479 dma(3-k) = min(dma(3-k),0.8d0*dmx(k))
484 jspin(k) = max(spin(i)*spnfac,1.0d-10)
487 ospin(k) = jspin(k)/(k2*rm0*rm0*(m1-mc)+k3*rcc*rcc*mc)
500 IF(dtx(1).EQ.0.d0.OR.dtx(2).EQ.0.d0) dt = dtx(2)
505 djspin(k) = (2.d0/3.d0)*dmx(k)*rad(k)*rad(k)*ospin(k)
507 IF(djspin(k).GT.0.0d0)
THEN
508 dt = min(dt,0.3d0*jspin(k)/djspin(k))
513 IF(dma(k).GT.0.d0)
THEN
514 djspin(k) = djspin(k) - (2.d0/3.d0)*xi*dma(k)*
515 & rad(3-k)*rad(3-k)*ospin(3-k)
518 IF(dma(k).GE.3.16e-9.AND.kw.GE.10)
THEN
519 WRITE(20,913)name(i),name(jx(3-k)),kstar(i),
520 & kstar(jx(3-k)),tphys,mass,sep,dmx(3-k),dma(k)
521 913
FORMAT(
' WINDAC NAM K* T M A MLOSS MACC ',
522 & 2i6,2i4,f9.2,2f6.2,f8.1,1p,2e9.1)
528 q = mass(3-k)/mass(k)
529 IF(k.EQ.1) djt = 0.d0
530 IF(kz(34).EQ.2.AND.dt.GT.0.d0.AND.ecc.LE.0.01d0)
THEN
531 IF((kw.LE.9.AND.rad(k).GE.0.01d0*rol(k)).OR.
532 & (kw.GE.10.AND.q.GE.1.d0))
THEN
534 CALL
bsetid(kw,mass(k),massc(k),menv(k),rad(k),
535 & radc(k),renv(k),lumin(k),ospin(k),k2str(k),
536 & q,sep,ecc,oorb,delet,dspin,eqspin,djti)
538 IF(abs(dspin).GT.tiny)
THEN
540 IF(dspin.GE.0.d0)
THEN
541 dspin = min(dt*dspin,oorb-ospin(k))/dt
543 dspin = max(dt*dspin,oorb-ospin(k))/dt
545 djti = djti*dspin/dspin0
549 djspin(k) = djspin(k) - djti
557 CALL
magbrk(kw,mass(k),menv(k),rad(k),ospin(k),djmb)
559 IF(djmb.GT.0.0d0)
THEN
560 dt = min(dt,0.03d0*jspin(k)/djmb)
561 djspin(k) = djspin(k) + djmb
565 dms(k) = (dmx(k) - dma(k))*dt
566 dmr = abs(dms(k)/(mass(k) + 1.0d-10))
571 dms(k) = 0.02*mass(k)
575 IF(kstar(i).LT.10)
THEN
576 dml = max(mass(k) - massc(k),1.0d-07)
577 IF(dml.LT.dms(k))
THEN
593 dtxmin = min(dtx(1),dtx(2))
594 CALL
grrad(mass(1),mass(2),sep,ecc,jorb,djgr,delet)
600 IF(abs(djorb).GT.tiny.AND.(dtxmin.GT.0.d0.OR.diff.EQ.0.d0))
THEN
601 dtgr = 0.02d0*jorb/abs(djorb)
602 IF(delet.GT.tiny.AND.ecc.GT.0.0011d0)
THEN
603 dtgr = min(dtgr,0.05d0*ecc/delet)
605 dtgr = max(dtgr,100.d0)
607 dtxmin = min(dtxmin,dtgr)
611 jorb = max(jorb,1.d0)
613 ecc = max(ecc0 - delet*dtxmin,0.001d0)
615 sep1 = (mass(1) + mass(2))*jorb*jorb/
616 & ((mass(1)*mass(2)*twopi)**2*aursun**3*(1.d0-ecc2))
620 rxl1 = 0.9d0*rad(1)/
rl(q)
621 sep1 = max(sep1,rxl1)
631 dmxmax = max(dmx(1),dmx(2))
653 dms(k) = (dmx(k) - dma(k))*dt
654 dmr = abs(dms(k)/(mass(k) + 1.0d-10))
659 IF(kw.LE.2.OR.kw.EQ.7)
THEN
661 CALL
star(kw,m0,m1,tm,tn,tscls,lums,gb,zpars)
663 IF(gb(9).LT.massc(k).OR.m10.GT.zpars(3))
THEN
666 epch0(k) = tm + (tscls(1)-tm)*(age0(k)-tm0(k))/
668 epch0(k) = tev0(i)*tstar - epch0(k)
671 epch0(k) = tev0(i)*tstar - age0(k)*tm/tm0(k)
675 djspin(k) = djspin(k)*dt
678 IF(dmr.GT.tiny.AND.kw.LE.1.AND.name(i).NE.iblue)
THEN
679 tphys2 = (tev0(i)+toff)*tstar - epoch0
680 IF(tm0(k).GT.tphys2.AND.tm.LT.0.98d0*tphys2)
THEN
682 IF(i.EQ.j.AND.kacc.EQ.2) j = jx(2)
683 WRITE(6,914)name(i),m1,tm,tphys2,epch0(k)+toff*tstar,
685 914
FORMAT(
' NEW BS (MDOT): NAM M TM TP EP KW1 ',
693 tevk = tev0(i) + dt/(1.0d+06*tstar)
695 age = tevk*tstar - epch0(k)
699 CALL
star(kw,m0,m1,tm,tn,tscls,lums,gb,zpars)
702 IF((age-tn).GT.1.0d-02)
THEN
704 WRITE(6,994)name(i), kw, dms(k), age, tn
706 994
FORMAT(
' MDOT WARNING! AGE > TN NM KW DMS AGE TN ',
707 & i6,i4,f7.3,1p,2e9.1)
709 age = min(age,0.9999d0*tscls(11))
711 age = min(age,0.9999d0*tscls(5))
712 age = min(age,1.0001d0*tn)
717 CALL
hrdiag(m0,age,m1,tm,tn,tscls,lums,gb,zpars,
718 & rm,lum,kw,mc,rcc,me,re,k2)
721 IF(dmr.GT.tiny.AND.kw.EQ.11)
THEN
722 dme = 2.08d-03*(1.d0/(1.d0 + zpars(11)))*rm
723 IF(abs(dma(k)).GT.0.4d0*dme) kw = 12
727 IF(kw.NE.kstar(i))
THEN
729 WRITE(6,915)i,name(i),m0,kstar(i),tevk*tstar-epch0(k)
730 915
FORMAT (
' MDOT WARNING! SN KW=15 I NM M0 KSTAR AGE ',
732 IF (name(n+kspair).LT.0)
THEN
741 jspin(k) = k3*rcc*rcc*mc*ospin(k)
745 dms(k) = mass(k) - m1
746 dmr = abs(dms(k)/(mass(k) + 1.0d-10))
759 IF((kw.EQ.kstar(i).AND.age.GE.0.99*tn).OR.
760 & (kstar(i).LE.6.AND.kw.GT.6).OR.
761 & (kstar(i).LE.9.AND.kw.GT.9))
THEN
765 CALL
hmdot(i,imerge,m1,kw,mc,dmsun,rnew,iterm)
767 CALL
hmdot2(i,ighost,imerge,m1,kw,mc,dmsun,rnew,iterm)
779 IF (i.LT.ifirst.AND.ihdot.EQ.0)
THEN
782 IF (name(n+kspair).GT.0) itry = 2
784 IF (kz(27).GT.1)
THEN
788 IF (namec(kk).EQ.name(n+kspair)) ic = kk
790 IF (ic.EQ.0) ic = nchaos + 1
793 IF (i.EQ.2*kspair) kk = 2
800 IF (i.LT.ifirst.AND.icorr.AND.ihdot.EQ.0)
THEN
802 semi = -0.5d0*body(n+kspair)/h(kspair)
803 IF (name(n+kspair).GT.0)
THEN
805 IF (kstar(i).LT.10.AND.kw.GE.10)
THEN
812 IF ((dmr.GT.0.2.AND.r(kspair).GT.rmin).OR.
813 & (dm.GT.0.0.AND.h(kspair) + dm/semi.GT.-eclose.AND.
814 & kstar(n+kspair).GE.0).OR.
816 & (kw.NE.kstar(i).AND.
817 & (kw.GE.13.OR.(kw.GE.11.AND.kz(25).GE.1).OR.
818 & (kw.EQ.10.AND.kz(25).GT.1))))
THEN
819 i = i + 2*(npairs - kspair)
822 jx(3-k) = jx(3-k) + 2*(npairs - kspair)
830 ELSE IF (dm.NE.0.d0)
THEN
832 CALL
hcorr(i,dm,rnew)
837 IF (i.EQ.2*kspair.AND.name(i).LE.nzero.AND.
838 & name(n+kspair).GT.-2*nzero.AND.dm.GT.0.0d0.AND.
840 & h(kspair) + dm/semi.LT.-eclose.AND.
841 & (kw.LT.10.OR.(kw.LT.11.AND.kz(25).LT.2).OR.
842 & (kw.LT.13.AND.kz(25).LT.1)))
THEN
843 CALL
hcorr(i,dm,rnew)
844 ELSEIF(dm.GT.0.d0)
THEN
853 IF (m1.GT.1.05*turn.AND.kstar(i).EQ.1.AND.kw.EQ.2)
THEN
854 WRITE(6,920) i, name(i), kw, tphys, age, m1, m0
855 920
FORMAT(
' END BS: I NAM KW TP AGE M1 M0 ',
856 & 2i6,i4,2f8.1,2f6.1)
871 j = 2*kspair - 2 + ihdot
872 body(j) = body(j) - dm
875 IF(dmsun.LT.tol) goto 250
878 zmdot = zmdot + dmsun
881 IF(mass(k)/zmbar.GE.0.99*body1.AND.nsub.EQ.0)
THEN
884 body1 = max(body1,body(j))
893 ELSEIF(kw.EQ.5.OR.kw.EQ.6)
THEN
895 ELSEIF(kw.GE.7.AND.kw.LE.9)
THEN
897 ELSEIF(kw.GE.10.AND.kw.LE.12)
THEN
899 ELSEIF(kw.EQ.13.OR.kw.EQ.15)
THEN
906 IF (kz(19).GT.3)
THEN
907 WRITE(6,36) i, name(i), kw, kstar(i), body(i)*zmbar,
908 & dmsun, zmdot, tphys
909 36
FORMAT(
' MDOT: I NM KW K* MS DMS ZMDOT T6 ',
910 & 4i5,f6.1,f7.2,f7.1,f8.1)
914 IF (i.LT.ifirst)
THEN
919 IF (list(1,i1).EQ.0)
THEN
925 IF (ighost.GT.0)
THEN
937 IF (i.EQ.n) ilist(2) = n - 1
949 IF (t0(j).LT.time)
THEN
956 IF (kz(25).EQ.1.AND.(kw.EQ.10.OR.kw.EQ.11)) ikick = .true.
957 IF (kz(25).EQ.2.AND.kw.EQ.12) ikick = .true.
959 IF (kw.EQ.13.OR.kw.EQ.14) ikick = .true.
962 IF (dmsun.LT.0.05.AND.(kw.LT.10.OR..NOT.ikick))
THEN
969 IF (i.GT.n) ipoly = -1
972 IF (abs(dmsun).GT.0.1.OR.kw.GE.13.OR.ikick)
THEN
980 x0dot(kk,j) = xdot(kk,j)
987 IF (kz(14).GE.3.AND.kz(31).GT.0)
THEN
994 IF (ighost.GT.0) i = ii
995 IF(iphase.EQ.-3) iphase = 0
1000 t0(i) = tadj + dtadj
1003 ri = sqrt(x(1,i)**2 + x(2,i)**2 + x(3,i)**2)
1004 vi = sqrt(xdot(1,i)**2 + xdot(2,i)**2 + xdot(3,i)**2)
1007 x0(l,i) = min(1.0d+04+x(l,i),1000.0*rscale*x(l,i)/ri)
1009 x0dot(l,i) = sqrt(0.004*zmass/rscale)*xdot(l,i)/vi
1010 xdot(l,i) = x0dot(l,i)
1030 IF (list(1,i1).GT.0)
THEN
1044 ELSEIF(kw.GE.7.AND.kw.LE.9.AND.kw0.LE.6)
THEN
1046 ELSEIF(kw.GE.10.AND.kw.LE.12.AND.kw0.LE.9)
THEN
1048 ELSEIF((kw.EQ.13.OR.kw.EQ.15).AND.kw0.LE.12)
THEN
1050 ELSEIF(kw.EQ.14.AND.kw0.LE.13)
THEN
1056 IF (rnew - radius(i).GT.0.5*radius(i))
THEN
1057 WRITE(43,924) i, name(i), tphys, dt/1.0d+06,
1058 & kstar(i), kw, m0, m1, radius(i)*su, rnew*su
1059 924
FORMAT(
' EXPAND! I NM TP DTP K* KW M0 M R RN ',
1060 & 2i6,f7.1,f7.3,2i4,2f7.1,2f7.1)
1068 jspin(k) = max(jspin(k) - djspin(k),1.0d-10)
1071 ospbru = twopi*sqrt(mass(k)*aursun**3/rad(k)**3)
1072 jspbru = (k2str(k)*(mass(k)-massc(k))*rad(k)*rad(k) +
1073 & k3*massc(k)*radc(k)*radc(k))*ospbru
1074 IF(jspin(k).GT.jspbru) jspin(k) = jspbru
1075 spin(i) = jspin(k)/spnfac
1082 WRITE(6,925)i,name(i),kw0,kw,m10,m1,dms(k),rm,age
1083 925
FORMAT(
' MDOT CHANGE: I NM K* M0 M1 DM R AGE',
1084 & 2i6,2i4,2f6.1,f7.3,f7.2,f8.1)
1086 IF (i.LT.ifirst.AND.kz(8).GT.3)
THEN
1092 IF (kz(19).GT.3.AND.(kw0.NE.kw.OR.icorr))
THEN
1098 WRITE(6,926)which1, tphys, i, name(i), dmr, kw0, kw, m0, m1,
1099 & radius(i)*su, emdot
1100 926
FORMAT(
' NEW',a8,
' TPHYS I NAM DM/M KW0 KW M0 M R EMD ',
1101 & f7.1,2i5,f6.2,2i3,2f6.1,f7.1,f10.5)
1105 epoch(i) = age0(k) + epch0(k) - age
1110 CALL
trdot(i,dtm,m1)
1111 tev(i) = tev(i) + dtm
1114 IF(name(ighost).LT.0.OR.name(ighost).GT.nzero)
THEN
1115 tev(ighost) = tev(i)
1123 rij2 = (x(1,icomp) - x(1,jcomp))**2 +
1124 & (x(2,icomp) - x(2,jcomp))**2 +
1125 & (x(3,icomp) - x(3,jcomp))**2
1126 IF (rij2.LT.rmin22)
THEN
1133 IF ((kw.EQ.13.OR.kw.EQ.14).AND.h(npairs).LT.0.0)
THEN
1136 semi = -0.5d0*body(j)/h(npairs)
1138 ecc2 = (1.0 - ra)**2 + tdot2(npairs)**2/(body(j)*semi)
1139 tk = days*semi*sqrt(semi/body(j))
1140 WRITE(6,928) kw, sqrt(ecc2), ra, semi*su, tk, step(j),
1141 & body(j)*zmbar, (xdot(kk,j)*vstar,kk=1,3)
1142 928
FORMAT(
' WD/NS BINARY KW E R/A A P DT M V ',
1143 & i4,2f6.2,1p,3e10.2,0p,4f7.1)
1145 IF(kw.GE.10.AND.h(npairs).LT.0.0)
THEN
1147 CALL
degen(npairs,npairs,3)
1151 IF(kstar(j1).GE.10.AND.kstar(j2).GE.10)
THEN
1165 IF(kw.EQ.14.AND.kstar(i).LT.14.AND.i.LE.n)
THEN
1166 WRITE(6,930) i, name(i), kw0, kw, kstar(i), m0, m1, dmr
1167 930
FORMAT(
' NEW BH/TZ I NM K0 KW K* M0 M1 DM/M ',
1173 IF((kstar(i).GE.10.AND.kstar(i).LE.12).AND.ihdot.EQ.0)
THEN
1174 IF(body(i)*zmbar.GT.mch)
THEN
1175 WRITE(6,932)i,kw,body0(i)*zmbar,body(i)*zmbar,radius(i)
1176 932
FORMAT(
' DANGER! MDOT I K* M0 M R ',2i5,2f7.2,1p,e9.1)
1177 WRITE(6,934) name(i), ttot, tev0(i), tev(i)
1178 934
FORMAT(
' NAM T TEV0 TEV ',i6,3f10.2)
1185 IF (radius(i).GE.0.0.AND.radius(i).LT.1.0) go to 105
1186 WRITE(6,936) i, kstar(i), m1, radius(i)
1187 936
FORMAT(
' DANGER! MDOT I K* M1 R* ',i5,i4,f7.2,1p,e10.1)
1192 IF(itry.GT.0.AND.ighost.EQ.0)
THEN
1196 IF(kstar(i).LT.0)
THEN
1197 IF(kw.GE.10.AND.dmr.GT.0.0)
THEN
1198 WRITE(6,940) name(ii), kstar(ii), kw, dmr
1199 940
FORMAT(
' DEGEN SPIRAL NAM K* DMR ',i5,2i4,1p,e9.1)
1202 IF (iphase.LE.0) ipoly = -1
1203 IF(dmr.LT.0.0) goto 1
1205 IF(kw.GE.10.AND.icorr)
THEN
1207 CALL
degen(ipair,ipair,3)
1211 IF(kstar(j1).GE.10.AND.kstar(j2).GE.10) ndd = ndd + 1
1219 IF(kspair.EQ.0) kacc = 1
1221 tev(jx(1)) = min(tev(jx(1)),tev(jx(2)))
1222 IF(dtgr.LT.1.0d+10)
THEN
1223 tev(jx(1)) = min(tev(jx(1)),tev0(jx(1))+dtgr/tstar)
1225 tev(jx(2)) = tev(jx(1))
1230 IF(kspair.GT.0.AND.ighost.EQ.0)
THEN
1234 IF(h(ipair).LT.0.d0.AND.name(i).GT.0.AND.kstar(i).GE.0)
THEN
1235 CALL
brake(ipair,dsep,ecc)
1236 IF(iqcoll.NE.0.OR.iphase.LT.0) go to 1
1261 IF(kstar(i).GT.0.AND.kz(34).GT.0)
THEN
1263 IF (kz(34).EQ.1.AND.kstar(i).GT.0.AND.
1264 & mod(kstar(i),2).EQ.0)
THEN
1266 IF(iqcoll.NE.0.OR.iphase.LT.0) go to 1
1270 IF(dtr.LT.step(i))
THEN
1272 IF(iqcoll.NE.0.OR.iphase.LT.0) go to 1
1275 IF(kstar(i).GT.10.AND.mod(kstar(i),2).EQ.1)
THEN
1278 tev(j1) = max(1.000002d0*tev(i),tev(j1))
1279 tev(j2) = max(1.000002d0*tev(i),tev(j2))
1289 IF(tev(j).LE.tmdot)
THEN
1295 IF (tmdot.LT.time) go to 1
1299 104
IF (nmerge.GT.0)
THEN
1300 IF (kstarm(imerge).LT.0.AND.tmdis(imerge).LT.time)
THEN
1304 IF (name(i).EQ.namem(imerge))
THEN
1308 IF (kspair.GT.0)
THEN
1311 IF (namec(k).EQ.name(n+kspair)) ic = k
1314 semi = -0.5*(bm(1,imerge) + bm(2,imerge))/hm(imerge)
1316 WRITE (6,108) nameg(imerge), name(n+kspair),kstar(i1),
1317 & es(ic), tmdis(imerge), semi
1318 108
FORMAT (
' TMDIS TERM NAMG NAMCM K* E TMD A ',
1319 & 2i7,i4,f8.4,f8.2,1p,e10.2)
1329 IF (imerge.LE.nmerge) go to 104
1335 body1 = max(body1,body(j))
1340 IF(kstar(j).EQ.0.AND.name(j).GT.0.AND.tev(j).LT.9.9e+09.AND.
1341 & body(j).GT.0.0.AND.kz(28).EQ.0)
THEN
1342 WRITE(6,556)j,name(j),tev(j)
1344 556
FORMAT(
' MDOT TEV SMALL ',2i8,1p,e10.2)
1349 IF (ipoly.LT.0)
THEN