Nbody6
xtrnlt.f
Go to the documentation of this file.
1  SUBROUTINE xtrnlt(XI,XIDOT,FREG,FDR)
2 *
3 *
4 * Galactic force & first derivative.
5 * ----------------------------------
6 *
7  include 'common6.h'
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),freg(3),fdr(3),fm(3),fmd(3)
11 *
12 *
13 * Consider point-mass, disk and/or logarithmic halo model.
14  IF (kz(14).EQ.3) THEN
15 * Employ global instead of linearized forms for better accuracy.
16  IF (gmg.GT.0.0d0) THEN
17  CALL fnuc(xi,xidot,fm,fmd)
18  DO 10 k = 1,3
19  freg(k) = freg(k) + fm(k)
20  fdr(k) = fdr(k) + fmd(k)
21  10 CONTINUE
22  END IF
23 *
24 * Check bulge force.
25  IF (gmb.GT.0.0d0) THEN
26  CALL fbulge(xi,xidot,fm,fmd)
27  DO 15 k = 1,3
28  freg(k) = freg(k) + fm(k)
29  fdr(k) = fdr(k) + fmd(k)
30  15 CONTINUE
31  END IF
32 *
33 * Include Miyamoto disk for positive disk mass.
34  IF (disk.GT.0.0d0) THEN
35  CALL fdisk(xi,xidot,fm,fmd)
36  DO 20 k = 1,3
37  freg(k) = freg(k) + fm(k)
38  fdr(k) = fdr(k) + fmd(k)
39  20 CONTINUE
40  END IF
41 *
42 * Check addition of logarithmic halo potential to regular force.
43  IF (v02.GT.0.0d0) THEN
44  CALL fhalo(xi,xidot,fm,fmd)
45  DO 30 k = 1,3
46  freg(k) = freg(k) + fm(k)
47  fdr(k) = fdr(k) + fmd(k)
48  30 CONTINUE
49  END IF
50  END IF
51 *
52  RETURN
53 *
54  END