1 SUBROUTINE fchain(I,IR,XI,XIDOT,FIRR,FD)
8 common/chainc/ xc(3,ncmax),uc(3,ncmax),bodyc(ncmax),ich,
10 REAL*8 xi(3),xidot(3),dx(3),dv(3),firr(3),fd(3),xis(3),vis(3)
17 dx(k) = x(k,ich) - xi(k)
18 dv(k) = xdot(k,ich) - xidot(k)
20 drdv = drdv + dx(k)*dv(k)
23 dr3i = body(ich)*dr2i*sqrt(dr2i)
28 firr(k) = firr(k) - dx(k)*dr3i
29 fd(k) = fd(k) - (dv(k) - dx(k)*drdv)*dr3i
42 dx(l) = xc(l,j) - xi(l)
43 dv(l) = uc(l,j) - xidot(l)
45 drdv = drdv + dx(l)*dv(l)
48 dr3i = bodyc(j)*dr2i*sqrt(dr2i)
53 firr(l) = firr(l) + dx(l)*dr3i
54 fd(l) = fd(l) + (dv(l) - dx(l)*drdv)*dr3i