-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmoving_sites.f
69 lines (68 loc) · 2.21 KB
/
moving_sites.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
subroutine moving_sites(station, year, month, day,
. xrec, yrec,zrec,fsite)
implicit none
character*4 station, cstation
integer y, m, d, ios, year, month, day,jtime(5)
logical eof, fsite
real*8 xx,yy,zz,dx,dy,dz, xrec, yrec,zrec
real*8 tjul0, rho, tjul
character*80 tmp, filename
c default outputs to zero and false
c a priori coordinates and velocity file
call getlogical ('COORDS', filename)
c filename = '/gipsy/source/RinexSNRv2gitHub/knut.txt'
print*, year, month, day
eof = .false.
fsite = .false.
xrec = 0.d0
yrec = 0.d0
zrec = 0.d0
rho = 0.d0
c restore the time data
jtime(4) = 0
jtime(5) = 0
jtime(1) = month
jtime(2) = day
jtime(3) = year
call julday(jtime,rho,tjul)
print*, station, year, month, day, 'MJD ', tjul
c requesting XYZ for a station at time t, in years
c not meant to be super precise cause it is not needed for reflectometry
open(17,file=filename,status='old',iostat = ios)
if (ios.ne.0) then
print*, 'did not find input file of coordinates'
goto 102
endif
c skip two header lines
read(17,'(a80)') tmp
read(17,'(a80)') tmp
do while (.not.eof)
read(17,'(A4, 3F16.3, 3F11.3,i6,i3,i3)',iostat=ios )
. cstation, xx,yy,zz,dx,dy,dz,y,m,d
jtime(1) = m
jtime(2) = d
jtime(3) = y
c reference mJD is in the variable tjul0
call julday(jtime,rho,tjul0)
if (ios.ne.0) goto 101
c time of record
c change time from days to years by div 365.25
c this does not have to be very precise. just within
c 100 meters or so
if (station .eq. cstation) then
write(6,*) 'POS (m) at epoch', y, m, d
print*, xx, yy, zz
print*, 'velocities (m/yr)', dx, dy, dz
print*,'DELtime (years)', (tjul-tjul0)/365.25
xrec = xx +dx*(tjul-tjul0)/365.25
yrec = yy +dy*(tjul-tjul0)/365.25
zrec = zz +dz*(tjul-tjul0)/365.25
c flag that you found the site
fsite = .true.
goto 101
endif
enddo
101 continue
close(17)
102 continue
end