drift.f 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. c*************************************************************************
  2. c DRIFT.F
  3. c*************************************************************************
  4. c This subroutine loops thorugh the particles and calls the danby routine
  5. c
  6. c Input:
  7. c nbod ==> number of massive bodies (int scalar)
  8. c mass ==> mass of bodies (real array)
  9. c xj,yj,zj ==> initial position in jacobi coord
  10. c (real arrays)
  11. c vxj,vyj,vzj ==> initial position in jacobi coord
  12. c (real arrays)
  13. c dt ==> time step
  14. c Output:
  15. c xj,yj,zj ==> final position in jacobi coord
  16. c (real arrays)
  17. c vxj,vyj,vzj ==> final position in jacobi coord
  18. c (real arrays)
  19. c
  20. c Authors: Hal Levison
  21. c Date: 2/12/93
  22. c Last revision: 9/5/94
  23. subroutine drift(nbod,mass,xj,yj,zj,vxj,vyj,vzj,dt)
  24. include '../../swift.inc'
  25. c... Inputs Only:
  26. integer nbod
  27. real*8 mass(nbod),dt
  28. c... Inputs and Outputs:
  29. real*8 xj(nbod),yj(nbod),zj(nbod)
  30. real*8 vxj(nbod),vyj(nbod),vzj(nbod)
  31. c... Internals:
  32. real*8 etajm1,etaj,mu
  33. integer j,iflg
  34. c----
  35. c... Executable code
  36. c Take a drift forward dth
  37. etajm1 = mass(1)
  38. do j = 2,nbod
  39. etaj = etajm1 + mass(j)
  40. mu = mass(1)*etaj/etajm1
  41. call drift_one(mu,xj(j),yj(j),zj(j),
  42. & vxj(j),vyj(j),vzj(j),dt,iflg)
  43. if(iflg.ne.0) then
  44. write(*,*) ' Planet ',j,' is lost !!!!!!!!!'
  45. write(*,*) mu,dt
  46. write(*,*) xj(j),yj(j),zj(j)
  47. write(*,*) vxj(j),vyj(j),vzj(j)
  48. write(*,*) ' STOPPING '
  49. call util_exit(1)
  50. endif
  51. etajm1 = etaj
  52. enddo
  53. return
  54. end
  55. c--------------------------------------------------------------------------