1 SUBROUTINE cmfreg(I,RS2,RCRIT2,VRFAC,NNB,XI,XID,FIRR,FREG,FD,FDR)
8 REAL*8 xi(3),xid(3),firr(3),freg(3),dv(3),fd(3),fdr(3)
15 IF (list(1,2*ipair-1).GT.0) np = 1
19 IF (i.LE.n.OR.np.EQ.0)
THEN
25 rmax1 = max(rmax1,r(lj))
29 rcm2 = max(rcrit2,cmsep2*rmax1**2)
39 rpert2 = cmsep2*r(ipair)**2
47 rcm2 = max(rcrit2,rpert2)
53 dv(1) = xdot(1,j) - xid(1)
54 dv(2) = xdot(2,j) - xid(2)
55 dv(3) = xdot(3,j) - xid(3)
56 rij2 = a1*a1 + a2*a2 + a3*a3
59 IF (rij2.LT.rcm2)
THEN
66 dr3i = body(j)*dr2i*sqrt(dr2i)
67 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
69 freg(1) = freg(1) + a1*dr3i
70 freg(2) = freg(2) + a2*dr3i
71 freg(3) = freg(3) + a3*dr3i
72 fdr(1) = fdr(1) + (dv(1) - a1*drdv)*dr3i
73 fdr(2) = fdr(2) + (dv(2) - a2*drdv)*dr3i
74 fdr(3) = fdr(3) + (dv(3) - a3*drdv)*dr3i
80 a1 = x(1,jdum) - xi(1)
81 a2 = x(2,jdum) - xi(2)
82 a3 = x(3,jdum) - xi(3)
83 dv(1) = xdot(1,jdum) - xid(1)
84 dv(2) = xdot(2,jdum) - xid(2)
85 dv(3) = xdot(3,jdum) - xid(3)
86 rij2 = a1*a1 + a2*a2 + a3*a3
88 IF (rij2.GT.rcm2) go to 56
92 IF (rij2.GT.rcrit2) go to 54
95 IF (rij2.GT.rs2.AND.step(j).GT.smin)
THEN
96 a7 = a1*dv(1) + a2*dv(2) + a3*dv(3)
98 IF (a7.GT.vrfac) go to 54
100 IF (jdum.EQ.i) go to 60
108 26
IF (lp.LE.np.AND.j.GT.jp)
THEN
118 IF (rij2.GT.cmsep2*r(j-n)**2) go to 30
120 IF (list(1,kdum).GT.0)
THEN
134 IF (list(1,kdum).GT.0)
THEN
143 dr3i = body(j)*dr2i*sqrt(dr2i)
144 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
146 firr(1) = firr(1) + a1*dr3i
147 firr(2) = firr(2) + a2*dr3i
148 firr(3) = firr(3) + a3*dr3i
149 fd(1) = fd(1) + (dv(1) - a1*drdv)*dr3i
150 fd(2) = fd(2) + (dv(2) - a2*drdv)*dr3i
151 fd(3) = fd(3) + (dv(3) - a3*drdv)*dr3i
158 45 a1 = x(1,k) - x(1,l)
161 rij2 = a1*a1 + a2*a2 + a3*a3
162 dv(1) = xdot(1,k) - xdot(1,l)
163 dv(2) = xdot(2,k) - xdot(2,l)
164 dv(3) = xdot(3,k) - xdot(3,l)
167 dr3i = body(k)*body(l)*dr2i*sqrt(dr2i)*bodyin
168 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
171 firr(1) = firr(1) + a1*dr3i
172 firr(2) = firr(2) + a2*dr3i
173 firr(3) = firr(3) + a3*dr3i
174 fd(1) = fd(1) + (dv(1) - a1*drdv)*dr3i
175 fd(2) = fd(2) + (dv(2) - a2*drdv)*dr3i
176 fd(3) = fd(3) + (dv(3) - a3*drdv)*dr3i
178 freg(1) = freg(1) + a1*dr3i
179 freg(2) = freg(2) + a2*dr3i
180 freg(3) = freg(3) + a3*dr3i
181 fdr(1) = fdr(1) + (dv(1) - a1*drdv)*dr3i
182 fdr(2) = fdr(2) + (dv(2) - a2*drdv)*dr3i
183 fdr(3) = fdr(3) + (dv(3) - a3*drdv)*dr3i
187 IF (l.EQ.i2) go to 45
189 IF (k.EQ.j2) go to 42
193 50 a1 = x(1,k) - xi(1)
196 dv(1) = xdot(1,k) - xid(1)
197 dv(2) = xdot(2,k) - xid(2)
198 dv(3) = xdot(3,k) - xid(3)
199 rij2 = a1*a1 + a2*a2 + a3*a3
202 dr3i = body(k)*dr2i*sqrt(dr2i)
203 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
206 firr(1) = firr(1) + a1*dr3i
207 firr(2) = firr(2) + a2*dr3i
208 firr(3) = firr(3) + a3*dr3i
209 fd(1) = fd(1) + (dv(1) - a1*drdv)*dr3i
210 fd(2) = fd(2) + (dv(2) - a2*drdv)*dr3i
211 fd(3) = fd(3) + (dv(3) - a3*drdv)*dr3i
213 freg(1) = freg(1) + a1*dr3i
214 freg(2) = freg(2) + a2*dr3i
215 freg(3) = freg(3) + a3*dr3i
216 fdr(1) = fdr(1) + (dv(1) - a1*drdv)*dr3i
217 fdr(2) = fdr(2) + (dv(2) - a2*drdv)*dr3i
218 fdr(3) = fdr(3) + (dv(3) - a3*drdv)*dr3i
222 IF (k.EQ.j2) go to 50
230 IF (rij2.LT.cmsep2*r(j-n)**2)
THEN
235 ELSE IF (j.LE.n)
THEN
237 IF (rij2.LT.rpert2)
THEN
243 IF (rij2.GT.rpert2)
THEN
244 IF (rij2.GT.cmsep2*r(j-n)**2)
THEN
255 IF (rij2.GT.cmsep2*r(j-n)**2)
THEN
268 dr3i = body(jdum)*dr2i*sqrt(dr2i)
269 drdv = 3.0*(a1*dv(1) + a2*dv(2) + a3*dv(3))*dr2i
271 freg(1) = freg(1) + a1*dr3i
272 freg(2) = freg(2) + a2*dr3i
273 freg(3) = freg(3) + a3*dr3i
274 fdr(1) = fdr(1) + (dv(1) - a1*drdv)*dr3i
275 fdr(2) = fdr(2) + (dv(2) - a2*drdv)*dr3i
276 fdr(3) = fdr(3) + (dv(3) - a3*drdv)*dr3i
280 IF (i.GT.n.AND.nch.GT.0)
THEN