8 REAL*8 a1(3),a2(3),xrel(3),vrel(3),ei(3),hi(3),ho(3),
9 & tk0(100),tlast(100),tterm(100)
10 INTEGER last(100),iprint(100)
12 SAVE first,tlast,tterm,rap,tk0,last,iprint,nl
14 DATA last,iprint /200*0/
19 OPEN (unit=10,
status=
'NEW',form=
'FORMATTED',file=
'HIARCH')
24 WRITE (10,1) rbar, bodym*zmbar, body1*zmbar, tscale,
26 1
FORMAT (/,6x,
'MODEL: RBAR =',f5.1,
' <M> =',f6.2,
27 &
' M1 =',f6.1,
' TSCALE =',f6.2,
28 &
' NB =',i4,
' N0 =',i6,//)
38 2
FORMAT (
' TIME A A1 E1 PMIN',
39 &
' P1/P0 Q PCR MB Q1 I NAME',
43 &
' Rc GAM IT N0 N1 KS NAME',/)
53 IF (iphase.EQ.7.AND.nl.EQ.0)
THEN
60 IF (name(i1).EQ.last(l))
THEN
74 IF (name(i1).EQ.last(il))
THEN
77 IF (ttot - tterm(il).LT.tcr)
THEN
93 IF (iprint(il).EQ.0)
THEN
100 semi = -0.5*body(i)/h(ipair)
101 IF (semi.LT.0.0) go to 30
102 ecc2 = (1.0d0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(body(i)*semi)
105 IF (ecc.GT.0.99) go to 30
106 tk = twopi*semi*sqrt(semi/body(i))
109 IF (iphase.EQ.6)
THEN
111 IF (list(1,i1).EQ.0.OR.x(1,i1).EQ.x(1,i2))
THEN
114 q = body(i)/body(jcomp)
115 q1 = max(body(i2)/body(i1),body(i1)/body(i2))
116 rap = semi*(1.0d0 + ecc)
127 rij2 = rij2 + (x(k,i) - x(k,jcomp))**2
128 vij2 = vij2 + (xdot(k,i) - xdot(k,jcomp))**2
129 rdot = rdot + (x(k,i) - x(k,jcomp))*
130 & (xdot(k,i) - xdot(k,jcomp))
135 a1(k) = (x(k1,i1) - x(k1,i2))*(xdot(k2,i1) - xdot(k2,i2))
136 & - (x(k2,i1) - x(k2,i2))*(xdot(k1,i1) - xdot(k1,i2))
137 a2(k) = (x(k1,jcomp) - x(k1,i))*
138 & (xdot(k2,jcomp) - xdot(k2,i))
139 & - (x(k2,jcomp) - x(k2,i))*
140 & (xdot(k1,jcomp) - xdot(k1,i))
143 a1a2 = a1a2 + a1(k)*a2(k)
145 xrel(k) = x(k,i1) - x(k,i2)
146 vrel(k) = xdot(k,i1) - xdot(k,i2)
147 ri2 = ri2 + xrel(k)**2
148 vi2 = vi2 + vrel(k)**2
149 rvi = rvi + xrel(k)*vrel(k)
154 zmb = body(i) + body(jcomp)
155 semi1 = 2.0/rij - vij2/zmb
157 IF (semi1.LT.0.0) go to 30
158 ecc1 = sqrt((1.0 - rij/semi1)**2 + rdot**2/(semi1*zmb))
159 pmin = semi1*(1.0d0 - ecc1)
160 tk1 = twopi*semi1*sqrt(semi1/zmb)
161 pmin = min(pmin/rap,999.0d0)
162 tk1 = min(tk1/tk,99999.0d0)
164 fac = a1a2/sqrt(a12*a22)
167 ideg = 360.0*fac/twopi
172 ei(k) = (vi2*xrel(k) - rvi*vrel(k))/body(i) -
181 ei(k) = ei(k)/sqrt(ei2)
182 hi(k) = a1(k)/sqrt(a12)
183 ho(k) = a2(k)/sqrt(a22)
184 cosj = cosj + hi(k)*ho(k)
185 sjsg = sjsg + ei(k)*ho(k)
189 a = cosj*sqrt(1.0 - ei2)
190 z = (1.0 - ei2)*(2.0 - cosj**2) + 5.0*ei2*sjsg**2
193 z2 = z**2 + 25.0 + 16.0*a**4 - 10.0*z - 20.0*a**2 - 8.0*a**2*z
194 emax = one6*(z + 1.0 - 4.0*a**2 + sqrt(z2))
197 IF (name(i).LT.0) kcm = -10
200 WRITE (10,10) ttot, semi, semi1, ecc1, pmin, tk1, q,
201 & pcrit/semi, body(i)/bodym, q1, ideg,
202 & name(i1), name(i2), name(jcomp), kcm
203 10
FORMAT (/,
' #1',f8.1,1p,2e10.2,0p,f6.2,f7.2,f8.1,3f6.2,f5.1,
206 WRITE (30,10) ttot, semi, semi1, ecc1, pmin, tk1, q,
207 & pcrit/semi, body(i)/bodym, q1, ideg,
208 & name(i1), name(i2), name(jcomp), kcm
210 rbig = max(radius(i1),radius(i2))
211 pmin = semi*(1.0 - ecc)
212 pmin2 = semi*(1.0 - emax)
213 IF (kz(19).GE.3)
THEN
221 em = sqrt(sin(zi)**2 + ei2*cos(zi)**2)
222 WRITE (30,11) sqrt(ei2), emax, kstar(i1), kstar(i2),kstar(i),
223 & semi, a, z, pmin2, r1, r2, em
224 11
FORMAT (
' INNER: E EMAX K* SEMI A Z PM2 R1 R2 EM ',
225 & 2f8.4,3i3,1p,4e10.2,0p,2f7.1,f7.3)
230 ELSE IF (iphase.EQ.7)
THEN
231 pmin = semi*(1.0d0 - ecc)
232 pmin = min(pmin/rap,999.0d0)
233 IF (tk0(il).LE.0.0d0) tk0(il) = tk
234 tk1 = min(tk/tk0(il),99999.0d0)
235 nk = (ttot - tlast(il))/tk0(il)
236 nk1 = (ttot - tlast(il))/tk
237 nk = min(nk,99999999)
242 ri = ri + (x(k,i) - rdens(k))**2
248 IF (time.GT.min(tev(i1),tev(i2),tev(i))) it = 1
249 IF (kstar(i1).NE.0.AND.it.EQ.0) it = kstar(i1)
251 WRITE (10,20) ttot, sqrt(ri)/rc, semi, ecc, pmin, tk1,
252 & rr, gamma(ipair), it, nk, nk1, npairs, name(i2)
253 20
FORMAT (
' #2',f8.1,1p,2e10.2,0p,f6.2,f7.2,f8.1,2f6.2,i4,i10,
256 WRITE (30,20) ttot, sqrt(ri)/rc, semi, ecc, pmin, tk1,
257 & rr, gamma(ipair), it, nk, nk1, npairs, name(i2)
261 30
IF (nl.GE.100)
THEN
264 32
IF (tterm(lt).LE.0.0d0)
THEN
269 tlast(l) = tlast(l+1)
270 tterm(l) = tterm(l+1)
273 iprint(l) = iprint(l+1)