1 subroutine da_spemiss_tl(f,tk,theta,ssw,ev,eh,TGL_tk,TGL_ev,TGL_eh )
3 !-----------------------------------------------------------------------
4 ! Purpose: returns the specular emissivity of sea water for given
5 ! freq. (GHz), temperature T (K), incidence angle theta (degrees),
8 ! Returned values verified against data in Klein and Swift (1977) and
9 ! against Table 3.8 in Olson (1987, Ph.D. Thesis)
12 ! Output : TGL_ev, TGL_eh, ev, eh
13 !------------------------------------------------------------------------
17 real, intent(in) :: f, tk, theta, TGL_tk
18 real, intent(inout) :: ssw
19 real, intent(out) :: TGL_ev, TGL_eh, ev, eh
21 real :: epsr,epsi,TGL_epsr,TGL_epsi
23 real :: tc,costh,sinth,rthet
24 complex :: etav,etah,eps,cterm1v,cterm1h,cterm2,cterm3v,cterm3h,epsnew
25 complex :: TGL_etav,TGL_eps,TGL_cterm1v,TGL_cterm2,TGL_cterm3v
26 complex :: TGL_cterm3h,TGL_epsnew
28 real :: tmp1r,tmp1i,tmp2r,tmp2i
29 ! real :: rnorm,tmp0i,tmp0r
30 real :: TGL_tc,TGL_tmp1r
31 ! real :: TGL_tmp0r,TGL_tmp0i,TGL_rnorm
32 real :: TGL_tmp1i,TGL_tmp2r,TGL_tmp2i
34 if (trace_use) call da_trace_entry("da_spemiss_tl")
40 call da_epsalt_tl(f,tc,ssw,epsr,epsi,TGL_tc, TGL_epsr, TGL_epsi )
42 eps = cmplx(epsr,epsi)
43 TGL_eps = cmplx(TGL_epsr,TGL_epsi)
47 rthet = theta*0.017453292
52 TGL_cterm1v = TGL_etav*costh
56 cterm2 = csqrt(epsnew)
58 ! calculate TGL_cterm2
60 if (cabs(epsnew) .gt. 0.0) then
61 TGL_cterm2 = TGL_epsnew*0.5/cterm2
67 ! It is not a standard fortran if statement here.
70 ! tmp0r = real(epsnew)
71 ! TGL_tmp0r = real(TGL_epsnew)
72 ! tmp0i = -aimag(epsnew)
73 ! TGL_tmp0i = -aimag(TGL_epsnew)
74 ! rnorm = sqrt(tmp0r*tmp0r+tmp0i*tmp0i)
76 ! if (rnorm .gt. 0.0) then
77 ! if (abs(tmp0i) .gt. 0.0) then
78 ! TGL_rnorm = (tmp0r*TGL_tmp0r + tmp0i*TGL_tmp0i)/rnorm
79 ! TGL_cterm2= cterm2*0.5*(TGL_rnorm/rnorm &
80 ! -uniti*(TGL_tmp0r*rnorm-TGL_rnorm*tmp0r)/(rnorm*tmp0i))
82 ! TGL_rnorm = TGL_tmp0r
83 ! TGL_cterm2= TGL_tmp0r*0.5/sqrt(tmp0r)
93 cterm3v = (cterm1v - cterm2)/(cterm1v + cterm2)
94 TGL_cterm3v = (TGL_cterm1v - TGL_cterm2)/(cterm1v + cterm2) &
95 -cterm3v*(TGL_cterm1v + TGL_cterm2)/(cterm1v + cterm2)
96 cterm3h = (cterm1h - cterm2)/(cterm1h + cterm2)
97 TGL_cterm3h = -TGL_cterm2/(cterm1h + cterm2) &
98 -cterm3h*TGL_cterm2/(cterm1h + cterm2)
100 TGL_tmp1r = real(TGL_cterm3v)
101 tmp1i = -aimag(cterm3v)
102 TGL_tmp1i = -aimag(TGL_cterm3v)
103 ! ev = 1.0 - cabs(cterm3v)**2
104 ev = 1.0 - (tmp1r*tmp1r+tmp1i*tmp1i)
105 TGL_ev = -2.0*tmp1r*TGL_tmp1r - 2.0*tmp1i*TGL_tmp1i
107 tmp2r = real(cterm3h)
108 TGL_tmp2r = real(TGL_cterm3h)
109 tmp2i = -aimag(cterm3h)
110 TGL_tmp2i = -aimag(TGL_cterm3h)
111 ! eh = 1.0 - cabs(cterm3h)**2
112 eh = 1.0 - (tmp2r*tmp2r+tmp2i*tmp2i)
113 TGL_eh = -2.0*tmp2r*TGL_tmp2r - 2.0*tmp2i*TGL_tmp2i
115 if (trace_use) call da_trace_exit("da_spemiss_tl")
117 end subroutine da_spemiss_tl