SURFEX v8.1
General documentation of Surfex
isba.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 isba(IO, KK, PK, PEK, G, AG, DK, DEK, DMK, TPTIME, PPOI, PABC, PIACAN, &
7  OMEB, PTSTEP, HIMPLICIT_WIND, PZREF, PUREF, PDIRCOSZW, &
8  PTA, PQA, PEXNA, PRHOA, PPS, PEXNS, PRR, PSR, PZENITH, &
9  PSCA_SW, PSW_RAD, PLW_RAD, PVMOD, PPEW_A_COEF, PPEW_B_COEF,&
10  PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, &
11  PALBNIR_TVEG, PALBVIS_TVEG, PALBNIR_TSOIL, PALBVIS_TSOIL, &
12  PPALPHAN, PZ0G_WITHOUT_SNOW, PZ0_MEBV, PZ0H_MEBV, &
13  PZ0EFF_MEBV, PZ0_MEBN, PZ0H_MEBN, PZ0EFF_MEBN, PTDEEP_A, &
14  PCSP, PFFG_NOSNOW, PFFV_NOSNOW, PEMIST, PUSTAR, PAC_AGG, &
15  PHU_AGG, PRESP_BIOMASS_INST, PDEEP_FLUX, PIRRIG_GR )
16 ! ##########################################################################
17 !
18 !
19 !!**** *ISBA*
20 !!
21 !! PURPOSE
22 !! -------
23 ! Monitor for the calculation of the surface fluxes and of the
24 ! prognostic variables of the surface over natural areas
25 !
26 !!** METHOD
27 !! ------
28 !
29 !! EXTERNAL
30 !! --------
31 !!
32 !! IMPLICIT ARGUMENTS
33 !! ------------------
34 !!
35 !!
36 !! REFERENCE
37 !! ---------
38 !!
39 !! Noilhan and Planton (1989)
40 !!
41 !! AUTHOR
42 !! ------
43 !! S. Belair * Meteo-France *
44 !!
45 !! MODIFICATIONS
46 !! -------------
47 !! Original 10/03/95
48 !! (J.Stein) 25/10/95 add the rain flux computation at the ground
49 !! and the lbc
50 !! (J.Stein) 15/11/95 include the strong slopes cases
51 !! (J.Stein) 06/02/96 bug correction for the precipitation flux writing
52 !! (J.Stein) 20/05/96 set the right IGRID value for the rain rate
53 !! (J.Viviand) 04/02/97 add cold and convective precipitation rate
54 !! (J.Stein) 22/06/97 use the absolute pressure
55 !! (V.Masson) 09/07/97 add directional z0 computations and RESA correction
56 !! (V.Masson) 13/02/98 simplify the routine: only vegetation computation
57 !! are now made here.
58 !! (A.Boone) 05/10/98 add: Boone et al. (1999) 3 soil-water Layers version
59 !! (V.Masson) Dumenil and Todini (1992) runoff
60 !! Calvet (1998) biomass and CO2 assimilation
61 !! Calvet (1998) LAI evolution
62 !! (A.Boone) 03/15/99 Soil ice scheme: modify CG, C1, C2, WSAT, WFC, WILT,
63 !! LEG (add soil ice sublimation); Can modify TS and T2.
64 !! New variables WGI1, WGI2
65 !! (A.Boone) 18/01/00 ISBA-ES (3-layer explicit snow scheme option)
66 !! (Boone and Etchevers 2000)
67 !! New variable IPEK%TSNOW%HEAT(:,:,1)
68 !! (V. Masson) 01/2004 wet leaves fraction computed in separate routine
69 !! all vegetation stress (ISBA, AGS, AST) routines
70 !! called at the same point
71 !! (P. LeMoigne) 03/2004 computation of QSAT
72 !! (P. LeMoigne) 10/2004 halstead coefficient as diagnostic for isba
73 !! (A. Bogatchev)09/2005 EBA snow option
74 !! (P. LeMoigne) 02/2006 z0h and snow
75 !! (B. Decharme) 05/2008 Add floodplains scheme
76 !! (R. Hamdi) 01/09 Cp and L are not constants (As in ALADIN)
77 !! (A.L. Gibelin) 03/2009 : Add respiration diagnostics
78 !! A.L. Gibelin 06/09 : move calculations of CO2 fluxes
79 !! A.L. Gibelin 07/2009 : Suppress PPST and PPSTF as outputs
80 !! (A. Boone) 11/2009 Add local variable: total soil temperature change (before
81 !! phase change) for use by LWT scheme in ISBA-DIF.
82 !! (A. Boone) 03/2010 Add local variable: delta functions for LEG and LEGI
83 !! to numerically correct for when they should be
84 !! zero when hug(i) Qsat < Qa and Qsat > Qa
85 !! (A. Carrer) 04/2011 : new radiative transfert (AGS)
86 !! (B. Decharme) 09/2012 Bug : Save snow albedo values at beginning
87 !! of time step for total albedo calculation
88 !! Bug : flood fraction in COTWORES
89 !! new wind implicitation
90 !! Irrigation rate diag
91 !! (C. de Munck) 03/2013 Specified irrigation for ground
92 !! (B. Decharme) 04/2013 Bug : Wrong radiative temperature
93 !! DIF lateral subsurface drainage
94 !! Sublimation diag flux
95 !! Qs for 3l or crocus (needed for coupling with atm)
96 !! water table / surface coupling
97 !! Routines drag, e_budget and isba_fluxes now in isba_ceb
98 !! (A. Boone & P. Samuelsson) (10/2014) Added MEB v1
99 !! (P. LeMoigne) 12/2014 EBA scheme update
100 !! (A. Boone) 02/2015 Consider spectral band dependence of snow for IO%LTR_ML radiation option
101 !! B. Decharme 01/16 : Bug with flood budget
102 !-------------------------------------------------------------------------------
103 !
104 !* 0. DECLARATIONS
105 ! ------------
106 !
109 USE modd_sfx_grid_n, ONLY : grid_t
110 USE modd_agri_n, ONLY : agri_t
111 USE modd_diag_n, ONLY : diag_t
114 !
115 USE modd_co2v_par, ONLY : xmc, xmco2, xpcco2
116 USE modd_surf_par, ONLY : xundef
117 !
118 USE modd_csts, ONLY : xtt
119 USE modd_co2v_par, ONLY : xmc, xmco2, xpcco2
120 USE modd_surf_par, ONLY : xundef
121 USE modd_data_cover_par, ONLY : nvt_snow
123 !
124 USE modd_type_date_surf, ONLY : date_time
125 !
126 USE modi_soil
127 USE modi_soildif
128 USE modi_soilstress
129 USE modi_wet_leaves_frac
130 USE modi_veg
131 USE modi_snow3l_isba
132 USE modi_hydro
133 USE modi_isba_snow_agr
134 !
135 USE modi_radiative_transfert
136 USE modi_cotwores
137 !
138 !
139 USE modi_isba_ceb
140 USE modi_isba_meb
141 !
142 USE mode_thermos
143 !
144 USE yomhook ,ONLY : lhook, dr_hook
145 USE parkind1 ,ONLY : jprb
146 !
147 IMPLICIT NONE
148 !
149 !* 0.1 declarations of arguments
150 ! -------------------------
151 !
152 !
153 !* general variables
154 ! -----------------
155 !
156 TYPE(isba_options_t), INTENT(INOUT) :: IO
157 TYPE(isba_k_t), INTENT(INOUT) :: KK
158 TYPE(isba_p_t), INTENT(INOUT) :: PK
159 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
160 TYPE(grid_t), INTENT(INOUT) :: G
161 TYPE(agri_t), INTENT(INOUT) :: AG
162 TYPE(diag_t), INTENT(INOUT) :: DK
163 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DEK
164 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
165 !
166 TYPE(date_time), INTENT(IN) :: TPTIME ! current date and time
167 !
168 REAL, DIMENSION(:), INTENT(IN) :: PPOI ! Gaussian weights (as above)
169 REAL, DIMENSION(:), INTENT(INOUT) :: PABC ! abscissa needed for integration
170 ! ! of net assimilation and stomatal
171 ! ! conductance over canopy depth
172 REAL, DIMENSION(:,:), INTENT(OUT) :: PIACAN ! PAR in the canopy at different gauss level
173 LOGICAL, INTENT(IN) :: OMEB ! True = patch with multi-energy balance
174 ! ! False = patch with classical ISBA
175 REAL, INTENT(IN) :: PTSTEP ! timestep of the integration
176  CHARACTER(LEN=*), INTENT(IN) :: HIMPLICIT_WIND ! wind implicitation option
177 ! ! 'OLD' = direct
178 ! ! 'NEW' = Taylor serie, order 1
179 REAL, DIMENSION(:), INTENT(IN) :: PZREF ! normal distance of the first
180 ! ! atmospheric level to the
181 ! ! orography
182 REAL, DIMENSION(:), INTENT(IN) :: PUREF ! reference height of the wind
183 ! ! NOTE this is different from ZZREF
184 ! ! ONLY in stand-alone/forced mode,
185 ! ! NOT when coupled to a model (MesoNH)
186 REAL, DIMENSION(:), INTENT(IN) :: PDIRCOSZW ! Director Cosinus along z
187 ! ! directions at surface w-point
188 !
189 !* atmospheric variables
190 ! ---------------------
191 !
192 ! suffix 'A' stands for atmospheric variable at first model level
193 ! suffix 'S' stands for atmospheric variable at ground level
194 !
195 REAL, DIMENSION(:), INTENT(IN) :: PTA ! Temperature
196 REAL, DIMENSION(:), INTENT(IN) :: PQA ! specific humidity
197 REAL, DIMENSION(:), INTENT(IN) :: PEXNA ! Exner function
198 REAL, DIMENSION(:), INTENT(IN) :: PRHOA ! air density
199 !
200 REAL, DIMENSION(:), INTENT(IN) :: PPS ! Pressure
201 REAL, DIMENSION(:), INTENT(IN) :: PEXNS ! Exner function
202 !
203 REAL, DIMENSION(:), INTENT(IN) :: PRR ! Rain rate (in kg/m2/s)
204 REAL, DIMENSION(:), INTENT(IN) :: PSR ! Snow rate (in kg/m2/s)
205 !
206 REAL, DIMENSION(:), INTENT(IN) :: PZENITH ! solar zenith angle
207 REAL, DIMENSION(:), INTENT(IN) :: PSW_RAD ! solar incoming radiation
208 REAL, DIMENSION(:), INTENT(IN) :: PSCA_SW ! solar diffuse incoming radiation
209 REAL, DIMENSION(:), INTENT(IN) :: PLW_RAD ! thermal incoming radiation
210 !
211 REAL, DIMENSION(:), INTENT(IN) :: PVMOD ! modulus of the wind
212 ! ! parallel to the orography
213 !
214 ! implicit coupling coefficients:
215 !
216 REAL, DIMENSION(:), INTENT(IN) :: PPEW_A_COEF, PPEW_B_COEF, &
217  PPET_A_COEF, PPEQ_A_COEF, &
218  PPET_B_COEF, PPEQ_B_COEF
219 ! PPEW_A_COEF ! A-wind coefficient
220 ! PPEW_B_COEF ! B-wind coefficient
221 ! PPET_A_COEF ! A-air temperature coefficient
222 ! PPET_B_COEF ! B-air temperature coefficient
223 ! PPEQ_A_COEF ! A-air specific humidity coefficient
224 ! PPEQ_B_COEF ! B-air specific humidity coefficient
225 !
226 !* vegetation parameters
227 ! ---------------------
228 !
229 REAL, DIMENSION(:), INTENT(IN) :: PALBNIR_TVEG ! tot albedo of vegetation in NIR (needed for LM_TR)
230 REAL, DIMENSION(:), INTENT(IN) :: PALBVIS_TVEG ! tot albedo of vegetation in VIS
231 REAL, DIMENSION(:), INTENT(IN) :: PALBNIR_TSOIL ! tot albedo of bare soil in NIR
232 REAL, DIMENSION(:), INTENT(IN) :: PALBVIS_TSOIL ! tot albedo of bare soil in VIS
233 !
234 ! For multi-energy balance
235 !
236 REAL, DIMENSION(:), INTENT(IN) :: PPALPHAN ! snow/canopy transition coefficient
237 REAL, DIMENSION(:), INTENT(IN) :: PZ0G_WITHOUT_SNOW ! roughness length for momentum at snow-free canopy floor
238 REAL, DIMENSION(:), INTENT(IN) :: PZ0_MEBV ! roughness length for momentum over MEB vegetation part of patch
239 REAL, DIMENSION(:), INTENT(IN) :: PZ0H_MEBV ! roughness length for heat over MEB vegetation part of path
240 REAL, DIMENSION(:), INTENT(IN) :: PZ0EFF_MEBV ! roughness length for momentum over MEB vegetation part of patch
241 REAL, DIMENSION(:), INTENT(IN) :: PZ0_MEBN ! roughness length for momentum over MEB snow part of patch
242 REAL, DIMENSION(:), INTENT(IN) :: PZ0H_MEBN ! roughness length for heat over MEB snow part of path
243 REAL, DIMENSION(:), INTENT(IN) :: PZ0EFF_MEBN ! roughness length for momentum over MEB snow part of patch
244 !
245 !* soil parameters
246 ! ---------------
247 !
248 REAL, DIMENSION(:), INTENT(IN) :: PTDEEP_A ! Deep soil temperature (prescribed)
249 ! PTDEEP_A = Deep soil temperature
250 ! coefficient depending on flux
251 !* ISBA-Ags parameters
252 ! -------------------
253 !
254 REAL, DIMENSION(:), INTENT(IN) :: PCSP ! atmospheric CO2 concentration
255 ! [ppmm]=[kg CO2 / kg air]
256 !
257 !* ISBA-DF variables/parameters:
258 ! ------------------------------
259 !
260 REAL, DIMENSION(:), INTENT(IN) :: PFFG_NOSNOW ! Without snow (ES)
261 REAL, DIMENSION(:), INTENT(IN) :: PFFV_NOSNOW ! Without snow (ES)
262 !
263 !* diagnostic variables
264 ! --------------------
265 !
266 REAL, DIMENSION(:), INTENT(OUT) :: PEMIST ! grid-area surface emissivity
267 !
268 !* surface fluxes
269 ! --------------
270 !
271 REAL, DIMENSION(:), INTENT(OUT) :: PUSTAR ! friction velocity
272 !
273 ! The following surface fluxes are from snow-free portion of grid
274 ! box when the ISBA-ES option is ON. Otherwise, they are equal
275 ! to the same variables without the _ISBA extension.
276 !
277 REAL, DIMENSION(:), INTENT(OUT) :: PAC_AGG ! aggregated aerodynamic conductance
278  ! for evaporative flux calculations
279 REAL, DIMENSION(:), INTENT(OUT) :: PHU_AGG ! aggregated relative humidity
280  ! for evaporative flux calculations
281 !
282 !* diagnostic variables for Carbon assimilation
283 ! --------------------------------------------
284 !
285 REAL, DIMENSION(:,:), INTENT(OUT) :: PRESP_BIOMASS_INST ! instantaneous biomass respiration (kgCO2/kgair m/s)
286 !
287 !* diagnostic variables for multi-energy balance (MEB)
288 ! ---------------------------------------------------
289 !
290 REAL, DIMENSION(:), INTENT(OUT) :: PDEEP_FLUX ! Heat flux at bottom of ISBA (W/m2)
291 !
292 REAL ,DIMENSION(:),INTENT(IN) :: PIRRIG_GR ! ground irrigation rate (kg/m2/s)
293 !
294 !
295 !* 0.2 declarations of local variables
296 !
297 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZCS ! heat capacity of the snow
298 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZFROZEN1 ! ice fraction in superficial soil
299 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELTA ! fraction of the foliage
300 ! ! covered with intercepted
301 ! ! water
302 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZQSAT ! expression for the saturation
303 ! ! specific humidity
304 !
305 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZWRMAX ! maximum canopy water interception
306 !
307 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZF2 ! water stress coefficient
308 !
309 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZF5 ! water stress coefficient (based on F2)
310 ! ! to enforce Etv=>0 as F2=>0
311 !
312 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZHUGI ! humidity over frozen bare ground
313 !
314 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZEVAPCOR ! evaporation correction as last traces of snow
315 ! ! cover ablate
316 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZLES3L ! sublimation from ISBA-ES(3L)
317 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZLEL3L ! evaporation heat flux of water in the snow (W/m2)
318 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZEVAP3L ! evaporation flux over snow from ISBA-ES (kg/m2/s)
319 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZSNOW_THRUFAL ! rate that liquid water leaves snow pack:
320 ! ! ISBA-ES [kg/(m2 s)]
321 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZSNOW_THRUFAL_SOIL !liquid water leaving the snowpack directly to the
322 ! !soil, ISBA-ES: [kg/(m2 s)] (equal to ZSNOW_THRUFAL
323 ! !if OMEB_LITTER=False and zero if OMEB_LITTER=True)
324 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZALB3L !Snow albedo at t-dt for total albedo calculation (ES/CROCUS)
325 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZRI3L !Snow Ridcharson number (ES/CROCUS)
326 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZQS3L ! surface humidity (kg/kg) (ES/CROCUS)
327 !
328 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZVEG
329 !
330 REAL, DIMENSION(SIZE(PEK%XWR),SIZE(PABC)) :: ZIACAN_SHADE, ZIACAN_SUNLIT
331 ! ! absorbed PAR of each level within the
332 ! ! canopy - Split into shaded and SUNLIT
333 REAL, DIMENSION(SIZE(PEK%XWR),SIZE(PABC)) :: ZFRAC_SUN ! fraction of sunlit leaves
334 !
335 ! ISBA-DF:
336 !
337 REAL, DIMENSION(SIZE(PEK%XWG,1),SIZE(PEK%XWG,2)) :: ZSOILHCAPZ ! ISBA-DF Soil heat capacity
338 ! ! profile [J/(m3 K)]
339 REAL, DIMENSION(SIZE(PEK%XWG,1),SIZE(PEK%XWG,2)) :: ZSOILCONDZ ! ISBA-DF Soil conductivity
340 ! ! profile [W/(m K)]
341 !
342 REAL, DIMENSION(SIZE(PEK%XWG,1),SIZE(PEK%XWG,2)) :: ZF2WGHT ! water stress factor
343 !
344 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZGRNDFLUX ! snow/soil-biomass interface flux (W/m2)
345 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZFLSN_COR ! snow/soil-biomass correction flux (W/m2)
346 !
347 ! MEB:
348 !
349 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZSUBVCOR ! A possible snow (intercepted by the canopy) mass correction
350 ! (to be potentially removed from soil) when MEB activated (kg/m2/s)
351 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZLITCOR ! A possible ice (in litter layer) mass correction
352 ! (to be potentially removed from soil) when litter activated (kg/m2/s)
353 !
354 ! Misc :
355 !
356 ! -----------------------------------------------------------------------------------------------------------------------------------------------------
357 ! Budget: Add to arguments, diags
358 
359 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELHEATV_SFC ! Change in heat storage of the explicit vegetation (MEB) layer over the current time step (W m-2)
360 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELHEATG ! change in heat storage of the entire soil column over the current time step (W m-2)
361 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELHEATG_SFC ! change in heat storage of the surface soil layer over the current time step (W m-2)
362 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELPHASEG ! latent heating due to soil freeze-thaw in the entire soil column (W m-2)
363 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELPHASEG_SFC ! latent heating due to soil freeze-thaw in the surface soil layer (W m-2)
364 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELHEATN ! change in heat storage of the entire snow column over the current time step (W m-2)
365 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZDELHEATN_SFC ! change in heat storage of the surface snow layer over the current time step (W m-2)
366 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZSNOWSFCH ! snow surface layer pseudo-heating term owing to
367 ! ! changes in grid thickness (W m-2)
368 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZGSFCSNOW ! conductive heat flux between the surface and sub-surface soil layers
369 ! ! for the multi-layer snow schemes..for composite snow, it is
370 ! ! equal to DEK%XRESTORE (W m-2)
371 !
372 !
373 ! Necessary to close the energy budget between surfex and the atmosphere:
374 !
375 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZEMIST, ZZHV
376 REAL, DIMENSION(SIZE(PEK%XWR)) :: ZALBT, ZEV, ZETR, ZER
377 !
378 LOGICAL, DIMENSION(SIZE(PEK%XTG,1)) :: GSHADE ! mask where evolution occurs
379 !
380 !
381 REAL(KIND=JPRB) :: ZHOOK_HANDLE
382 !
383 !-------------------------------------------------------------------------------
384 !
385 !* 1.0 Preliminaries
386 ! -------------
387 !
388 IF (lhook) CALL dr_hook('ISBA',0,zhook_handle)
389 !
390 dmk%XC1(:) = xundef
391 dmk%XC2(:) = xundef
392 dmk%XWGEQ(:) = xundef
393 zcs(:) = xundef
394 !
395 zemist(:) = xundef
396 zalbt(:) = xundef
397 zri3l(:) = xundef
398 !
399 zsoilhcapz(:,:) = xundef
400 zsoilcondz(:,:) = xundef
401 zf2wght(:,:) = xundef
402 zevap3l(:) = xundef
403 !
404 dmk%XRS (:) = 0.0
405 pac_agg(:) = 0.0
406 phu_agg(:) = 0.0
407 dmk%XSNOWTEMP (:,:) = xtt
408 dek%XMELT (:) = 0.0
409 !
410 !
411 !
412 ! MEB:
413 !
414 zdelheatv_sfc(:) = 0.0
415 zdelheatg(:) = 0.0
416 zdelheatg_sfc(:) = 0.0
417 zdelphaseg(:) = 0.0
418 zdelphaseg_sfc(:) = 0.0
419 zdelheatn(:) = 0.0
420 zdelheatn_sfc(:) = 0.0
421 zsnowsfch(:) = 0.0
422 zgsfcsnow(:) = 0.0
423 !
424 zsubvcor(:) = 0.0
425 zlitcor(:) = 0.0
426 zles3l = 0.0
427 zlel3l = 0.0
428 !
429 IF(omeb)THEN
430  zveg(:) = 0.0
431  dek%XLEG(:) = 0.0
432  dek%XLEGI(:) = 0.0
433  dek%XLELITTER(:) = 0.0
434  dek%XLELITTERI(:) = 0.0
435 ELSE
436  zveg(:) = pek%XVEG(:)
437 ENDIF
438 !
439 ! Save snow albedo values at beginning of time step for total albedo calculation
440 !
441 zalb3l(:)=pek%TSNOW%ALB(:)
442 !
443 !-------------------------------------------------------------------------------
444 !
445 !* 2.0 Soil parameters
446 ! ---------------
447 !
448 IF(io%CISBA =='2-L' .OR. io%CISBA == '3-L')THEN
449 !
450  CALL soil (io, kk, pk, pek, dmk, zveg, zcs, zfrozen1, pffg_nosnow, pffv_nosnow )
451 !
452 ELSE
453 !
454  CALL soildif (io, kk, pk, pek, dmk, zveg, zfrozen1, pffg_nosnow, pffv_nosnow, zsoilcondz, zsoilhcapz )
455 !
456 ENDIF
457 !
458 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
459 !
460 !* 3.0 Plant stress due to soil water deficit
461 ! --------------------------------------
462 !
463  CALL soilstress(io%CISBA, zf2, kk, pk, pek, zf2wght, zf5 )
464 !
465 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
466 !
467 !* 4.0 Explicit Canopy Vegetation Option
468 ! ---------------------------------
469 !
470 IF(omeb)THEN
471  CALL isba_meb(io, kk, pk, pek, dk, dek, dmk, g, ag, &
472  tptime, omeb, gshade, himplicit_wind, ptstep, &
473  zsoilhcapz, zsoilcondz, zfrozen1, pps, pzenith, &
474  psca_sw, psw_rad, pvmod, prr, psr, prhoa, pta, pqa, &
475  pdircoszw, pexns, pexna, ppet_a_coef, ppet_b_coef, &
476  ppeq_a_coef, ppeq_b_coef, ppew_a_coef, ppew_b_coef, &
477  pzref, puref, pz0g_without_snow, pz0_mebv, pz0h_mebv,&
478  pz0eff_mebv, pz0_mebn, pz0h_mebn, pz0eff_mebn, &
479  palbnir_tveg, palbvis_tveg,palbnir_tsoil, palbvis_tsoil, &
480  pabc, piacan, ppoi, pcsp, presp_biomass_inst, ppalphan, &
481  zf2, plw_rad, zgrndflux, zflsn_cor, pustar, zemist, &
482  phu_agg, pac_agg, zdelheatv_sfc, zdelheatg_sfc, zdelheatg, &
483  zdelheatn, zdelheatn_sfc, zgsfcsnow, ptdeep_a, pdeep_flux, &
484  zri3l, zsnow_thrufal, zsnow_thrufal_soil, zevapcor, zsubvcor, &
485  zlitcor, zsnowsfch, zqs3l )
486 
487 ELSE
488 !
489 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
490 !
491 !* 5.0 Radiative transfert
492 ! -------------------
493 !
494  IF (io%LTR_ML) THEN
495  CALL radiative_transfert(io%LAGRI_TO_GRASS, pk%XVEGTYPE_PATCH, palbvis_tveg, &
496  palbvis_tsoil, palbnir_tveg, palbnir_tsoil, psw_rad, &
497  pek%XLAI, pzenith, pabc, pek%XFAPARC, pek%XFAPIRC, &
498  pek%XMUS, pek%XLAI_EFFC, gshade, piacan, ziacan_sunlit,&
499  ziacan_shade, zfrac_sun, dmk%XFAPAR, dmk%XFAPIR, &
500  dmk%XFAPAR_BS, dmk%XFAPIR_BS )
501  ENDIF
502 !
503 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
504 !
505 !* 6.0 Fraction of leaves occupied by intercepted water
506 ! ------------------------------------------------
507 !
508  CALL wet_leaves_frac(pek%XWR, pek%XVEG, pek%XWRMAX_CF, dk%XZ0, pek%XLAI, zwrmax, zdelta)
509 !
510 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
511 !
512 !* 7.0 Explicit snow scheme
513 ! --------------------
514 !
515  CALL snow3l_isba(io, g, pk, pek, dk, dek, dmk, omeb, himplicit_wind, &
516  tptime, ptstep, pk%XVEGTYPE_PATCH, pek%XTG, dmk%XCT, zsoilhcapz, &
517  zsoilcondz(:,1), pps, pta, psw_rad, pqa, pvmod, plw_rad, prr, &
518  psr, prhoa, puref, pexns, pexna, pdircoszw, pzref, pek%XSNOWFREE_ALB, &
519  pk%XDG, pk%XDZG, ppew_a_coef, ppew_b_coef, ppet_a_coef, ppeq_a_coef, &
520  ppet_b_coef, ppeq_b_coef, zsnow_thrufal_soil, zgrndflux, zflsn_cor, &
521  zgsfcsnow, zevapcor, zles3l, zlel3l, zevap3l, zsnowsfch, zdelheatn, &
522  zdelheatn_sfc, zri3l, pzenith, zdelheatg, zdelheatg_sfc, zqs3l )
523 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
524 !
525 !* 8.0 Plant stress, stomatal resistance and, possibly, CO2 assimilation
526 ! --------------------------------------------------------------------
527 !
528  IF (io%CPHOTO=='NON') THEN
529  CALL veg(psw_rad, pta, pqa, pps, pek%XRGL, pek%XLAI, pek%XRSMIN, pek%XGAMMA, zf2, dmk%XRS)
530  ELSE IF (maxval(pek%XGMES(:)).NE.xundef .OR. minval(pek%XGMES(:)).NE.xundef) THEN
531  zqsat(:)=qsat(pek%XTG(:,1),pps(:))
532  CALL cotwores(ptstep, io, gshade, pk, pek, pk%XDMAX, ppoi, pcsp, pek%XTG(:,1), &
533  zf2, psw_rad, pqa, zqsat, pek%XPSNV, zdelta, prhoa, pzenith, &
534  kk%XFFV, ziacan_sunlit, ziacan_shade, zfrac_sun, piacan, pabc, &
535  dmk%XRS, dek%XGPP, presp_biomass_inst(:,1))
536  ELSE
537  presp_biomass_inst(:,1) = 0.0
538  dek%XGPP(:) = 0.0
539  ENDIF
540 !
541 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
542 !
543 !* 9.0 ISBA Composit Energy Budget
544 ! -----------------------------------------------
545 !
546  CALL isba_ceb(io, kk, pk, pek, dk, dek, dmk, &
547  himplicit_wind, ptstep, ppew_a_coef, &
548  ppew_b_coef, ppet_a_coef, ppeq_a_coef, ppet_b_coef, &
549  ppeq_b_coef, psw_rad, plw_rad, pexns, pexna, pta, &
550  pvmod, pqa, prr, psr, pps, pzref, puref, pdircoszw, &
551  zf5, pffg_nosnow, pffv_nosnow, prhoa, zcs, &
552  zsoilcondz, zsoilhcapz, zfrozen1, ptdeep_a, &
553  zgrndflux, zflsn_cor, zsnow_thrufal_soil, zdelta, zhugi, &
554  zalbt, zemist, pdeep_flux, pustar, pac_agg, phu_agg )
555 !
556 ENDIF
557 !
558 !*******************************************************************************
559 ! WARNING: at this stage, all fluxes have two different meanings according
560 ! to the ISBA snow-scheme option:
561 ! 'D95' : they represent aggregated (snow + flood + snow-flood-free) fluxes
562 ! '3-L' : they represent flood + snow-flood-free fluxes
563 !
564 ! The variables concerned by this are: PRN, PH, PLE, PLEI, DEK%XLEG, DEK%XLEGI, DEK%XLEV, DEK%XLES,
565 ! DEK%XLER, DEK%XLETR, PEVAP, PUSTAR, PGFLUX
566 !*******************************************************************************
567 !
568 !* 12.0 Water transfers and phase change in the soil
569 ! --------------------------------------------
570 !
571  CALL hydro(io, kk, pk, pek, ag, dek, dmk, &
572  omeb, ptstep, zveg, zwrmax, zsnow_thrufal_soil, &
573  zevapcor, zsubvcor, zsoilhcapz, zf2wght, zf2, pps, &
574  pirrig_gr, zdelheatg, zdelheatg_sfc, zdelphaseg, &
575  zdelphaseg_sfc )
576 !-------------------------------------------------------------------------------
577 !
578 !* 13.0 Aggregated output fluxes and diagnostics
579 ! -----------------------------------------
580 !
581 !* add snow component to output radiative parameters and fluxes in case
582 ! of ES or CROCUS snow schemes
583 !
584  CALL isba_snow_agr(kk, pk, pek, dmk, dk, dek, &
585  omeb, io%LMEB_LITTER, pexns, pexna, pta, pqa, &
586  pzref, puref, pdircoszw, pvmod, prr, psr, &
587  zemist, zalbt, pustar, zles3l, zlel3l, &
588  zevap3l, zqs3l, zalb3l, zgsfcsnow, &
589  zgrndflux, zflsn_cor, pemist, ppalphan )
590 !
591 !***************************************************************************
592 ! All output fluxes and radiative variables have recovered the same physical
593 ! meaning, that is they are aggregated quantities (snow + snow-free)
594 !***************************************************************************
595 !
596 IF (lhook) CALL dr_hook('ISBA',1,zhook_handle)
597 !
598 !-------------------------------------------------------------------------------
599 !
600 END SUBROUTINE isba
real, parameter xsw_wght_vis
subroutine isba_meb(IO, KK, PK, PEK, DK, DEK, DMK, G, AG,
Definition: isba_meb.F90:7
real, parameter xundef
subroutine wet_leaves_frac(PWRM, PVEG, PWRMAX_CF, PZ0, PLAI, PWRMAX, PDELTA)
integer, parameter jprb
Definition: parkind1.F90:32
subroutine cotwores(PTSTEP, IO, OSHADE, PK, PEK, PDMAX, PPOI, PCSP, PTG, PF2, PSW_RAD, PQA, PQSAT, PPSNV, PDELTA, PRHOA, PZENITH, PFFV, PIACAN_SUNLIT, PIACAN_SHADE, PFRAC_SUN, PIACAN, PABC, PRS, PGPP, PRESP_LEAF)
Definition: cotwores.F90:10
subroutine soilstress(HISBA, PF2, KK, PK, PEK, PF2WGHT, PF5)
Definition: soilstress.F90:7
subroutine snow3l_isba(IO, G, PK, PEK, DK, DEK, DMK, OMEB, HIMPLICIT_WIND, TPTIME, PTSTEP, PVEGTYPE, PTG, PCT, PSOILHCAPZ, PSOILCONDZ, PPS, PTA, PSW_RAD, PQA, PVMOD, PLW_RAD, PRR, PSR, PRHOA, PUREF, PEXNS, PEXNA, PDIRCOSZW, PZREF, PALB, PD_G, PDZG, PPEW_A_COEF, PPEW_B_COEF, PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, PTHRUFAL, PGRNDFLUX, PFLSN_COR, PGSFCSNOW, PEVAPCOR, PLES3L, PLEL3L, PEVAP, PSNOWSFCH, PDELHEATN, PDELHEATN_SFC, PRI, PZENITH, PDELHEATG, PDELHEATG_SFC, PQS)
Definition: snow3L_isba.F90:15
subroutine soildif(IO, KK, PK, PEK, DMI, PVEG, PFROZEN1, PFFG, PFF
Definition: soildif.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine veg(PSW_RAD, PTA, PQA, PPS, PRGL, PLAI, PRSMIN, PGAMMA, PF2, PRS)
Definition: veg.F90:8
subroutine isba(IO, KK, PK, PEK, G, AG, DK, DEK, DMK, TPTIME, PPOI
Definition: isba.F90:7
subroutine hydro(IO, KK, PK, PEK, AG, DEK, DMK, OMEB, PTSTEP, PVEG
Definition: hydro.F90:7
subroutine soil(IO, KK, PK, PEK, DMI, PVEG, PCS, PFROZEN1, PFFG_N
Definition: soil.F90:7
subroutine isba_ceb(IO, KK, PK, PEK, DK, DEK, DMK, HIMPLICIT_WIND, PTSTEP, PPEW_A_COEF, PPEW_B_COEF, PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, PSW_RAD, PLW_RAD, PEXNS, PEXNA, PTA, PVMOD, PQA, PRR, PSR, PPS, PZREF, PUREF, PDIRCOSZW, PF5, PFFG_NOSNOW, PFFV_NOSNOW, PRHOA, PCS, PSOILCONDZ, PSOILHCAPZ, PFROZEN1, PTDEEP_A, PGRNDFLUX, PFLSN_COR, PSNOW_THRUFAL, PDELTA, PHUGI, PALBT, PEMIST, PDEEP_FLUX, PUSTAR, PAC_AGG, PHU_AGG)
Definition: isba_ceb.F90:15
real, save xtt
Definition: modd_csts.F90:66
subroutine isba_snow_agr(KK, PK, PEK, DMK, DK, DEK, OMEB, OMEB_LITTER, PEXNS, PEXNA, PTA, PQA
subroutine radiative_transfert(OAGRI_TO_GRASS, PVEGTYPE, PALBVIS_VEG, PALBVIS_SOIL, PALBNIR_VEG, PALBNIR_SOIL, PSW_RAD, PLAI, PZENITH, PABC, PFAPARC, PFAPIRC, PMUS, PLAI_EFFC, OSHADE, PIACAN, PIACAN_SUNLIT, PIACAN_SHADE, PFRAC_SUN, PFAPAR, PFAPIR, PFAPAR_BS, PFAPIR_BS)
real, parameter xsw_wght_nir