FV3 Bundle
Small_Scale_Correction_Module.f90
Go to the documentation of this file.
1 !
2 ! Small_Scale_Correction_Module
3 !
4 ! Module containing the small-scale correction procedures for the
5 ! CRTM implementations of FASTEM4 and FASTEM5
6 !
7 ! Equation (A4) of
8 !
9 ! Liu, Q. et al. (2011) An Improved Fast Microwave Water
10 ! Emissivity Model, TGRSS, 49, pp1238-1250
11 !
12 ! describes the fitting of the small-scale correction formulation
13 ! given in equation (17a,b) of
14 !
15 ! Liu, Q. et al. (1998) Monte Carlo simulations of the microwave
16 ! emissivity of the sea surface, JGR, 103, pp24983-24989
17 !
18 ! and originally in equation (30) of
19 !
20 ! Guissard,A. and P.Sobieski (1987) An approximate model
21 ! for the microwave brightness temperature of the sea,
22 ! Int.J.Rem.Sens., 8, pp1607-1627.
23 !
24 !
25 ! CREATION HISTORY:
26 ! Written by: Original FASTEM authors
27 !
28 ! Refactored by: Paul van Delst, November 2011
29 ! paul.vandelst@noaa.gov
30 !
31 
33 
34  ! -----------------
35  ! Environment setup
36  ! -----------------
37  ! Module use
38  USE type_kinds , ONLY: fp
40  ! Disable implicit typing
41  IMPLICIT NONE
42 
43 
44  ! ------------
45  ! Visibilities
46  ! ------------
47  PRIVATE
48  ! Data types
49  PUBLIC :: ivar_type
50  ! Science routines
51  PUBLIC :: small_scale_correction
54 
55 
56  ! -----------------
57  ! Module parameters
58  ! -----------------
59  CHARACTER(*), PARAMETER :: module_version_id = &
60  '$Id: Small_Scale_Correction_Module.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $'
61 
62  ! Literal constants
63  REAL(fp), PARAMETER :: zero = 0.0_fp
64  REAL(fp), PARAMETER :: one = 1.0_fp
65  REAL(fp), PARAMETER :: two = 2.0_fp
66  ! Minimum and maximum frequency
67  REAL(fp), PARAMETER :: min_frequency = 1.4_fp
68  REAL(fp), PARAMETER :: max_frequency = 200.0_fp
69  ! Minimum and maximum wind speed
70  REAL(fp), PARAMETER :: min_wind_speed = 0.3_fp
71  REAL(fp), PARAMETER :: max_wind_speed = 35.0_fp
72 
73 
74  ! --------------------------------------
75  ! Structure definition to hold internal
76  ! variables across FWD, TL, and AD calls
77  ! --------------------------------------
78  TYPE :: ivar_type
79  PRIVATE
80  ! Direct inputs
81  REAL(fp) :: wind_speed = zero
82  REAL(fp) :: frequency = zero
83  ! Flag to indicate if wind spped outside limits
84  LOGICAL :: wind_speed_limited = .false.
85  ! Intermediate variables
86  REAL(fp) :: f2 = zero
87  REAL(fp) :: y = zero
88  REAL(fp) :: cos2_z = zero
89  ! Final result (since equation is an exponential)
90  REAL(fp) :: correction = zero
91  END TYPE ivar_type
92 
93 
94 CONTAINS
95 
96 
97  ! =============================================================
98  ! Procedures to compute the reflectivity small scale correction
99  ! =============================================================
100  ! Forward model
101  SUBROUTINE small_scale_correction( &
102  SSCCoeff , & ! Input
103  Frequency , & ! Input
104  cos_Z , & ! Input
105  Wind_Speed, & ! Input
106  Correction, & ! Output
107  iVar ) ! Internal variable output
108  ! Arguments
109  TYPE(fitcoeff_1d_type), INTENT(IN) :: ssccoeff
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
114  TYPE(ivar_type), INTENT(IN OUT) :: ivar
115  ! Local variables
116  REAL(fp) :: w2
117 
118  ! Check input
119  ivar%frequency = frequency
120  IF ( ivar%frequency < min_frequency ) ivar%frequency = min_frequency
121  IF ( ivar%frequency > max_frequency ) ivar%frequency = max_frequency
122  ivar%wind_speed = wind_speed
123  ivar%wind_speed_limited = .false.
124  IF ( ivar%wind_speed < min_wind_speed ) THEN
125  ivar%wind_speed = min_wind_speed
126  ivar%wind_speed_limited = .true.
127  END IF
128  IF ( ivar%wind_speed > max_wind_speed ) THEN
129  ivar%wind_speed = max_wind_speed
130  ivar%wind_speed_limited = .true.
131  END IF
132 
133  ! Compute correction
134  ivar%f2 = ivar%frequency**2
135  w2 = ivar%wind_speed**2
136  ! ...Intermediate term regression equation
137  ivar%y = &
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 )
146  ! ... The correction
147  ivar%cos2_z = cos_z**2
148  ivar%correction = exp(-ivar%y*ivar%cos2_z)
149  correction = ivar%correction
150 
151  END SUBROUTINE small_scale_correction
152 
153 
154  ! Tangent-linear model
155  SUBROUTINE small_scale_correction_tl( &
156  SSCCoeff , & ! Input
157  Wind_Speed_TL, & ! TL input
158  Correction_TL, & ! TL output
159  iVar ) ! Internal variable input
160  ! Arguments
161  TYPE(fitcoeff_1d_type), INTENT(IN) :: ssccoeff
162  REAL(fp), INTENT(IN) :: wind_speed_tl
163  REAL(fp), INTENT(OUT) :: correction_tl
164  TYPE(ivar_type), INTENT(IN) :: ivar
165  ! Local variables
166  REAL(fp) :: y_tl
167  REAL(fp) :: two_w
168 
169  ! Check input
170  IF ( ivar%wind_speed_limited ) THEN
171  correction_tl = zero
172  RETURN
173  END IF
174 
175  ! Compute tangent-linear intermediate term
176  two_w = two * ivar%wind_speed
177  y_tl = &
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 ) + &
184  ssccoeff%C(7) + &
185  (ssccoeff%C(8) * two_w ) ) * wind_speed_tl
186 
187  ! Compute the tangent-linear correction
188  correction_tl = -ivar%cos2_z * ivar%correction * y_tl
189 
190  END SUBROUTINE small_scale_correction_tl
191 
192 
193  ! Adjoint model
194  SUBROUTINE small_scale_correction_ad( &
195  SSCCoeff , & ! Input
196  Correction_AD, & ! AD input
197  Wind_Speed_AD, & ! AD output
198  iVar ) ! Internal variable input
199  TYPE(fitcoeff_1d_type), INTENT(IN) :: ssccoeff
200  REAL(fp), INTENT(IN OUT) :: correction_ad
201  REAL(fp), INTENT(IN OUT) :: wind_speed_ad
202  TYPE(ivar_type), INTENT(IN) :: ivar
203  ! Local variables
204  REAL(fp) :: y_ad
205  REAL(fp) :: two_w
206 
207  ! Check input
208  IF ( ivar%wind_speed_limited ) THEN
209  correction_ad = zero
210  RETURN
211  END IF
212 
213  ! Adjoint of correction
214  y_ad = -ivar%cos2_z * ivar%correction * correction_ad
215  correction_ad = zero
216 
217  ! Adjoint of intermediate term
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 ) + &
226  ssccoeff%C(7) + &
227  (ssccoeff%C(8) * two_w ) ) * y_ad
228 
229  END SUBROUTINE small_scale_correction_ad
230 
real(fp), parameter, public zero
integer, parameter, public fp
Definition: Type_Kinds.f90:124
subroutine, public small_scale_correction(SSCCoeff, Frequency, cos_Z, Wind_Speed, Correction, iVar)
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)