1 subroutine da_spemiss_adj(f,tk,theta,ssw,ev,eh, ADJ_tk,ADJ_ev,ADJ_eh)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
9 !------------------------------------------------------------------------
11 ! Input :: ADJ_ev, ADJ_eh
12 !------------------------------------------------------------------------
14 real, intent(in ) :: f, tk, theta, ADJ_ev,ADJ_eh
15 real, intent(inout) :: ssw
16 real, intent(inout) :: ADJ_tk
17 real, intent(out) :: ev, eh
19 real epsr,epsi,ADJ_epsr,ADJ_epsi
21 real tc,costh,sinth,rthet
22 complex etav,etah,eps,cterm1v,cterm1h,cterm2,cterm3v,cterm3h,epsnew
23 complex ADJ_etav,ADJ_eps,ADJ_cterm1v,ADJ_cterm2,ADJ_cterm3v
24 complex ADJ_cterm3h,ADJ_epsnew
25 real tmp1r,tmp1i,tmp2r,tmp2i,tmp0r,tmp0i,rnorm
26 real ADJ_tc,ADJ_tmp0r,ADJ_tmp0i,ADJ_rnorm,ADJ_tmp1r
27 real ADJ_tmp1i,ADJ_tmp2r,ADJ_tmp2i
29 if (trace_use) call da_trace_entry("da_spemiss_adj")
59 call epsalt(f,tc,ssw,epsr,epsi)
61 eps = cmplx(epsr,epsi)
64 rthet = theta*0.017453292
71 cterm2 = csqrt(epsnew)
73 cterm3v = (cterm1v - cterm2)/(cterm1v + cterm2)
74 cterm3h = (cterm1h - cterm2)/(cterm1h + cterm2)
76 tmp1i = -aimag(cterm3v)
77 ! ev = 1.0 - (tmp1r*tmp1r+tmp1i*tmp1i)
80 tmp2i = -aimag(cterm3h)
81 ! eh = 1.0 - (tmp2r*tmp2r+tmp2i*tmp2i)
83 ADJ_tmp2r = - 2.0*tmp2r*ADJ_eh
84 ADJ_tmp2i = - 2.0*tmp2i*ADJ_eh
86 ADJ_cterm3h = ADJ_tmp2r + ADJ_tmp2i*(0.0,1.0)
88 ADJ_tmp1r = - 2.0*tmp1r*ADJ_ev
89 ADJ_tmp1i = - 2.0*tmp1i*ADJ_ev
91 ADJ_cterm3v = ADJ_tmp1r + ADJ_tmp1i*(0.0,1.0)
93 ADJ_cterm2 = - ADJ_cterm3h/(cterm1h + cterm2)
94 ADJ_cterm2 = - cterm3h*ADJ_cterm3h/(cterm1h + cterm2) + ADJ_cterm2
96 ADJ_cterm1v = ADJ_cterm3v/(cterm1v + cterm2)
97 ADJ_cterm2 = - ADJ_cterm3v/(cterm1v + cterm2) + ADJ_cterm2
98 ADJ_cterm1v = - cterm3v*ADJ_cterm3v/(cterm1v + cterm2) + ADJ_cterm1v
99 ADJ_cterm2 = - cterm3v*ADJ_cterm3v/(cterm1v + cterm2) + ADJ_cterm2
101 if (cabs(epsnew) .gt. 0.0) then
102 ADJ_epsnew = ADJ_cterm2*0.5/cterm2
109 ADJ_etav = ADJ_cterm1v*costh
111 ADJ_eps = ADJ_etav + ADJ_eps
113 ADJ_epsr = real(ADJ_eps)
114 ADJ_epsi = -aimag(ADJ_eps)
116 call da_epsalt_adj(f,tc,ssw,ADJ_tc, ADJ_epsr, ADJ_epsi)
118 ADJ_tk = ADJ_tc + ADJ_tk
120 if (trace_use) call da_trace_exit("da_spemiss_adj")
122 end subroutine da_spemiss_adj