8 common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
10 REAL*8 firr(3),fd(3),dx(3),dv(3),fp(3),fpd(3),fcm(3),fcmd(3)
26 5 a1 = x(1,j) - x(1,i)
29 rij2 = a1*a1 + a2*a2 + a3*a3
31 dv(1) = xdot(1,j) - xdot(1,i)
32 dv(2) = xdot(2,j) - xdot(2,i)
33 dv(3) = xdot(3,j) - xdot(3,i)
35 dr3i = body(j)*dr2i*sqrt(dr2i)
36 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
42 fcmd(1) = (dv(1) - a1*drdv)*dr3i
43 fcmd(2) = (dv(2) - a2*drdv)*dr3i
44 fcmd(3) = (dv(3) - a3*drdv)*dr3i
56 dx(l) = xc(l,jj) - x(l,i)
57 dv(l) = uc(l,jj) - xdot(l,i)
59 drdv = drdv + dx(l)*dv(l)
62 dr3i = bodyc(jj)*dr2i*sqrt(dr2i)
67 fp(l) = fp(l) + dx(l)*dr3i
68 fpd(l) = fpd(l) + (dv(l) - dx(l)*drdv)*dr3i
74 firr(k) = firr(k) + body(i)*(fp(k) - fcm(k))*bodyin
75 fd(k) = fd(k) + body(i)*(fpd(k) - fcmd(k))*bodyin