53 '$Id: Reflection_Correction_Module.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 56 REAL(fp),
PARAMETER ::
zero = 0.0_fp
57 REAL(fp),
PARAMETER ::
one = 1.0_fp
58 REAL(fp),
PARAMETER ::
two = 2.0_fp
74 REAL(fp) :: transmittance =
zero 75 REAL(fp) :: wind_speed =
zero 77 REAL(fp) :: frequency =
zero 84 REAL(fp) :: rv_rough =
zero 85 REAL(fp) :: rh_rough =
zero 89 TYPE(svvar_type) :: svvar
104 Frequency , & ! Input
106 Wind_Speed , & ! Input
107 Transmittance, & ! Input
113 REAL(fp) ,
INTENT(IN) :: frequency
114 REAL(fp) ,
INTENT(IN) :: cos_z
115 REAL(fp) ,
INTENT(IN) :: wind_speed
116 REAL(fp) ,
INTENT(IN) :: transmittance
117 REAL(fp) ,
INTENT(OUT) :: rv_mod
118 REAL(fp) ,
INTENT(OUT) :: rh_mod
126 ivar%Transmittance = transmittance
127 ivar%Wind_Speed = wind_speed
129 ivar%Frequency = frequency
137 ivar%od = -log(transmittance) * cos_z
138 ivar%odx(1) = log(ivar%od)
139 ivar%odx(2) = ivar%odx(1)**2
144 ivar%zx(2) = variance
145 ivar%zx(4) =
one / cos_z
146 ivar%zx(3) = ivar%zx(2) * ivar%zx(4)
147 ivar%zx(5) = ivar%zx(3) * ivar%zx(3)
148 ivar%zx(6) = ivar%zx(4) * ivar%zx(4)
149 ivar%zx(7) = ivar%zx(2) * ivar%zx(2)
156 ivar%Rv_Rough = ivar%Rv_Rough + ivar%zx(i) * ( rccoeff%C(1,i,1) + &
157 ivar%odx(1)*rccoeff%C(2,i,1) + &
158 ivar%odx(2)*rccoeff%C(3,i,1) )
160 ivar%Rh_Rough = ivar%Rh_Rough + ivar%zx(i) * ( rccoeff%C(1,i,2) + &
161 ivar%odx(1)*rccoeff%C(2,i,2) + &
162 ivar%odx(2)*rccoeff%C(3,i,2) )
167 rv_mod = (
one - transmittance**ivar%Rv_Rough) / (
one - transmittance)
168 rh_mod = (
one - transmittance**ivar%Rh_Rough) / (
one - transmittance)
179 Wind_Speed_TL , & ! Input
180 Transmittance_TL, & ! Input
181 Rv_Mod_TL , & ! Output
182 Rh_Mod_TL , & ! Output
186 REAL(fp) ,
INTENT(IN) :: wind_speed_tl
187 REAL(fp) ,
INTENT(IN) :: transmittance_tl
188 REAL(fp) ,
INTENT(OUT) :: rv_mod_tl
189 REAL(fp) ,
INTENT(OUT) :: rh_mod_tl
192 REAL(fp) :: variance_tl, od_tl
194 REAL(fp) :: rv_rough_tl, rh_rough_tl
203 od_tl = -transmittance_tl * ivar%cos_z / ivar%Transmittance
204 odx_tl(1) = od_tl / ivar%od
205 odx_tl(2) =
two * odx_tl(1) * ivar%odx(1)
211 zx_tl(2) = variance_tl
213 zx_tl(3) = zx_tl(2) * ivar%zx(4)
214 zx_tl(5) =
two * zx_tl(3) * ivar%zx(3)
215 zx_tl(6) =
two * zx_tl(4) * ivar%zx(4)
216 zx_tl(7) =
two * zx_tl(2) * ivar%zx(2)
223 rv_rough_tl = rv_rough_tl + zx_tl(i) * ( rccoeff%C(1,i,1) + &
224 ivar%odx(1)*rccoeff%C(2,i,1) + &
225 ivar%odx(2)*rccoeff%C(3,i,1) ) + &
226 ivar%zx(i) * (odx_tl(1)*rccoeff%C(2,i,1) + &
227 odx_tl(2)*rccoeff%C(3,i,1) )
229 rh_rough_tl = rh_rough_tl + zx_tl(i) * ( rccoeff%C(1,i,2) + &
230 ivar%odx(1)*rccoeff%C(2,i,2) + &
231 ivar%odx(2)*rccoeff%C(3,i,2) ) + &
232 ivar%zx(i) * (odx_tl(1)*rccoeff%C(2,i,2) + &
233 odx_tl(2)*rccoeff%C(3,i,2) )
238 rv_mod_tl = ((ivar%Rv_Mod - ivar%Rv_Rough*(ivar%Transmittance**(ivar%Rv_Rough-
one)))*transmittance_tl - &
239 (log(ivar%Transmittance)*(ivar%Transmittance**ivar%Rv_Rough))*rv_rough_tl) / &
240 (
one - ivar%Transmittance)
241 rh_mod_tl = ((ivar%Rh_Mod - ivar%Rh_Rough*(ivar%Transmittance**(ivar%Rh_Rough-
one)))*transmittance_tl - &
242 (log(ivar%Transmittance)*(ivar%Transmittance**ivar%Rh_Rough))*rh_rough_tl) / &
243 (
one - ivar%Transmittance)
251 Rv_Mod_AD , & ! Input
252 Rh_Mod_AD , & ! Input
253 Wind_Speed_AD , & ! Output
254 Transmittance_AD, & ! Output
258 REAL(fp) ,
INTENT(IN OUT) :: rv_mod_ad
259 REAL(fp) ,
INTENT(IN OUT) :: rh_mod_ad
260 REAL(fp) ,
INTENT(IN OUT) :: transmittance_ad
261 REAL(fp) ,
INTENT(IN OUT) :: wind_speed_ad
265 REAL(fp) :: rv_rough_ad, rh_rough_ad
268 REAL(fp) :: variance_ad
275 transmittance_ad = transmittance_ad + &
276 (ivar%Rh_Mod - ivar%Rh_Rough * ivar%Transmittance**(ivar%Rh_Rough-
one)) * rh_mod_ad / &
277 (
one - ivar%Transmittance)
278 rh_rough_ad = rh_rough_ad - &
279 (ivar%Transmittance**ivar%Rh_Rough * log(ivar%Transmittance)) * rh_mod_ad / &
280 (
one - ivar%Transmittance)
283 transmittance_ad = transmittance_ad + &
284 (ivar%Rv_Mod - ivar%Rv_Rough * ivar%Transmittance**(ivar%Rv_Rough-
one)) * rv_mod_ad / &
285 (
one - ivar%Transmittance)
286 rv_rough_ad = rv_rough_ad - &
287 (ivar%Transmittance**ivar%Rv_Rough * log(ivar%Transmittance)) * rv_mod_ad / &
288 (
one - ivar%Transmittance)
297 odx_ad(2) = odx_ad(2) + ivar%zx(i)*rccoeff%C(3,i,2)*rh_rough_ad
298 odx_ad(1) = odx_ad(1) + ivar%zx(i)*rccoeff%C(2,i,2)*rh_rough_ad
299 zx_ad(i) = zx_ad(i) + ( rccoeff%C(1,i,2) + &
300 ivar%odx(1)*rccoeff%C(2,i,2) + &
301 ivar%odx(2)*rccoeff%C(3,i,2) )*rh_rough_ad
303 odx_ad(2) = odx_ad(2) + ivar%zx(i)*rccoeff%C(3,i,1)*rv_rough_ad
304 odx_ad(1) = odx_ad(1) + ivar%zx(i)*rccoeff%C(2,i,1)*rv_rough_ad
305 zx_ad(i) = zx_ad(i) + ( rccoeff%C(1,i,1) + &
306 ivar%odx(1)*rccoeff%C(2,i,1) + &
307 ivar%odx(2)*rccoeff%C(3,i,1) )*rv_rough_ad
315 zx_ad(2) = zx_ad(2) +
two*ivar%zx(2)*zx_ad(7)
318 zx_ad(4) = zx_ad(4) +
two*ivar%zx(4)*zx_ad(6)
321 zx_ad(3) = zx_ad(3) +
two*ivar%zx(3)*zx_ad(5)
324 zx_ad(2) = zx_ad(2) + ivar%zx(4)*zx_ad(3)
329 variance_ad = zx_ad(2)
336 odx_ad(1) = odx_ad(1) +
two*ivar%odx(1)*odx_ad(2)
338 od_ad = odx_ad(1) / ivar%od
340 transmittance_ad = transmittance_ad - od_ad*ivar%cos_z/ivar%Transmittance
real(fp), parameter, public zero
integer, parameter, public fp
subroutine, public compute_slope_variance(Frequency, Wind_Speed, iVar, Variance)
integer, parameter n_predictors
character(*), parameter module_version_id
subroutine, public reflection_correction_ad(RCCoeff, Rv_Mod_AD, Rh_Mod_AD, Wind_Speed_AD, Transmittance_AD, iVar)
real(fp), parameter, public one
real(fp), parameter, public two
subroutine, public reflection_correction_tl(RCCoeff, Wind_Speed_TL, Transmittance_TL, Rv_Mod_TL, Rh_Mod_TL, iVar)
subroutine, public compute_slope_variance_tl(Wind_Speed_TL, iVar, Variance_TL)
integer, parameter n_terms
subroutine, public compute_slope_variance_ad(Variance_AD, iVar, Wind_Speed_AD)
subroutine, public reflection_correction(RCCoeff, Frequency, cos_z, Wind_Speed, Transmittance, Rv_Mod, Rh_Mod, iVar)