Nbody6
 All Files Functions Variables
clint.f
Go to the documentation of this file.
1  SUBROUTINE clint
2 *
3 *
4 * Cloud integration.
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  REAL*8 fc(3)
12 *
13 *
14 * Check the time for advancing clouds.
15  IF (tcl + stepcl.GT.time + toff) go to 30
16 *
17 * Set time-step and update the cloud reference time.
18  dt = time + toff - tcl
19  dt1 = 0.5d0*dt
20  tcl = time + toff
21 *
22 * Integrate cloud orbits in rotating coordinates with tidal effects.
23  DO 20 icl = 1,ncl
24  fc(1) = xcl(1,icl)*tidal(1) + xdotcl(2,icl)*tidal(4)
25  fc(2) = -xdotcl(1,icl)*tidal(4)
26  fc(3) = xcl(3,icl)*tidal(3)
27  xcl2 = 0.0
28 *
29  DO 10 k = 1,3
30  xcl(k,icl) = (fc(k)*dt1 + xdotcl(k,icl))*dt + xcl(k,icl)
31  xdotcl(k,icl) = fc(k)*dt + xdotcl(k,icl)
32  xcl2 = xcl2 + (xcl(k,icl) - rdens(k))**2
33  10 CONTINUE
34 *
35 * Determine the minimum impact parameter (squared).
36  pcl2 = min(xcl2,pcl2)
37 *
38 * Check for modification of the cloud mass (increase or reduction).
39  IF (xcl2.LT.rb2) THEN
40  IF (bodycl(icl).LT.clm(icl)) THEN
41  bodycl(icl) = bodycl(icl) + clmdot(icl)*dt
42  END IF
43  ELSE
44 * Reduce cloud mass gradually by 'sun-set' procedure.
45  bodycl(icl) = bodycl(icl) - clmdot(icl)*dt
46  END IF
47 *
48 * Initialize a new cloud when current mass becomes negative.
49  IF (bodycl(icl).LE.0.0) CALL cloud(icl)
50  20 CONTINUE
51 *
52  30 RETURN
53 *
54  END