1 subroutine read_gps(input,nframes,scal_p,xmaglm,gpsvec,nsig,
2 * igyr,igday,gpsec,secst,secend,ngps)
68 #include "nav_cnst.fin"
69 #include "input_s.fin"
73 real*8 gpsvec(6,maxlin), gpsec(maxlin), scal_p, secst, secend
74 real*8 sec, xmaglm(2), pmag
75 integer*4 nsig(maxlin), nframes, igyr, igday, ngps
76 integer*4 iframe, mframe, if1, j, iy2, im2, id2, ms, mp
77 integer*4 jd, jd1, jd2, jdtol
88 igyr = input(if1)%iyear
89 igday = input(if1)%iday
90 jd1 =
jd(igyr,1,igday)
91 secst = input(if1)%msec/1000.d0
97 mframe = input(if1)%sc_id(1)/128
100 iy2 = input(if1)%iyear
101 id2 = input(if1)%iday
103 sec = input(if1)%msec/1000.d0
104 sec = sec +(jd2-jd1)*864.d2
105 if (sec.lt.secst) secst = sec
106 if (sec.gt.secend) secend = sec
107 if((input(if1)%flag.eq.0).and.(mframe.eq.1))
then
110 ms = input(if1)%sc_dis(12)
116 b2(1) = input(if1)%sc_dis(15)
117 b2(2) = input(if1)%sc_dis(14)
119 b2(1) = input(if1)%sc_dis(14)
120 b2(2) = input(if1)%sc_dis(15)
124 im2 = input(if1)%sc_dis(16)
125 id2 = input(if1)%sc_dis(17)
126 jd2 =
jd(iy2,im2,id2)
128 sec = input(if1)%sc_dis(18)*36.d2
129 * + input(if1)%sc_dis(19)*6.d1 + input(if1)%sc_dis(20)
130 * + input(if1)%sc_ana(21)
132 sec = sec + (jd2-jd1)*864.d2
135 if ( (sec.ge.(secst-10.)) .and. (sec.lt.secend) )
then
139 if (sec.lt.secst) secst = sec
145 gpsvec(j,ngps) = input(if1)%sc_ana(j)*scal_p
146 gpsvec(j+3,ngps) = input(if1)%sc_ana(j+3)
149 pmag = sqrt(gpsvec(1,ngps)**2 + gpsvec(2,ngps)**2
150 * + gpsvec(3,ngps)**2)
151 if ((pmag.lt.xmaglm(1)).or.(pmag.gt.xmaglm(2)))
then
159 if (if1.gt.nframes)
go to 999
164 do iframe = if1,nframes
165 iy2 = input(iframe)%iyear
166 id2 = input(iframe)%iday
168 sec = input(iframe)%msec/1000.d0
169 sec = sec + (jd2-jd1)*864.d2
172 if (sec.lt.secst) secst = sec
173 if (sec.gt.secend) secend = sec
176 mframe = input(iframe)%sc_id(1)/128
177 if ((input(iframe)%flag.eq.0).and.(mframe.eq.1))
then
180 ms = input(iframe)%sc_dis(12)
185 b2(1) = input(iframe)%sc_dis(15)
186 b2(2) = input(iframe)%sc_dis(14)
188 b2(1) = input(iframe)%sc_dis(14)
189 b2(2) = input(iframe)%sc_dis(15)
193 im2 = input(iframe)%sc_dis(16)
194 id2 = input(iframe)%sc_dis(17)
195 jd2 =
jd(iy2,im2,id2)
196 sec = input(iframe)%sc_dis(18)*36.d2
197 * + input(iframe)%sc_dis(19)*6.d1
198 * + input(iframe)%sc_dis(20)
199 * + input(iframe)%sc_ana(21)
202 sec = sec + (jd2-jd1)*864.d2
205 if ((sec.ge.secst).and.(sec.le.secend))
then
208 if ((ms.ge.4).and.(mp.ge.4).and.
209 * (dabs(sec-gpsec(ngps)).gt.1.d-9))
then
216 gpsvec(j,ngps) = input(iframe)%sc_ana(j)*scal_p
217 gpsvec(j+3,ngps) = input(iframe)%sc_ana(j+3)
220 pmag = sqrt(gpsvec(1,ngps)**2 + gpsvec(2,ngps)**2
221 * + gpsvec(3,ngps)**2)
222 if ((pmag.lt.xmaglm(1)).or.(pmag.gt.xmaglm(2)))
then
230 print *,
'READ_GPS: Invalid date',iy2,im2,id2,
236 999 print *,
'READ_GPS:',ngps,
' valid GPS vectors'
237 print *,
' starting at ',igyr,igday,secst
238 print *,
' ending at ',igyr,igday,secend