SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
mode_meb.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 ! ################
6  MODULE mode_meb
7 ! ################
8 !
9 !!**** *MODE_MEB * - contains multi-energy balance characteristics functions
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !! IMPLICIT ARGUMENTS
21 !! ------------------
22 !!
23 !! REFERENCE
24 !! ---------
25 !!
26 !! AUTHOR
27 !! ------
28 !! P. Samuelsson * SMHI *
29 !! A. Boone * Meteo France *
30 !! S. Gollvik * SMHI *
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 18/01/11
35 !-----------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 !
39 !
40 INTERFACE mebpalphan
41  MODULE PROCEDURE mebpalphan_3d
42  MODULE PROCEDURE mebpalphan_2d
43  MODULE PROCEDURE mebpalphan_1d
44  MODULE PROCEDURE mebpalphan_0d
45 END INTERFACE
46 !
47 INTERFACE sfc_heatcap_veg
48  MODULE PROCEDURE sfc_heatcap_veg_2d
49  MODULE PROCEDURE sfc_heatcap_veg_1d
50  MODULE PROCEDURE sfc_heatcap_veg_0d
51 END INTERFACE
52 !
53 INTERFACE swdown_diff
54  MODULE PROCEDURE swdown_diff_2d
55  MODULE PROCEDURE swdown_diff_1d
56  MODULE PROCEDURE swdown_diff_0d
57 END INTERFACE
58 !
60  MODULE PROCEDURE snow_intercept_eff_2d
61  MODULE PROCEDURE snow_intercept_eff_1d
62  MODULE PROCEDURE snow_intercept_eff_0d
63 END INTERFACE
64 !
66  MODULE PROCEDURE meb_shield_factor_2d
67  MODULE PROCEDURE meb_shield_factor_1d
68  MODULE PROCEDURE meb_shield_factor_0d
69 END INTERFACE
70 !
71 !-------------------------------------------------------------------------------
72  CONTAINS
73 !
74 !####################################################################
75 !####################################################################
76 !####################################################################
77  FUNCTION mebpalphan_3d(PSNOWDEPTH,PH_VEG) RESULT(PPALPHAN)
78 !
79 !! PURPOSE
80 !! -------
81 ! Calculation of p_alphan, the snow/canopy transition coefficient
82 ! 0 for snow at canopy base
83 ! 1 for snow at canopy top
84 !
85 USE yomhook ,ONLY : lhook, dr_hook
86 USE parkind1 ,ONLY : jprb
87 !
88 IMPLICIT NONE
89 !
90 !* 0.1 declarations of arguments
91 !
92 REAL, DIMENSION(:,:,:), INTENT(IN) :: psnowdepth,ph_veg
93 !
94 REAL, DIMENSION(SIZE(PSNOWDEPTH,1),SIZE(PSNOWDEPTH,2),SIZE(PSNOWDEPTH,3)) :: ppalphan
95 !
96 !* 0.2 declarations of local variables
97 !
98 REAL(KIND=JPRB) :: zhook_handle
99 !
100 REAL, DIMENSION(SIZE(PSNOWDEPTH,1),SIZE(PSNOWDEPTH,2),SIZE(PSNOWDEPTH,3)) :: zh_baseveg ! height of the base of the canopy
101 !
102 !-------------------------------------------------------------------------------
103 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_3D',0,zhook_handle)
104 !
105 ! multi-energy balance: Maybe the calculation of ZH_BASEVEG should be modified.
106 !WHERE(PH_VEG>1.)
107 ! ZH_BASEVEG(:,:,:)=0.3*PH_VEG(:,:,:)
108 !ELSEWHERE
109 ! ZH_BASEVEG(:,:,:)=0.
110 !END WHERE
111 zh_baseveg(:,:,:)=max(0.2*(ph_veg(:,:,:)-2.0),0.0);
112 !
113 ppalphan(:,:,:)=min(1.,max(0., (psnowdepth(:,:,:)-zh_baseveg(:,:,:))/(ph_veg(:,:,:)-zh_baseveg(:,:,:)) ))
114 !
115 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_3D',1,zhook_handle)
116 !-------------------------------------------------------------------------------
117 !
118 END FUNCTION mebpalphan_3d
119 !####################################################################
120 !####################################################################
121 !####################################################################
122  FUNCTION mebpalphan_2d(PSNOWDEPTH,PH_VEG) RESULT(PPALPHAN)
123 !
124 !! PURPOSE
125 !! -------
126 ! Calculation of p_alphan, the snow/canopy transition coefficient
127 ! 0 for snow at canopy base
128 ! 1 for snow at canopy top
129 !
130 USE yomhook ,ONLY : lhook, dr_hook
131 USE parkind1 ,ONLY : jprb
132 !
133 IMPLICIT NONE
134 !
135 !* 0.1 declarations of arguments
136 !
137 REAL, DIMENSION(:,:), INTENT(IN) :: psnowdepth,ph_veg
138 !
139 REAL, DIMENSION(SIZE(PSNOWDEPTH,1),SIZE(PSNOWDEPTH,2)) :: ppalphan
140 !
141 !* 0.2 declarations of local variables
142 !
143 REAL(KIND=JPRB) :: zhook_handle
144 !
145 REAL, DIMENSION(SIZE(PSNOWDEPTH,1),SIZE(PSNOWDEPTH,2)) :: zh_baseveg ! height of the base of the canopy
146 !
147 !-------------------------------------------------------------------------------
148 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_2D',0,zhook_handle)
149 !
150 !WHERE(PH_VEG>1.)
151 ! ZH_BASEVEG(:,:)=0.3*PH_VEG(:,:)
152 !ELSEWHERE
153 ! ZH_BASEVEG(:,:)=0.
154 !END WHERE
155 zh_baseveg(:,:)=max(0.2*(ph_veg(:,:)-2.0),0.0);
156 !
157 ppalphan(:,:)=min(1.,max(0., (psnowdepth(:,:)-zh_baseveg(:,:))/(ph_veg(:,:)-zh_baseveg(:,:)) ))
158 !
159 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_2D',1,zhook_handle)
160 !-------------------------------------------------------------------------------
161 !
162 END FUNCTION mebpalphan_2d
163 !####################################################################
164 !####################################################################
165 !####################################################################
166  FUNCTION mebpalphan_1d(PSNOWDEPTH,PH_VEG) RESULT(PPALPHAN)
167 !
168 !! PURPOSE
169 !! -------
170 ! Calculation of p_alphan, the snow/canopy transition coefficient
171 ! 0 for snow at canopy base
172 ! 1 for snow at canopy top
173 !
174 USE yomhook ,ONLY : lhook, dr_hook
175 USE parkind1 ,ONLY : jprb
176 !
177 IMPLICIT NONE
178 !
179 !* 0.1 declarations of arguments
180 !
181 REAL, DIMENSION(:), INTENT(IN) :: psnowdepth,ph_veg
182 !
183 REAL, DIMENSION(SIZE(PSNOWDEPTH,1)) :: ppalphan
184 !
185 !* 0.2 declarations of local variables
186 !
187 REAL(KIND=JPRB) :: zhook_handle
188 !
189 REAL, DIMENSION(SIZE(PSNOWDEPTH,1)) :: zh_baseveg ! height of the base of the canopy
190 !
191 !-------------------------------------------------------------------------------
192 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_1D',0,zhook_handle)
193 !
194 !WHERE(PH_VEG>1.)
195 ! ZH_BASEVEG(:)=0.3*PH_VEG(:)
196 !ELSEWHERE
197 ! ZH_BASEVEG(:)=0.
198 !END WHERE
199 zh_baseveg(:)=max(0.2*(ph_veg(:)-2.0),0.0);
200 !
201 !
202 ppalphan(:)=min(1.,max(0., (psnowdepth(:)-zh_baseveg(:))/(ph_veg(:)-zh_baseveg(:)) ))
203 !
204 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_1D',1,zhook_handle)
205 !-------------------------------------------------------------------------------
206 !
207 END FUNCTION mebpalphan_1d
208 !####################################################################
209 !####################################################################
210 !####################################################################
211  FUNCTION mebpalphan_0d(PSNOWDEPTH,PH_VEG) RESULT(PPALPHAN)
212 !
213 !! PURPOSE
214 !! -------
215 ! Calculation of p_alphan, the snow/canopy transition coefficient
216 ! 0 for snow at canopy base
217 ! 1 for snow at canopy top
218 !
219 USE yomhook ,ONLY : lhook, dr_hook
220 USE parkind1 ,ONLY : jprb
221 !
222 IMPLICIT NONE
223 !
224 !* 0.1 declarations of arguments
225 !
226 REAL, INTENT(IN) :: psnowdepth,ph_veg
227 !
228 REAL :: ppalphan
229 !
230 !* 0.2 declarations of local variables
231 !
232 REAL(KIND=JPRB) :: zhook_handle
233 !
234 REAL :: zh_baseveg ! height of the base of the canopy
235 !
236 !-------------------------------------------------------------------------------
237 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_0D',0,zhook_handle)
238 !
239 !IF(PH_VEG>1.)THEN
240 ! ZH_BASEVEG=0.3*PH_VEG
241 !ELSE
242 ! ZH_BASEVEG=0.
243 !ENDIF
244 zh_baseveg=max(0.2*(ph_veg-2.0),0.0);
245 !
246 ppalphan=min(1.,max(0., (psnowdepth-zh_baseveg)/(ph_veg-zh_baseveg) ))
247 !
248 IF (lhook) CALL dr_hook('MODE_MEB:MEBPALPHAN_0D',1,zhook_handle)
249 !-------------------------------------------------------------------------------
250 !
251 END FUNCTION mebpalphan_0d
252 !####################################################################
253 !####################################################################
254 !####################################################################
255 FUNCTION sfc_heatcap_veg_0d(PWRN,PWR,PCV) RESULT(ZCHEATV)
256 
257 ! Compute the bulk heat capacity of the vegetation canopy
258 
259 USE modd_csts, ONLY : xcl, xci
260 USE modd_isba_par, ONLY : xcvheatf
261 
262 USE yomhook ,ONLY : lhook, dr_hook
263 USE parkind1 ,ONLY : jprb
264 !
265 IMPLICIT NONE
266 
267 !* 0.1 declarations of arguments
268 !
269 REAL, INTENT(IN) :: pwrn, pwr, pcv
270 ! PWRN = Liquid water equivalent mass of intercepted snow (kg m-2)
271 ! PCV = Thermal inertia of the vegetation (m2 K J-1)
272 ! PWR = Liquid water mass intercepted (kg m-2)
273 !
274 !* 0.2 declarations of local variables
275 !
276 REAL(KIND=JPRB) :: zhook_handle
277 !
278 REAL :: zcheatv
279 ! ZCHEATV = Total bulk Vegetation canopy heat capacity (J m-2 K-1)
280 !
281 !* 0.3 declarations of local parameters
282 !
283 REAL, PARAMETER :: zcheatvmin = 1.e+4 ! minimum limit (J m-2 K-1)
284 !
285 !------------------------------------------------------------
286 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_0D',0,zhook_handle)
287 !
288 ! Total bulk canopy heat capacity
289 ! Method: we use the ratio of biomass to LAI to get a total biomass estimate,
290 ! next assume that the dry biomass heat capacity is small compared to that
291 ! of the water contained in the vegetation to arrive at the vegetation part, then
292 ! we add the heat capacities of intercepted liquid and frozen water.
293 ! Finally, use a minimum value to avoid numerical jumps, while still ensuring that
294 ! the heat capacity of the vegetation is generally < a typical daily restore for the soil
295 
296 zcheatv = max(zcheatvmin,xcvheatf/pcv) + & ! stems, branches, trunk...
297  xci*pwrn + & ! intercepted snow
298  xcl*pwr ! intercepted water
299 
300 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_0D',1,zhook_handle)
301 
302 END FUNCTION sfc_heatcap_veg_0d
303 !####################################################################
304 !####################################################################
305 !####################################################################
306 FUNCTION sfc_heatcap_veg_1d(PWRN,PWR,PCV) RESULT(ZCHEATV)
307 
308 ! Compute the bulk heat capacity of the vegetation canopy
309 
310 USE modd_csts, ONLY : xcl, xci
311 USE modd_isba_par, ONLY : xcvheatf
312 
313 USE yomhook ,ONLY : lhook, dr_hook
314 USE parkind1 ,ONLY : jprb
315 !
316 IMPLICIT NONE
317 
318 !* 0.1 declarations of arguments
319 !
320 REAL, DIMENSION(:), INTENT(IN) :: pwrn, pwr, pcv
321 ! PWRN = Liquid water equivalent mass of intercepted snow (kg m-2)
322 ! PCV = Thermal inertia of the vegetation (m2 K J-1)
323 ! PWR = Liquid water mass intercepted (kg m-2)
324 !
325 !* 0.2 declarations of local variables
326 !
327 REAL(KIND=JPRB) :: zhook_handle
328 !
329 REAL, DIMENSION(SIZE(PCV)) :: zcheatv
330 ! ZCHEATV = Total bulk Vegetation canopy heat capacity (J m-2 K-1)
331 !
332 !* 0.3 declarations of local parameters
333 !
334 REAL, PARAMETER :: zcheatvmin = 1.e+4 ! minimum limit (J m-2 K-1)
335 !
336 !------------------------------------------------------------
337 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_1D',0,zhook_handle)
338 !
339 ! Total bulk canopy heat capacity
340 ! Method: we use the ratio of biomass to LAI to get a total biomass estimate,
341 ! next assume that the dry biomass heat capacity is small compared to that
342 ! of the water contained in the vegetation to arrive at the vegetation part, then
343 ! we add the heat capacities of intercepted liquid and frozen water.
344 ! Finally, use a minimum value to avoid numerical jumps, while still ensuring that
345 ! the heat capacity of the vegetation is generally < a typical daily restore for the soil
346 
347 zcheatv(:) = max(zcheatvmin,xcvheatf/pcv(:)) + & ! stems, branches, trunk...
348  xci*pwrn(:) + & ! intercepted snow
349  xcl*pwr(:) ! intercepted water
350 
351 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_1D',1,zhook_handle)
352 
353 END FUNCTION sfc_heatcap_veg_1d
354 !####################################################################
355 !####################################################################
356 !####################################################################
357 FUNCTION sfc_heatcap_veg_2d(PWRN,PWR,PCV) RESULT(ZCHEATV)
358 
359 ! Compute the bulk heat capacity of the vegetation canopy
360 
361 USE modd_csts, ONLY : xcl, xci
362 USE modd_isba_par, ONLY : xcvheatf
363 
364 USE yomhook ,ONLY : lhook, dr_hook
365 USE parkind1 ,ONLY : jprb
366 !
367 IMPLICIT NONE
368 
369 !* 0.1 declarations of arguments
370 !
371 REAL, DIMENSION(:,:), INTENT(IN) :: pwrn, pwr, pcv
372 ! PWRN = Liquid water equivalent mass of intercepted snow (kg m-2)
373 ! PCV = Thermal inertia of the vegetation (m2 K J-1)
374 ! PWR = Liquid water mass intercepted (kg m-2)
375 !
376 !* 0.2 declarations of local variables
377 !
378 REAL(KIND=JPRB) :: zhook_handle
379 !
380 REAL, DIMENSION(SIZE(PCV),SIZE(PCV,2)) :: zcheatv
381 ! ZCHEATV = Total bulk Vegetation canopy heat capacity (J m-2 K-1)
382 !
383 !* 0.3 declarations of local parameters
384 !
385 REAL, PARAMETER :: zcheatvmin = 1.e+4 ! minimum limit (J m-2 K-1)
386 !
387 !------------------------------------------------------------
388 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_2D',0,zhook_handle)
389 !
390 ! Total bulk canopy heat capacity
391 ! Method: we use the ratio of biomass to LAI to get a total biomass estimate,
392 ! next assume that the dry biomass heat capacity is small compared to that
393 ! of the water contained in the vegetation to arrive at the vegetation part, then
394 ! we add the heat capacities of intercepted liquid and frozen water.
395 ! Finally, use a minimum value to avoid numerical jumps, while still ensuring that
396 ! the heat capacity of the vegetation is generally < a typical daily restore for the soil
397 
398 zcheatv(:,:) = max(zcheatvmin,xcvheatf/pcv(:,:)) + & ! stems, branches, trunk...
399  xci*pwrn(:,:) + & ! intercepted snow
400  xcl*pwr(:,:) ! intercepted water
401 
402 IF (lhook) CALL dr_hook('MODE_MEB:SFC_HEATCAP_VEG_2D',1,zhook_handle)
403 
404 END FUNCTION sfc_heatcap_veg_2d
405 !####################################################################
406 !####################################################################
407 !####################################################################
408 !####################################################################
409 !####################################################################
410 !####################################################################
411 FUNCTION swdown_diff_2d(PSW_RAD,PCOSZENITH) RESULT(ZSWDOWN_DIFF)
412 
413 ! Based on incoming total rad (direct and diffuse) and cosine of the
414 ! solar zenith angle, compute the fraction of that rad which is diffuse.
415 ! D.G. Erbs, S.A. Klein and J.A. Duffie, 1982:
416 ! Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation.
417 ! Solar Energy, 28(4), 293-302.
418 !
419 ! Author: A. Boone CNRM-GAME
420 
421 USE modd_csts, ONLY : xi0
422 
423 USE yomhook ,ONLY : lhook, dr_hook
424 USE parkind1 ,ONLY : jprb
425 !
426 IMPLICIT NONE
427 
428 !* 0.1 declarations of arguments
429 !
430 REAL, DIMENSION(:,:), INTENT(IN) :: psw_rad
431 
432 REAL, DIMENSION(:,:), INTENT(IN) :: pcoszenith
433 
434 !
435 !* 0.2 declarations of local variables
436 !
437 REAL(KIND=JPRB) :: zhook_handle
438 !
439 REAL, DIMENSION(SIZE(PSW_RAD,1),SIZE(PSW_RAD,2)) :: zswdown_diff, zratio
440 
441 !* 0.3 declarations of local parameters
442 
443 REAL, PARAMETER :: zswcnt = 1.0 ! 1.000 if all wavelength SWdown
444  ! 2.083 (=1/0.48) if just visible
445 !--------------------------------------------------------
446 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_2D',0,zhook_handle)
447 
448 zratio(:,:) = psw_rad(:,:)*(zswcnt/xi0)/max(0.01,pcoszenith(:,:))
449 
450 ! Numerical Check:
451 
452 zratio(:,:) = min(1.0, zratio(:,:))
453 
454 zswdown_diff(:,:) = 0.165 ! RATIO >= 0.8
455 
456 WHERE(zratio(:,:) < 0.22 ) &
457  zswdown_diff(:,:) = 1.0 - 0.09*zratio(:,:)
458 
459 WHERE(zratio(:,:) >= 0.22 .AND. zratio(:,:) < 0.80) &
460  zswdown_diff(:,:) = 0.9511 + (-0.1604 + (4.388 + (-16.64 + &
461  12.34*zratio(:,:))*zratio(:,:))*zratio(:,:))*zratio(:,:)
462 
463 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_2D',1,zhook_handle)
464 
465 END FUNCTION swdown_diff_2d
466 !####################################################################
467 !####################################################################
468 !####################################################################
469 FUNCTION swdown_diff_1d(PSW_RAD,PCOSZENITH) RESULT(ZSWDOWN_DIFF)
470 
471 ! Based on incoming total rad (direct and diffuse) and cosine of the
472 ! solar zenith angle, compute the fraction of that rad which is diffuse.
473 ! D.G. Erbs, S.A. Klein and J.A. Duffie, 1982:
474 ! Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation.
475 ! Solar Energy, 28(4), 293-302.
476 !
477 ! Author: A. Boone CNRM-GAME
478 
479 USE modd_csts, ONLY : xi0
480 
481 USE yomhook ,ONLY : lhook, dr_hook
482 USE parkind1 ,ONLY : jprb
483 !
484 IMPLICIT NONE
485 
486 !* 0.1 declarations of arguments
487 !
488 REAL, DIMENSION(:), INTENT(IN) :: psw_rad
489 
490 REAL, DIMENSION(:), INTENT(IN) :: pcoszenith
491 
492 !
493 !* 0.2 declarations of local variables
494 !
495 REAL(KIND=JPRB) :: zhook_handle
496 !
497 REAL, DIMENSION(SIZE(PSW_RAD)) :: zswdown_diff, zratio
498 
499 !* 0.3 declarations of local parameters
500 
501 REAL, PARAMETER :: zswcnt = 1.0 ! 1.000 if all wavelength SWdown
502  ! 2.083 (=1/0.48) if just visible
503 !
504 !--------------------------------------------------------
505 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_1D',0,zhook_handle)
506 
507 zratio(:) = psw_rad(:)*(zswcnt/xi0)/max(0.01,pcoszenith(:))
508 
509 ! Numerical Check:
510 
511 zratio(:) = min(1.0, zratio(:))
512 
513 zswdown_diff(:) = 0.165 ! RATIO >= 0.8
514 
515 WHERE(zratio(:) < 0.22 ) &
516  zswdown_diff(:) = 1.0 - 0.09*zratio(:)
517 
518 WHERE(zratio(:) >= 0.22 .AND. zratio(:) < 0.80) &
519  zswdown_diff(:) = 0.9511 + (-0.1604 + (4.388 + (-16.64 + &
520  12.34*zratio(:))*zratio(:))*zratio(:))*zratio(:)
521 
522 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_1D',1,zhook_handle)
523 
524 END FUNCTION swdown_diff_1d
525 !####################################################################
526 !####################################################################
527 !####################################################################
528 FUNCTION swdown_diff_0d(PSW_RAD,PCOSZENITH) RESULT(ZSWDOWN_DIFF)
529 
530 ! Based on incoming total rad (direct and diffuse) and cosine of the
531 ! solar zenith angle, compute the fraction of that rad which is diffuse.
532 ! D.G. Erbs, S.A. Klein and J.A. Duffie, 1982:
533 ! Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation.
534 ! Solar Energy, 28(4), 293-302.
535 !
536 ! Author: A. Boone CNRM-GAME
537 
538 USE modd_csts, ONLY : xi0
539 
540 USE yomhook ,ONLY : lhook, dr_hook
541 USE parkind1 ,ONLY : jprb
542 !
543 IMPLICIT NONE
544 
545 !* 0.1 declarations of arguments
546 !
547 REAL, INTENT(IN) :: psw_rad
548 
549 REAL, INTENT(IN) :: pcoszenith
550 
551 !
552 !* 0.2 declarations of local variables
553 !
554 REAL(KIND=JPRB) :: zhook_handle
555 !
556 REAL :: zswdown_diff, zratio
557 !
558 !* 0.3 declarations of local parameters
559 !
560 REAL, PARAMETER :: zswcnt = 1.0 ! 1.000 if all wavelength SWdown
561  ! 2.083 (=1/0.48) if just visible
562 !--------------------------------------------------------
563 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_0D',0,zhook_handle)
564 
565 zratio = psw_rad*(zswcnt/xi0)/max(0.01,pcoszenith)
566 
567 ! Numerical Check:
568 
569 zratio = min(1.0, zratio)
570 
571 zswdown_diff = 0.165 ! RATIO >= 0.8
572 
573 IF (zratio < 0.22 )THEN
574  zswdown_diff = 1.0 - 0.09*zratio
575 ELSEIF(zratio >= 0.22 .AND. zratio < 0.80)THEN
576  zswdown_diff = 0.9511 + (-0.1604 + (4.388 + (-16.64 + &
577  12.34*zratio)*zratio)*zratio)*zratio
578 ENDIF
579 
580 IF (lhook) CALL dr_hook('MODE_MEB:SWDOWN_DIFF_0D',1,zhook_handle)
581 
582 END FUNCTION swdown_diff_0d
583 !####################################################################
584 !####################################################################
585 !####################################################################
586 FUNCTION snow_intercept_eff_0d(PCHIP,PVELC,PWRVNMAX) RESULT(ZKVN)
587 !!
588 !! Calculate snow interception efficiency.
589 !!
590 !! REFERENCE
591 !! ---------
592 !!
593 !!
594 !! AUTHOR
595 !! ------
596 !!
597 !! P. Samuelsson * SMHI *
598 !!
599 !! MODIFICATIONS
600 !! -------------
601 !! Original 02/2011
602 !! (A. Boone) 08/08/2011 Transform from subroutine to function
603 !!
604 !-------------------------------------------------------------------------------
605 !
606 !* 0. DECLARATIONS
607 ! ------------
608 !
609 USE yomhook ,ONLY : lhook, dr_hook
610 USE parkind1 ,ONLY : jprb
611 !
612 IMPLICIT NONE
613 !
614 !* 0.1 declarations of arguments
615 !
616 REAL, INTENT(IN) :: pchip, pvelc
617 ! PCHIP = view factor (for LW)
618 ! PVELC = wind speed at top of vegetation
619 !
620 REAL, INTENT(IN) :: pwrvnmax
621 ! PWRVNMAX = maximum equivalent snow content
622 ! in the canopy vegetation
623 !
624 !* 0.2 declarations of local variables
625 !
626 !
627 REAL :: zkvn
628 ! ZKVN = Snow interception efficiency
629 ! coefficient.
630 ! Note: if this is set=0 it means
631 ! that snow interception is shut
632 ! off.
633 !
634 REAL :: zfcp
635 ! ZFCP = snow interception factor
636 REAL(KIND=JPRB) :: zhook_handle
637 !
638 !* 0.3 declarations of local parameters
639 !
640 REAL, PARAMETER :: zwsnow = 0.8 ! Snow fall velocity (m/s)
641 !
642 !-------------------------------------------------------------------------------
643 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_0D',0,zhook_handle)
644 !
645 ! Initialization:
646 !
647 zfcp = 0.0
648 zkvn = 0.0
649 !
650 ! Snow interception efficiency
651 !
652 IF(pwrvnmax > 0.0)THEN
653  zfcp = min(1.,max(0., pvelc/((2*zwsnow)*pchip) ) )
654  zkvn = (1.-pchip+zfcp*pchip)/pwrvnmax
655 ENDIF
656 !
657 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_0D',1,zhook_handle)
658 END FUNCTION snow_intercept_eff_0d
659 !####################################################################
660 !####################################################################
661 !####################################################################
662 FUNCTION snow_intercept_eff_1d(PCHIP,PVELC,PWRVNMAX) RESULT(ZKVN)
663 !!
664 !! Calculate snow interception efficiency.
665 !!
666 !! REFERENCE
667 !! ---------
668 !!
669 !!
670 !! AUTHOR
671 !! ------
672 !!
673 !! P. Samuelsson * SMHI *
674 !!
675 !! MODIFICATIONS
676 !! -------------
677 !! Original 02/2011
678 !! (A. Boone) 08/08/2011 Transform from subroutine to function
679 !!
680 !-------------------------------------------------------------------------------
681 !
682 !* 0. DECLARATIONS
683 ! ------------
684 !
685 USE yomhook ,ONLY : lhook, dr_hook
686 USE parkind1 ,ONLY : jprb
687 !
688 IMPLICIT NONE
689 !
690 !* 0.1 declarations of arguments
691 !
692 REAL, DIMENSION(:), INTENT(IN) :: pchip, pvelc
693 ! PCHIP = view factor (for LW)
694 ! PVELC = wind speed at top of vegetation
695 !
696 REAL, DIMENSION(:), INTENT(IN) :: pwrvnmax
697 ! PWRVNMAX = maximum equivalent snow content
698 ! in the canopy vegetation
699 !
700 !* 0.2 declarations of local variables
701 !
702 !
703 REAL, DIMENSION(SIZE(PVELC)) :: zkvn
704 ! ZKVN = Snow interception efficiency
705 ! coefficient.
706 ! Note: if this is set=0 it means
707 ! that snow interception is shut
708 ! off.
709 !
710 REAL, DIMENSION(SIZE(PVELC)) :: zfcp
711 ! ZFCP = snow interception factor
712 REAL(KIND=JPRB) :: zhook_handle
713 !
714 !* 0.3 declarations of local parameters
715 !
716 REAL, PARAMETER :: zwsnow = 0.8 ! Snow fall velocity (m/s)
717 !
718 !-------------------------------------------------------------------------------
719 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_1D',0,zhook_handle)
720 !
721 ! Initialization:
722 !
723 zfcp(:) = 0.0
724 zkvn(:) = 0.0
725 !
726 ! Snow interception efficiency
727 !
728 WHERE(pwrvnmax(:) > 0.0)
729  zfcp(:) = min(1.,max(0., pvelc(:)/((2*zwsnow)*pchip(:)) ) )
730  zkvn(:) = (1.-pchip(:)+zfcp(:)*pchip(:))/pwrvnmax(:)
731 END WHERE
732 !
733 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_1D',1,zhook_handle)
734 END FUNCTION snow_intercept_eff_1d
735 !####################################################################
736 !####################################################################
737 !####################################################################
738 FUNCTION snow_intercept_eff_2d(PCHIP,PVELC,PWRVNMAX) RESULT(ZKVN)
739 !!
740 !! Calculate snow interception efficiency.
741 !!
742 !! REFERENCE
743 !! ---------
744 !!
745 !!
746 !! AUTHOR
747 !! ------
748 !!
749 !! P. Samuelsson * SMHI *
750 !!
751 !! MODIFICATIONS
752 !! -------------
753 !! Original 02/2011
754 !! (A. Boone) 08/08/2011 Transform from subroutine to function
755 !!
756 !-------------------------------------------------------------------------------
757 !
758 !* 0. DECLARATIONS
759 ! ------------
760 !
761 USE yomhook ,ONLY : lhook, dr_hook
762 USE parkind1 ,ONLY : jprb
763 !
764 IMPLICIT NONE
765 !
766 !* 0.1 declarations of arguments
767 !
768 REAL, DIMENSION(:,:), INTENT(IN) :: pchip, pvelc
769 ! PCHIP = view factor (for LW)
770 ! PVELC = wind speed at top of vegetation
771 !
772 REAL, DIMENSION(:,:), INTENT(IN) :: pwrvnmax
773 ! PWRVNMAX = maximum equivalent snow content
774 ! in the canopy vegetation
775 !
776 !* 0.2 declarations of local variables
777 !
778 !
779 REAL, DIMENSION(SIZE(PVELC,1),SIZE(PVELC,2)) :: zkvn
780 ! ZKVN = Snow interception efficiency
781 ! coefficient.
782 ! Note: if this is set=0 it means
783 ! that snow interception is shut
784 ! off.
785 !
786 REAL, DIMENSION(SIZE(PVELC,1),SIZE(PVELC,2)) :: zfcp
787 ! ZFCP = snow interception factor
788 REAL(KIND=JPRB) :: zhook_handle
789 !
790 !* 0.3 declarations of local parameters
791 !
792 REAL, PARAMETER :: zwsnow = 0.8 ! Snow fall velocity (m/s)
793 !
794 !-------------------------------------------------------------------------------
795 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_2D',0,zhook_handle)
796 !
797 ! Initialization:
798 !
799 zfcp(:,:) = 0.0
800 zkvn(:,:) = 0.0
801 !
802 ! Snow interception efficiency
803 !
804 WHERE(pwrvnmax(:,:) > 0.0)
805  zfcp(:,:) = min(1.,max(0., pvelc(:,:)/((2*zwsnow)*pchip(:,:)) ) )
806  zkvn(:,:) = (1.-pchip(:,:)+zfcp(:,:)*pchip(:,:))/pwrvnmax(:,:)
807 END WHERE
808 !
809 IF (lhook) CALL dr_hook('MODE_MEB:SNOW_INTERCEPT_EFF_2D',1,zhook_handle)
810 END FUNCTION snow_intercept_eff_2d
811 !####################################################################
812 !####################################################################
813 !####################################################################
814 FUNCTION meb_shield_factor_0d(PLAI,PPALPHAN) RESULT(PCHIP)
815 !!
816 !! Calculate MEB shielding factor
817 !!
818 !! REFERENCE
819 !! ---------
820 !!
821 !!
822 !! AUTHOR
823 !! ------
824 !!
825 !! A. Boone * Meteo France *
826 !!
827 !! MODIFICATIONS
828 !! -------------
829 !! Original 02/2011
830 !! P. Samuelsson 07/2014 Transform from subroutine to function
831 !!
832 !-------------------------------------------------------------------------------
833 !
834 !* 0. DECLARATIONS
835 ! ------------
836 !
837 USE modd_meb_par, ONLY : xtau_lw
838 !
839 USE yomhook, ONLY : lhook, dr_hook
840 USE parkind1, ONLY : jprb
841 !
842 IMPLICIT NONE
843 !
844 !* 0.1 declarations of arguments
845 !
846 REAL, INTENT(IN) :: plai, ppalphan
847 ! PWRVNMAX = canopy vegetation leaf area index
848 ! PPALPHAN = snow/canopy transition coefficient
849 !
850 REAL :: pchip
851 ! PCHIP = shielding factor (for LW)
852 !
853 !* 0.2 declarations of local variables
854 !
855 REAL(KIND=JPRB) :: zhook_handle
856 !
857 !-------------------------------------------------------------------------------
858 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_0D',0,zhook_handle)
859 !
860 pchip = exp(-xtau_lw*plai*(1.-ppalphan))
861 !
862 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_0D',1,zhook_handle)
863 END FUNCTION meb_shield_factor_0d
864 !####################################################################
865 !####################################################################
866 !####################################################################
867 FUNCTION meb_shield_factor_1d(PLAI,PPALPHAN) RESULT(PCHIP)
868 !!
869 !! Calculate MEB shielding factor
870 !!
871 !! REFERENCE
872 !! ---------
873 !!
874 !!
875 !! AUTHOR
876 !! ------
877 !!
878 !! A. Boone * Meteo France *
879 !!
880 !! MODIFICATIONS
881 !! -------------
882 !! Original 02/2011
883 !! P. Samuelsson 07/2014 Transform from subroutine to function
884 !!
885 !-------------------------------------------------------------------------------
886 !
887 !* 0. DECLARATIONS
888 ! ------------
889 !
890 USE modd_meb_par, ONLY : xtau_lw
891 !
892 USE yomhook, ONLY : lhook, dr_hook
893 USE parkind1, ONLY : jprb
894 !
895 IMPLICIT NONE
896 !
897 !* 0.1 declarations of arguments
898 !
899 REAL, DIMENSION(:), INTENT(IN) :: plai, ppalphan
900 ! PWRVNMAX = canopy vegetation leaf area index
901 ! PPALPHAN = snow/canopy transition coefficient
902 !
903 REAL, DIMENSION(SIZE(PLAI,1)) :: pchip
904 ! PCHIP = shielding factor (for LW)
905 !
906 !* 0.2 declarations of local variables
907 !
908 REAL(KIND=JPRB) :: zhook_handle
909 !
910 !-------------------------------------------------------------------------------
911 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_1D',0,zhook_handle)
912 !
913 pchip(:) = exp(-xtau_lw*plai(:)*(1.-ppalphan(:)))
914 !
915 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_1D',1,zhook_handle)
916 END FUNCTION meb_shield_factor_1d
917 !####################################################################
918 !####################################################################
919 !####################################################################
920 FUNCTION meb_shield_factor_2d(PLAI,PPALPHAN) RESULT(PCHIP)
921 !!
922 !! Calculate MEB shielding factor
923 !!
924 !! REFERENCE
925 !! ---------
926 !!
927 !!
928 !! AUTHOR
929 !! ------
930 !!
931 !! A. Boone * Meteo France *
932 !!
933 !! MODIFICATIONS
934 !! -------------
935 !! Original 02/2011
936 !! P. Samuelsson 07/2014 Transform from subroutine to function
937 !!
938 !-------------------------------------------------------------------------------
939 !
940 !* 0. DECLARATIONS
941 ! ------------
942 !
943 USE modd_meb_par, ONLY : xtau_lw
944 !
945 USE yomhook, ONLY : lhook, dr_hook
946 USE parkind1, ONLY : jprb
947 !
948 IMPLICIT NONE
949 !
950 !* 0.1 declarations of arguments
951 !
952 REAL, DIMENSION(:,:), INTENT(IN) :: plai, ppalphan
953 ! PWRVNMAX = canopy vegetation leaf area index
954 ! PPALPHAN = snow/canopy transition coefficient
955 !
956 REAL, DIMENSION(SIZE(PLAI,1),SIZE(PLAI,2)) :: pchip
957 ! PCHIP = shielding factor (for LW)
958 !
959 !* 0.2 declarations of local variables
960 !
961 REAL(KIND=JPRB) :: zhook_handle
962 !
963 !-------------------------------------------------------------------------------
964 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_2D',0,zhook_handle)
965 !
966 pchip(:,:) = exp(-xtau_lw*plai(:,:)*(1.-ppalphan(:,:)))
967 !
968 IF (lhook) CALL dr_hook('MODE_MEB:MEB_SHIELD_FACTOR_2D',1,zhook_handle)
969 END FUNCTION meb_shield_factor_2d
970 !####################################################################
971 !####################################################################
972 !####################################################################
973 END MODULE mode_meb
real function mebpalphan_0d(PSNOWDEPTH, PH_VEG)
Definition: mode_meb.F90:211
real function sfc_heatcap_veg_0d(PWRN, PWR, PCV)
Definition: mode_meb.F90:255
real function, dimension(size(psnowdepth, 1), size(psnowdepth, 2), size(psnowdepth, 3)) mebpalphan_3d(PSNOWDEPTH, PH_VEG)
Definition: mode_meb.F90:77
real function, dimension(size(psnowdepth, 1), size(psnowdepth, 2)) mebpalphan_2d(PSNOWDEPTH, PH_VEG)
Definition: mode_meb.F90:122
real function, dimension(size(plai, 1), size(plai, 2)) meb_shield_factor_2d(PLAI, PPALPHAN)
Definition: mode_meb.F90:920
real function, dimension(size(psw_rad)) swdown_diff_1d(PSW_RAD, PCOSZENITH)
Definition: mode_meb.F90:469
real function swdown_diff_0d(PSW_RAD, PCOSZENITH)
Definition: mode_meb.F90:528
real function, dimension(size(pcv), size(pcv, 2)) sfc_heatcap_veg_2d(PWRN, PWR, PCV)
Definition: mode_meb.F90:357
real function, dimension(size(psw_rad, 1), size(psw_rad, 2)) swdown_diff_2d(PSW_RAD, PCOSZENITH)
Definition: mode_meb.F90:411
real function, dimension(size(psnowdepth, 1)) mebpalphan_1d(PSNOWDEPTH, PH_VEG)
Definition: mode_meb.F90:166
real function meb_shield_factor_0d(PLAI, PPALPHAN)
Definition: mode_meb.F90:814
real function, dimension(size(plai, 1)) meb_shield_factor_1d(PLAI, PPALPHAN)
Definition: mode_meb.F90:867
real function snow_intercept_eff_0d(PCHIP, PVELC, PWRVNMAX)
Definition: mode_meb.F90:586
real function, dimension(size(pvelc, 1), size(pvelc, 2)) snow_intercept_eff_2d(PCHIP, PVELC, PWRVNMAX)
Definition: mode_meb.F90:738
real function, dimension(size(pcv)) sfc_heatcap_veg_1d(PWRN, PWR, PCV)
Definition: mode_meb.F90:306
real function, dimension(size(pvelc)) snow_intercept_eff_1d(PCHIP, PVELC, PWRVNMAX)
Definition: mode_meb.F90:662