SURFEX v8.1
General documentation of Surfex
canopy.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 SUBROUTINE canopy(KI, SB, PHEIGHT, PDENSITY, PCDRAG, PAIRVOL, PSV, &
7  PFORC, PFORC_U, PDFORC_UDU, PFORC_E, PDFORC_EDE )
8 ! ###############################################################################
9 !
10 !!**** *ISBA_CANOPY_n * - prepares forcing for canopy air model
11 !!
12 !! SB%XURPOSE
13 !! -------
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !! REFERENCE
19 !! ---------
20 !!
21 !!
22 !! AUTHOR
23 !! ------
24 !! V. Masson
25 !!
26 !! MODIFICATIONS
27 !! -------------
28 !! Original 07/2006
29 !!---------------------------------------------------------------
30 !
31 USE modd_canopy_n, ONLY : canopy_t
32 !
33 USE modd_csts, ONLY : xrd, xcpd, xp00, xg
34 USE modd_surf_par, ONLY : xundef
35 !
36 !
37 USE yomhook ,ONLY : lhook, dr_hook
38 USE parkind1 ,ONLY : jprb
39 !
40 IMPLICIT NONE
41 !
42 !* 0.1 declarations of arguments
43 !
44 INTEGER, INTENT(IN) :: KI ! number of points
45 TYPE(canopy_t), INTENT(INOUT) :: SB
46 REAL, DIMENSION(KI), INTENT(IN) :: PHEIGHT ! canopy height (m)
47 REAL, DIMENSION(KI,SB%NLVL), INTENT(IN) :: PDENSITY ! canopy density (-)
48 REAL, DIMENSION(KI,SB%NLVL), INTENT(IN) :: PCDRAG
49 !
50 REAL, DIMENSION(KI,SB%NLVL), INTENT(IN) :: PAIRVOL ! Fraction of air for each canopy level total volume
51 !
52 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PSV ! vertical surface of building
53  ! (walls) for each canopy level
54 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PFORC !
55 !
56 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PFORC_U ! tendency of wind due to canopy drag (m/s2)
57 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PDFORC_UDU! formal derivative of the tendency of
58 ! ! wind due to canopy drag (1/s)
59 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PFORC_E ! tendency of TKE due to canopy drag (m2/s3)
60 REAL, DIMENSION(KI,SB%NLVL), INTENT(OUT) :: PDFORC_EDE! formal derivative of the tendency of
61 ! ! TKE due to canopy drag (1/s)
62 !
63 !* 0.2 declarations of local variables
64 !
65 INTEGER :: JLAYER ! loop counter on canopy heights
66 REAL(KIND=JPRB) :: ZHOOK_HANDLE
67 !
68 !-------------------------------------------------------------------------------------
69 !
70 IF (lhook) CALL dr_hook('CANOPY',0,zhook_handle)
71 !
72 !* 1. Computations of canopy grid characteristics
73 ! -------------------------------------------
74 !
75 !
76 !* 1.2 Discretization on each canopy level
77 !
78 psv(:,:) = 0.
79 DO jlayer = 1,sb%NLVL-1
80  !
81  WHERE ( sb%XZF(:,jlayer) < pheight(:) )
82  psv(:,jlayer) = pdensity(:,jlayer) / pheight(:)
83  WHERE ( sb%XZF(:,jlayer+1) > pheight(:) )
84  psv(:,jlayer) = psv(:,jlayer) * ( pheight(:) - sb%XZF(:,jlayer) )
85  ELSEWHERE
86  psv(:,jlayer) = psv(:,jlayer) * sb%XDZ(:,jlayer)
87  END WHERE
88  END WHERE
89  !
90 END DO
91 !
92 pforc(:,:) = pcdrag(:,:) * sb%XU(:,:) * psv(:,:)/pairvol(:,:)/sb%XDZ(:,:)
93 !
94 !-------------------------------------------------------------------------------------
95 !
96 !* 2. Computations of wind tendency due to canopy drag
97 ! ------------------------------------------------
98 !
99 pforc_u = 0.
100 pdforc_udu = 0.
101 !
102 ! Ext = - Cdrag * u- * u- * Sv tree canopy drag
103 ! - u'w'(ground) * Sh horizontal surfaces (ground)
104 !
105 !
106 !* 2.2 Drag force by wall surfaces
107 ! ---------------------------
108 !
109 !* drag force by vertical surfaces
110 !
111 pforc_u(:,:) = pforc_u - pforc(:,:) * sb%XU(:,:)
112 pdforc_udu(:,:) = pdforc_udu - 2. * pforc(:,:)
113 !
114 !-------------------------------------------------------------------------------------
115 !
116 !* 3. Computations of TKE tendency due to canopy drag
117 ! ------------------------------------------------
118 !
119 !* Tendency due to drag for TKE
120 !
121 pforc_e(:,:) = 0.
122 pdforc_ede(:,:) = 0.
123 !
124 !* 3.1 Creation of TKE by wake
125 ! -----------------------
126 !
127 ! from Kanda and Hino (1994)
128 !
129 ! Ext = + Cd * u+^3 * Sv/Vair vertical surfaces or trees
130 !
131 ! with Vair = Vair/Vtot * Vtot = (Vair/Vtot) * Stot * Dz
132 ! and Sv/Vair = (Sv/Stot) * Stot/Vair = (Sv/Stot) / (Vair/Vtot) / Dz
133 !
134 pforc_e = pforc_e + pforc(:,:) * sb%XU(:,:)**2
135 pdforc_ede = pdforc_ede + 0.
136 !
137 !
138 IF (lhook) CALL dr_hook('CANOPY',1,zhook_handle)
139 !
140 !-------------------------------------------------------------------------------------
141 !
142 END SUBROUTINE canopy
real, save xcpd
Definition: modd_csts.F90:63
real, parameter xundef
real, save xrd
Definition: modd_csts.F90:62
real, save xg
Definition: modd_csts.F90:55
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
real, save xp00
Definition: modd_csts.F90:57
subroutine canopy(KI, SB, PHEIGHT, PDENSITY, PCDRAG, PAIRVOL, PSV, PFORC, PFORC_U, PDFORC_UDU, PFORC_E, PDFORC_EDE)
Definition: canopy.F90:8