8 common/binary/ cm(4,mmax),xrel(3,mmax),vrel(3,mmax),
9 & hm(mmax),um(4,mmax),umdot(4,mmax),tmdis(mmax),
10 & namem(mmax),nameg(mmax),kstarm(mmax),iflag(mmax)
11 REAL*8 xx(3,3),vv(3,3),m1,m2,m3
20 OPEN (unit=87,
status=
'NEW',form=
'FORMATTED',file=
'HIDAT')
23 1
FORMAT (/,
' NAM1 NAM2 NAM3 K* M1 M2 M3 RI',
24 &
' EMAX E0 E1 P0 P1')
31 IF (name(i).LT.-2*nzero) mult = mult + 1
33 WRITE (87,3) npairs, nrun, n, nc, nmerge, mult, newhi, ttot
34 3
FORMAT (/,i6,i4,i6,3i4,i6,f9.1)
40 DO 30 jpair = 1,npairs
42 IF (name(icm).GT.0.AND.body(icm).GT.0.0d0) go to 30
48 IF (body(icm).GT.0.0d0)
THEN
49 semi1 = -0.5*body(icm)/h(jpair)
50 ecc1 = (1.0 - r(jpair)/semi1)**2 +
51 & tdot2(jpair)**2/(body(icm)*semi1)
55 IF (name(icm).LT.-2*nzero)
THEN
59 IF (namem(k).EQ.name(icm) + 2*nzero) im = k
64 IF (nameg(im).EQ.name(k)) j = k
69 bodycm = cm(1,im) + cm(2,im)
71 semi = -0.5*bodycm/hm(im)
72 rj = sqrt(xrel(1,im)**2 + xrel(2,im)**2 + xrel(3,im)**2)
75 td2 = td2 + 2.0*um(k,im)*umdot(k,im)
77 ecc2 = (1.0 - rj/semi)**2 + td2**2/(bodycm*semi)
83 CALL
himax(j1,im,e0,semi,emax,emin,zi,tg,edav)
86 ELSE IF (body(icm).GT.0.0d0)
THEN
89 bodycm = cm(1,im) + cm(2,im)
91 semi = -0.5*bodycm/hm(im)
92 rj = sqrt(xrel(1,im)**2 + xrel(2,im)**2 + xrel(3,im)**2)
95 td2 = td2 + 2.0*um(k,im)*umdot(k,im)
97 ecc2 = (1.0 - rj/semi)**2 + td2**2/(bodycm*semi)
106 CALL
himax(j1,im,e0,semi,emax,emin,zi,tg,edav)
107 pmin = semi1*(1.0 - e1)
109 rm = semi*(1.0 - e0)/max(radius(j1),radius(j),1.0d-20)
120 CALL
inclin(xx,vv,x(1,icm),xdot(1,icm),angle)
121 pcr =
stability(m1,m2,m3,e0,e1,angle)*semi
124 IF (pmin*(1.0 - gamma(jpair)).LT.pcr.AND.e1.LT.0.96.AND.
125 & list(1,j1).GT.0)
THEN
127 WRITE (6,20) name(j1), name(j), 180.0*angle/3.14, e1,
128 & pmin, pcr, gamma(jpair), r0(jpair)
129 20
FORMAT (
' MERGE UNSTAB NAM INC E1 PM PCR G R0 ',
130 & 2i6,f7.1,f7.3,1p,4e10.2)
132 ELSE IF (body(j1).EQ.0.0d0)
THEN
137 IF (nameg(k).EQ.name(icm)) im = k
139 IF (im.EQ.0) go to 30
144 IF (name(k) - nzero.EQ.name(j1)) j = k
148 IF (body(j).EQ.0.0d0)
THEN
151 IF (namem(im).EQ.nameg(k)) jm = k
153 IF (jm.EQ.0) go to 30
157 IF (name(k).EQ.namem(jm)) j = k
171 semi1 = -0.5*body(icm)/h(jp)
172 ecc1 = (1.0 - r(jp)/semi1)**2 +
173 & tdot2(jp)**2/(body(icm)*semi1)
177 bodycm = bodyj1 + bodyj2
178 bodycm = max(bodycm,1.0d-10)
181 m3 = (body(icm) - bodycm)*smu
183 semi = -0.5*bodycm/h(jpair)
184 ecc2 = (1.0 - r(jpair)/semi)**2 +
185 & tdot2(jpair)**2/(bodycm*semi)
192 DO 26 k = ifirst,ntot
193 IF (k.EQ.icm) go to 26
194 rij2 = (x(1,k) - x(1,icm))**2 + (x(2,k) - x(2,icm))**2
195 & + (x(3,k) - x(3,icm))**2
196 phi = phi + body(k)/sqrt(rij2)
202 p0 = days*semi*sqrt(abs(semi)/bodycm)
203 p1 = days*semi1*sqrt(abs(semi1)/body(icm))
204 p0 = min(p0,9999.0d0)
206 vj2 = xdot(1,icm)**2 + xdot(2,icm)**2 + xdot(3,icm)**2
207 IF (body(icm).EQ.0.0d0) vj2 = 0.0
209 ri = sqrt((x(1,icm) - rdens(1))**2 + (x(2,icm) - rdens(2))**2
210 & + (x(3,icm) - rdens(3))**2)
211 WRITE (87,28) name(j1), nam2, name(j2), kstar(j1), kstar(j),
212 & kcm, m1, m2, m3, ri, emax, e0, e1, p0, p1
213 28
FORMAT (3i6,3i3,3f5.1,f7.2,f7.3,2f6.2,f8.1,1p,e9.1)