1 SUBROUTINE degen(I1,I2,ICASE)
8 REAL*8 eb(kmax),semi(kmax),ecc(kmax),rcm(kmax),ecm(kmax)
10 LOGICAL first,first2,first3
11 SAVE first,first2,first3
12 DATA first,first2,first3 /.true.,.true.,.true./
16 IF (iphase.EQ.6.OR.iphase.EQ.7) go to 50
17 IF (icase.EQ.7) go to 40
24 IF (kstar(j1).GT.9.OR.kstar(j2).GT.9)
THEN
30 IF (nb.GT.0.AND.first)
THEN
31 OPEN (unit=4,
status=
'NEW',form=
'FORMATTED',file=
'DEGEN')
35 WRITE (4,2) rbar, bodym*zmbar, body1*zmbar, tscale,
37 2
FORMAT (/,6x,
'MODEL: RBAR =',f5.1,
' <M> =',f6.2,
38 &
' M1 =',f6.1,
' TSCALE =',f6.2,
39 &
' NB =',i4,
' N0 =',i6,//)
42 3
FORMAT (
' # TPHYS A E Rp/R* P r',
52 IF (kstar(j1).LT.10.AND.kstar(j2).LT.10) go to 20
56 IF (body(j1).GT.0.0)
THEN
57 eb(jpair) = body(j1)*body(j2)*h(ipair)/
58 & (body(j1) + body(j2))
59 semi(jpair) = -0.5d0*body(icm)/h(ipair)
60 ecc2 = (1.d0 - r(ipair)/semi(jpair))**2 +
61 & tdot2(ipair)**2/(body(icm)*semi(jpair))
62 ecc(jpair) = sqrt(ecc2)
64 IF (r(ipair).GT.2.0*semi(jpair))
THEN
67 eb(jpair) = max(eb(jpair),-9.99999d0)
70 semi(jpair) = r(ipair)
73 rcm(jpair) = sqrt((x(1,icm) - rdens(1))**2 +
74 & (x(2,icm) - rdens(2))**2 +
75 & (x(3,icm) - rdens(3))**2)
77 vj2 = xdot(1,icm)**2 + xdot(2,icm)**2 +
91 ecm(jpair) = 0.5d0*vj2 - potj
98 tk = semi(jpair)*sqrt(abs(semi(jpair))/(body(icm) + 1.0d-20))
100 tk = min(tk,999999.9d0)
101 rbig = max(radius(j1),radius(j2))
102 ratio = semi(jpair)*(1.d0 - ecc(jpair))/rbig
103 ratio = min(ratio,99.9d0)
104 IF (semi(jpair).LT.0.0.AND.ratio.GT.5.0) go to 20
105 semi(jpair) = semi(jpair)*rbar*au
106 IF (iprint.EQ.0.AND.icase.EQ.0)
THEN
109 WRITE (4,10) icase, tphys, semi(jpair), ecc(jpair), ratio,
110 & tk, rcm(jpair), body(j1)*zmbar, body(j2)*zmbar,
111 & kstar(j1), kstar(j2), kstar(icm),
113 10
FORMAT (i2,f8.1,f8.2,f7.3,f6.1,f9.1,f6.2,2f5.1,3i4,2i6)
118 IF (iprint.GT.0.AND.icase.EQ.0)
THEN
125 IF (kstar(j).EQ.13)
THEN
127 OPEN (unit=33,
status=
'NEW',form=
'FORMATTED',
131 IF (j.LT.ifirst)
THEN
134 vi2 = xdot(1,i)**2 + xdot(2,i)**2 +
138 vi2 = xdot(1,j)**2 + xdot(2,j)**2 +
141 WRITE (33,25) which1, j, name(j), ifirst, kstar(j),
142 & tphys, sqrt(vi2)*vstar
143 25
FORMAT (1x,a8,
'NS',
' J NAM I* K* TPH V ',
146 ELSE IF (kstar(j).GT.13)
THEN
147 IF (j.LT.ifirst)
THEN
149 IF (name(jcm).LT.0) go to 30
152 OPEN (unit=34,
status=
'NEW',form=
'FORMATTED',
156 vi2 = xdot(1,j)**2 + xdot(2,j)**2 +
160 IF (kstar(j).EQ.14) which1 =
' BH '
161 IF (kstar(j).EQ.15)
THEN
163 ri = sqrt(x(1,j)**2 + x(2,j)**2 + x(3,j)**2)
165 x0(l,j) = 1000.0*rscale*x(l,j)/ri
167 x0dot(l,j) = sqrt(0.004*zmass/rscale)*
169 xdot(l,j) = x0dot(l,j)
173 WRITE (34,28) which1,j,name(j),kstar(j),tphys,vi
174 28
FORMAT (1x,a8,
'J NAM K* TPH V ',2i6,i4,2f7.1)
182 40
IF (icase.EQ.7)
THEN
184 vi2 = xdot(1,j)**2 + xdot(2,j)**2 + xdot(3,j)**2
187 WRITE (33,25) which1, j, name(j), ifirst, kstar(j), tphys, vi
191 IF (icase.EQ.3.OR.icase.EQ.4)
THEN
195 IF (kstar(j1).GE.10.AND.kstar(j2).GE.10)
THEN
197 a = -0.5d0*su*body(n+ipair)/h(ipair)
198 WRITE (6,48) ipair, name(j1), name(j2), kstar(j1),
199 & kstar(j2), kstar(n+ipair), r(ipair), a, tk
200 48
FORMAT (
' NEW DD KS NM K* R A P ',i4,2i6,3i4,1p,3e10.2)