SURFEX v8.1
General documentation of Surfex
z0v_from_lai.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !#######################
7 !#######################
8 !
9 INTERFACE z0v_from_lai
10 !
11  FUNCTION z0v_from_lai_0d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
12 !
13 REAL, INTENT(IN) :: PLAI ! Leaf area Index
14 REAL, INTENT(IN) :: PH_TREE ! height of trees
15 REAL, DIMENSION(:), INTENT(IN) :: PVEGTYPE ! type of vegetation
16 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
17 !
18 REAL :: PZ0 ! vegetation roughness
19 !
20 END FUNCTION z0v_from_lai_0d
21 !
22 !
23  FUNCTION z0v_from_lai_1d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
24 !
25 REAL, DIMENSION(:), INTENT(IN) :: PLAI ! Leaf area Index
26 REAL, DIMENSION(:), INTENT(IN) :: PH_TREE ! height of trees
27 REAL, DIMENSION(:,:), INTENT(IN) :: PVEGTYPE ! type of vegetation
28 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
29 !
30 REAL, DIMENSION(SIZE(PLAI)) :: PZ0 ! vegetation roughness
31 !
32 END FUNCTION z0v_from_lai_1d
33 !
34 !
35  FUNCTION z0v_from_lai_2d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
36 !
37 REAL, DIMENSION(:,:), INTENT(IN) :: PLAI ! Leaf area Index
38 REAL, DIMENSION(:,:), INTENT(IN) :: PH_TREE ! height of trees
39 REAL, DIMENSION(:,:,:), INTENT(IN) :: PVEGTYPE ! type of vegetation
40 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
41 !
42 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: PZ0 ! vegetation roughness
43 !
44 END FUNCTION z0v_from_lai_2d
45 !
46  FUNCTION z0v_from_lai_vegtype(PLAI,PH_TREE,OAGRI_TO_GRASS) RESULT(PZ0)
47 !
48 REAL, DIMENSION(:), INTENT(IN) :: PLAI ! Leaf area Index
49 REAL, DIMENSION(:), INTENT(IN) :: PH_TREE ! height of trees
50 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
51 !
52 REAL, DIMENSION(SIZE(PLAI)) :: PZ0 ! vegetation roughness
53 !
54 END FUNCTION z0v_from_lai_vegtype
55 !
56 END INTERFACE
57 !
58 END MODULE modi_z0v_from_lai
59 !
60 
61 ! ###########################################################
62  FUNCTION z0v_from_lai_0d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
63 ! ###########################################################
64 !!
65 !! PURPOSE
66 !! -------
67 !
68 ! Calculates vegetation roughness from leaf
69 ! area index and type of vegetation
70 ! (most of types; forest and vineyards; grassland)
71 !
72 !!** METHOD
73 !! ------
74 !!
75 !! EXTERNAL
76 !! --------
77 !! none
78 !!
79 !! IMPLICIT ARGUMENTS
80 !! ------------------
81 !!
82 !! none
83 !!
84 !! REFERENCE
85 !! ---------
86 !!
87 !!
88 !! AUTHOR
89 !! ------
90 !!
91 !! V. Masson and A. Boone * Meteo-France *
92 !!
93 !! MODIFICATIONS
94 !! -------------
95 !! Original 25/03/99
96 !! P. Aumond 10/10/2009 Because drag force applied in atmospheric
97 !! model, Z0tree -> z0grass
98 !! R. Alkama 05/2012 : Extantion from 12 to 19 vegtypes
99 !-------------------------------------------------------------------------------
100 !
101 !* 0. DECLARATIONS
102 ! ------------
103 !
104 USE modd_surf_par, ONLY : xundef
106 !
107 USE yomhook ,ONLY : lhook, dr_hook
108 USE parkind1 ,ONLY : jprb
109 !
110 IMPLICIT NONE
111 !
112 !* 0.1 declarations of arguments
113 !
114 REAL, INTENT(IN) :: PLAI ! Leaf area Index
115 REAL, INTENT(IN) :: PH_TREE ! height of trees
116 REAL, DIMENSION(:), INTENT(IN) :: PVEGTYPE ! type of vegetation
117 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
118 !
119 REAL :: PZ0 ! vegetation roughness
120 !
121 !* 0.2 declarations of local variables
122 !
123 REAL :: ZALLEN_H ! Allen formula for height
124 REAL :: ZLAI ! LAI for vegetated areas
125 !
126 REAL, DIMENSION(SIZE(PVEGTYPE)) :: ZH_VEG ! height for each type
127 REAL :: ZAVG_H ! averaged height
128 REAL :: ZZREF ! reference height
129 !
130 INTEGER :: JTYPE ! loop counter
131 REAL(KIND=JPRB) :: ZHOOK_HANDLE
132 !-----------------------------------------------------------------
133 !
134 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_0D',0,zhook_handle)
135 !
136 zh_veg(:) = veg_height_from_lai(plai,ph_tree,pvegtype,oagri_to_grass)
137 !
138 zzref = 10.
139 zavg_h = 0.
140 DO jtype=1,SIZE(pvegtype)
141  zavg_h = zavg_h + pvegtype(jtype) / (log(0.13*zh_veg(jtype)/zzref))**2
142 END DO
143 zavg_h = max(zavg_h,0.00001)
144 
145 zavg_h = zzref / 0.13 * exp(-1./sqrt(zavg_h))
146 !
147 pz0 = max(0.001, 0.13*zavg_h)
148 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_0D',1,zhook_handle)
149 !
150 !-----------------------------------------------------------------
151 !
152 END FUNCTION z0v_from_lai_0d
153 !
154 ! ###########################################################
155  FUNCTION z0v_from_lai_1d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
156 ! ###########################################################
157 !!
158 !! PURPOSE
159 !! -------
160 !
161 ! Calculates vegetation roughness from leaf
162 ! area index and type of vegetation
163 ! (most of types; forest and vineyards; grassland)
164 !
165 !!** METHOD
166 !! ------
167 !!
168 !! EXTERNAL
169 !! --------
170 !! none
171 !!
172 !! IMPLICIT ARGUMENTS
173 !! ------------------
174 !!
175 !! none
176 !!
177 !! REFERENCE
178 !! ---------
179 !!
180 !!
181 !! AUTHOR
182 !! ------
183 !!
184 !! V. Masson and A. Boone * Meteo-France *
185 !!
186 !! MODIFICATIONS
187 !! -------------
188 !! Original 25/03/99
189 !!
190 !-------------------------------------------------------------------------------
191 !
192 !* 0. DECLARATIONS
193 ! ------------
194 !
195 USE modd_surf_par, ONLY : xundef
197 !
198 USE yomhook ,ONLY : lhook, dr_hook
199 USE parkind1 ,ONLY : jprb
200 !
201 IMPLICIT NONE
202 !
203 !* 0.1 declarations of arguments
204 !
205 REAL, DIMENSION(:), INTENT(IN) :: PLAI ! Leaf area Index
206 REAL, DIMENSION(:), INTENT(IN) :: PH_TREE ! height of trees
207 REAL, DIMENSION(:,:), INTENT(IN) :: PVEGTYPE ! type of vegetation
208 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
209 !
210 REAL, DIMENSION(SIZE(PLAI)) :: PZ0 ! vegetation roughness
211 !
212 !* 0.2 declarations of local variables
213 !
214 REAL, DIMENSION(SIZE(PLAI)) :: ZALLEN_H ! Allen formula for height
215 REAL, DIMENSION(SIZE(PLAI)) :: ZLAI ! LAI for vegetated areas
216 !
217 REAL, DIMENSION(SIZE(PLAI),SIZE(PVEGTYPE,2)) :: ZH_VEG ! height for each type
218 REAL, DIMENSION(SIZE(PLAI)) :: ZAVG_H ! averaged height
219 REAL :: ZZREF ! reference height
220 !
221 INTEGER :: JTYPE ! loop counter
222 REAL(KIND=JPRB) :: ZHOOK_HANDLE
223 !-----------------------------------------------------------------
224 !
225 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_1D',0,zhook_handle)
226 zh_veg(:,:) = veg_height_from_lai(plai,ph_tree,pvegtype,oagri_to_grass)
227 !
228 zzref = 10.
229 zavg_h(:) = 0.
230 DO jtype=1,SIZE(pvegtype,2)
231  zavg_h(:) = zavg_h(:) + pvegtype(:,jtype) / (log(0.13*zh_veg(:,jtype)/zzref))**2
232 END DO
233 
234 zavg_h = max(zavg_h,0.00001)
235 
236 zavg_h(:) = zzref / 0.13 * exp(-1./sqrt(zavg_h(:)))
237 !
238 pz0(:) = max(0.001, 0.13*zavg_h(:))
239 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_1D',1,zhook_handle)
240 !-----------------------------------------------------------------
241 !
242 END FUNCTION z0v_from_lai_1d
243 !
244 ! ###########################################################
245  FUNCTION z0v_from_lai_2d(PLAI,PH_TREE,PVEGTYPE,OAGRI_TO_GRASS) RESULT(PZ0)
246 ! ###########################################################
247 !!
248 !! PURPOSE
249 !! -------
250 !
251 ! Calculates vegetation roughness from leaf
252 ! area index and type of vegetation
253 ! (most of types; forest and vineyards; grassland)
254 !
255 !!** METHOD
256 !! ------
257 !!
258 !! EXTERNAL
259 !! --------
260 !! none
261 !!
262 !! IMPLICIT ARGUMENTS
263 !! ------------------
264 !!
265 !! none
266 !!
267 !! REFERENCE
268 !! ---------
269 !!
270 !!
271 !! AUTHOR
272 !! ------
273 !!
274 !! V. Masson and A. Boone * Meteo-France *
275 !!
276 !! MODIFICATIONS
277 !! -------------
278 !! Original 25/03/99
279 !!
280 !-------------------------------------------------------------------------------
281 !
282 !* 0. DECLARATIONS
283 ! ------------
284 !
285 USE modd_surf_par, ONLY : xundef
287 !
288 USE yomhook ,ONLY : lhook, dr_hook
289 USE parkind1 ,ONLY : jprb
290 !
291 IMPLICIT NONE
292 !
293 !* 0.1 declarations of arguments
294 !
295 REAL, DIMENSION(:,:), INTENT(IN) :: PLAI ! Leaf area Index
296 REAL, DIMENSION(:,:), INTENT(IN) :: PH_TREE ! height of trees
297 REAL, DIMENSION(:,:,:), INTENT(IN) :: PVEGTYPE ! type of vegetation
298 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
299 !
300 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: PZ0 ! vegetation roughness
301 !
302 !* 0.2 declarations of local variables
303 !
304 
305 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: ZALLEN_H ! Allen formula for height
306 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: ZLAI ! LAI for vegetated areas
307 !
308 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2),SIZE(PVEGTYPE,3)) :: ZH_VEG ! height for each type
309 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: ZAVG_H ! averaged height
310 REAL :: ZZREF ! reference height
311 !
312 INTEGER :: JTYPE ! loop counter
313 REAL(KIND=JPRB) :: ZHOOK_HANDLE
314 !-----------------------------------------------------------------
315 !
316 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_2D',0,zhook_handle)
317 zh_veg(:,:,:) = veg_height_from_lai(plai,ph_tree,pvegtype,oagri_to_grass)
318 !
319 zzref = 10.
320 zavg_h(:,:) = 0.
321 DO jtype=1,SIZE(pvegtype,3)
322  zavg_h(:,:) = zavg_h(:,:) + pvegtype(:,:,jtype) / (log(0.13*zh_veg(:,:,jtype)/zzref))**2
323 END DO
324 zavg_h(:,:) = max(zavg_h(:,:),0.00001)
325 zavg_h(:,:) = zzref / 0.13 * exp(-1./sqrt(zavg_h(:,:)))
326 !
327 pz0(:,:) = max(0.001, 0.13*zavg_h(:,:))
328 !
329 WHERE (plai(:,:) == xundef)
330  pz0(:,:) = xundef
331 END WHERE
332 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_2D',1,zhook_handle)
333 !-----------------------------------------------------------------
334 !
335 END FUNCTION z0v_from_lai_2d
336 !
337 !
338 !
339 ! ###########################################################
340  FUNCTION z0v_from_lai_vegtype(PLAI,PH_TREE,OAGRI_TO_GRASS) RESULT(PZ0)
341 ! ###########################################################
342 !!
343 !! PURPOSE
344 !! -------
345 !
346 ! Calculates vegetation roughness from leaf
347 ! area index and type of vegetation for each patch
348 ! (most of types; forest and vineyards; grassland)
349 !
350 !!** METHOD
351 !! ------
352 !!
353 !! EXTERNAL
354 !! --------
355 !! none
356 !!
357 !! IMPLICIT ARGUMENTS
358 !! ------------------
359 !!
360 !! none
361 !!
362 !! REFERENCE
363 !! ---------
364 !!
365 !!
366 !! AUTHOR
367 !! ------
368 !! F.Solmon
369 !! V. Masson and A. Boone * Meteo-France *
370 !!
371 !! MODIFICATIONS
372 !! -------------
373 !! Original 25/03/99
374 !!
375 !-------------------------------------------------------------------------------
376 !
377 !* 0. DECLARATIONS
378 ! ------------
379 !
380 USE modd_surf_par, ONLY : xundef
382 !
383 USE yomhook ,ONLY : lhook, dr_hook
384 USE parkind1 ,ONLY : jprb
385 !
386 IMPLICIT NONE
387 !
388 !* 0.1 declarations of arguments
389 !
390 REAL, DIMENSION(:), INTENT(IN) :: PLAI ! Leaf area Index
391 REAL, DIMENSION(:), INTENT(IN) :: PH_TREE ! height of trees
392 LOGICAL, INTENT(IN) :: OAGRI_TO_GRASS
393 !
394 REAL, DIMENSION(SIZE(PLAI)) :: PZ0 ! vegetation roughness
395 !
396 !* 0.2 declarations of local variables
397 !
398 REAL, DIMENSION(SIZE(PLAI)) :: ZALLEN_H ! Allen formula for height
399 !
400 REAL, DIMENSION(SIZE(PLAI)) :: ZH_VEG ! height for each type
401 REAL(KIND=JPRB) :: ZHOOK_HANDLE
402 !-----------------------------------------------------------------
403 !
404 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_VEGTYPE',0,zhook_handle)
405 zh_veg(:) = veg_height_from_lai(plai,ph_tree,oagri_to_grass)
406 !
407 pz0(:) = xundef
408 !
409 WHERE(zh_veg(:)/=xundef) pz0(:) = max(0.001, 0.13*zh_veg(:)) ! rugosite pour chaque vegtype
410 !-----------------------------------------------------------------
411 !
412 WHERE (plai(:) == xundef)
413  pz0(:) = xundef
414 END WHERE
415 IF (lhook) CALL dr_hook('MODI_Z0V_FROM_LAI:Z0V_FROM_LAI_VEGTYPE',1,zhook_handle)
416 !
417 !
418 END FUNCTION z0v_from_lai_vegtype
419 !
real function, dimension(size(plai, 1), size(plai, 2)) z0v_from_lai_2d(PLAI, PH_TREE, PVEGTYPE, OAGRI_TO_GRASS)
real function, dimension(size(plai)) z0v_from_lai_vegtype(PLAI, PH_TREE, OAGRI_TO_GRASS)
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
real function z0v_from_lai_0d(PLAI, PH_TREE, PVEGTYPE, OAGRI_TO_GRASS)
real function, dimension(size(plai)) z0v_from_lai_1d(PLAI, PH_TREE, PVEGTYPE, OAGRI_TO_GRASS)