tu4_ldrift_tp.f 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. c*******************************************************************
  2. c TU4_LDRIFT_TP.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 TEST PARTICLES
  7. c
  8. c Input:
  9. c ntp ==> number of bodies (int scalar)
  10. c xbt,ybt,zbt ==> initial position in beri coord
  11. c (real arrays)
  12. c vxbt,vybt,vzbt ==> initial velocity in beri coord
  13. c (real arrays)
  14. c dt ==> time step
  15. c istat ==> status of the test paricles
  16. c (integer array)
  17. c istat(i) = 0 ==> active: = 1 not
  18. c NOTE: it is really a 2d array but
  19. c we only use the 1st row
  20. c Output:
  21. c xbt,ybt,zbt ==> final position in beri coord
  22. c (real arrays)
  23. c vxbt,vybt,vzbt ==> final velocity in beri coord
  24. c (real arrays)
  25. c
  26. c Remarks: Based on Martin's NB4M routines
  27. c Authors: Martin Duncan
  28. c Date: 3/8/93
  29. c Last revision:
  30. subroutine tu4_ldrift_tp(ntp,xbt,ybt,zbt,vxbt,vybt,vzbt,
  31. & dt,istat)
  32. include '../swift.inc'
  33. c... Inputs Only:
  34. integer ntp,istat(ntp)
  35. real*8 dt
  36. c... Inputs and Outputs:
  37. real*8 xbt(ntp),ybt(ntp),zbt(ntp)
  38. real*8 vxbt(ntp),vybt(ntp),vzbt(ntp)
  39. c... Internals
  40. integer i
  41. c---
  42. c... Executable code
  43. do i=1,ntp
  44. if(istat(i).eq.0) then
  45. xbt(i) = xbt(i) + vxbt(i)*dt
  46. ybt(i) = ybt(i) + vybt(i)*dt
  47. zbt(i) = zbt(i) + vzbt(i)*dt
  48. endif
  49. enddo
  50. return
  51. end ! tu4_ldrift_tp
  52. c____________________________________________________________________________