1 SUBROUTINE da_mdl_ref_to_eph (gps_rays, ref_mean_h, model_eph)
3 !---------------------------------------------------------------------------------------
4 ! Purpose: calculate model excess phase
5 ! (Chen et al., 2009, doi:10.3319/TAO.2007.11.29.01(F3C))
6 ! It is called by da_get_innov_vector_gpseph.
7 !---------------------------------------------------------------------------------------
10 ! input : gps_rays: gps rays information
11 ! ref_mean_h: model refractivity on mean height
14 type(gpsrays_type), intent(in) :: gps_rays
15 real,dimension(ids:ide,jds:jde,kds:kde),intent(in) :: ref_mean_h
16 real,dimension(kds:kde), intent(out) :: model_eph
18 real,dimension(kds:kde) :: mean_h
19 integer :: i, j, k, l, m, nn, i1, i2, i3, nbot, ntop
20 integer :: is, ie, js, je, ks, ke
21 integer :: i1l,i2l,i1r,i2r
22 real :: step, h, tmp_ref
23 real,dimension(2) :: w1
24 real,dimension(2,2) :: w2
25 integer :: ip1,ip2,ip3,je2
28 step = gps_ray_path_step
33 mean_h = global_h_mean(:) !km
37 ! use the ilocal decided in obs_ref_to_eph for consistency
38 ! between obs and model eph calculation
40 if ( gps_rays%ilocal(i) == 0 ) then ! local
42 ip1 = gps_rays%ip123(i)%i1(0)
43 ip2 = gps_rays%ip123(i)%i2(0)
44 ip3 = gps_rays%ip123(i)%i3(0)
45 w1 = gps_rays%ip123(i)%w1(1:2,0)
46 w2 = gps_rays%ip123(i)%w2(1:2,1:2,0)
51 refp=refp+ref_mean_h(ip1+l-1,ip2+m-1,ip3+nn-1)*w2(l,m)*w1(nn)
56 model_eph(i)=step*refp
63 !* calculate S from TP point and integrate to different direction (WRF)
66 ! transform coordiante from cartesian to sphere coordinate
67 h = gps_rays%ip123(i)%h(k*j)
68 if (h <= mean_h(ke-1)) then
69 i1 = gps_rays%ip123(i)%i1(k*j)
70 i2 = gps_rays%ip123(i)%i2(k*j)
71 i3 = gps_rays%ip123(i)%i3(k*j)
72 w1 = gps_rays%ip123(i)%w1(1:2,k*j)
73 w2 = gps_rays%ip123(i)%w2(1:2,1:2,k*j)
78 tmp_ref=tmp_ref+ref_mean_h(i1+l-1,i2+m-1,i3+nn-1)*w2(l,m)*w1(nn)
82 model_eph(i)=model_eph(i)+step*tmp_ref
89 end do !kbot, ntop loop
91 END SUBROUTINE da_mdl_ref_to_eph