60 '$Id: Small_Scale_Correction_Module.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 63 REAL(fp),
PARAMETER ::
zero = 0.0_fp
64 REAL(fp),
PARAMETER ::
one = 1.0_fp
65 REAL(fp),
PARAMETER ::
two = 2.0_fp
81 REAL(fp) :: wind_speed =
zero 82 REAL(fp) :: frequency =
zero 84 LOGICAL :: wind_speed_limited = .false.
90 REAL(fp) :: correction =
zero 103 Frequency , & ! Input
105 Wind_Speed, & ! Input
106 Correction, & ! Output
110 REAL(fp),
INTENT(IN) :: frequency
111 REAL(fp),
INTENT(IN) :: cos_z
112 REAL(fp),
INTENT(IN) :: wind_speed
113 REAL(fp),
INTENT(OUT) :: correction
119 ivar%frequency = frequency
122 ivar%wind_speed = wind_speed
123 ivar%wind_speed_limited = .false.
126 ivar%wind_speed_limited = .true.
130 ivar%wind_speed_limited = .true.
134 ivar%f2 = ivar%frequency**2
135 w2 = ivar%wind_speed**2
138 (ssccoeff%C(1) * ivar%wind_speed * ivar%frequency) + &
139 (ssccoeff%C(2) * ivar%wind_speed * ivar%f2 ) + &
140 (ssccoeff%C(3) * w2 * ivar%frequency) + &
141 (ssccoeff%C(4) * w2 * ivar%f2 ) + &
142 (ssccoeff%C(5) * w2 / ivar%frequency) + &
143 (ssccoeff%C(6) * w2 / ivar%f2 ) + &
144 (ssccoeff%C(7) * ivar%wind_speed ) + &
145 (ssccoeff%C(8) * w2 )
147 ivar%cos2_z = cos_z**2
148 ivar%correction = exp(-ivar%y*ivar%cos2_z)
149 correction = ivar%correction
157 Wind_Speed_TL, & ! TL input
158 Correction_TL, & ! TL output
162 REAL(fp),
INTENT(IN) :: wind_speed_tl
163 REAL(fp),
INTENT(OUT) :: correction_tl
170 IF ( ivar%wind_speed_limited )
THEN 176 two_w =
two * ivar%wind_speed
178 ( (ssccoeff%C(1) * ivar%frequency ) + &
179 (ssccoeff%C(2) * ivar%f2 ) + &
180 (ssccoeff%C(3) * two_w * ivar%frequency) + &
181 (ssccoeff%C(4) * two_w * ivar%f2 ) + &
182 (ssccoeff%C(5) * two_w / ivar%frequency) + &
183 (ssccoeff%C(6) * two_w / ivar%f2 ) + &
185 (ssccoeff%C(8) * two_w ) ) * wind_speed_tl
188 correction_tl = -ivar%cos2_z * ivar%correction * y_tl
196 Correction_AD, & ! AD input
197 Wind_Speed_AD, & ! AD output
200 REAL(fp),
INTENT(IN OUT) :: correction_ad
201 REAL(fp),
INTENT(IN OUT) :: wind_speed_ad
208 IF ( ivar%wind_speed_limited )
THEN 214 y_ad = -ivar%cos2_z * ivar%correction * correction_ad
218 two_w =
two * ivar%wind_speed
219 wind_speed_ad = wind_speed_ad + &
220 ( (ssccoeff%C(1) * ivar%frequency ) + &
221 (ssccoeff%C(2) * ivar%f2 ) + &
222 (ssccoeff%C(3) * two_w * ivar%frequency) + &
223 (ssccoeff%C(4) * two_w * ivar%f2 ) + &
224 (ssccoeff%C(5) * two_w / ivar%frequency) + &
225 (ssccoeff%C(6) * two_w / ivar%f2 ) + &
227 (ssccoeff%C(8) * two_w ) ) * y_ad
real(fp), parameter, public zero
integer, parameter, public fp
subroutine, public small_scale_correction(SSCCoeff, Frequency, cos_Z, Wind_Speed, Correction, iVar)
real(fp), parameter min_wind_speed
real(fp), parameter max_wind_speed
character(*), parameter module_version_id
real(fp), parameter, public one
subroutine, public small_scale_correction_tl(SSCCoeff, Wind_Speed_TL, Correction_TL, iVar)
real(fp), parameter, public two
subroutine, public small_scale_correction_ad(SSCCoeff, Correction_AD, Wind_Speed_AD, iVar)
real(fp), parameter max_frequency
real(fp), parameter min_frequency