Nbody6
 All Files Functions Variables
brake4.f
Go to the documentation of this file.
1  SUBROUTINE brake4(I1,I2,DT)
2 *
3 *
4 * GR analytical orbit shrinkage.
5 * ------------------------------
6 *
7  include 'common6.h'
8  common/postn/ cvel,taugr,rz1,gammaz,tkoz,emax,tsp,kz24,igr,ipn
9  common/kspar/ istat(kmax)
10  REAL*8 m1,m2,ui(4),uidot(4)
11  SAVE iter
12  DATA iter /0/
13 *
14 *
15 * Check relativistic conditions (at least one >= NS).
16  IF (max(kstar(i1),kstar(i2)).LT.13) go to 100
17 *
18 * See whether CLIGHT has been initialized in ARchain.
19  IF (iter.EQ.0) THEN
20  READ (5,*) clight
21  iter = 1
22  END IF
23 *
24 * Specify the basic elements from BH or KS treatments.
25  m1 = body(i1)
26  m2 = body(i2)
27  ipair = kvec(i1)
28  i = n + ipair
29  semi = -0.5*body(i)/h(ipair)
30  e2 = (1.0 - r(ipair)/semi)**2 + tdot2(ipair)**2/(body(i)*semi)
31  ecc = sqrt(e2)
32 *
33 * Replace the BH value of CVEL by CLIGHT for standard binaries.
34  IF (cvel.EQ.0.0d0) cvel = clight
35 *
36 * Form da/dt & de/dt according to Peters 1964.
37  adot = 64.0/5.0*m1*m2*(m1+m2)/(cvel**5*semi**3*(1.0 - e2)**3.5)
38  adot = adot*(1.0 + 73.0/24.0*e2 + 37.0/96.0*e2**2)
39  edot = 304.0/15.0*ecc*m1*m2*(m1 + m2)/(cvel**5*semi**4)
40  edot = edot/(1.0 - e2)**2.5*(1.0 + 121.0/304.0*e2)
41  tgr = semi/adot
42 *
43 * Skip for long time-scale (low probability of unperturbed orbit).
44  IF (tgr.GT.500.0) go to 100
45 *
46 * Set local KS vectors.
47  DO 2 k = 1,4
48  ui(k) = u0(k,ipair)
49  uidot(k) = udot(k,ipair)
50  2 CONTINUE
51 *
52 * Evaluate the Einstein shift per orbit and check time-step.
53  dw = 3.0*twopi*(body(i1) + body(i2))/(semi*cvel**2*(1.0-e2))
54  tk = twopi*semi*sqrt(semi/(body(i1) + body(i2)))
55 * Adopt time-scale of 2 % relative change (subject to c.m. step).
56  dt = min(0.02*semi/adot,step(i))
57  theta = dw*dt/tk
58 * Impose limit of time-step if THETA > TWOPI.
59  IF (theta.GT.twopi) THEN
60  dt = twopi*tk/dw
61  END IF
62  step(i1) = dt
63 * THETA = DMOD(THETA,TWOPI) ! original condition.
64 *
65 * Rotate KS orbit by THETA/2 (period halving).
66  CALL ksrot(ui,uidot,theta)
67 *
68 * Copy back to KS common variables.
69  DO 15 k = 1,4
70  u(k,ipair) = ui(k)
71  u0(k,ipair) = ui(k)
72  udot(k,ipair) = uidot(k)
73  15 CONTINUE
74 *
75 * Define RZ and obtain the incremental change in SEMI & ECC.
76  rz = 8.0*(m1 + m2)/cvel**2
77  semi1 = max(semi - adot*dt,rz)
78  ecc1 = max(ecc - edot*dt,0.0d0)
79  IF (semi1.LT.0.5*semi) THEN
80  WRITE (6,20) name(i1), semi, semi1, adot*dt
81  20 FORMAT (' PN WARNING NM A A1 ADOT*DT ',i6,1p,3e10.2)
82  END IF
83 *
84 * Update binding energy and collision energy.
85  hi = h(ipair)
86  h(ipair) = -0.5*body(i)/semi1
87  zmu = body(i1)*body(i2)/body(i)
88  ecoll = ecoll + zmu*(hi - h(ipair))
89 *
90  IF (iter.LT.10000) THEN
91  WRITE (93,30) name(i1), time+toff, ecc1, semi1
92  30 FORMAT (' ',i7,f10.3,f9.5,1p,e12.4)
93  CALL flush(93)
94  END IF
95 *
96 * Change KS variables at original ecc and modify ECC at H = const.
97  CALL expand2(ipair,semi)
98  CALL ksperi(ipair)
99 * Note simplified versions of standard routines (new STEP(I1) given).
100  CALL deform2(ipair,ecc,ecc1)
101 *
102  iter = iter + 1
103  IF (iter.LT.1000.OR.mod(iter,1000).EQ.0) THEN
104  WRITE (94,40) time+toff, ecc, theta, dt, tgr, semi
105  40 FORMAT (' GR SHRINK T E TH DT TGR A ',
106  & f11.4,f9.5,1p,3e9.1,e12.4)
107  CALL flush(94)
108  END IF
109 *
110 * Check KS termination with added perturber to activate PN.
111  IF (tgr.LT.0.5) THEN
112 * Note that first order Peters formulation is not valid for strong GR.
113  jp = list(2,i)
114  list(1,i1) = 1
115  list(2,i1) = jp
116 * Set PN indicator for ARCHAIN (TGR limit means small TZ).
117  ipn = 3
118  WRITE (6,44) jp, name(jp), step(i1), step(i), semi, tgr
119  44 FORMAT (' ENFORCED PERTURB JP NM S1 SI A TZ',2i6,1p,5e10.2)
120  go to 100
121  END IF
122 *
123 * Activate coalescence condition using local index.
124  jphase = 0
125  IF (semi1.LT.100.0*rz.AND.tgr.LT.0.1) THEN
126  WRITE (6,45) kstar(i1), kstar(i2), radius(i1), radius(i2),
127  & semi1
128  45 FORMAT (' PN COAL K* R1 R2 A ',2i4,1p,3e10.2)
129  CALL flush(6)
130  iqcoll = -2
131  jphase = -1
132 * KSPAIR = IPAIR
133 * CALL CMBODY(SEMI1,2)
134 *
135 * Include optional kick velocity of 3*VRMS km/s for coalescence recoil.
136  IF (kz(43).GT.0) THEN
137 * Initialize basic variables at start of new step.
138  vi20 = 0.0
139  DO 48 k = 1,3
140  x0(k,i) = x(k,i)
141  x0dot(k,i) = xdot(k,i)
142  vi20 = vi20 + xdot(k,i)**2
143  48 CONTINUE
144 *
145  vf = 3.0*(vrms/vstar)/sqrt(vi20)
146  DO 50 k = 1,3
147  xdot(k,i) = vf*xdot(k,i)
148  x0dot(k,i) = xdot(k,i)
149  50 CONTINUE
150  ecd0 = ecdot
151  ecdot = ecdot + 0.5*body(i)*vi20*(1.0 - vf**2)
152  vesc = 3.0*vrms
153  WRITE (6,60) vf, ecd0-ecdot, vesc
154  60 FORMAT (' COALESCENCE KICK VF ECDOT VESC ',
155  & f7.3,f10.6,f6.1)
156 * Form neighbour list and new polynomials.
157  rs0 = rs(i)
158  CALL nblist(i,rs0)
159  CALL fpoly1(i,i,0)
160  CALL fpoly2(i,i,0)
161  END IF
162  END IF
163 *
164  IF (istat(kcase).EQ.0) istat(kcase) = jphase
165 *
166  100 RETURN
167 *
168  END