step_dkd_tp.f 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. c*************************************************************************
  2. c STEP_DKD_TP.F
  3. c*************************************************************************
  4. c This subroutine takes a step in helio coord.
  5. c Does a DRIFT than a KICK than a DRIFT.
  6. c ONLY DOES TEST PARTICLES
  7. c
  8. c Input:
  9. c i1st ==> = 0 if first step; = 1 not (int scalar)
  10. c not used here !!!
  11. c nbod ==> number of massive bodies (int scalar)
  12. c ntp ==> number of massive bodies (int scalar)
  13. c mass ==> mass of bodies (real array)
  14. c j2rp2,j4rp4 ==> J2*radii_pl^2 and J4*radii_pl^4
  15. c (real scalars)
  16. c xhm,yhm,zhm ==> massive part position in middle of step
  17. c (real arrays)
  18. c xht,yht,zht ==> initial part position in helio coord
  19. c (real arrays)
  20. c vxht,vyht,vzht ==> initial velocity in helio coord
  21. c (real arrays)
  22. c istat ==> status of the test paricles
  23. c (2d integer array)
  24. c istat(i,1) = 0 ==> active: = 1 not
  25. c istat(i,2) = -1 ==> Danby did not work
  26. c dt ==> time step
  27. c Output:
  28. c xht,yht,zht ==> final position in helio coord
  29. c (real arrays)
  30. c vxht,vyht,vzht ==> final position in helio coord
  31. c (real arrays)
  32. c
  33. c Remarks: Adopted from martin's nbwh.f program
  34. c Authors: Hal Levison
  35. c Date: 2/12/93
  36. c Last revision: 2/12/93
  37. subroutine step_dkd_tp(i1st,nbod,ntp,mass,j2rp2,j4rp4,
  38. & xhm,yhm,zhm,xht,yht,zht,vxht,vyht,vzht,istat,dt)
  39. include '../../swift.inc'
  40. c... Inputs Only:
  41. integer nbod,ntp,i1st
  42. real*8 mass(nbod),dt,j2rp2,j4rp4
  43. real*8 xhm(nbod),yhm(nbod),zhm(nbod)
  44. c... Inputs and Outputs:
  45. integer istat(NTPMAX,NSTAT)
  46. real*8 xht(ntp),yht(ntp),zht(ntp)
  47. real*8 vxht(ntp),vyht(ntp),vzht(ntp)
  48. c... Internals:
  49. real*8 dth
  50. real*8 axht(NTPMAX),ayht(NTPMAX),azht(NTPMAX)
  51. c----
  52. c... Executable code
  53. dth = 0.5d0*dt
  54. c... Take a drift forward 0.5dt to begin the step (the first kick = 0).
  55. call drift_tp(ntp,mass(1),xht,yht,zht,vxht,vyht,vzht,dth,istat)
  56. c... Get the accelerations in helio frame.
  57. call getacch_tp(nbod,ntp,mass,j2rp2,j4rp4,xhm,yhm,zhm,
  58. & xht,yht,zht,istat,axht,ayht,azht)
  59. c... Apply a heliocentric kick for a full dt
  60. call kickvh_tp(ntp,vxht,vyht,vzht,axht,ayht,azht,istat,dt)
  61. c.. Drift again in Jacobi coords for the final half-step 0.5dt
  62. call drift_tp(ntp,mass(1),xht,yht,zht,vxht,vyht,vzht,dth,istat)
  63. return
  64. end ! step_dkd_tp
  65. c---------------------------------------------------------------------