-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwrite_gnss_to_file.f
84 lines (81 loc) · 2.57 KB
/
write_gnss_to_file.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
subroutine write_gnss_to_file(outID, prn, tod, s1,s2,s5,az,
. elev,edot, prn_pick,s6,s7,s8,tod2)
c inputs fileID, prn number, time of day (seconds),
c s1,s2,s5, azimuth, elevation angles
c edot, in degrees/second
c output selection
c 18ocdt01 added galileo frequencies
c added option 66, which is all data < 30 degrees
c 20mar02 added msec to the output, sent from main code
implicit none
include 'local.inc'
real*8 s1, s2, s5, tod, az, elev, edot,tod2
real*8 s6, s7, s8
integer prn_pick,outID,prn,msec
logical galileo
c asked for all, but < 30 degrees elevation
c i made 98 and 99 do the same thing so i would
c not interfere with my existing file structures at CU
c
c 20aug17
c this is stupid- but gets the job done
call checkForNonsense(s1,s2,s5,s6,s7,s8)
c 2020 mar 02
c try to use actual time, not the integer time
c print*, msec
msec = 0
c tod = tod + msec/1000.d0
c try this ...
tod=tod2
if (prn_pick.eq.99.or.prn_pick.eq.98) then
if (elev .ge.5.and.elev.le.30) then
write(outID,112)
. prn, elev, az, tod, edot,s6, s1, s2,s5,s7,s8
endif
c asked for all data > 5
elseif (prn_pick.eq.88) then
if (elev.ge.5) then
write(outID, 112)
. prn, elev, az, tod, edot,s6, s1, s2,s5,s7,s8
endif
c all data below 30
c KL 2019Sep25 fixed bug found by YNakashima
elseif (prn_pick.eq.66.and.elev.le.30) then
write(outID, 112) prn, elev, az, tod,
. edot,s6, s1, s2,s5,s7,s8
c all data < 10
elseif (prn_pick.eq.50) then
if (elev.le.10) then
write(outID, 112)
. prn, elev, az, tod, edot,s6, s1, s2,s5,s7,s8
endif
endif
c this format statement gives space for edot and S5
111 format(i3, 2f10.4, f10.0, f10.6, f7.2, 3f7.2)
c this format allows galileo
112 format(i3, 2f10.4, f10.1, f10.6, f7.2, 5f7.2)
end
subroutine checkForNonsense(s1,s2,s5,s6,s7,s8)
c this should take care of nonsense values that overrun
c the fortran write statements
c 2020 august 19
real*8 s1,s2,s5,s6,s7,s8
if ((s1.gt.999).or.(s1.lt.0)) then
s1=0
endif
if ((s2.gt.999).or.(s2.lt.0)) then
s2=0
endif
if ((s5.gt.999).or.(s5.lt.0)) then
s5=0
endif
if ((s6.gt.999).or.(s6.lt.0)) then
s1=0
endif
if ((s7.gt.999).or.(s7.lt.0)) then
s7=0
endif
if ((s8.gt.999).or.(s8.lt.0)) then
s8=0
endif
end