OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
intpos.f
Go to the documentation of this file.
1 c -------------------------------------------------------------------
2 c subroutine intpos
3 c
4 c Orbit vector interpolation.
5 c
6 c Algorithm by Fred Patt.
7 c -------------------------------------------------------------------
8  subroutine intpos(sec1,pos1,vel1,sec2,pos2,vel2,sec,pos,vel)
9 c
10  implicit none
11 c
12  real*8 sec1,sec2,sec
13  real*4 pos1(3),pos2(3),pos(3)
14  real*4 vel1(3),vel2(3),vel(3)
15  real*4 a0(3),a1(3),a2(3),a3(3)
16  real*8 dt
17  real*8 x,x2,x3
18  integer*4 j
19 c
20  dt = sec2 - sec1
21  do j=1,3
22  a0(j) = pos1(j)
23  a1(j) = vel1(j)*dt
24  a2(j) = 3.d0*pos2(j) - 3.d0*pos1(j)
25  . - 2.d0*vel1(j)*dt - vel2(j)*dt
26  a3(j) = 2.d0*pos1(j) - 2.d0*pos2(j)
27  . + vel1(j)*dt + vel2(j)*dt
28  end do
29 c
30  x = (sec - sec1)/dt
31  x2 = x*x
32  x3 = x2*x
33 c
34  do j=1,3
35  pos(j) = a0(j) + a1(j)*x + a2(j)*x2 + a3(j)*x3
36  vel(j) = (a1(j) + 2.*a2(j)*x + 3.*a3(j)*x2)/dt
37  end do
38 c
39  return
40  end
41 
42 
43 
44 
45 
46 
subroutine intpos(sec1, pos1, vel1, sec2, pos2, vel2, sec, pos, vel)
Definition: intpos.f:9
#define real
Definition: DbAlgOcean.cpp:26