rmvs_obl_acc.f 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. c*************************************************************************
  2. c RMVS_OBL_ACC.F
  3. c*************************************************************************
  4. c This subroutine adds the differential accel due to J2 and J4
  5. c
  6. c Input:
  7. c nbod ==> number of massive bodies (int scalar)
  8. c ntp ==> number of test bodies (int scalar)
  9. c ipl ==> the planet that is currently in the
  10. c center (integer scalar)
  11. c mass ==> mass of bodies (real array)
  12. c j2rp2,j4rp4 ==> J2*radii_pl^2 and J4*radii_pl^4
  13. c (real scalars)
  14. c xpl,ypl,zpl ==> massive part position at
  15. c (real arrays)
  16. c aoblx,aobly,aoblz ==> acceleration of the Sun on the central pl
  17. c due to J2 anf J4
  18. c (real scalars)
  19. c xpt,ypt,zpt ==> initial part position in planet-coord
  20. c (real arrays)
  21. c istat ==> status of the test paricles
  22. c (2d integer array)
  23. c istat(i,1) = 0 ==> active: = 1 not
  24. c istat(i,2) = -1 ==> Danby did not work
  25. c axpt,aypt,azpt ==> accel on tp w/o J2 and J4
  26. c (real arrays)
  27. c
  28. c Output:
  29. c axpt,aypt,azpt ==> accel on tp WITH J2 and J4 added.
  30. c (real arrays)
  31. c
  32. c Remarks: Taken from step_kdk_tp.f
  33. c Authors: Hal Levison
  34. c Date: 2/24/94
  35. c Last revision:
  36. subroutine rmvs_obl_acc(nbod,ntp,ipl,mass,j2rp2,j4rp4,xpl,ypl,
  37. & zpl,aoblx,aobly,aoblz,xpt,ypt,zpt,istat,axpt,aypt,azpt)
  38. include '../swift.inc'
  39. include 'rmvs.inc'
  40. c... Inputs Only:
  41. integer nbod,ntp,ipl
  42. integer istat(NTPMAX,NSTAT)
  43. real*8 mass(nbod),j2rp2,j4rp4
  44. real*8 xpl(NPLMAX),ypl(NPLMAX),zpl(NPLMAX)
  45. real*8 xpt(ntp),ypt(ntp),zpt(ntp)
  46. real*8 aoblx,aobly,aoblz
  47. c... Inputs and Outputs:
  48. real*8 axpt(ntp),aypt(ntp),azpt(ntp)
  49. c... Internals:
  50. integer i
  51. real*8 xht(NTPMAX),yht(NTPMAX),zht(NTPMAX)
  52. real*8 irht(NPLMAX)
  53. real*8 aoblxt(NTPMAX),aoblyt(NTPMAX),aoblzt(NTPMAX)
  54. c----
  55. c... Executable code
  56. c... Do we need to do this?
  57. if(j2rp2.eq.0.0d0) then
  58. return !!!!!!! NOTE
  59. endif
  60. c... first get barycentric accel
  61. do i=1,ntp
  62. xht(i) = xpt(i)-xpl(ipl)
  63. yht(i) = ypt(i)-ypl(ipl)
  64. zht(i) = zpt(i)-zpl(ipl)
  65. irht(i) = 1.0d0/sqrt( xht(i)**2 + yht(i)**2 + zht(i)**2 )
  66. enddo
  67. call obl_acc_tp(ntp,istat,mass(ipl),j2rp2,j4rp4,xht,yht,zht,
  68. & irht,aoblxt,aoblyt,aoblzt)
  69. do i = 1,ntp
  70. axpt(i) = axpt(i) + aoblxt(i) - aoblx
  71. aypt(i) = aypt(i) + aoblyt(i) - aobly
  72. azpt(i) = azpt(i) + aoblzt(i) - aoblz
  73. enddo
  74. return
  75. end ! rmvs_obl_acc
  76. c------------------------------------------------------------------------