SURFEX v8.1
General documentation of Surfex
greenroof.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 greenroof (DTCO, G, T, TOP, TIR, DTV, GB, DK, DEK, DMK, GRO, S, K, P, PEK, &
7  HIMPLICIT_WIND, TPTIME, PTSUN, PPEW_A_COEF, PPEW_B_COEF, &
8  PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, &
9  PTSTEP, PZREF, PUREF, PTA, PQA, PEXNS, PEXNA, PRHOA, &
10  PCO2, PPS, PRR, PSR, PZENITH, PSW, PLW, PVMOD, &
11  PALBNIR_TVEG, PALBVIS_TVEG, PALBNIR_TSOIL, PALBVIS_TSOIL, &
12  PRN, PH, PLE, PGFLUX, PSFCO2, PEVAP, PUW, PRUNOFF, PDRAIN,&
13  PAC, PQSAT, PTSRAD, PAC_AGG, PHU_AGG, PDEEP_FLUX, PIRRIG )
14 ! ##################################################################################
15 !
16 !!**** *GREENROOF*
17 !!
18 !! PURPOSE
19 !! -------
20 !!
21 !! call the vegetation scheme (ISBA) inside TEB for greenroofs
22 !!
23 !!** METHOD
24 !! ------
25 !! based on subroutine "garden"
26 !!
27 !! EXTERNAL
28 !! --------
29 !!
30 !!
31 !! IMPLICIT ARGUMENTS
32 !! ------------------
33 !!
34 !!
35 !! REFERENCE
36 !! ---------
37 !! Based on subroutine "garden"
38 !!
39 !! AUTHOR
40 !! ------
41 !!
42 !! C. de Munck & A. Lemonsu * Meteo-France *
43 !!
44 !! MODIFICATIONS
45 !! -------------
46 ! Original 09/2011
47 ! C. de Munck 02/2013 irrigation (drip irrigation)
48 ! B. decharme 04/2013 : Variables required in TEB to allow coupling with AROME/ALADIN/ARPEGE
49 ! phasing call isba
50 ! calculation of vegetation CO2 flux
51 ! dummy for water table / surface coupling
52 !! P. Samuelsson 10/2014 Introduced dummy variables in call to ISBA for MEB
53 !-------------------------------------------------------------------------------
54 !
55 !* 0. DECLARATIONS
56 ! ------------
57 !
59 USE modd_data_isba_n, ONLY : data_isba_t
60 USE modd_sfx_grid_n, ONLY : grid_t
61 USE modd_sso_n, ONLY : sso_t, sso_init
62 USE modd_teb_n, ONLY : teb_t
64 USE modd_teb_irrig_n, ONLY : teb_irrig_t
65 !
66 USE modd_data_isba_n, ONLY : data_isba_t
67 USE modd_gr_biog_n, ONLY : gr_biog_t
68 !
69 USE modd_diag_n, ONLY : diag_t
72 !
75 !
76 USE modd_agri_n, ONLY : agri_t, agri_init
77 !
78 USE modd_surf_par, ONLY: xundef
80 USE modd_csts, ONLY: xcpd
81 !
82 USE modi_isba
83 USE modi_vegetation_update
84 USE modi_vegetation_evol
85 USE modi_carbon_evol
86 USE mode_thermos
87 USE modi_roof_impl_coef
88 USE modi_teb_irrig
89 USE modi_flag_teb_veg_n
90 !
91 USE yomhook ,ONLY : lhook, dr_hook
92 USE parkind1 ,ONLY : jprb
93 !
94 IMPLICIT NONE
95 !
96 !* 0.1 Declarations of arguments
97 !
98 !
99 !
100 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
101 TYPE(grid_t), INTENT(INOUT) :: G
102 TYPE(teb_t), INTENT(INOUT) :: T
103 TYPE(teb_options_t), INTENT(INOUT) :: TOP
104 TYPE(teb_irrig_t), INTENT(INOUT) :: TIR
105 !
106 TYPE(data_isba_t), INTENT(INOUT) :: DTV
107 TYPE(gr_biog_t), INTENT(INOUT) :: GB
108 !
109 TYPE(diag_t), INTENT(INOUT) :: DK
110 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DEK
111 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
112 !
113 TYPE(isba_options_t), INTENT(INOUT) :: GRO
114 TYPE(isba_s_t), INTENT(INOUT) :: S
115 TYPE(isba_k_t), INTENT(INOUT) :: K
116 TYPE(isba_p_t), INTENT(INOUT) :: P
117 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
118 !
119  CHARACTER(LEN=*), INTENT(IN) :: HIMPLICIT_WIND ! wind implicitation option
120 ! ! 'OLD' = direct
121 ! ! 'NEW' = Taylor serie, order 1
122 TYPE(date_time) , INTENT(IN) :: TPTIME ! current date and time from teb
123 REAL, DIMENSION(:) , INTENT(IN) :: PTSUN ! solar time (s from midnight)
124 REAL, DIMENSION(:) , INTENT(IN) :: PPEW_A_COEF ! implicit coefficients
125 REAL, DIMENSION(:) , INTENT(IN) :: PPEW_B_COEF ! for wind coupling
126 REAL, DIMENSION(:) , INTENT(IN) :: PPEQ_A_COEF ! implicit coefficients
127 REAL, DIMENSION(:) , INTENT(IN) :: PPEQ_B_COEF ! for humidity
128 REAL, DIMENSION(:) , INTENT(IN) :: PPET_A_COEF ! implicit coefficients
129 REAL, DIMENSION(:) , INTENT(IN) :: PPET_B_COEF ! for temperature
130 REAL , INTENT(IN) :: PTSTEP ! time step
131 REAL, DIMENSION(:) , INTENT(IN) :: PZREF ! height of the first atmospheric level
132 REAL, DIMENSION(:) , INTENT(IN) :: PUREF ! reference height for the wind
133 REAL, DIMENSION(:) , INTENT(IN) :: PTA ! temperature at first atm. level
134 REAL, DIMENSION(:) , INTENT(IN) :: PQA ! specific humidity at first atm. level
135 REAL, DIMENSION(:) , INTENT(IN) :: PPS ! pressure at the surface
136 REAL, DIMENSION(:) , INTENT(IN) :: PEXNA ! Exner function at first atm. level
137 REAL, DIMENSION(:) , INTENT(IN) :: PEXNS ! surface Exner function
138 REAL, DIMENSION(:) , INTENT(IN) :: PRHOA ! air density at the lowest level
139 REAL, DIMENSION(:) , INTENT(IN) :: PCO2 ! CO2 concentration in the air (kg/m3)
140 REAL, DIMENSION(:) , INTENT(IN) :: PRR ! rain rate
141 REAL, DIMENSION(:) , INTENT(IN) :: PSR ! snow rate
142 REAL, DIMENSION(:) , INTENT(IN) :: PZENITH ! solar zenithal angle
143 REAL, DIMENSION(:) , INTENT(IN) :: PSW ! incoming total solar rad on an horizontal surface
144 REAL, DIMENSION(:) , INTENT(IN) :: PLW ! atmospheric infrared radiation
145 REAL, DIMENSION(:) , INTENT(IN) :: PVMOD ! module of horizontal wind near first atm. level
146 REAL, DIMENSION(:) , INTENT(IN) :: PALBNIR_TVEG ! nearIR veg tot albedo
147 REAL, DIMENSION(:) , INTENT(IN) :: PALBVIS_TVEG ! visible veg tot albedo
148 REAL, DIMENSION(:) , INTENT(IN) :: PALBNIR_TSOIL ! nearIR soil tot albedo
149 REAL, DIMENSION(:) , INTENT(IN) :: PALBVIS_TSOIL ! visible soil tot albedo
150 !
151 REAL, DIMENSION(:) , INTENT(OUT) :: PRN ! net radiation over greenroofs
152 REAL, DIMENSION(:) , INTENT(OUT) :: PH ! sensible heat flux over greenroofs
153 REAL, DIMENSION(:) , INTENT(OUT) :: PLE ! latent heat flux over greenroofs
154 REAL, DIMENSION(:) , INTENT(OUT) :: PGFLUX ! flux through the greenroofs
155 REAL, DIMENSION(:) , INTENT(OUT) :: PSFCO2 ! flux of greenroof CO2 (m/s*kg_CO2/kg_air)
156 REAL, DIMENSION(:) , INTENT(OUT) :: PEVAP ! total evaporation over greenroofs (kg/m2/s)
157 REAL, DIMENSION(:) , INTENT(OUT) :: PUW ! friction flux (m2/s2)
158 REAL, DIMENSION(:) , INTENT(OUT) :: PRUNOFF ! greenroof surface runoff
159 REAL, DIMENSION(:) , INTENT(OUT) :: PDRAIN ! greenroof surface drainage
160 REAL, DIMENSION(:) , INTENT(OUT) :: PAC ! greenroof aerodynamical conductance
161 REAL, DIMENSION(:) , INTENT(OUT) :: PQSAT ! saturation humidity
162 REAL, DIMENSION(:) , INTENT(OUT) :: PTSRAD ! greenroof radiative surface temp. (snow free)
163 REAL, DIMENSION(:) , INTENT(OUT) :: PAC_AGG ! aggreg. aeodynamic resistance for greenroofs for latent heat flux
164 REAL, DIMENSION(:) , INTENT(OUT) :: PHU_AGG ! aggreg. relative humidity for greenroofs for latent heat flux
165 REAL, DIMENSION(:) , INTENT(OUT) :: PDEEP_FLUX ! Heat Flux at the bottom layer of the greenroof
166 REAL, DIMENSION(:) , INTENT(OUT) :: PIRRIG ! greenroof summer irrigation rate
167 !
168 !
169 !* 0.2 Declarations of local variables
170 !
171 TYPE(sso_t) :: YSS
172 TYPE(agri_t) :: YAG
173 !
174 REAL, DIMENSION(SIZE(PPS)) :: ZDIRCOSZW ! orography slope cosine (=1 in TEB)
175 REAL, DIMENSION(SIZE(PPS),GRO%NNBIOMASS) :: ZRESP_BIOMASS_INST ! instantaneous biomass respiration (kgCO2/kgair m/s)
176 REAL, DIMENSION(SIZE(PPS)) :: ZUSTAR
177 !
178 ! temperatures
179 !
180 REAL, DIMENSION(SIZE(PPS)) :: ZTA ! estimate of air temperature at future time
181 ! ! step as if modified by ISBA flux alone.
182 !
183 ! surfaces relative fractions
184 ! for flood
185 REAL, DIMENSION(SIZE(PPS)) :: ZEMISF
186 !
187 ! variables for deep soil temperature
188 REAL, DIMENSION(SIZE(PPS)) :: ZTDEEP_A
189 !
190 ! Dummy variables for MEB:
191 REAL, DIMENSION(SIZE(PPS)) :: ZP_MEB_SCA_SW, ZPALPHAN, ZZ0G_WITHOUT_SNOW, &
192  ZZ0_MEBV, ZZ0H_MEBV, ZZ0EFF_MEBV, ZZ0_MEBN, &
193  ZZ0H_MEBN, ZZ0EFF_MEBN
194 !
195 !
196 INTEGER :: ILU
197 LOGICAL :: GUPDATED, GALB
198 !
199 REAL(KIND=JPRB) :: ZHOOK_HANDLE
200 !
201 !-------------------------------------------------------------------------------
202 !
203 !* 1. various initialisations
204 ! -----------------------
205 !
206 IF (lhook) CALL dr_hook('GREENROOF',0,zhook_handle)
207 ilu = SIZE(pps)
208 !
209 zdircoszw = 1.
210 !
211  CALL sso_init(yss)
212 !
213  CALL agri_init(yag)
214 !
215 !* automatic summer irrigation
216 !
217 pirrig(:) = 0.
218 !
219 !* deep soil implicitation with roof
220 !
221  CALL roof_impl_coef(t, ptstep, ztdeep_a, k%XTDEEP)
222 !
223 !-------------------------------------------------------------------------------
224 !
225 !* 9. Treatment of green areas
226 ! ------------------------
227 !
228 !radiative temperature diagnostic
229 !-------------------------------
230 !
231 !* 9.1 Summer irrigation
232 ! ------------------
233 !
234 !* irrigation automatique de type goutte à goutte (arrosage du sol seulement)
235 !
236  CALL teb_irrig(tir%LPAR_GR_IRRIG, ptstep, tptime%TDATE%MONTH, ptsun, &
237  tir%XGR_START_MONTH, tir%XGR_END_MONTH, tir%XGR_START_HOUR, &
238  tir%XGR_END_HOUR, tir%XGR_24H_IRRIG, pirrig )
239 !
240 ! --------------------------------------------------------------------------------------
241 ! Vegetation update (in case of non-interactive vegetation):
242 ! --------------------------------------------------------------------------------------
243 !
244 s%TTIME = tptime
245 !
246 gupdated=.false.
247 galb = .false.
248 IF (gro%CPHOTO=='NIT'.OR.gro%CPHOTO=='NCB') galb = .true.
249 !
250  CALL vegetation_update(dtco, dtv, g%NDIM, gro, k, p, pek, 1, &
251  ptstep, s%TTIME, top%XCOVER, top%LCOVER, .false., &
252  'GNR', galb, yss, gupdated, oabsent=(t%XGREENROOF==0.) )
253 !
254 !* 9.2 Call ISBA for greenroofs
255 ! ------------------------
256 !
257 dk%XZ0(:) = pek%XZ0(:)
258 dk%XZ0H(:) = pek%XZ0(:) / p%XZ0_O_Z0H(:)
259 !
260 dk%XZ0EFF(:) = pek%XZ0(:)
261 !
262 ALLOCATE(gb%XIACAN(SIZE(pps),SIZE(s%XABC)))
263 !
264  CALL isba(gro, k, p, pek, g, yag, dk, dek, dmk, &
265  tptime, s%XPOI, s%XABC, gb%XIACAN, .false., ptstep, &
266  himplicit_wind, pzref, puref, zdircoszw, pta, pqa, pexna, prhoa, pps, &
267  pexns, prr, psr, pzenith, zp_meb_sca_sw, psw, plw, pvmod, ppew_a_coef, &
268  ppew_b_coef, ppet_a_coef, ppeq_a_coef, ppet_b_coef, ppeq_b_coef, &
269  palbnir_tveg, palbvis_tveg, palbnir_tsoil, palbvis_tsoil, zpalphan, &
270  zz0g_without_snow, zz0_mebv, zz0h_mebv, zz0eff_mebv, zz0_mebn, &
271  zz0h_mebn, zz0eff_mebn, ztdeep_a, pco2, k%XFFG(:), k%XFFV(:), &
272  zemisf, zustar, pac_agg, phu_agg, zresp_biomass_inst, pdeep_flux, pirrig )
273 !
274 IF (pek%TSNOW%SCHEME=='3-L' .OR. pek%TSNOW%SCHEME=='CRO') pek%TSNOW%TS(:) = dmk%XSNOWTEMP(:,1)
275 !
276 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
277 ! Diagnostic of respiration carbon fluxes and soil carbon evolution
278 !
279 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
280 ! Vegetation evolution for interactive LAI
281 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
282 !
283 !
284 IF (gro%CPHOTO=='NIT') THEN
285  CALL vegetation_evol(gro, dtv, p, pek, .false., ptstep, tptime%TDATE%MONTH, tptime%TDATE%DAY, &
286  tptime%TIME, g%XLAT, prhoa, pco2, yss, zresp_biomass_inst )
287 END IF
288 !
289 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
290 !
291 psfco2(:) = 0.
292 dek%XRESP_ECO (:) = 0.
293 dek%XRESP_AUTO(:) = 0.
294 !
295 IF (gro%CPHOTO/='NON' .AND. gro%CRESPSL/='NON' .AND. any(pek%XLAI(:)/=xundef)) THEN
296  ! faire intervenir le type de vegetation du greenroof ? (CTYP_GR)
297  CALL carbon_evol(gro, k, p, pek, dek, ptstep, prhoa, zresp_biomass_inst )
298  ! calculation of vegetation CO2 flux
299  ! Positive toward the atmosphere
300  psfco2(:) = dek%XRESP_ECO(:) - dek%XGPP(:)
301 END IF
302 !
303 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
304 !
305 !* 4. Set undefined values for points where there is no garden
306 ! --------------------------------------------------------
307 !
308 ! This way, these points are clearly flaged, and one will not try to interpret
309 ! the values for those points
310 !
311  CALL flag_teb_veg_n(pek, gro, t%XGREENROOF, 2)
312 !
313 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
314 !
315 !* 9. Fields required for TEB
316 ! -----------------------
317 !
318 WHERE (t%XGREENROOF/=0.)
319  !
320  ! energy balance
321  !
322  dk%XLE(:) = pek%XLE(:)
323  !
324  ! Estimate of green area aerodynamic conductance recomputed from heat flux,
325  ! surface (radiative) temp. and forcing air temperature (estimated at future time step)
326  zta = ppet_b_coef + ppet_a_coef * dk%XH
327  pac = 0.
328  WHERE (dk%XTSRAD /= zta)
329  pac(:) = max(dk%XH(:) / xcpd / prhoa(:) / (dk%XTSRAD - zta) , 0.)
330  ENDWHERE
331  !
332  ! Humidity of saturation for green areas
333  pqsat(:) = qsat(pek%XTG(:,1),pps(:))
334  !
335  !* friction flux
336  puw(:) = -zustar(:)**2
337  !
338 ELSEWHERE
339  !
340  dk%XRN (:) = xundef
341  dk%XH (:) = xundef
342  dk%XLE (:) = xundef
343  dk%XGFLUX (:) = xundef
344  dk%XEVAP (:) = xundef
345  !
346  pac(:) = xundef
347  pqsat(:) = xundef
348  puw(:) = xundef
349  !
350 END WHERE
351 !
352 !
353 ptsrad(:) = dk%XTSRAD(:)
354 !
355 prn(:) = dk%XRN (:)
356 ph(:) = dk%XH (:)
357 ple(:) = dk%XLE (:)
358 pgflux(:) = dk%XGFLUX (:)
359 pevap(:) = dk%XEVAP (:)
360 prunoff(:) =dek%XRUNOFF(:)
361 pdrain(:) =dek%XDRAIN (:)
362 !
363 IF (lhook) CALL dr_hook('GREENROOF',1,zhook_handle)
364 !
365 !-------------------------------------------------------------------------------
366 !
367 !
368 END SUBROUTINE greenroof
real, save xcpd
Definition: modd_csts.F90:63
subroutine agri_init(AG)
Definition: modd_agrin.F90:67
subroutine sso_init(YSSO)
Definition: modd_sson.F90:103
subroutine vegetation_evol(IO, DTI, PK, PEK, OAGRIP, PTSTEP, KMONTH, KDAY, PTIME, PLAT, PRHOA, P_CO2, ISSK, PRESP_BIOMASS_INST, PSWDIR)
subroutine flag_teb_veg_n(PEK, IO, PMASK, KFLAG)
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
subroutine roof_impl_coef(T, PTSTEP, PTDEEP_A, PTDEEP_B)
logical lhook
Definition: yomhook.F90:15
subroutine vegetation_update(DTCO, DTV, KDIM, IO, KK, PK, PEK, KPATCH, PTSTEP, TTIME, PCOVER, OCOVER, OAGRIP, HSFTYPE, OALB, ISSK, ODUPDATED, OABSENT)
subroutine greenroof(DTCO, G, T, TOP, TIR, DTV, GB, DK, DEK, DMK, GRO, S, K, P, PEK, HIMPLICIT_WIND, TPTIME, PTSUN, PPEW_A_COEF, PPEW_B_COEF, PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, PTSTEP, PZREF, PUREF, PTA, PQA, PEXNS, PEXNA, PRHOA, PCO2, PPS, PRR, PSR, PZENITH, PSW, PLW, PVMOD, PALBNIR_TVEG, PALBVIS_TVEG, PALBNIR_TSOIL, PALBVIS_TSOIL, PRN, PH, PLE, PGFLUX, PSFCO2, PEVAP, PUW, PRUNOFF, PDRAIN, PAC, PQSAT, PTSRAD, PAC_AGG, PHU_AGG, PDEEP_FLUX, PIRRIG)
Definition: greenroof.F90:14
subroutine isba(IO, KK, PK, PEK, G, AG, DK, DEK, DMK, TPTIME, PPOI
Definition: isba.F90:7
subroutine teb_irrig(OIRRIG, PTSTEP, KMONTH, PSOLAR_TIME, PSTART_MONTH, PEND_MONTH, PSTART_HOUR, PEND_HOUR, P24H_IRRIG, PIRRIG)
Definition: teb_irrig.F90:9
subroutine carbon_evol(IO, KK, PK, PEK, DEK, PTSTEP, PRHOA, PRESP_BIOMASS_INST)
Definition: carbon_evol.F90:7