tu4_ldrift.f 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. c*******************************************************************
  2. c TU4_LDRIFT.F
  3. c*********************************************************************
  4. c LDRIFT gives a 'linear drift' to the bary. positions for use in
  5. c the symplectic code based on Ham. of the form T(p) + V(x).
  6. c
  7. c
  8. c Input:
  9. c nbod ==> number of massive bodies (int scalar)
  10. c xb,yb,zb ==> initial position in beri coord
  11. c (real arrays)
  12. c vxb,vyb,vzb ==> initial velocity in beri coord
  13. c (real arrays)
  14. c dt ==> time step
  15. c Output:
  16. c xb,yb,zb ==> final position in beri coord
  17. c (real arrays)
  18. c vxb,vyb,vzb ==> final velocity in beri coord
  19. c (real arrays)
  20. c
  21. c Remarks: Based on Martin's NB4M routines
  22. c Authors: Martin Duncan
  23. c Date: 3/8/93
  24. c Last revision:
  25. subroutine tu4_ldrift(nbod,xb,yb,zb,vxb,vyb,vzb,dt)
  26. include '../swift.inc'
  27. c... Inputs Only:
  28. integer nbod
  29. real*8 dt
  30. c... Inputs and Outputs:
  31. real*8 xb(nbod),yb(nbod),zb(nbod)
  32. real*8 vxb(nbod),vyb(nbod),vzb(nbod)
  33. c... Internals
  34. integer i
  35. c---
  36. c... Executable code
  37. do i=1,nbod
  38. xb(i) = xb(i) + vxb(i)*dt
  39. yb(i) = yb(i) + vyb(i)*dt
  40. zb(i) = zb(i) + vzb(i)*dt
  41. enddo
  42. return
  43. end ! tu4_ldrift
  44. c____________________________________________________________________________