Nbody6
 All Files Functions Variables
nbrem.f
Go to the documentation of this file.
1  SUBROUTINE nbrem(ICM,NSYS,NP)
2 *
3 *
4 * Removal of ghosts from neighbour lists.
5 * ---------------------------------------
6 *
7  include 'common6.h'
8 *
9 *
10 * Examine all members inside neighbour radius of body #ICM.
11  DO 100 ll = 1,np
12  i = jpert(ll)
13  10 nnb1 = list(1,i) + 1
14  IF (nnb1.EQ.1) go to 100
15 *
16 * First see whether body #ICM is a neighbour.
17  DO 20 l = 2,nnb1
18  IF (list(l,i).EQ.icm) THEN
19  go to 30
20  ELSE
21  IF (list(l,i).GT.icm) go to 100
22  END IF
23  20 CONTINUE
24 *
25 * Remove any other members of the subsystem.
26  30 DO 60 k = 1,nsys
27  j = jlist(k)
28  IF (j.EQ.icm) go to 60
29 *
30 * Determine location of body #J.
31  DO 50 l = 2,nnb1
32  IF (list(l,i).EQ.j) THEN
33 * Reduce membership and move all subsequent members up by one.
34  list(1,i) = list(1,i) - 1
35  nnb1 = nnb1 - 1
36  DO 40 lj = l,nnb1
37  list(lj,i) = list(lj+1,i)
38  40 CONTINUE
39  go to 60
40  ELSE
41  IF (list(l,i).GT.j) go to 60
42  END IF
43  50 CONTINUE
44  60 CONTINUE
45 *
46 * Also check any KS perturber list.
47  IF (i.GT.n) THEN
48  i = 2*(i - n) - 1
49  IF (list(1,i).GT.0) go to 10
50  END IF
51  100 CONTINUE
52 *
53  RETURN
54 *
55  END