symba5_step_helio.f 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. c*************************************************************************
  2. c SYMBA5_STEP_HELIO.F
  3. c*************************************************************************
  4. c This subroutine takes a step in helio coord.
  5. c Does a KICK than a DRIFT than a KICK.
  6. c ONLY DOES MASSIVE PARTICLES
  7. c
  8. c Input:
  9. c i1st ==> = 0 if first step; = 1 not (int scalar)
  10. c nbod ==> number of massive bodies (int 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 xh,yh,zh ==> initial position in helio coord
  15. c (real arrays)
  16. c vxh,vyh,vzh ==> initial velocity in helio coord
  17. c (real arrays)
  18. c dt ==> time step
  19. c Output:
  20. c xh,yh,zh ==> final position in helio coord
  21. c (real arrays)
  22. c vxh,vyh,vzh ==> final velocity in helio coord
  23. c (real arrays)
  24. c Remarks: Based on helio_step_pl.f but does not pass the intermediate
  25. c positions and velocities back for the TP to use.
  26. c Authors: Hal Levison
  27. c Date: 3/20/97
  28. c Last revision: 12/13/00
  29. subroutine symba5_step_helio(i1st,nbod,nbodm,mass,j2rp2,
  30. & j4rp4,xh,yh,zh,vxh,vyh,vzh,dt)
  31. include '../swift.inc'
  32. c... Inputs Only:
  33. integer nbod,i1st,nbodm
  34. real*8 mass(nbod),dt,j2rp2,j4rp4
  35. c... Inputs and Outputs:
  36. real*8 xh(nbod),yh(nbod),zh(nbod)
  37. real*8 vxh(nbod),vyh(nbod),vzh(nbod)
  38. c... Internals:
  39. integer i1stloc
  40. real*8 dth
  41. real*8 axh(NTPMAX),ayh(NTPMAX),azh(NTPMAX)
  42. real*8 vxb(NTPMAX),vyb(NTPMAX),vzb(NTPMAX),msys
  43. real*8 ptxb,ptyb,ptzb ! Not used here
  44. real*8 ptxe,ptye,ptze
  45. save vxb,vyb,vzb ! Note this !!
  46. c----
  47. c... Executable code
  48. dth = 0.5d0*dt
  49. i1stloc = i1st
  50. if(i1st.eq.0) then
  51. c... Convert vel to bery to jacobi coords
  52. call coord_vh2b(nbod,mass,vxh,vyh,vzh,vxb,vyb,vzb,msys)
  53. i1st = 1 ! turn this off
  54. endif
  55. c... Do the linear drift due to momentum of the Sun
  56. call helio_lindrift(nbod,mass,vxb,vyb,vzb,dth,
  57. & xh,yh,zh,ptxb,ptyb,ptzb)
  58. c... Get the accelerations in helio frame. if frist time step
  59. call symba5_helio_getacch(i1stloc,nbod,nbodm,mass,j2rp2,j4rp4,
  60. & xh,yh,zh,axh,ayh,azh)
  61. i1stloc = 0
  62. c... Apply a heliocentric kick for a half dt
  63. call kickvh(nbod,vxb,vyb,vzb,axh,ayh,azh,dth)
  64. c.. Drift in helio coords for the full step
  65. call helio_drift(nbod,mass,xh,yh,zh,vxb,vyb,vzb,dt)
  66. c... Get the accelerations in helio frame. if frist time step
  67. call symba5_helio_getacch(i1stloc,nbod,nbodm,mass,j2rp2,j4rp4,
  68. & xh,yh,zh,axh,ayh,azh)
  69. c... Apply a heliocentric kick for a half dt
  70. call kickvh(nbod,vxb,vyb,vzb,axh,ayh,azh,dth)
  71. c... Do the linear drift due to momentum of the Sun
  72. call helio_lindrift(nbod,mass,vxb,vyb,vzb,dth,
  73. & xh,yh,zh,ptxe,ptye,ptze)
  74. c... convert back to helio velocities
  75. call coord_vb2h(nbod,mass,vxb,vyb,vzb,vxh,vyh,vzh)
  76. return
  77. end ! symba5_step_helio
  78. c---------------------------------------------------------------------