1 SUBROUTINE kspred(IPAIR,I1,I,BODYIN,UI,UIDOT,XI,VI)
8 parameter(one24=1.0/24.0d0,one120=1.0/120.0d0)
9 REAL*8 ui(4),uidot(4),xi(6),vi(6),rdot(3),a1(3,4)
22 x(1,j) = ((fdot(1,j)*s + f(1,j))*s + x0dot(1,j))*s + x0(1,j)
23 x(2,j) = ((fdot(2,j)*s + f(2,j))*s + x0dot(2,j))*s + x0(2,j)
24 x(3,j) = ((fdot(3,j)*s + f(3,j))*s + x0dot(3,j))*s + x0(3,j)
25 xdot(1,j) = (fdot(1,j)*s1 + f(1,j))*s2 + x0dot(1,j)
26 xdot(2,j) = (fdot(2,j)*s1 + f(2,j))*s2 + x0dot(2,j)
27 xdot(3,j) = (fdot(3,j)*s1 + f(3,j))*s2 + x0dot(3,j)
40 u4 = one24*fudot2(k,ipair)
41 u5 = one120*fudot3(k,ipair)
43 ui(k) = ((((u5*z5*dtu + u4*z4)*dtu + u3)*dtu + u2)*dtu +
44 & udot(k,ipair))*dtu + u0(k,ipair)
45 uidot(k) = (((5.0*u5*z4*dtu + 4.0d0*u4*z3)*dtu + 3.0d0*u3)*dtu
46 & + 2.0*u2)*dtu + udot(k,ipair)
49 r(ipair) = ui(1)**2 + ui(2)**2 + ui(3)**2 + ui(4)**2
52 q1 = ui(1)**2 - ui(2)**2 - ui(3)**2 + ui(4)**2
53 q2 = ui(1)*ui(2) - ui(3)*ui(4)
54 q3 = ui(1)*ui(3) + ui(2)*ui(4)
59 a2 = body(i1+1)*bodyin
60 xi(1) = x(1,i) + a2*q1
61 xi(2) = x(2,i) + a2*q2
62 xi(3) = x(3,i) + a2*q3
75 rdot(l) = rdot(l) + a1(l,k)*uidot(k)
77 rdot(l) = rdot(l)*rinv
81 vi(1) = xdot(1,i) + a2*rdot(1)
82 vi(2) = xdot(2,i) + a2*rdot(2)
83 vi(3) = xdot(3,i) + a2*rdot(3)
84 vi(4) = vi(1) - rdot(1)
85 vi(5) = vi(2) - rdot(2)
86 vi(6) = vi(3) - rdot(3)