SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
teb_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 teb_canopy(KI,KLVL,PZ,PZF,PDZ,PDZF,PBLD,PBLD_HEIGHT,PWALL_O_HOR,PPA,PRHOA,PU, &
7  pduwdu_road, puw_roof, pduwdu_roof, &
8  ph_wall,ph_roof,pe_roof,pac_road,pac_road_wat, &
9  pforc_u,pdforc_udu,pforc_e,pdforc_ede,pforc_t,pdforc_tdt,pforc_q,pdforc_qdq)
10 ! ###############################################################################
11 !
12 !!**** *TEB_CANOPY_n * - prepares forcing for canopy air model
13 !!
14 !! PURPOSE
15 !! -------
16 !
17 !!** METHOD
18 !! ------
19 !!
20 !! REFERENCE
21 !! ---------
22 !!
23 !!
24 !! AUTHOR
25 !! ------
26 !! V. Masson
27 !!
28 !! MODIFICATIONS
29 !! -------------
30 !! Original 07/2006
31 !!---------------------------------------------------------------
32 !
33 !
34 USE modd_csts, ONLY : xrd, xcpd, xp00, xg, xpi
35 USE modd_surf_par, ONLY : xundef
36 !
37 USE yomhook ,ONLY : lhook, dr_hook
38 USE parkind1 ,ONLY : jprb
39 !
40 USE modi_canopy
41 !
42 IMPLICIT NONE
43 !
44 !* 0.1 declarations of arguments
45 !
46 INTEGER, INTENT(IN) :: ki ! number of points
47 INTEGER, INTENT(IN) :: klvl ! number of levels in canopy
48 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pz ! heights of canopy levels (m)
49 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pzf ! heights of bottom of canopy levels (m)
50 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pdz ! depth of canopy levels (m)
51 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pdzf ! depth between canopy levels (m)
52 REAL, DIMENSION(KI), INTENT(IN) :: pbld ! building density (-)
53 REAL, DIMENSION(KI), INTENT(IN) :: pbld_height ! building height (m)
54 REAL, DIMENSION(KI), INTENT(IN) :: pwall_o_hor ! wall surf. / hor. surf. (-)
55 
56 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pu ! wind for each canopy layer (m/s)
57 !
58 REAL, DIMENSION(KI), INTENT(IN) :: ppa ! air pressure (Pa)
59 REAL, DIMENSION(KI), INTENT(IN) :: prhoa ! air density (kg/m3)
60 !
61 REAL, DIMENSION(KI), INTENT(IN) :: pduwdu_road ! derivative of road friction flux (m/s)
62 REAL, DIMENSION(KI), INTENT(IN) :: puw_roof ! friction flux for roof surfaces (m2/s2)
63 REAL, DIMENSION(KI), INTENT(IN) :: pduwdu_roof ! derivative of roof friction flux (m/s)
64 REAL, DIMENSION(KI), INTENT(IN) :: ph_wall ! flux of heat for wall surfaces (W/m2)
65 REAL, DIMENSION(KI), INTENT(IN) :: ph_roof ! flux of heat for roof surfaces (W/m2)
66 REAL, DIMENSION(KI), INTENT(IN) :: pe_roof ! flux of vapor for roof surfaces (kg/m2/s)
67 REAL, DIMENSION(KI), INTENT(IN) :: pac_road ! road aerodynamical conductance ()
68 REAL, DIMENSION(KI), INTENT(IN) :: pac_road_wat ! road water aerodynamical conductance ()
69 !
70 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pforc_u ! tendency of wind due to canopy drag (m/s2)
71 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdforc_udu! formal derivative of the tendency of
72 ! ! wind due to canopy drag (1/s)
73 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pforc_e ! tendency of TKE due to canopy drag (m2/s3)
74 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdforc_ede! formal derivative of the tendency of
75 ! ! TKE due to canopy drag (1/s)
76 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pforc_t ! tendency of Temp due to canopy drag (T/s)
77 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdforc_tdt! formal derivative of the tendency of
78 ! ! Temp due to canopy drag (1/s)
79 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pforc_q ! tendency of Temp due to canopy drag (kg/m3/s)
80 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdforc_qdq! formal derivative of the tendency of
81 ! ! Temp due to canopy drag (1/s)
82 !
83 !* 0.2 declarations of local variables
84 !
85 INTEGER :: jlayer ! loop counter on canopy heights
86 !
87 REAL, DIMENSION(KI,KLVL) :: zcdrag ! drag coefficient in canopy
88 REAL, DIMENSION(KI,KLVL) :: zsh ! horizontal surface of building
89  ! (road&roof) for each canopy level
90 REAL, DIMENSION(KI,KLVL) :: zsv ! vertical surface of building
91  ! (walls) for each canopy level
92 REAL, DIMENSION(KI,KLVL) :: zforc
93 REAL, DIMENSION(KI,KLVL) :: zdensity
94 REAL, DIMENSION(KI,KLVL) :: zairvol ! Fraction of air for each canopy level total volume
95 REAL, DIMENSION(KI,KLVL) :: zp ! pressure at full levels
96 REAL, DIMENSION(KI,KLVL) :: zexn ! Exner function at full levels
97 REAL(KIND=JPRB) :: zhook_handle
98 !
99 !-------------------------------------------------------------------------------------
100 !
101 !* 1. Computations of canopy grid characteristics
102 ! -------------------------------------------
103 !
104 !
105 !* 1.2 Proportion of horizontal surfaces for each canopy level
106 !
107 IF (lhook) CALL dr_hook('TEB_CANOPY',0,zhook_handle)
108 zsh(:,:) = 0.
109 zsh(:,1) = (1.-pbld(:))
110 !
111 WHERE( pzf(:,2)>=pbld_height(:) ) zsh(:,2) = pbld(:) ! the roofs cannot be at the same level as roads
112 DO jlayer = 2,klvl-1
113  WHERE( pzf(:,jlayer)<pbld_height(:) .AND. pzf(:,jlayer+1)>=pbld_height(:) ) zsh(:,jlayer) = pbld(:)
114 END DO
115 WHERE( pzf(:,klvl)<pbld_height(:) ) zsh(:,klvl) = pbld(:)
116 !
117 !* 2.1 Drag coefficient by walls
118 ! -------------------------
119 !
120 zcdrag(:,:) = 0.40
121 !* integration for all canyon directions (for facing wind walls)
122 zcdrag(:,:) = zcdrag(:,:) / xpi
123 !
124 !* 1.4 No building volume
125 !
126 ! * in order to take into account building volume, further developments must be
127 ! done in the atmospheric model.
128 ! If these changes are not done, to take into account building volume in the
129 ! present routine alone would not be energetically coeherent (there would be
130 ! too much energy release for heat and vapor or consumed for wind).
131 !
132 zairvol = 1.
133 !
134 !* 1.2 Discretization on each canopy level
135 !
136 DO jlayer=1,klvl
137  zdensity(:,jlayer) = pwall_o_hor(:)
138 ENDDO
139 !
140  CALL canopy(ki, klvl, pzf, pdz, pbld_height, zdensity, zcdrag, pu, zairvol, &
141  zsv, zforc, pforc_u, pdforc_udu, pforc_e, pdforc_ede )
142 !
143 !-------------------------------------------------------------------------------------
144 !
145 !* 2. Computations of wind tendency due to canopy drag
146 ! ------------------------------------------------
147 !
148 ! Ext = - Cdrag * u- * u- * Sv/Vair vertical surfaces or trees
149 ! - u'w'(roof) * Sh/Vair horizontal surfaces (except road)
150 ! - u'w'(road) * Sh/Vair horizontal surfaces (road)
151 !
152 ! with Vair = Vair/Vtot * Vtot = (Vair/Vtot) * Stot * Dz
153 ! and Sv/Vair = (Sv/Stot) * Stot/Vair = (Sv/Stot) / (Vair/Vtot) / Dz
154 ! and Sh/Vair = (Sh/Stot) * Stot/Vair = (Sv/Stot) / (Vair/Vtot) / Dz
155 !
156 !* Note that for the time being, air is assumed to occupy all the space of the grid
157 ! (buildings have no volume), so that Vair = Vtot
158 !
159 zforc(:,:) = zsh(:,:)/zairvol(:,:)/pdz(:,:)
160 !
161 !* 2.3 Drag force by roof surfaces
162 ! ---------------------------
163 !
164 !* drag force by horizontal surfaces
165 !
166 DO jlayer=2,klvl
167  pforc_u(:,jlayer) = pforc_u(:,jlayer) + puw_roof(:) * zforc(:,jlayer)
168  pdforc_udu(:,jlayer) = pdforc_udu(:,jlayer) + pduwdu_roof(:) * zforc(:,jlayer)
169 END DO
170 !
171 !* 2.4 Drag force by road surfaces
172 ! ---------------------------
173 !
174 !PFORC_U(:,1) = PUW_ROAD(:) / PDZ(:,1) * ZSH(:,1)
175 pforc_u(:,1) = pforc_u(:,1)
176 pdforc_udu(:,1) = pdforc_udu(:,1) + pduwdu_road(:) * zsh(:,1)/pdz(:,1)
177 !
178 !-------------------------------------------------------------------------------------
179 !
180 !* 4. Computations of potential temperature tendency due to canopy drag
181 ! -----------------------------------------------------------------
182 !
183 pforc_t(:,:) = 0.
184 pdforc_tdt(:,:) = 0.
185 !
186 !* 4.1 Heating from the road surface flux
187 ! ----------------------------------
188 !
189 !* surface flux
190 !
191 pdforc_tdt(:,1) = pdforc_tdt(:,1) - pac_road(:)
192 !!* Warning, the " - PAC_ROAD(:) " term in the equation above is used
193 ! to improve stability for the first layer of canopy. But the TEB equations
194 ! for road temperature are not implicited, so this implies that the energy
195 ! coming from the road as seen by canopy is not equal to the one emitted by
196 ! TEB.
197 ! This has no consequence on the conservation of the energy between the
198 ! surface and the atmosphere, because the heat flux goes directly from TEB to
199 ! SURF_ATM and then to the atmosphere. Only the canopy air profiles are
200 ! affected.
201 !
202 !
203 !* 4.2 Heating from the walls surface flux
204 ! -----------------------------------
205 !
206 DO jlayer=1,klvl
207  zforc(:,jlayer) = 1. / zairvol(:,jlayer) / pdz(:,jlayer) / prhoa(:) / xcpd
208  pforc_t(:,jlayer) = pforc_t(:,jlayer) + ph_wall * zsv(:,jlayer) * zforc(:,jlayer)
209  pdforc_tdt(:,jlayer) = pdforc_tdt(:,jlayer) + 0.
210 END DO
211 !
212 !* 4.3 Heating from the roof surface flux
213 ! ----------------------------------
214 !
215 DO jlayer=2,klvl
216  pforc_t(:,jlayer) = pforc_t(:,jlayer) + ph_roof * zsh(:,jlayer) * zforc(:,jlayer)
217  pdforc_tdt(:,jlayer) = pdforc_tdt(:,jlayer) + 0.
218 END DO
219 !
220 !-------------------------------------------------------------------------------------
221 !
222 !* 5. Conversion into temperature tendency
223 ! ------------------------------------
224 !
225 DO jlayer=1,klvl
226  zp(:,jlayer) = ppa(:) + xg * prhoa(:) * (pz(:,klvl) - pz(:,jlayer))
227 END DO
228 zexn = (zp/xp00)**(xrd/xcpd)
229 !
230 pforc_t = pforc_t * zexn
231 pdforc_tdt = pdforc_tdt * zexn
232 !
233 !-------------------------------------------------------------------------------------
234 !
235 !* 6. Computations of humidity tendency due to canopy
236 ! -----------------------------------------------
237 !
238 !
239 pforc_q(:,:) = 0.
240 pdforc_qdq(:,:) = 0.
241 !
242 !
243 !* 4.1 Evaporation from the road surface flux
244 ! --------------------------------------
245 !
246 !* surface flux
247 !
248 !
249 pdforc_qdq(:,1) = pdforc_qdq(:,1) - pac_road_wat(:)
250 !!* Warning, the " - PAC_ROAD_WAT(:) " term in the equation above is used
251 ! to improve stability for the first layer of canopy. But the TEB equations
252 ! for road latent heat flux are not implicited, so this implies that the energy
253 ! coming from the road as seen by canopy is not equal to the one emitted by
254 ! TEB.
255 ! This has no consequence on the conservation of the energy between the
256 ! surface and the atmosphere, because the latent heat flux goes directly from TEB to
257 ! SURF_ATM and then to the atmosphere. Only the canopy air profiles are
258 ! affected.
259 !
260 !* 4.2 Evaporation from the roof surface flux
261 ! --------------------------------------
262 !
263 DO jlayer=2,klvl
264  pforc_q(:,jlayer) = pforc_q(:,jlayer) + pe_roof * zsh(:,jlayer)/zairvol(:,jlayer)/pdz(:,jlayer)
265  pdforc_qdq(:,jlayer) = pdforc_qdq(:,jlayer) + 0.
266 END DO
267 IF (lhook) CALL dr_hook('TEB_CANOPY',1,zhook_handle)
268 !
269 !-------------------------------------------------------------------------------------
270 !
271 END SUBROUTINE teb_canopy
subroutine teb_canopy(KI, KLVL, PZ, PZF, PDZ, PDZF, PBLD, PBLD_HEIGHT, PWALL_O_HOR, PPA, PRHOA, PU, PDUWDU_ROAD, PUW_ROOF, PDUWDU_ROOF, PH_WALL, PH_ROOF, PE_ROOF, PAC_ROAD, PAC_ROAD_WAT, PFORC_U, PDFORC_UDU, PFORC_E, PDFORC_EDE, PFORC_T, PDFORC_TDT, PFORC_Q, PDFORC_QDQ)
Definition: teb_canopy.F90:6
subroutine canopy(KI, KLVL, PZF, PDZ, PHEIGHT, PDENSITY, PCDRAG, PU, PAIRVOL, PSV, PFORC, PFORC_U, PDFORC_UDU, PFORC_E, PDFORC_EDE)
Definition: canopy.F90:6