1 SUBROUTINE chfirr(I,IR,XI,XIDOT,FIRR,FD)
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 & xj(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,
16 REAL*8 xi(3),xidot(3),dx(3),dv(3),firr(3),fd(3),fp(3*ncmax),
17 & fpsum(3),fpd(3*ncmax),fpdsum(3)
35 rpert2 = cmsep2*(0.5*rsum)**2
40 dx(1) = x(1,j) - xi(1)
41 dx(2) = x(2,j) - xi(2)
42 dx(3) = x(3,j) - xi(3)
43 rij2 = dx(1)**2 + dx(2)**2 + dx(3)**2
45 IF (rij2.GT.rpert2) go to 30
50 IF (rij2.GT.cmsep2*r(jp)**2.OR.list(1,j1).EQ.0) go to 5
60 dx(k) = x(k,j) - xi(k)
61 dv(k) = xdot(k,j) - xidot(k)
63 drdv = drdv + dx(k)*dv(k)
66 dr3i = body(j)*dr2i*sqrt(dr2i)
71 firr(k) = firr(k) - dx(k)*dr3i
72 fd(k) = fd(k) - (dv(k) - dx(k)*drdv)*dr3i
98 rij2 = a1*a1 + a2*a2 + a3*a3
101 IF (rij2.GT.rpert2) go to 70
105 IF (rij2.LT.400.0*r(k-n)**2)
THEN
118 dx(l) = x(l,k) - xc(l,im)
119 dv(l) = xdot(l,k) - uc(l,im)
121 drdv = drdv + dx(l)*dv(l)
124 dr3i = body(k)*dr2i*sqrt(dr2i)
129 fp(im1+l) = fp(im1+l) + dx(l)*dr3i
130 fpd(im1+l) = fpd(im1+l) + (dv(l) - dx(l)*drdv)*dr3i
137 IF (kdum.GT.0) k = kdum
149 dx(l) = x(l,k) - xi(l)
150 dv(l) = xdot(l,k) - xidot(l)
152 drdv = drdv + dx(l)*dv(l)
155 dr3i = body(k)*dr2i*sqrt(dr2i)
160 firr(l) = firr(l) + dx(l)*dr3i
161 fd(l) = fd(l) + (dv(l) - dx(l)*drdv)*dr3i
175 fpsum(k) = fpsum(k) + bodyc(l)*fp(l1+k)
176 fpdsum(k) = fpdsum(k) + bodyc(l)*fpd(l1+k)
183 firr(k) = fpsum(k)*bodyin + firr(k)
184 fd(k) = fpdsum(k)*bodyin + fd(k)