OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
checkorb.f
Go to the documentation of this file.
1  subroutine checkorb( msecl, posl, msecg, posg, nlinl, nling, iret)
2 c
3 c checkorb( msecl, posl, msecg, posg, nlinl, nling, iret)
4 c
5 c Purpose: checks for consistency of LAC and GAC orbit
6 c
7 c Calling Arguments:
8 c
9 c Name Type I/O Description
10 c -------- ---- --- -----------
11 c msecl(*) I*4 I LAC scan line times
12 c posl(3,*) R*4 I LAC orbit position vectors (km)
13 c msecg(*) I*4 I GAC scan line times
14 c posg(3,*) R*4 I GAC orbit position vectors (km)
15 c nlinl I*4 I number of LAC scan lines
16 c nling I*4 I number of GAC scan lines
17 c iret R*4 O return code (gt 3, number of scans
18 c LAC attitude was extrapolated)
19 c
20 c By: F. S. Patt, SAIC, 13 Sep 2002
21 c
22 c Notes:
23 c
24 c Modification History:
25 c
26 c Increase tolerance to 0.02 km. F. S. Patt, SAIC, January 10, 2003.
27 
28  implicit none
29 
30  real*4 posl(3,*), posg(3,*)
31  integer*4 msecl(*), msecg(*), nlinl, nling, iret
32  integer*4 ig, il, i
33  real*4 toldif
34 
35  data toldif /0.02/
36 
37 c Find first GAC and LAC frame with same time
38 
39  ig = 1
40  il = 1
41  iret = 0
42 
43  dowhile(msecl(il) .ne. msecg(ig))
44 
45 c If LAC time is greater increment GAC index
46  if (msecl(il) .gt. msecg(ig)) then
47  ig = ig + 1
48 
49 c Check for GAC index out of range
50  if (ig .gt. nling) then
51  iret = -1
52  write(*,*) 'CHECKORB: No matching GAC and LAC times'
53  go to 999
54  end if
55 
56  else
57 c Else increment LAC index
58  il = il + 1
59 
60 c Check for LAC index out of range
61  if (il .gt. nlinl) then
62  iret = -1
63  write(*,*) 'CHECKORB: No matching GAC and LAC times'
64  go to 999
65  end if
66  end if
67  end do
68 
69 c Compare LAC and GAC orbit data
70 
71  do i=1,3
72  if (abs(posl(i,il) - posg(i,ig)) .gt. toldif) then
73  write(*,*)'CHECKORB: Inconsistent GAC and LAC orbit'
74  write(*,*) i, il, posl(i,il), ig, posg(i,ig)
75  iret = -1
76  end if
77  end do
78 
79  999 return
80  end
#define real
Definition: DbAlgOcean.cpp:26
#define abs(a)
Definition: misc.h:90
subroutine checkorb(msecl, posl, msecg, posg, nlinl, nling, iret)
Definition: checkorb.f:2