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