Nbody6
 All Files Functions Variables
extend.f
Go to the documentation of this file.
1  SUBROUTINE extend(ISUB)
2 *
3 *
4 * Size of (un)perturbed subsystem.
5 * --------------------------------
6 *
7  include 'common6.h'
8  common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
9  & listc(lmax)
10  common/clump/ bodys(ncmax,5),t0s(5),ts(5),steps(5),rmaxs(5),
11  & names(ncmax,5),isys(5)
12 *
13 *
14 * Set global index for chain c.m. body.
15  ncm = names(1,isub)
16  IF (isys(isub).GE.3) THEN
17  icm = ich
18  IF (name(ich).EQ.0) go to 20
19  go to 12
20  END IF
21 *
22 * Find global index for c.m. body (unperturbed triple or quad).
23  DO 10 i = ifirst,n
24  IF (ncm.EQ.name(i)) THEN
25  icm = i
26  go to 20
27  END IF
28  10 CONTINUE
29 *
30 * Include safety procedure in case c.m. body not identified.
31  12 WRITE (6,15) isub, ncm
32  15 FORMAT (5x,'WARNING! SUBSYSTEM TERMINATION ISUB =',i3,
33  & ' NCM =',i5)
34  steps(isub) = 0.0d0
35  WRITE (6,60) isub, nch, ich, name(ich)
36  60 FORMAT (' EXTEND: ISUB NCH ICH NAME(ICH) ',4i5)
37  go to 40
38 *
39 * Determine the largest perturbing force (M/R**3).
40  20 pmax = 0.0
41  nnb = list(1,icm)
42  DO 30 l = 2,nnb+1
43  j = list(l,icm)
44  rij2 = (x(1,j) - x(1,icm))**2 + (x(2,j) - x(2,icm))**2 +
45  & (x(3,j) - x(3,icm))**2
46  pij = body(j)/(rij2*sqrt(rij2))
47  IF (pij.GT.pmax) THEN
48  pmax = pij
49  END IF
50  30 CONTINUE
51 *
52 * Choose maximum of dominant perturber and all neighbours at boundary.
53  pmax = max(pmax,float(nnb)*bodym/rs(icm)**3)
54 *
55 * Specify maximum size of (un)perturbed system (limit of 100*GSTAR).
56  IF (isys(isub).LE.2) THEN
57  gstar = gmin
58  ELSE
59  gstar = 0.01*gmax
60  END IF
61  rmaxs(isub) = (100.0*gstar*body(icm)/(2.0*pmax))**0.3333
62 *
63 * Update time limit interval unless termination has been signalled.
64  IF (steps(isub).GT.0.0d0) THEN
65  steps(isub) = step(icm)
66  ELSE
67 * Set phase indicator for termination (step reduction in STEPS).
68  IF (isys(isub).LE.2) iphase = 4
69  END IF
70 *
71 * WRITE (6,35) ICM,NAME(ICM),RMAXS(ISUB),STEPS(ISUB),STEP(ICM)
72 * 35 FORMAT (' EXTEND: ICM NM RMAX STEPS STEP ',2I5,1P,3E10.2)
73  40 RETURN
74 *
75  END