Nbody6
 All Files Functions Variables
events.f
Go to the documentation of this file.
1  SUBROUTINE events
2 *
3 *
4 * Output of mass loss or tidal capture events.
5 * --------------------------------------------
6 *
7  include 'common6.h'
8  INTEGER ntype(17)
9  real*8 thookf,tbgbf
10  external thookf,tbgbf
11 *
12 *
13 * Check counter for stellar evolution events.
14  IF (nmdot.GT.0) THEN
15  DO 5 j = 1,16
16  ntype(j) = 0
17  5 CONTINUE
18 *
19  km = 1
20  zmx = 0.0
21  DO 10 j = 1,n
22  kw = kstar(j) + 1
23  kw = min(kw,16)
24  kw = max(kw,1)
25  ntype(kw) = ntype(kw) + 1
26  km = max(km,kw)
27  zmx = max(body(j),zmx)
28  10 CONTINUE
29 *
30  WRITE (6,15)
31  15 FORMAT (/,6x,'NMDOT NRG NHE NRS NNH NWD NSN NBH NBS',
32  & ' ZMRG ZMHE ZMRS ZMNH ZMWD ZMSN ZMDOT',
33  & ' NTYPE')
34  WRITE (6,20) nmdot, nrg, nhe, nrs, nnh, nwd, nsn, nbh, nbs,
35  & zmrg, zmhe, zmrs, zmnh, zmwd, zmsn, zmdot,
36  & (ntype(j),j=1,km)
37  20 FORMAT (' #4',i9,8i5,2f6.1,f7.1,3f6.1,f8.1,i7,i6,9i4,i5,4i4)
38  END IF
39 *
40 * Determine turnoff mass at current cluster age (cf. routine STAR).
41  IF (time.LE.0.0d0) THEN
42  turn = body1*zmbar
43  ELSE
44  tphys = (time + toff)*tstar
45  turn = body1*zmbar
46  turn2 = 2.0*turn
47  25 tm = max(zpars(8),thookf(turn))*tbgbf(turn)
48  IF (tm.GT.tphys) THEN
49  turn = 1.01*turn
50  ELSE
51  turn = 0.985*turn
52  END IF
53  IF (abs(tm - tphys).GT.1.0.AND.turn.LT.turn2) go to 25
54  END IF
55 *
56 * Check output for tidal capture, collisions or coalescence.
57  IF (ndiss + ncoll + ncoal.GT.0.OR.egrav.LT.0.0d0) THEN
58 * Form the net energy gain in binary interactions.
59  degrav = ebin + esub + ebesc + emesc + emerge + egrav - ebin0
60  WRITE (6,30)
61  30 FORMAT (/,5x,'NDISS NTIDE NSYNC NCOLL NCOAL NDD NCIRC',
62  & ' NROCHE NRO NCE NHYP NHYPC EBIN ',
63  & ' EMERGE ECOLL EMDOT ECDOT EKICK ESESC ',
64  & ' EBESC EMESC DEGRAV EBIND MAXM')
65  WRITE (6,35) ndiss, ntide, nsync, ncoll, ncoal, ndd, ncirc,
66  & nroche, nro, nce, nhyp, nhypc, ebin, emerge,
67  & ecoll, emdot, ecdot, ekick, esesc, ebesc,
68  & emesc, degrav, e(3), zmx*smu
69  35 FORMAT (' #5',i8,i6,3i7,i5,i7,i8,2i5,i6,i7,3f8.3,4f7.3,f8.3,
70  & f7.3,2f8.3,f6.1)
71  END IF
72 *
73  RETURN
74 *
75  END