1 SUBROUTINE derqp(Q,CMX,ENERGY,P,CMV,CHTIME,DQ,DX,DE,DP,DV,DT)
10 common/slow1/ tk2(0:nmx),ejump,ksch(nmx),kslow,kcoll
11 common/cpert/ rgrav,gpert,ipert,npert
12 common/calls/ tpr,tkpr,step,ider,icall,nfn,nreg,iter,imcirc
13 common/ccoll2/ qk(nmx4),pk(nmx4),rij(nmx,nmx),
SIZE(nmx),vstar1,
14 & ecoll1,rcoll,qperi,istar(nmx),icoll,isync,ndiss1
15 common/bssave/ ep(4),dsc,facm,tfac,itfac,jc
18 REAL*8 q(nmx4),cmx(3),p(nmx4),cmv(3)
19 REAL*8 dq(nmx4),dx(3),dp(nmx4),dv(3),fcm(3),upr(nmx4)
20 REAL*8 w(nmx4),ak(nmx4),dk(nmx),fnc(nmx3),fxtnl(nmx3)
21 REAL*8 tp(nmx4),tq(nmx4),uq(nmx4),faux(4),aux(-2:2),xaux(3)
36 w(k1)=(q(k1)*p(k1)-q(k2)*p(k2)-q(k3)*p(k3)+q(k4)*p(k4))
37 w(k2)=(q(k2)*p(k1)+q(k1)*p(k2)-q(k4)*p(k3)-q(k3)*p(k4))
38 w(k3)=(q(k3)*p(k1)+q(k4)*p(k2)+q(k1)*p(k3)+q(k2)*p(k4))
39 w(k4)=(q(k4)*p(k1)-q(k3)*p(k2)+q(k2)*p(k3)-q(k1)*p(k4))
40 rijl=q(k1)**2+q(k2)**2+q(k3)**2+q(k4)**2
54 aux(-2)=0.5d0*tk2(i-1)
57 aux(+1)=0.5d0*tk1(i+1)
58 aux(+2)=0.5d0*tk2(i+1)
65 if (lj.ge.0.and.lj.le.4*n-8)
then
84 xc(l+1)=q(ks+1)**2-q(ks+2)**2-q(ks+3)**2+q(ks+4)**2
85 xc(l+2)=2.d0*(q(ks+1)*q(ks+2)-q(ks+3)*q(ks+4))
86 xc(l+3)=2.d0*(q(ks+1)*q(ks+3)+q(ks+2)*q(ks+4))
88 xi(l+3+k)=xi(l+k)+xc(l+k)
95 CALL
xtf(fxtnl,fcm,cmx,chtime)
97 IF (gpert.LT.1.0d-06)
THEN
125 xaux(k)=xi(lj+k)-xi(li+k)
130 xaux(k)=xc(li+k)+xc(li+k+3)
137 rinv(lri)=sqrt(rij2in)
139 fm=mij(i,j)*rinv(lri)
150 fnc(l+k)=fnc(l+k)+faux(k)
161 CALL
qforce(q(ks1),fnc(l1),uq(ks1))
162 CALL
vector(q(ks1),ak(ks1),tp(ks1))
165 CALL
vector(p(ks1),ak(ks1),tq(ks1))
168 uq(ks+k)=uq(ks+k)-2.0d0*mkk(i)*q(ks+k)*rinv(i)**2
169 tq(ks+k)=tq(ks+k)-4.d0*dk(i)*q(ks+k)
183 gamma=(h-(
energy+ejump))*g
194 dq(ks+k)=gtoverr*tp(ks+k)
195 dp(ks+k)=-gtoverr*tq(ks+k)-gu*uq(ks+k)
211 CALL
qforce(q(ks1),fxtnl(l1),faux)
213 de=de+dq(ks+k)*faux(k)
225 IF (icall.EQ.0) go to 50
226 IF (jc.GT.0) go to 10
231 IF (rinv(i).GT.rm)
THEN
240 CALL
peri(q(k),dq(k),tpr/ksch(im),m(k1),m(k2),qperi)
243 IF (qperi.GT.4.0*max(
SIZE(k1),
SIZE(k2)))
THEN
259 ELSE IF (im.EQ.2.AND.n.GT.3)
THEN
260 rp = min(1.0/rinv(1),1.0/rinv(3))
261 ELSE IF (im.EQ.3.AND.n.GT.4)
THEN
262 rp = min(1.0/rinv(2),1.0/rinv(4))
269 gi = (1.0/(rinv(im)*rp))**3
270 IF (gi.LT.0.005)
THEN
272 CALL
peri(q(k),dq(k),tpr/ksch(im),m(k1),m(k2),qperi)
278 rij(k1,k2) = min(rij(k1,k2),qperi)
279 rij(k2,k1) = min(rij(k2,k1),qperi)
282 IF (qperi.LT.qpmin.AND.im.NE.imcirc)
THEN
294 rcoll = min(rcoll,qpmin)
314 IF (qpmin.LT.4.0*max(
SIZE(k1),
SIZE(k2)).OR.iter.GT.0)
THEN
319 WRITE (6,26) iter, im, g0, qpmin, ecc
320 26
FORMAT (
' WARNING! NO CONVERGENCE # IM GI QP ECC ',
341 upr(j) = dq(j)*rb*ksch(im)/tpr
342 rpr = rpr + 2.0d0*q(j)*upr(j)
346 CALL
erel(im,eb,semi)
349 ecc = 1.0 - qpmin/semi
351 IF (ecc.LT.0.002.AND.imcirc.EQ.0.AND.vstar1.LT.100.0)
THEN
365 CALL
tperi(semi,q(ks1),upr(ks1),mb,tper)
375 IF (abs(rpr).LT.1.0e-09*sqrt(2.0d0*mb*rb))
THEN
395 dsc = 2.0d0*(hi*tper - 0.5d0*rpr)/mb
400 IF (jc.GT.0.AND.rpr.LT.0.0d0)
THEN
404 IF (jc.EQ.0) dsc = 1.0
407 IF (g0.GT.0.005.AND.iter.GT.5)
THEN
414 ELSE IF (rb.GT.semi.AND.imcirc.GT.0)
THEN