Nbody6
 All Files Functions Variables
hotsys.f
Go to the documentation of this file.
1  SUBROUTINE hotsys
2 *
3 *
4 * Hot initial system.
5 * -------------------
6 *
7  include 'common6.h'
8 *
9 *
10 * Determine the rms velocity from current kinetic energy.
11  vrms = 0.0
12  DO 10 i = 1,n
13  DO 5 k = 1,3
14  vrms = vrms + body(i)*xdot(k,i)**2
15  5 CONTINUE
16  10 CONTINUE
17  vrms = sqrt(vrms/zmass)
18 *
19 * Define GM & PC in cgs units and form velocity scale in km/sec.
20  gm = 6.67e-08*1.989e+33
21  pc = 3.0857e+18
22  vstar = 1.0e-05*sqrt(gm/pc)
23 *
24 * Ensure ZMBAR & RBAR > 0 (=0: assume <M>/Sun = 1, RBAR = 1 pc).
25  IF (zmbar.LE.0.0d0) zmbar = float(n)/zmass
26  IF (rbar.LE.0.0d0) rbar = 1.0
27 *
28 * Scale to working units of RBAR in pc & ZMBAR in solar masses.
29  vstar = vstar*sqrt(zmass*zmbar/rbar)
30 *
31 * Read central velocity dispersion and form scaling factor.
32  READ (5,*) sigma0
33  vscale = sigma0/(vstar*vrms)
34 *
35 * Scale the velocities to central velocity dispersion of SIGMA0 km/sec.
36  DO 20 i = 1,n
37  DO 15 k = 1,3
38  xdot(k,i) = vscale*xdot(k,i)
39  x0dot(k,i) = xdot(k,i)
40  15 CONTINUE
41  20 CONTINUE
42 *
43 * Rescale crossing time, output times & termination time.
44  ratio = sigma0/vstar
45  tcr = tcr/ratio
46  tcr0 = tcr
47  dtadj = dtadj/ratio
48  deltat = deltat/ratio
49  tcrit = tcrit/ratio
50  vc = vscale*vc
51 *
52  WRITE (6,30) sigma0, vrms, vscale
53  30 FORMAT (/,12x,'HOT SYSTEM: SIGMA0 =',f5.1,' <V> =',f6.3,
54  & ' VSCALE =',f6.3,/)
55 *
56  RETURN
57 *
58  END