FV3 Bundle
CRTM_MW_Land_SfcOptics.f90
Go to the documentation of this file.
1 !
2 ! CRTM_MW_Land_SfcOptics
3 !
4 ! Module to compute the surface optical properties for LAND surfaces at
5 ! microwave frequencies required for determining the LAND surface
6 ! contribution to the radiative transfer.
7 !
8 ! This module is provided to allow developers to "wrap" their existing
9 ! codes inside the provided functions to simplify integration into
10 ! the main CRTM_SfcOptics module.
11 !
12 !
13 ! CREATION HISTORY:
14 ! Written by: Paul van Delst, 23-Jun-2005
15 ! paul.vandelst@noaa.gov
16 !
17 
19 
20  ! -----------------
21  ! Environment setup
22  ! -----------------
23  ! Module use
24  USE type_kinds, ONLY: fp
27  USE crtm_spccoeff, ONLY: sc
32  ! Disable implicit typing
33  IMPLICIT NONE
34 
35 
36  ! ------------
37  ! Visibilities
38  ! ------------
39  ! Everything private by default
40  PRIVATE
41  ! Data types
42  PUBLIC :: ivar_type
43  ! Science routines
47 
48 
49  ! -----------------
50  ! Module parameters
51  ! -----------------
52  CHARACTER(*), PRIVATE, PARAMETER :: module_version_id = &
53  '$Id: CRTM_MW_Land_SfcOptics.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $'
54  ! Message length
55  INTEGER, PARAMETER :: ml = 256
56  ! Valid type indices for the microwave land emissivity model
57  ! ...The soil types
58  INTEGER, PARAMETER :: n_valid_soil_types = 8
59  INTEGER, PARAMETER :: invalid_soil = 0
60  INTEGER, PARAMETER :: coarse = 1
61  INTEGER, PARAMETER :: medium = 2
62  INTEGER, PARAMETER :: fine = 3
63  INTEGER, PARAMETER :: coarse_medium = 4
64  INTEGER, PARAMETER :: coarse_fine = 5
65  INTEGER, PARAMETER :: medium_fine = 6
66  INTEGER, PARAMETER :: coarse_med_fine = 7
67  INTEGER, PARAMETER :: organic = 8
68  ! ...The vegetation types
69  INTEGER, PARAMETER :: n_valid_vegetation_types = 12
70  INTEGER, PARAMETER :: invalid_vegetation = 0
71  INTEGER, PARAMETER :: broadleaf_evergreen_trees = 1
72  INTEGER, PARAMETER :: broadleaf_deciduous_trees = 2
73  INTEGER, PARAMETER :: broadleaf_needleleaf_trees = 3
74  INTEGER, PARAMETER :: needleleaf_evergreen_trees = 4
75  INTEGER, PARAMETER :: needleleaf_deciduous_trees = 5
76  INTEGER, PARAMETER :: broadleaf_trees_groundcover = 6
77  INTEGER, PARAMETER :: groundcover = 7
78  INTEGER, PARAMETER :: groadleaf_shrubs_groundcover = 8
79  INTEGER, PARAMETER :: broadleaf_shrubs_bare_soil = 9
80  INTEGER, PARAMETER :: dwarf_trees_shrubs_groundcover = 10
81  INTEGER, PARAMETER :: bare_soil = 11
82  INTEGER, PARAMETER :: cultivations = 12
83 
84 
85  ! --------------------------------------
86  ! Structure definition to hold forward
87  ! variables across FWD, TL, and AD calls
88  ! --------------------------------------
89  TYPE :: ivar_type
90  PRIVATE
91  INTEGER :: dummy = 0
92  END TYPE ivar_type
93 
94 
95 CONTAINS
96 
97 
98 
99 !----------------------------------------------------------------------------------
100 !:sdoc+:
101 !
102 ! NAME:
103 ! Compute_MW_Land_SfcOptics
104 !
105 ! PURPOSE:
106 ! Function to compute the surface emissivity and reflectivity at microwave
107 ! frequencies over a land surface.
108 !
109 ! This function is a wrapper for third party code.
110 !
111 ! CALLING SEQUENCE:
112 ! Error_Status = Compute_MW_Land_SfcOptics( &
113 ! Surface , &
114 ! SensorIndex , &
115 ! ChannelIndex, &
116 ! SfcOptics )
117 !
118 ! INPUTS:
119 ! Surface: CRTM_Surface structure containing the surface state
120 ! data.
121 ! UNITS: N/A
122 ! TYPE: CRTM_Surface_type
123 ! DIMENSION: Scalar
124 ! ATTRIBUTES: INTENT(IN)
125 !
126 ! GeometryInfo: CRTM_GeometryInfo structure containing the
127 ! view geometry information.
128 ! UNITS: N/A
129 ! TYPE: CRTM_GeometryInfo_type
130 ! DIMENSION: Scalar
131 ! ATTRIBUTES: INTENT(IN)
132 !
133 ! SensorIndex: Sensor index id. This is a unique index associated
134 ! with a (supported) sensor used to access the
135 ! shared coefficient data for a particular sensor.
136 ! See the ChannelIndex argument.
137 ! UNITS: N/A
138 ! TYPE: INTEGER
139 ! DIMENSION: Scalar
140 ! ATTRIBUTES: INTENT(IN)
141 !
142 ! ChannelIndex: Channel index id. This is a unique index associated
143 ! with a (supported) sensor channel used to access the
144 ! shared coefficient data for a particular sensor's
145 ! channel.
146 ! See the SensorIndex argument.
147 ! UNITS: N/A
148 ! TYPE: INTEGER
149 ! DIMENSION: Scalar
150 ! ATTRIBUTES: INTENT(IN)
151 !
152 ! OUTPUTS:
153 ! SfcOptics: CRTM_SfcOptics structure containing the surface
154 ! optical properties required for the radiative
155 ! transfer calculation. On input the Angle component
156 ! is assumed to contain data.
157 ! UNITS: N/A
158 ! TYPE: CRTM_SfcOptics_type
159 ! DIMENSION: Scalar
160 ! ATTRIBUTES: INTENT(IN OUT)
161 !
162 ! FUNCTION RESULT:
163 ! Error_Status: The return value is an integer defining the error status.
164 ! The error codes are defined in the Message_Handler module.
165 ! If == SUCCESS the computation was sucessful
166 ! == FAILURE an unrecoverable error occurred
167 ! UNITS: N/A
168 ! TYPE: INTEGER
169 ! DIMENSION: Scalar
170 !
171 ! COMMENTS:
172 ! Note the INTENT on the output SfcOptics argument is IN OUT rather
173 ! than just OUT as it is assumed to contain some data upon input.
174 !
175 !:sdoc-:
176 !----------------------------------------------------------------------------------
177 
178  FUNCTION compute_mw_land_sfcoptics( &
179  Surface , & ! Input
180  SensorIndex , & ! Input
181  ChannelIndex, & ! Input
182  SfcOptics ) & ! Output
183  result( err_stat )
184  ! Arguments
185  TYPE(crtm_surface_type), INTENT(IN) :: surface
186  INTEGER, INTENT(IN) :: sensorindex
187  INTEGER, INTENT(IN) :: channelindex
188  TYPE(crtm_sfcoptics_type), INTENT(IN OUT) :: sfcoptics
189  ! Function result
190  INTEGER :: err_stat
191  ! Local parameters
192  CHARACTER(*), PARAMETER :: routine_name = 'Compute_MW_Land_SfcOptics'
193  REAL(fp), PARAMETER :: frequency_cutoff = 80.0_fp ! GHz
194  REAL(fp), PARAMETER :: default_emissivity = 0.95_fp
195  ! Local variables
196  CHARACTER(ML) :: msg
197  INTEGER :: i
198 
199 
200  ! Set up
201  err_stat = success
202  ! ...Check the soil type...
203  IF ( surface%Soil_Type < 1 .OR. &
204  surface%Soil_Type > n_valid_soil_types ) THEN
205  sfcoptics%Emissivity = zero
206  sfcoptics%Reflectivity = zero
207  err_stat = failure
208  msg = 'Invalid soil type index specified'
209  CALL display_message( routine_name, msg, err_stat ); RETURN
210  END IF
211  ! ...and the vegetation type
212  IF ( surface%Vegetation_Type < 1 .OR. &
213  surface%Vegetation_Type > n_valid_vegetation_types ) THEN
214  sfcoptics%Emissivity = zero
215  sfcoptics%Reflectivity = zero
216  err_stat = failure
217  msg = 'Invalid vegetation type index specified'
218  CALL display_message( routine_name, msg, err_stat ); RETURN
219  END IF
220 
221 
222  ! Compute the surface optical parameters
223  IF ( sc(sensorindex)%Frequency(channelindex) < frequency_cutoff ) THEN
224  ! Frequency is low enough for the model
225  DO i = 1, sfcoptics%n_Angles
226  CALL nesdis_landem(sfcoptics%Angle(i), & ! Input, Degree
227  sc(sensorindex)%Frequency(channelindex), & ! Input, GHz
228  surface%Soil_Moisture_Content, & ! Input, g.cm^-3
229  surface%Vegetation_Fraction, & ! Input
230  surface%Soil_Temperature, & ! Input, K
231  surface%Land_Temperature, & ! Input, K
232  surface%Lai, & ! Input, Leaf Area Index
233  surface%Soil_Type, & ! Input, Soil Type (1 - 9)
234  surface%Vegetation_Type, & ! Input, Vegetation Type (1 - 13)
235  zero, & ! Input, Snow depth, mm
236  sfcoptics%Emissivity(i,2), & ! Output, H component
237  sfcoptics%Emissivity(i,1) ) ! Output, V component
238  ! Assume specular surface
239  sfcoptics%Reflectivity(i,1,i,1) = one-sfcoptics%Emissivity(i,1)
240  sfcoptics%Reflectivity(i,2,i,2) = one-sfcoptics%Emissivity(i,2)
241  END DO
242  ELSE
243  ! Frequency is too high for model. Use default.
244  DO i = 1, sfcoptics%n_Angles
245  sfcoptics%Emissivity(i,1:2) = default_emissivity
246  sfcoptics%Reflectivity(i,1:2,i,1:2) = one-default_emissivity
247  END DO
248  END IF
249 
250  END FUNCTION compute_mw_land_sfcoptics
251 
252 
253 !----------------------------------------------------------------------------------
254 !:sdoc+:
255 !
256 ! NAME:
257 ! Compute_MW_Land_SfcOptics_TL
258 !
259 ! PURPOSE:
260 ! Function to compute the tangent-linear surface emissivity and
261 ! reflectivity at microwave frequencies over a land surface.
262 !
263 ! This function is a wrapper for third party code.
264 !
265 ! NB: CURRENTLY THIS IS A STUB FUNCTION AS THERE ARE NO TL
266 ! COMPONENTS IN THE MW LAND SFCOPTICS COMPUTATIONS.
267 !
268 ! CALLING SEQUENCE:
269 ! Error_Status = Compute_MW_Land_SfcOptics_TL( SfcOptics_TL )
270 !
271 ! OUTPUTS:
272 ! SfcOptics_TL: Structure containing the tangent-linear surface
273 ! optical properties required for the tangent-
274 ! linear radiative transfer calculation.
275 ! UNITS: N/A
276 ! TYPE: CRTM_SfcOptics_type
277 ! DIMENSION: Scalar
278 ! ATTRIBUTES: INTENT(IN OUT)
279 !
280 ! FUNCTION RESULT:
281 ! Error_Status: The return value is an integer defining the error status.
282 ! The error codes are defined in the Message_Handler module.
283 ! If == SUCCESS the computation was sucessful
284 ! == FAILURE an unrecoverable error occurred
285 ! UNITS: N/A
286 ! TYPE: INTEGER
287 ! DIMENSION: Scalar
288 !
289 ! COMMENTS:
290 ! Note the INTENT on the output SfcOptics_TL argument is IN OUT rather
291 ! than just OUT. This is necessary because the argument may be defined
292 ! upon input.
293 !
294 !:sdoc-:
295 !----------------------------------------------------------------------------------
296 
297  FUNCTION compute_mw_land_sfcoptics_tl( &
298  SfcOptics_TL) & ! TL Output
299  result( err_stat )
300  ! Arguments
301  TYPE(crtm_sfcoptics_type), INTENT(IN OUT) :: sfcoptics_tl
302  ! Function result
303  INTEGER :: err_stat
304  ! Local parameters
305  CHARACTER(*), PARAMETER :: routine_name = 'Compute_MW_Land_SfcOptics_TL'
306  ! Local variables
307 
308 
309  ! Set up
310  err_stat = success
311 
312 
313  ! Compute the tangent-linear surface optical parameters
314  ! ***No TL models yet, so default TL output is zero***
315  sfcoptics_tl%Reflectivity = zero
316  sfcoptics_tl%Emissivity = zero
317 
318  END FUNCTION compute_mw_land_sfcoptics_tl
319 
320 
321 
322 !----------------------------------------------------------------------------------
323 !:sdoc+:
324 !
325 ! NAME:
326 ! Compute_MW_Land_SfcOptics_AD
327 !
328 ! PURPOSE:
329 ! Function to compute the adjoint surface emissivity and
330 ! reflectivity at microwave frequencies over a land surface.
331 !
332 ! This function is a wrapper for third party code.
333 !
334 ! NB: CURRENTLY THIS IS A STUB FUNCTION AS THERE ARE NO AD
335 ! COMPONENTS IN THE MW LAND SFCOPTICS COMPUTATIONS.
336 !
337 ! CALLING SEQUENCE:
338 ! Error_Status = Compute_MW_Land_SfcOptics_AD( SfcOptics_AD )
339 !
340 ! INPUTS:
341 ! SfcOptics_AD: Structure containing the adjoint surface optical
342 ! properties required for the adjoint radiative
343 ! transfer calculation.
344 ! *** COMPONENTS MODIFIED UPON OUTPUT ***
345 ! UNITS: N/A
346 ! TYPE: CRTM_SfcOptics_type
347 ! DIMENSION: Scalar
348 ! ATTRIBUTES: INTENT(IN OUT)
349 !
350 ! FUNCTION RESULT:
351 ! Error_Status: The return value is an integer defining the error status.
352 ! The error codes are defined in the Message_Handler module.
353 ! If == SUCCESS the computation was sucessful
354 ! == FAILURE an unrecoverable error occurred
355 ! UNITS: N/A
356 ! TYPE: INTEGER
357 ! DIMENSION: Scalar
358 !
359 ! COMMENTS:
360 ! Note the INTENT on the input adjoint arguments are IN OUT regardless
361 ! of their specification as "input" or "output". This is because these
362 ! arguments may contain information on input, or need to be zeroed on
363 ! output (or both).
364 !
365 !:sdoc-:
366 !----------------------------------------------------------------------------------
367 
368  FUNCTION compute_mw_land_sfcoptics_ad( &
369  SfcOptics_AD) & ! AD Input
370  result( err_stat )
371  ! Arguments
372  TYPE(crtm_sfcoptics_type), INTENT(IN OUT) :: sfcoptics_ad
373  ! Function result
374  INTEGER :: err_stat
375  ! Local parameters
376  CHARACTER(*), PARAMETER :: routine_name = 'Compute_MW_Land_SfcOptics_AD'
377  ! Local variables
378 
379 
380  ! Set up
381  err_stat = success
382 
383 
384  ! Compute the adjoint surface optical parameters
385  ! ***No AD models yet, so there is no impact on AD result***
386  sfcoptics_ad%Reflectivity = zero
387  sfcoptics_ad%Emissivity = zero
388 
389  END FUNCTION compute_mw_land_sfcoptics_ad
390 
391 END MODULE crtm_mw_land_sfcoptics
integer, parameter, public failure
integer, parameter coarse_med_fine
integer, parameter groadleaf_shrubs_groundcover
integer, parameter needleleaf_deciduous_trees
real(fp), parameter, public zero
integer function, public compute_mw_land_sfcoptics_ad(SfcOptics_AD)
integer, parameter, public fp
Definition: Type_Kinds.f90:124
integer, parameter, public max_n_angles
subroutine, public nesdis_landem(Angle, Frequency, Soil_Moisture_Content, Vegetation_Fraction, Soil_Temperature, t_skin, Lai, Soil_Type, Vegetation_Type, Snow_Depth, Emissivity_H, Emissivity_V)
integer, parameter broadleaf_needleleaf_trees
integer, parameter needleleaf_evergreen_trees
integer, parameter coarse_medium
integer, parameter broadleaf_evergreen_trees
integer function, public compute_mw_land_sfcoptics_tl(SfcOptics_TL)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer function, public compute_mw_land_sfcoptics(Surface, SensorIndex, ChannelIndex, SfcOptics)
character(*), parameter, private module_version_id
type(spccoeff_type), dimension(:), allocatable, save, public sc
integer, parameter n_valid_vegetation_types
integer, parameter broadleaf_shrubs_bare_soil
integer, parameter, public success
integer, parameter n_valid_soil_types
integer, parameter dwarf_trees_shrubs_groundcover
integer, parameter invalid_vegetation
integer, parameter broadleaf_trees_groundcover
integer, parameter broadleaf_deciduous_trees