skeel_interp.f 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. c*************************************************************************
  2. c SKEEL_INTERP.F
  3. c*************************************************************************
  4. c This subroutine interpolates between two kepler orbits.
  5. c
  6. c Input:
  7. c msun ==> mass of sun (real sclar)
  8. c xbeg,ybeg,zbeg ==> initial planet position in helio
  9. c (real scalars)
  10. c vxbeg,vybeg,vzbeg ==> initial planet vel in bery
  11. c (real scalars)
  12. c xend,yend,zend ==> final planet position in helio
  13. c (real scalars)
  14. c vxend,vyend,vzend ==> final planet position in bery
  15. c (real scalars)
  16. c dti ==> small time step (real sclar)
  17. c Output:
  18. c xpl,ypl,zpl ==> position of planet wrt time
  19. c for inner region
  20. c (real arrays)
  21. c vxpl,vypl,vzpl ==> velcity of planet wrt time
  22. c for inner region
  23. c (real arrays)
  24. c
  25. c
  26. c Remarks: Based on rmvs_interp.f
  27. c Authors: Hal Levison
  28. c Date: 9/24/96
  29. c Last revision: 3/18/97
  30. subroutine skeel_interp(msun,xbeg,ybeg,zbeg,vxbeg,vybeg,vzbeg,
  31. & xend,yend,zend,vxend,vyend,vzend,xpl,ypl,zpl,vxpl,vypl,
  32. & vzpl,dti)
  33. include '../swift.inc'
  34. include 'skeel.inc'
  35. c... Inputs Only:
  36. real*8 dti,msun
  37. real*8 xbeg,ybeg,zbeg
  38. real*8 vxbeg,vybeg,vzbeg
  39. real*8 xend,yend,zend
  40. real*8 vxend,vyend,vzend
  41. c... Outputs:
  42. real*8 xpl(0:NTENC),ypl(0:NTENC),zpl(0:NTENC)
  43. real*8 vxpl(0:NTENC),vypl(0:NTENC),vzpl(0:NTENC)
  44. c... Internals
  45. real*8 dt
  46. real*8 xc1,yc1,zc1,vxc1,vyc1,vzc1
  47. integer ib,iflg
  48. c----
  49. c... Executable code
  50. dt = dti*float(NTENC)
  51. c... move the end positions to beginning
  52. xc1 = xbeg
  53. yc1 = ybeg
  54. zc1 = zbeg
  55. vxc1 = vxbeg
  56. vyc1 = vybeg
  57. vzc1 = vzbeg
  58. xpl(0) = xbeg
  59. ypl(0) = ybeg
  60. zpl(0) = zbeg
  61. vxpl(0) = vxbeg
  62. vypl(0) = vybeg
  63. vzpl(0) = vzbeg
  64. do ib = 1,NTENC-1
  65. call drift_one(msun,xc1,yc1,zc1,vxc1,vyc1,vzc1,dti,iflg)
  66. if(iflg.ne.0) then
  67. write(*,*) ' Planet is lost in skeel_interp(2) !!!'
  68. write(*,*) msun,dti,ib
  69. write(*,*) xc1,yc1,zc1
  70. write(*,*) vxc1,vyc1,vzc1
  71. write(*,*) ' STOPPING '
  72. call util_exit(1)
  73. endif
  74. xpl(ib) = xc1
  75. ypl(ib) = yc1
  76. zpl(ib) = zc1
  77. vxpl(ib) = vxc1
  78. vypl(ib) = vyc1
  79. vzpl(ib) = vzc1
  80. enddo
  81. xpl(NTENC) = xend
  82. ypl(NTENC) = yend
  83. zpl(NTENC) = zend
  84. vxpl(NTENC) = vxend
  85. vypl(NTENC) = vyend
  86. vzpl(NTENC) = vzend
  87. return
  88. end ! skeel_interp.f
  89. c-----------------------------------------------------------------------