OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
asap_rots.f
Go to the documentation of this file.
1  subroutine asap_rots(iyinit,idinit,tsap,asap,nstp,vecs)
2 c
3 c Purpose: This subroutine rotates orbit vectors from TOD inertial to
4 c ECEF coordinates.
5 c
6 c Calling Arguments:
7 c
8 c Name Type I/O Description
9 c -------- ---- --- -----------
10 c iyinit I*4 I Time tag year
11 c idinit I*4 I Time tag day
12 c tsap(nstp) R*8 I Time tag seconds-of-day
13 c asap(6,nstp) R*8 I Inertial orbit vectors
14 c nstp I*4 I Number of input vectors
15 c vecs(6,nstp) R*8 I ECEF orbit vectors
16 c
17 c
18 c
19 c By: Frederick S. Patt, GSC, December 21, 1993
20 c
21 c Notes:
22 c
23 c Modification History:
24 c
25 c Modified to call get_ut1 to retrieve UT1 - UTC
26 c F. S. Patt, SAIC, July 19, 2011
27 
28  implicit none
29 
30 #include "nav_cnst.fin"
31 
32  integer*4 nstp, iyinit, idinit, i, ier
33  real*8 asap(6,nstp), vecs(6,nstp), tsap(nstp)
34  real*8 gha, cogha, sigha, td, ut1c/0.d0/
35  logical first/.true./
36 
37  if (first) then
38  call get_ut1(iyinit,idinit,ut1c,ier)
39  first = .false.
40  if (ier.ne.0) then
41  print *, '-E- utcpole.dat file could not be read.'
42  call exit(1)
43  end if
44  end if
45 
46  do i=1,nstp
47  td = idinit + (tsap(i)+ut1c)/864.d2
48  call gha2000(iyinit,td,gha)
49  cogha = cos(gha/radeg)
50  sigha = sin(gha/radeg)
51  vecs(1,i) = asap(1,i)*cogha + asap(2,i)*sigha
52  vecs(2,i) = asap(2,i)*cogha - asap(1,i)*sigha
53  vecs(3,i) = asap(3,i)
54  vecs(4,i) = asap(4,i)*cogha + asap(5,i)*sigha + omegae*vecs(2,i)
55  vecs(5,i) = asap(5,i)*cogha - asap(4,i)*sigha - omegae*vecs(1,i)
56  vecs(6,i) = asap(6,i)
57 
58  end do
59  return
60  end
#define real
Definition: DbAlgOcean.cpp:26
subroutine asap_rots(iyinit, idinit, tsap, asap, nstp, vecs)
Definition: asap_rots.f:2