Nbody6
xcpred.f
Go to the documentation of this file.
1  SUBROUTINE xcpred(KCASE)
2 *
3 *
4 * Prediction of global chain coordinates.
5 * ---------------------------------------
6 *
7  include 'common6.h'
8  REAL*8 m,mass,mc,mij,mkk
9  parameter(nmx=10,nmx3=3*nmx,nmxm=nmx*(nmx-1)/2)
10  common/chain1/ xch(nmx3),vch(nmx3),m(nmx),
11  & zz(nmx3),wc(nmx3),mc(nmx),
12  & xi(nmx3),pi(nmx3),mass,rinv(nmxm),rsum,mkk(nmx),
13  & mij(nmx,nmx),tkk(nmx),tk1(nmx),iname(nmx),nn
14  common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
15  & listc(lmax)
16 *
17 *
18 * Check indicator for prediction of perturbers & c.m.
19  IF (kcase.EQ.0) go to 4
20 *
21 * Check adding chain c.m. #ICH to perturber list for prediction.
22  IF (kcase.EQ.1) THEN
23  nnb2 = listc(1) + 2
24  listc(nnb2) = ich
25  ELSE
26 * Note KCASE = 2 for chain c.m. prediction at new block-time.
27  nnb2 = listc(1) + 1
28  END IF
29 *
30 * Predict X & XDOT of perturbers and (if needed) c.m. to order FDOT.
31  DO 1 l = 2,nnb2
32  j = listc(l)
33  s = time - t0(j)
34  s1 = 1.5*s
35  s2 = 2.0*s
36 * Note no bad effects in DIFSY1 for prediction outside range.
37 * S = MIN(S,STEP(J))
38  x(1,j) = ((fdot(1,j)*s + f(1,j))*s + x0dot(1,j))*s + x0(1,j)
39  x(2,j) = ((fdot(2,j)*s + f(2,j))*s + x0dot(2,j))*s + x0(2,j)
40  x(3,j) = ((fdot(3,j)*s + f(3,j))*s + x0dot(3,j))*s + x0(3,j)
41  xdot(1,j) = (fdot(1,j)*s1 + f(1,j))*s2 + x0dot(1,j)
42  xdot(2,j) = (fdot(2,j)*s1 + f(2,j))*s2 + x0dot(2,j)
43  xdot(3,j) = (fdot(3,j)*s1 + f(3,j))*s2 + x0dot(3,j)
44  1 CONTINUE
45 *
46 * Obtain global coordinates & velocities from current chain & c.m.
47  4 lk = 0
48  DO 10 i = 1,nn
49  DO 5 k = 1,3
50  lk = lk + 1
51  xc(k,i) = xch(lk) + x(k,ich)
52  uc(k,i) = vch(lk) + xdot(k,ich)
53  5 CONTINUE
54  10 CONTINUE
55 *
56  RETURN
57 *
58  END