getacch_ah2.f 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. c*************************************************************************
  2. c GETACCH_AH2.F
  3. c*************************************************************************
  4. c This subroutine calculates the 2nd term of acceleration
  5. c on the massive particles in the HELIOCENTRIC frame. Only in one direction.
  6. c Input:
  7. c nbod ==> number of massive bodies (int scalor)
  8. c mass ==> mass of bodies (real array)
  9. c xj,yj,zj ==> position in jacobi coord (real array)
  10. c ir3j ==> inv radii in jacobi coord (real array)
  11. c Output:
  12. c axh2,ayh2,azh2 ==> 2nd term acceleration in helio coord
  13. c (real array)
  14. c
  15. c Author: Hal Levison
  16. c Date: 2/2/93
  17. c Last revision: 2/3/93
  18. subroutine getacch_ah2(nbod,mass,xj,yj,zj,ir3j,axh2,ayh2,azh2)
  19. include '../../swift.inc'
  20. c... Inputs:
  21. integer nbod
  22. real*8 mass(nbod),ir3j(nbod)
  23. real*8 xj(nbod),yj(nbod),zj(nbod)
  24. c... Outputs:
  25. real*8 axh2(nbod),ayh2(nbod),azh2(nbod)
  26. c... Internals:
  27. integer i
  28. real*8 etaj, fac
  29. c----
  30. c... Executable code
  31. axh2(1) = 0.0
  32. ayh2(1) = 0.0
  33. azh2(1) = 0.0
  34. axh2(2) = 0.0
  35. ayh2(2) = 0.0
  36. azh2(2) = 0.0
  37. etaj = mass(1)
  38. do i=3,nbod
  39. etaj = etaj + mass(i-1)
  40. fac = mass(i)*mass(1)*ir3j(i)/etaj
  41. axh2(i) = axh2(i-1) + fac*xj(i)
  42. ayh2(i) = ayh2(i-1) + fac*yj(i)
  43. azh2(i) = azh2(i-1) + fac*zj(i)
  44. enddo
  45. return
  46. end ! getacch_ah2
  47. c---------------------------------------------------------------------