1 | PROGRAM test_slant_tec
|
---|
2 |
|
---|
3 | IMPLICIT NONE
|
---|
4 |
|
---|
5 | INTEGER, PARAMETER :: nstate = 4
|
---|
6 | INTEGER, PARAMETER :: nobs = 80
|
---|
7 | INTEGER, PARAMETER :: n_test = 10
|
---|
8 |
|
---|
9 | INTEGER :: i,j
|
---|
10 |
|
---|
11 | REAL :: r_leo(nobs),r_gps(nobs)
|
---|
12 | REAL :: x(nstate),x_tl(nstate),xp(nstate)
|
---|
13 | REAL :: impact(nobs)
|
---|
14 | REAL :: slant_tec(nobs,n_test)
|
---|
15 | REAL :: slant_tec_tl(nobs),slant_tec0(nobs)
|
---|
16 | REAL :: kmat(nobs,nstate)
|
---|
17 | REAL :: cos_alpha,rel_error
|
---|
18 |
|
---|
19 | real :: v(nstate,nstate),w(nstate)
|
---|
20 |
|
---|
21 | REAL :: erad
|
---|
22 |
|
---|
23 | erad = 6.371e6
|
---|
24 |
|
---|
25 | r_leo(:) = erad + 8.0e5 ! 800 km
|
---|
26 |
|
---|
27 | r_gps(:) = erad + 2.2e7 ! 22000km
|
---|
28 |
|
---|
29 | x(1) = 3.0e-4 !!! e12*e-16
|
---|
30 | x(2) = erad + 3.0e5 ! 300 km
|
---|
31 | x(3) = 5.0e4
|
---|
32 | x(4) = 0.1
|
---|
33 | !!x(4) = 0.0
|
---|
34 |
|
---|
35 |
|
---|
36 | Call Random_Number(x_tl)
|
---|
37 |
|
---|
38 | do i = 1,nobs
|
---|
39 |
|
---|
40 | impact(i) = erad + 1.0e5 + REAL(i)*5000.0
|
---|
41 |
|
---|
42 | enddo
|
---|
43 |
|
---|
44 |
|
---|
45 | ! this is a test of the tangent linear
|
---|
46 |
|
---|
47 | do i=1,n_test
|
---|
48 |
|
---|
49 | xp(:)=x(:) + x_tl(:)
|
---|
50 |
|
---|
51 | CALL comp_slant_tec(nstate,nobs,r_leo,r_gps,xp,impact,slant_tec(:,i))
|
---|
52 |
|
---|
53 | CALL comp_slant_tec_tl&
|
---|
54 | &(nstate,nobs,r_leo,r_gps,x,x_tl,impact,slant_tec0,slant_tec_tl)
|
---|
55 |
|
---|
56 | do j = 1,nobs
|
---|
57 | write (6,*)i,j,slant_tec(j,i)-slant_tec0(j),slant_tec0(j),slant_tec_tl(j)
|
---|
58 | enddo
|
---|
59 |
|
---|
60 | cos_alpha = DOT_PRODUCT(slant_tec_tl,slant_tec(:,i)-slant_tec0)/&
|
---|
61 | &SQRT(DOT_PRODUCT(slant_tec_tl,slant_tec_tl)*&
|
---|
62 | &DOT_PRODUCT((slant_tec(:,i)-slant_tec0),(slant_tec(:,i)-slant_tec0)))
|
---|
63 |
|
---|
64 |
|
---|
65 | write (6,*) 'cos_alpha=',cos_alpha
|
---|
66 |
|
---|
67 | x_tl(:) = 0.1*x_tl(:)
|
---|
68 |
|
---|
69 |
|
---|
70 | enddo
|
---|
71 |
|
---|
72 | !
|
---|
73 | ! compute kmat
|
---|
74 | !
|
---|
75 |
|
---|
76 | do i = 1,nstate
|
---|
77 |
|
---|
78 | x_tl(:) = 0.0
|
---|
79 |
|
---|
80 | x_tl(i) = 1.0
|
---|
81 |
|
---|
82 | CALL comp_slant_tec_tl&
|
---|
83 | &(nstate,nobs,r_leo,r_gps,x,x_tl,impact,slant_tec0,slant_tec_tl)
|
---|
84 |
|
---|
85 | ! matrix containing the gradient of slants w.r.t. the VaryChap params.
|
---|
86 |
|
---|
87 | kmat(:,i) = slant_tec_tl(:)
|
---|
88 |
|
---|
89 | enddo
|
---|
90 |
|
---|
91 | end
|
---|
92 |
|
---|
93 |
|
---|
94 |
|
---|
95 |
|
---|
96 |
|
---|
97 |
|
---|
98 |
|
---|