Nbody6
 All Files Functions Variables
fhalo.f
Go to the documentation of this file.
1  SUBROUTINE fhalo(XI,XIDOT,FM,FD)
2 *
3 *
4 * Logarithmic halo force.
5 * -----------------------
6 *
7  IMPLICIT REAL*8 (a-h,o-z)
8  common/galaxy/ gmg,rg(3),vg(3),fg(3),fgd(3),tg,
9  & omega,disk,a,b,v02,rl2,gmb,ar,gam,zdum(7)
10  REAL*8 xi(3),xidot(3),fm(3),fd(3)
11 *
12 *
13 * Obtain force and first derivative for logarithmic potential.
14  r2 = xi(1)**2 + xi(2)**2 + xi(3)**2 + rl2
15  rrd = 2.0*(xi(1)*xidot(1) + xi(2)*xidot(2) + xi(3)*xidot(3))/r2
16  h2 = v02/r2
17 *
18 * Note softening in the logarithmic potential (cf. Binney & Tremaine).
19  DO 10 k = 1,3
20  fm(k) = -h2*xi(k)
21  fd(k) = -h2*(xidot(k) - rrd*xi(k))
22  10 CONTINUE
23 *
24  RETURN
25 *
26  END