tu4_vkickb_tp.f 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. c*************************************************************************
  2. c TU4_VKICKB_TP.F
  3. c*************************************************************************
  4. c VKICKB gives a 'kick' to the bary. velocities for use in the symplectic
  5. c code based on Ham. of the form T(p) + V(x). TEST PARTICLES
  6. c
  7. c Input:
  8. c ntp ==> number of massive bodies (int scalar)
  9. c vxbt,vybt,vzbt ==> initial velocity in beri coord
  10. c (real arrays)
  11. c axbt,aybt,azbt ==> accel in beri coord (real arrays)
  12. c dt ==> time step
  13. c istat ==> status of the test paricles
  14. c (integer array)
  15. c istat(i) = 0 ==> active: = 1 not
  16. c NOTE: it is really a 2d array but
  17. c we only use the 1st row
  18. c
  19. c Output:
  20. c vxbt,vybt,vzbt ==> final velocity in beri coord
  21. c (real arrays)
  22. c
  23. c Remarks: Based on Martin's NB4M routines
  24. c Authors: Martin Duncan
  25. c Date: 3/8/93
  26. c Last revision:
  27. subroutine tu4_vkickb_tp(ntp,vxbt,vybt,vzbt,axbt,aybt,
  28. & azbt,dt,istat)
  29. include '../swift.inc'
  30. c... Inputs Only:
  31. integer ntp,istat(ntp)
  32. real*8 axbt(ntp),aybt(ntp),azbt(ntp),dt
  33. c... Inputs and Outputs:
  34. real*8 vxbt(ntp),vybt(ntp),vzbt(ntp)
  35. c... Internals
  36. integer i
  37. c---
  38. c... Executable code
  39. do i=1,ntp
  40. if(istat(i).eq.0) then
  41. vxbt(i) = vxbt(i) + axbt(i)*dt
  42. vybt(i) = vybt(i) + aybt(i)*dt
  43. vzbt(i) = vzbt(i) + azbt(i)*dt
  44. endif
  45. enddo
  46. return
  47. end ! tu4_vkickb_tp
  48. c____________________________________________________________________________