Nbody6
 All Files Functions Variables
cloud0.f
Go to the documentation of this file.
1  SUBROUTINE cloud0
2 *
3 *
4 * Cloud initialization.
5 * ---------------------
6 *
7  include 'common6.h'
8  common/clouds/ xcl(3,mcl),xdotcl(3,mcl),bodycl(mcl),rcl2(mcl),
9  & clm(mcl),clmdot(mcl),cldot,vcl,sigma,rb2,pcl2,
10  & tcl,stepcl,ncl,newcl
11 *
12 *
13 * Initialize cloud variables.
14  ncl = 0
15  tcl = 0.0d0
16  newcl = 0
17  pcl2 = 0.0
18 *
19 * Read the cloud parameters (pc, km/sec, Msun & pc).
20  READ (5,*) ncl, rb2, vcl, sigma, (clm(j),j=1,ncl),
21  & (rcl2(j),j=1,ncl)
22  WRITE (6,1) ncl, rb2, vcl, sigma
23  1 FORMAT (/,12x,'CLOUDS: NCL =',i4,' RB =',f5.1,
24  & ' MEAN VELOC =',f5.1,' DISP =',f5.1)
25  WRITE (6,2) (clm(j),j=1,ncl)
26  2 FORMAT (/,12x,'CLOUD MASSES: ',1p,10e9.1)
27  WRITE (6,3) (rcl2(j),j=1,ncl)
28  3 FORMAT (/,12x,'PLUMMER RADII: ',1p,10e9.1)
29  rbar1 = rbar
30  IF (rbar.EQ.0.0) rbar1 = 1.0
31 * Set cloud parameters in scaled units.
32  rb2 = rb2/rbar1
33  a1 = 0.047*sqrt(zmass*zmbar/rbar1)
34 * Rms velocity of cluster members in km/sec.
35  a2 = a1/sqrt(0.5d0*zmass)
36 * Velocity unit.
37  vcl = vcl/a2
38 * Cloud velocity in scaled units.
39  sigma = sigma/a2
40 * Specify conservative cloud integration step using crossing time.
41  stepcl = 0.002*tcr*rb2/vcl
42 *
43 * Adopt a quantized value.
44  CALL stepk(stepcl,dtn)
45  stepcl = dtn
46 *
47 * Scale radii & masses to model units.
48  DO 10 j = 1,ncl
49  rcl2(j) = rcl2(j)/rbar1
50  clm(j) = clm(j)/zmbar
51  10 CONTINUE
52 *
53  WRITE (6,15) rb2, vcl, sigma, stepcl
54  15 FORMAT (/,12x,'SCALING: RB =',f6.1,' VCL =',f5.1,
55  & ' SIGMA =',f5.1,' STEP =',1p,e10.2)
56  WRITE (6,20) (clm(j),j=1,ncl)
57  20 FORMAT (/,12x,'SCALED MASSES: ',10f7.2)
58  WRITE (6,25) (rcl2(j),j=1,ncl)
59  25 FORMAT (/,12x,'SCALED RADII: ',10f7.2)
60  cldot = 0.1*rb2/vcl
61 * Time scale for 'sun-rise' is 0.05 of the cloud crossing time.
62  cldot = 1.0/cldot
63 *
64 * Define the square of cloud half-mass radii & growth times.
65  DO 30 j = 1,ncl
66  rcl2(j) = rcl2(j)**2
67  clmdot(j) = clm(j)*cldot
68  30 CONTINUE
69 *
70 * Set square boundary radius & impact parameter.
71  rb2 = rb2**2
72  pcl2 = rb2
73 * Define density centre for routine CLOUD.
74  DO 40 k = 1,3
75  rdens(k) = 0.0
76  40 CONTINUE
77 *
78 * Initialize new clouds on the boundary.
79  DO 50 icl = 1,ncl
80  CALL cloud(icl)
81  50 CONTINUE
82 *
83  RETURN
84 *
85  END