getacch_ah0.f 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. c*************************************************************************
  2. c GETACCH_AH0.F
  3. c*************************************************************************
  4. c This subroutine calculates the 0th term of acceleration
  5. c on the massive particles in the HELIOCENTRIC frame.
  6. c Input:
  7. c istart ==> 1st planet in the loop
  8. c istart=3 to get accel for planets
  9. c istart=2 to get accel for tp
  10. c nbod ==> number of massive bodies (int scalor)
  11. c mass ==> mass of bodies (real array)
  12. c xh,yh,zh ==> position in heliocentric coord (real array)
  13. c ir3h ==> inv radii in heliocentric coord (real array)
  14. c Output:
  15. c axh0,ayh0,azh0 ==> 0th term acceleration in helio coord
  16. c (real scalor)
  17. c
  18. c Author: Hal Levison
  19. c Date: 2/2/93
  20. c Last revision: 2/18/93
  21. subroutine getacch_ah0(istart,nbod,mass,xh,yh,zh,ir3h,
  22. & axh0,ayh0,azh0)
  23. include '../../swift.inc'
  24. c... Inputs:
  25. integer nbod, istart
  26. real*8 mass(nbod),ir3h(nbod)
  27. real*8 xh(nbod),yh(nbod),zh(nbod)
  28. c... Outputs:
  29. real*8 axh0,ayh0,azh0
  30. c... Internals:
  31. integer i
  32. real*8 fac
  33. c----
  34. c... Executable code
  35. axh0 = 0.0d0
  36. ayh0 = 0.0d0
  37. azh0 = 0.0d0
  38. do i=istart,nbod
  39. fac = mass(i)*ir3h(i)
  40. axh0 = axh0 - fac*xh(i)
  41. ayh0 = ayh0 - fac*yh(i)
  42. azh0 = azh0 - fac*zh(i)
  43. enddo
  44. return
  45. end ! getacch_ah0
  46. c---------------------------------------------------------------------