Nbody6
 All Files Functions Variables
nbody6.f
Go to the documentation of this file.
1 *
2 * N B O D Y 6
3 * ***********
4 *
5 * Regularized N-body code with synthetic stellar evolution.
6 * ---------------------------------------------------------
7 *
8 * Hermite integration method with block-steps & AC scheme.
9 * --------------------------------------------------------
10 *
11 * Roche-lobe mass transfer & Mardling 2007 stability criterion.
12 * -------------------------------------------------------------
13 *
14 * Developed by Sverre Aarseth, IoA, Cambridge (V 7.5 08/10).
15 * ..........................................................
16 *
17 * Binary and chain regularization: Seppo Mikkola, Turku.
18 * ......................................................
19 *
20 * Stellar evolution: Chris Tout & Jarrod Hurley (Swinburn).
21 * .........................................................
22 *
23 * GPU support: Keigo Nitadori, Riken (V 9.0.0 08/10).
24 * ...................................................
25 *
26  PROGRAM nbody6
27 *
28  include 'common6.h'
29  EXTERNAL merge
30 *
31 *
32 * Initialize the timers.
33  CALL cputim(cpu0)
34  wtot0 = 0.0
35 *
36 * Read start/restart indicator & CPU time.
37  READ (5,*) kstart, tcomp
38 *
39  IF (kstart.EQ.1) THEN
40 *
41 * Read input parameters, perform initial setup and obtain output.
42  cpu = tcomp
43  CALL start
44  CALL adjust
45  ELSE
46 *
47 * Read previously saved COMMON variables from tape/disc on unit 1.
48  CALL mydump(0,1)
49  IF (ndump.GE.3) stop
50 * Safety indicator preventing repeated restarts set in routine CHECK.
51  cpu = tcomp
52  cpu0 = 0.0
53 * Set IPHASE = -1 for new time-step list in routine INTGRT.
54  iphase = -1
55 *
56 * Initialize evolution parameters which depend on metallicity.
57  IF (kz(19).GE.3) THEN
58  CALL zcnsts(zmet,zpars)
59  END IF
60 *
61 * Check reading modified restart parameters (KSTART = 3, 4 or 5).
62  IF (kstart.GT.2) THEN
63  CALL modify(kstart)
64  END IF
65  END IF
66 *
67 * Advance solutions until next output or change of procedure.
68  1 CALL intgrt
69 *
70  IF (iphase.EQ.1) THEN
71 * Prepare new KS regularization.
72  CALL ksreg
73 *
74  ELSE IF (iphase.EQ.2) THEN
75 * Terminate KS regularization.
76  CALL ksterm
77 *
78  ELSE IF (iphase.EQ.3) THEN
79 * Perform energy check & parameter adjustments and print diagnostics.
80  CALL adjust
81 *
82  ELSE IF (iphase.EQ.4) THEN
83 * Switch to unperturbed three-body regularization.
84  isub = 0
85  CALL triple(isub)
86 *
87  ELSE IF (iphase.EQ.5) THEN
88 * Switch to unperturbed four-body regularization.
89  isub = 0
90  CALL quad(isub)
91 *
92 * Adopt c.m. approximation for inner binary in hierarchical triple.
93  ELSE IF (iphase.EQ.6) THEN
94  CALL merge
95 *
96  ELSE IF (iphase.EQ.7) THEN
97 * Restore old binary in hierarchical configuration.
98  CALL reset
99 *
100 * Begin chain regularization.
101  ELSE IF (iphase.EQ.8) THEN
102  isub = 0
103  CALL chain(isub)
104  END IF
105 *
106 * Continue integration.
107  go to 1
108 *
109  END