SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
hydro.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 hydro(HISBA, HSNOW_ISBA, HRUNOFF, HSOILFRZ, OMEB, OGLACIER,&
7  oflood, ptstep, pvegtype, &
8  prr, psr, plev, pletr, pleg, ples, &
9  prunoffb, pwdrain, &
10  pc1, pc2, pc3, pc4b, pc4ref, pwgeq, pcg, pct, &
11  pveg, plai, pwrmax, pmelt, ptauice, plegi, &
12  prunoffd, psoilwght, klayer_hort, klayer_dun, &
13  ppsnv, ppsng, &
14  psnow_thrufal, pevapcor, psubvcor, &
15  pwr, psoilhcapz, &
16  psnowswe, psnowalb, psnowrho, &
17  pbcoef, pwsat, pcondsat, pmpotsat, pwfc, &
18  pwwilt, pf2wght, pf2, pd_g, pdzg, pdzdif, pps, &
19  pwg, pwgi, ptg, kwg_layer, &
20  pdrain, prunoff, ptopqs, &
21  pirrig, pwatsup, pthreshold, lirriday, lirrigate, &
22  hksat, hrain, hhort, pmuf, pfsat, pksat_ice, &
23  pd_ice, phorton, pdrip, pffg, pffv , pfflood, &
24  ppiflood, piflood, ppflood, prrveg, pirrig_flux, &
25  pirrig_gr, pqsb, pfwtd, pwtd, &
26  pdelheatg, pdelheatg_sfc, &
27  pdelphaseg, pdelphaseg_sfc, plvtt, plstt )
28 ! #####################################################################
29 !
30 !!**** *HYDRO*
31 !!
32 !! PURPOSE
33 !! -------
34 !
35 ! Calculates the evolution of the water variables, i.e., the superficial
36 ! and deep-soil volumetric water content (wg and w2), the equivalent
37 ! liquid water retained in the vegetation canopy (Wr), the equivalent
38 ! water of the snow canopy (Ws), and also of the albedo and density of
39 ! the snow (i.e., SNOWALB and SNOWRHO). Also determine the runoff and drainage
40 ! into the soil.
41 !
42 !
43 !!** METHOD
44 !! ------
45 !
46 !! EXTERNAL
47 !! --------
48 !!
49 !! none
50 !!
51 !! IMPLICIT ARGUMENTS
52 !! ------------------
53 !!
54 !!
55 !!
56 !! REFERENCE
57 !! ---------
58 !!
59 !! Noilhan and Planton (1989)
60 !! Belair (1995)
61 !!
62 !! AUTHOR
63 !! ------
64 !!
65 !! S. Belair * Meteo-France *
66 !!
67 !! MODIFICATIONS
68 !! -------------
69 !!
70 !! Original 14/03/95
71 !! 31/08/98 (V. Masson and F. Habets) add Dumenil et Todini
72 !! runoff scheme
73 !! 31/08/98 (V. Masson and A. Boone) add the third soil-water
74 !! reservoir (WG3,D3)
75 !! 19/07/05 (P. LeMoigne) bug in runoff computation if isba-2L
76 !! 10/10/05 (P. LeMoigne) bug in hydro-soil calling sequence
77 !! 25/05/08 (B. Decharme) Add floodplains
78 !! 27/11/09 (A. Boone) Add possibility to do time-splitting when
79 !! calling hydro_soildif (DIF option only)
80 !! for *very* large time steps (30min to 1h+).
81 !! For *usual* sized time steps, time step
82 !! NOT split.
83 !! 08/11 (B. Decharme) DIF optimization
84 !! 09/12 (B. Decharme) Bug in wg2 ice energy budget
85 !! 10/12 (B. Decharme) EVAPCOR snow correction in DIF
86 !! Add diag IRRIG_FLUX
87 !! 04/13 (B. Decharme) Pass soil phase changes routines here
88 !! Apply physical limits on wg in hydro_soil.F90
89 !! Subsurface runoff if SGH (DIF option only)
90 !! water table / surface coupling
91 !! 02/2013 (C. de Munck) specified irrigation rate of ground added
92 !! 10/2014 (A. Boone) MEB added
93 !! 07/15 (B. Decharme) Numerical adjustement for F2 soilstress function
94 !! 03/16 (B. Decharme) Limit flood infiltration
95 !-------------------------------------------------------------------------------
96 !
97 !* 0. DECLARATIONS
98 ! ------------
99 !
100 USE modd_csts, ONLY : xrholw, xday, xtt, xlstt, xlmtt
101 USE modd_isba_par, ONLY : xwgmin, xdenom_min
102 USE modd_surf_par, ONLY : xundef, nundef
103 !
104 #ifdef TOPD
105 USE modd_coupling_topd, ONLY : lcoupl_topd, xas_nature, xatop, xrunoff_top, nmaskt_patch
106 #endif
107 !
108 USE modi_hydro_veg
109 USE modi_hydro_snow
110 USE modi_hydro_soil
111 USE modi_hydro_soildif
112 USE modi_hydro_sgh
113 USE modi_ice_soildif
114 USE modi_ice_soilfr
115 !
116 USE mode_thermos
117 !
118 USE yomhook ,ONLY : lhook, dr_hook
119 USE parkind1 ,ONLY : jprb
120 !
121 IMPLICIT NONE
122 !
123 !* 0.1 declarations of arguments
124 !
125 !
126  CHARACTER(LEN=*), INTENT(IN) :: hisba ! type of ISBA version:
127 ! ! '2-L' (default)
128 ! ! '3-L'
129 ! ! 'DIF' ISBA-DF
130  CHARACTER(LEN=*), INTENT(IN) :: hsnow_isba ! 'DEF' = Default F-R snow scheme
131 ! ! (Douville et al. 1995)
132 ! ! '3-L' = 3-L snow scheme (option)
133 ! ! (Boone and Etchevers 2001)
134  CHARACTER(LEN=*), INTENT(IN) :: hrunoff ! surface runoff formulation
135 ! ! 'WSAT'
136 ! ! 'DT92'
137 ! ! 'SGH ' Topmodel
138  CHARACTER(LEN=*), INTENT(IN) :: hsoilfrz ! soil freezing-physics option
139 ! ! 'DEF' Default (Boone et al. 2000; Giard and Bazile 2000)
140 ! ! 'LWT' phase changes as above, but relation between unfrozen
141 ! water and temperature considered
142 LOGICAL, INTENT(IN) :: oglacier ! True = Over permanent snow and ice,
143 ! initialise WGI=WSAT,
144 ! Hsnow>=10m and allow 0.8<SNOALB<0.85
145 ! False = No specific treatment
146 !
147 LOGICAL, INTENT(IN) :: omeb ! True = patch with multi-energy balance
148 ! ! False = patch with classical (composite) ISBA
149 !
150 LOGICAL, INTENT(IN) :: oflood ! Flood scheme
151 !
152 REAL, INTENT(IN) :: ptstep
153 ! timestep of the integration
154 !
155 REAL, DIMENSION(:,:), INTENT(IN) :: pvegtype ! fraction of each vegetation
156 !
157 REAL, DIMENSION(:), INTENT(IN) :: prr, psr, plev, pletr, pleg, ples
158 ! PRR = rain rate
159 ! PSR = snow rate
160 ! PLEV = latent heat of evaporation over vegetation
161 ! PLETR = evapotranspiration of the vegetation
162 ! PLEG = latent heat of evaporation over the ground
163 ! PLES = latent heat of sublimation over the snow
164 !
165 REAL, DIMENSION(:), INTENT(IN) :: prunoffb ! slope of the runoff curve
166 REAL, DIMENSION(:), INTENT(IN) :: plvtt, plstt ! latent heat of vaporization and sublimation (J/kg)
167 REAL, DIMENSION(:), INTENT(IN) :: pwdrain ! minimum Wg for drainage (m3/m3)
168 !
169 REAL, DIMENSION(:), INTENT(IN) :: pc1, pc2, pwgeq, pcg, pct
170 REAL, DIMENSION(:,:), INTENT(IN) :: pc3
171 ! soil coefficients
172 ! C1, C2 = coefficients for the moisture calculations
173 ! C3 = coefficient for WG2 calculation
174 ! PWGEQ = equilibrium surface volumetric moisture
175 ! PCG = soil heat capacity
176 ! PCT = grid-averaged heat capacity
177 !
178 REAL, DIMENSION(:), INTENT(IN) :: pveg, plai, prunoffd, pwrmax
179 ! PVEG = fraction of vegetation
180 ! PLAI = Leaf Area Index
181 ! PRUNOFFD = depth over which sub-grid runoff calculated (m)
182 ! PWRMAX = maximum equivalent water content
183 ! in the vegetation canopy
184 !
185 REAL, DIMENSION(:), INTENT(IN) :: pc4b, pc4ref
186 ! PC4REF, PC4B = fiiting soil paramter for vertical diffusion (C4)
187 !
188 REAL, DIMENSION(:), INTENT(IN) :: ppsnv, ppsng
189 ! PPSNV = vegetation covered by snow
190 ! PPSNG = baresoil covered by snow
191 !
192 REAL, DIMENSION(:), INTENT(IN) :: ptauice, plegi
193 ! PTAUICE = characteristic time scale for soil water
194 ! phase changes (s)
195 ! PLEGI = surface soil ice sublimation
196 !
197 REAL, DIMENSION(:), INTENT(IN) :: psnow_thrufal, pevapcor, psubvcor
198 ! PSNOW_THRUFAL = rate that liquid water leaves snow pack:
199 ! *ISBA-ES* [kg/(m2 s)]
200 ! PEVAPCOR = correction if evaporation from snow exceeds
201 ! actual amount on the surface [kg/(m2 s)]
202 ! PSUBVCOR = correction if sublimation from snow intercepted
203 ! on the MEB canopy exceeds snow available as it
204 ! disappears [kg/(m2 s)]
205 !
206 REAL, DIMENSION(:), INTENT(IN) :: pps, pf2
207 ! PPS = surface pressure (Pa)
208 ! PF2 = total water stress factor (-)
209 !
210 REAL, DIMENSION(:,:), INTENT(IN) :: pwsat, pcondsat, pwfc, pd_g, pf2wght, pwwilt
211 ! PD_G = Depth of bottom of Soil layers (m)
212 ! PWFC = field capacity profile (m3/m3)
213 ! PWWILT = wilting point profile (m3/m3)
214 ! PWSAT = porosity profile (m3/m3)
215 ! PCONDSAT = hydraulic conductivity at saturation (m/s)
216 ! PF2WGHT = water stress factor (profile) (-)
217 
218 REAL, DIMENSION(:,:), INTENT(IN) :: pdzdif, pdzg
219 ! PDZDIF = distance between consecuative layer mid-points
220 ! PDZG = soil layers thicknesses
221 !
222 REAL, DIMENSION(:,:), INTENT(IN) :: psoilhcapz
223 ! PSOILHCAPZ = ISBA-DF Soil heat capacity profile [J/(m3 K)]
224 !
225 REAL, DIMENSION(:,:), INTENT(IN) :: psoilwght ! ISBA-DIF: weights for vertical
226 ! ! integration of soil water and properties
227 INTEGER, INTENT(IN) :: klayer_hort! DIF optimization
228 INTEGER, INTENT(IN) :: klayer_dun ! DIF optimization
229 !
230 REAL, DIMENSION(:,:), INTENT(IN) :: pmpotsat,pbcoef
231 ! PMPOTSAT = matric potential at saturation (m)
232 ! PBCOEF = slope of the retention curve (-)
233 !
234 REAL, DIMENSION(:,:), INTENT(INOUT) :: ptg
235 ! PTG = soil layer average temperatures (K)
236 !
237 REAL, DIMENSION(:,:), INTENT(INOUT) :: pwgi, pwg
238 ! PWGI = soil frozen volumetric water content (m3/m3)
239 ! PWG = soil liquid volumetric water content (m3/m3)
240 ! Prognostic variables of ISBA at 't-dt'
241 ! PWGI(:,1) = surface-soil volumetric ice content
242 ! PWGI(:,2) = deep-soil volumetric ice content
243 !
244 INTEGER, DIMENSION(:), INTENT(IN) :: kwg_layer
245 ! KWG_LAYER = Number of soil moisture layers (DIF option)
246 !
247 REAL, DIMENSION(:), INTENT(INOUT) :: pdelheatg, pdelheatg_sfc
248 ! PDELHEATG_SFC = change in heat storage of the surface soil layer over the current time step (W m-2)
249 ! PDELHEATG = change in heat storage of the entire soil column over the current time step (W m-2)
250 !
251 REAL, DIMENSION(:), INTENT(INOUT) :: pwr, psnowswe, psnowalb, psnowrho
252 REAL, DIMENSION(:), INTENT(INOUT) :: pmelt
253 REAL, DIMENSION(:), INTENT(OUT) :: pdrain, prunoff
254 ! PWR = liquid water retained on the foliage
255 ! of the vegetation at time 't+dt'
256 ! PSNOWSWE = equivalent water content of the
257 ! snow reservoir at time 't+dt'
258 ! PSNOWALB = albedo of the snow at 't+dt'
259 ! PSNOWRHO = density of the snow at 't+dt'
260 ! PMELT = melting rate of the snow
261 !
262 REAL, DIMENSION(:), INTENT(OUT) :: pdelphaseg, pdelphaseg_sfc
263 ! PDELPHASEG = latent heating due to soil freeze-thaw in the entire soil column (W m-2)
264 ! PDELPHASEG_SFC = latent heating due to soil freeze-thaw in the surface soil layer (W m-2)
265 !
266 !
267 REAL ,DIMENSION(:),INTENT(IN) :: pirrig
268 REAL ,DIMENSION(:),INTENT(IN) :: pwatsup
269 REAL ,DIMENSION(:),INTENT(IN) :: pthreshold
270 LOGICAL,DIMENSION(:),INTENT(INOUT) :: lirriday
271 LOGICAL,DIMENSION(:),INTENT(IN) :: lirrigate
272 REAL ,DIMENSION(:),INTENT(INOUT) :: pirrig_flux ! irrigation rate (kg/m2/s)
273 REAL ,DIMENSION(:),INTENT(IN) :: pirrig_gr ! ground irrigation rate (kg/m2/s)
274 !
275 !
276 !
277  CHARACTER(LEN=*), INTENT(IN) :: hksat ! soil hydraulic profil option
278 ! ! 'DEF' = ISBA homogenous soil
279 ! ! 'SGH' = ksat exponential decay
280 !
281  CHARACTER(LEN=*), INTENT(IN) :: hrain ! Rainfall spatial distribution
282  ! 'DEF' = No rainfall spatial distribution
283  ! 'SGH' = Rainfall exponential spatial distribution
284  !
285 !
286  CHARACTER(LEN=*), INTENT(IN) :: hhort ! Horton runoff
287  ! 'DEF' = no Horton runoff
288  ! 'SGH' = Horton runoff
289 !
290 REAL, DIMENSION(:), INTENT(IN) :: pd_ice !depth of the soil column for the calculation
291 ! of the frozen soil fraction (m)
292 REAL, DIMENSION(:), INTENT(IN) :: pksat_ice!hydraulic conductivity at saturation (m/s)
293 !
294 REAL, DIMENSION(:), INTENT(IN) :: pmuf !fraction of the grid cell reached by the rainfall
295 REAL, DIMENSION(:), INTENT(INOUT):: pfsat !Topmodel/dt92 saturated fraction
296 !
297 REAL, DIMENSION(:), INTENT(OUT) :: phorton !Horton runoff (kg/m2/s)
298 !
299 REAL, DIMENSION(:), INTENT(INOUT) :: pdrip !Dripping from the vegetation (kg/m2/s)
300 REAL, DIMENSION(:), INTENT(INOUT) :: prrveg !Precip. intercepted by vegetation (kg/m2/s)
301 !
302 REAL, DIMENSION(:), INTENT(IN) :: pffg,pffv
303 REAL, DIMENSION(:), INTENT(IN) :: pfflood !Floodplain effective fraction
304 REAL, DIMENSION(:), INTENT(IN) :: ppiflood !Floodplain potential infiltration [kg/mē/s]
305 !
306 REAL, DIMENSION(:), INTENT(INOUT) :: piflood !Floodplain real infiltration [kg/mē/s]
307 REAL, DIMENSION(:), INTENT(INOUT) :: ppflood !Floodplain interception [kg/mē/s]
308 !
309 REAL, DIMENSION(:,:), INTENT(IN) :: ptopqs !Topmodel (HRUNOFF=SGH) subsurface flow by layer (m/s)
310 REAL, DIMENSION(:), INTENT(OUT) :: pqsb !Topmodel (HRUNOFF=SGH) lateral subsurface flow [kg/mē/s]
311 !
312 REAL, DIMENSION(:), INTENT(IN) :: pfwtd !grid-cell fraction of water table to rise
313 REAL, DIMENSION(:), INTENT(IN) :: pwtd !water table depth (m)
314 !
315 !* 0.2 declarations of local variables
316 !
317 !
318 INTEGER :: jj, jl ! loop control
319 INTEGER :: indt, jdt ! Time splitting indicies
320 INTEGER :: ini, inl, idepth ! (ISBA-DF option)
321 !
322 REAL :: ztstep ! maximum time split time step (<= PTSTEP)
323 ! ! ONLY used for DIF option.
324 !
325 REAL, DIMENSION(SIZE(PVEG)) :: zpg, zpg_melt, zdunne, &
326  zlev, zleg, zlegi, zletr, zpsnv, &
327  zrr, zdg3, zwg3, zwsat_avg, zwwilt_avg, zwfc_avg, &
328  zrunoff, zdrain, zhorton, zevapcor, zqsb
329 ! Prognostic variables of ISBA at 't-dt'
330 ! ZPG = total water reaching the ground
331 ! ZPG_MELT = snowmelt reaching the ground
332 ! ZDUNNE = Dunne runoff
333 ! ZLEV, ZLEG, ZLEGI, ZLETR = Evapotranspiration amounts
334 ! from the non-explicit snow area *ISBA-ES*
335 ! ZPSNV = used to calculate interception of liquid
336 ! water by the vegetation in FR snow method:
337 ! For ES snow method, precipitation already modified
338 ! so set this to zero here for this option.
339 ! ZWSAT_AVG, ZWWILT_AVG, ZWFC_AVG = Average water and ice content
340 ! values over the soil depth D2 (for calculating surface runoff)
341 ! ZDG3, ZWG3, ZRUNOFF, ZDRAIN, ZQSB and ZHORTON are working variables only used for DIF option
342 ! ZEVAPCOR = correction if evaporation from snow exceeds
343 ! actual amount on the surface [m/s]
344 !
345 REAL, DIMENSION(SIZE(PVEG)) :: zdwgi1, zdwgi2, zksfc_iveg
346 ! ZDWGI1 = surface layer liquid water equivalent
347 ! volumetric ice content time tendency
348 ! ZDWGI2 = deep-soil layer liquid water equivalent
349 ! volumetric ice content time tendency
350 ! ZKSFC_IVEG = non-dimensional vegetation insolation coefficient
351 !
352 REAL, DIMENSION(SIZE(PVEG)) :: zwgi_excess, zf2
353 ! ZWGI_EXCESS = Soil ice excess water content
354 ! ZF2 = Soilstress function for transpiration
355 !
356 REAL, DIMENSION(SIZE(PWG,1),SIZE(PWG,2)) :: zqsat, zqsati, zti, zps
357 ! For specific humidity at saturation computation (ISBA-DIF)
358 !
359 REAL, DIMENSION(SIZE(PWG,1),SIZE(PWG,2)) :: zwgi0
360 ! ZWGI0 = initial soil ice content (m3 m-3) before update
361 ! for budget diagnostics
362 !
363 !* 0.3 declarations of local parameters
364 !
365 REAL, PARAMETER :: zinsolfrz_veg = 0.20 ! (-) Vegetation insolation coefficient
366 !
367 REAL, PARAMETER :: zinsolfrz_lai = 30.0 ! (m2 m-2) Vegetation insolation coefficient
368 
369 REAL, PARAMETER :: ztimemax = 900. ! s Maximum timescale without time spliting
370 !
371 REAL(KIND=JPRB) :: zhook_handle
372 !-------------------------------------------------------------------------------
373 !
374 !* 0. Initialization:
375 ! ---------------
376 !
377 IF (lhook) CALL dr_hook('HYDRO',0,zhook_handle)
378 !
379 jdt = 0
380 indt = 0
381 ztstep = 0.0
382 !
383 zpg(:) = 0.0
384 zpg_melt(:) = 0.0
385 zdunne(:) = 0.0
386 !
387 zwsat_avg(:) = 0.0
388 zwwilt_avg(:) = 0.0
389 zwfc_avg(:) = 0.0
390 !
391 zrr(:) = prr(:)
392 !
393 zdrain(:) = 0.
394 zhorton(:) = 0.
395 zrunoff(:) = 0.
396 zwgi_excess(:) = 0.
397 zevapcor(:) = 0.
398 zqsb(:) = 0.
399 !
400 pdrain(:) = 0.
401 prunoff(:) = 0.
402 phorton(:) = 0.
403 pqsb(:) = 0.
404 !
405 pdelphaseg(:) = 0.0
406 pdelphaseg_sfc(:)= 0.0
407 zwgi0(:,:) = 0.0
408 !
409 zf2(:) = max(xdenom_min,pf2(:))
410 !
411 ! Initialize evaporation components: variable definitions
412 ! depend on snow or explicit canopy scheme:
413 !
414 IF(omeb)THEN
415 !
416 ! MEB uses explicit snow scheme by default, but fluxes already aggregated
417 ! for snow and floods so no need to multiply by fractions here.
418 !
419  zlev(:) = plev(:)
420  zletr(:) = pletr(:)
421  zleg(:) = pleg(:)
422  zlegi(:) = plegi(:)
423  zpsnv(:) = 0.0
424 !
425  zevapcor(:) = pevapcor(:) + psubvcor(:)
426 !
427 ELSE
428 !
429 ! Initialize evaporation components: variable definitions
430 ! depend on snow scheme:
431 !
432  IF(hsnow_isba == '3-L' .OR. hsnow_isba == 'CRO' .OR. hisba == 'DIF')THEN
433  zlev(:) = (1.0-ppsnv(:)-pffv(:)) * plev(:)
434  zletr(:) = (1.0-ppsnv(:)-pffv(:)) * pletr(:)
435  zleg(:) = (1.0-ppsng(:)-pffg(:)) * pleg(:)
436  zlegi(:) = (1.0-ppsng(:)-pffg(:)) * plegi(:)
437  zpsnv(:) = 0.0
438  ELSE
439  zlev(:) = plev(:)
440  zletr(:) = pletr(:)
441  zleg(:) = pleg(:)
442  zlegi(:) = plegi(:)
443  zpsnv(:) = ppsnv(:)+pffv(:)
444  ENDIF
445 !
446  zevapcor(:) = pevapcor(:)
447 
448 ENDIF
449 !
450 ! Initialize average soil hydrological parameters
451 ! over the entire soil column: if Isba Force-Restore
452 ! is in use, then parameter profile is constant
453 ! so simply use first element of this array: if
454 ! the Diffusion option is in force, the relevant
455 ! calculation is done later within this routine.
456 !
457 IF(hisba == '2-L' .OR. hisba == '3-L')THEN
458  zwsat_avg(:) = pwsat(:,1)
459  zwwilt_avg(:) = pwwilt(:,1)
460  zwfc_avg(:) = pwfc(:,1)
461 ENDIF
462 !
463 IF (hisba == '3-L') THEN
464  zdg3(:) = pd_g(:,3)
465  zwg3(:) = pwg(:,3)
466 ELSE
467  zdg3(:) = xundef
468  zwg3(:) = xundef
469 END IF
470 !
471 !-------------------------------------------------------------------------------
472 !
473 !* 1. EVOLUTION OF THE EQUIVALENT WATER CONTENT Wr
474 ! --------------------------------------------
475 !
476 !
477 !
478 IF(.NOT.omeb)THEN ! Canopy Int & Irrig Already accounted for if MEB in use.
479 !
480  pirrig_flux(:)=0.0
481 !
482 !* add irrigation over vegetation to liquid precipitation (rr)
483 !
484 !
485  IF (SIZE(lirrigate)>0) THEN
486  WHERE (lirrigate(:) .AND. pirrig(:)>0. .AND. pirrig(:) /= xundef .AND. (pf2(:)<pthreshold(:)) )
487  pirrig_flux(:) = pwatsup(:) / xday
488  zrr(:) = zrr(:) + pwatsup(:) / xday
489  lirriday(:) = .true.
490  END WHERE
491  ENDIF
492 !
493 !* interception reservoir and dripping computation
494 !
495  CALL hydro_veg(hrain, ptstep, pmuf, &
496  zrr, zlev, zletr, pveg, zpsnv, &
497  pwr, pwrmax, zpg, pdrip, prrveg, plvtt )
498 !
499 !
500 !
501 ELSE
502 !
503 ! For MEB case, interception interactions already computed and PRR represents
504 ! water falling (drip and not intercepted by vegetation) outside of snow covered
505 ! areas. Part for snow covered areas (net outflow at base of snowpack) accounted
506 ! for in PSNOW_THRUFAL.
507 !
508  zpg(:) = prr(:)
509 !
510 ENDIF
511 !
512 !* add irrigation over ground to potential soil infiltration (pg)
513 !
514 pirrig_flux(:) = pirrig_flux(:) + pirrig_gr(:)
515 !
516 zpg(:) = zpg(:) + pirrig_gr(:)
517 !
518 !-------------------------------------------------------------------------------
519 !
520 !* 2. EVOLUTION OF THE EQUIVALENT WATER CONTENT snowSWE
521 ! -------------------------------------------------
522 !
523 !* 3. EVOLUTION OF SNOW ALBEDO
524 ! ------------------------
525 !
526 !* 4. EVOLUTION OF SNOW DENSITY
527 ! -------------------------
528 !
529 ! Boone and Etchevers '3-L' snow option
530 IF(hsnow_isba == '3-L' .OR. hsnow_isba == 'CRO' .OR. hisba == 'DIF')THEN
531 !
532  zpg_melt(:) = zpg_melt(:) + psnow_thrufal(:) ! [kg/(m2 s)]
533 !
534 ! Note that 'melt' is referred to as rain and meltwater
535 ! running off from the snowpack in a timestep for ISBA-ES,
536 ! not the actual amount of ice converted to liquid.
537 !
538  pmelt(:) = pmelt(:) + psnow_thrufal(:) ! [kg/(m2 s)]
539 !
540 ELSE
541  !
542  CALL hydro_snow(oglacier, ptstep, pvegtype, &
543  psr, ples, pmelt, &
544  psnowswe, psnowalb, psnowrho,zpg_melt)
545  !
546 ENDIF
547 !
548 !-------------------------------------------------------------------------------
549 !
550 !* 5. Sub Grid Hydrology
551 ! ------------------
552 !
553 ! - Dunne runoff : Dumenil et Todini (1992) or Topmodel
554 ! - Horton runoff : Direct or exponential precipitation distribution
555 ! - Floodplains interception and infiltration
556 !
557  CALL hydro_sgh(hisba,hrunoff,hrain,hhort, &
558  ptstep,pd_g,pdzg, &
559  pwsat,pwfc,pwwilt, &
560  pwg, pwgi, kwg_layer, &
561  zpg, zpg_melt, pmuf, &
562  pcondsat, pbcoef, &
563  pmpotsat, pksat_ice, pd_ice, &
564  pfsat, phorton, zdunne, pfflood, &
565  ppiflood, piflood, ppflood, &
566  prunoffb, prunoffd, pcg, &
567  psoilwght, oflood, klayer_hort, &
568  klayer_dun )
569 !
570 !-------------------------------------------------------------------------------
571 !
572 !* 6. EVOLUTION OF THE SOIL WATER CONTENT
573 ! -----------------------------------
574 !
575 !* 7. EFFECT OF MELTING/FREEZING ON SOIL ICE AND LIQUID WATER CONTENTS
576 ! ----------------------------------------------------------------
577 !
578 !* 8. DRAINAGE FROM THE DEEP SOIL
579 ! ---------------------------
580 !
581 !* 9. RUN-OFF
582 ! -------
583 ! when the soil water exceeds saturation,
584 ! there is fast-time-response runoff
585 !
586 !
587 ! -----------------------------------------------------------------
588 ! Time splitting parameter for *very large time steps* since Richard
589 ! and/or soil freezing equations are very non-linear
590 ! NOTE for NWP/GCM type applications, the time step is generally not split
591 ! (usually just for offline applications with a time step on order of
592 ! 15 minutes to an hour for example)
593 ! ------------------------------------------------------------------
594 !
595 indt = 1
596 IF(ptstep>=ztimemax)THEN
597  indt = max(2,nint(ptstep/ztimemax))
598 ENDIF
599 !
600 ztstep = ptstep/REAL(indt)
601 !
602 ! ------------------------------------------------------------------
603 ! The values for the two coefficients (multiplied by VEG and LAI)
604 ! in the expression below are from
605 ! Giard and Bazile (2000), Mon. Wea. Rev.: they model the effect of insolation due to
606 ! vegetation cover. This used by both 'DEF' (code blocks 3.-4.) and 'DIF' options.
607 ! ------------------------------------------------------------------
608 !
609 WHERE(plai(:)/=xundef .AND. pveg(:)/=0.)
610  zksfc_iveg(:) = (1.0-zinsolfrz_veg*pveg(:)) * (1.0-(plai(:)/zinsolfrz_lai))
611 ELSEWHERE
612  zksfc_iveg(:) = 1.0 ! No vegetation
613 ENDWHERE
614 !
615 !
616 zwgi0(:,:) = pwgi(:,:) ! save initial ice content before phase changes and sublimation
617 !
618 IF (hisba=='DIF') THEN
619 !
620  ini = SIZE(pd_g(:,:),1)
621  inl = maxval(kwg_layer(:))
622 !
623 ! Initialize some field
624 ! ---------------------
625 !
626  zps(:,:)=xundef
627  zti(:,:)=xundef
628  DO jl=1,inl
629  DO jj=1,ini
630  idepth=kwg_layer(jj)
631  IF(jl<=idepth)THEN
632  zps(jj,jl) = pps(jj)
633  zti(jj,jl) = min(xtt,ptg(jj,jl))
634  ENDIF
635  ENDDO
636  ENDDO
637 !
638 ! Compute specific humidity at saturation for the vapor conductivity
639 ! ------------------------------------------------------------------
640 !
641  zqsat(:,:) = qsat(ptg(:,:),zps(:,:),kwg_layer(:),inl)
642  zqsati(:,:) = qsati(zti(:,:),zps(:,:),kwg_layer(:),inl)
643 !
644 ! Soil water sink terms: convert from (W m-2) and (kg m-2 s-1) to (m s-1)
645 ! ------------------------------------------------------------------
646 !
647  zpg(:) = zpg(:) / xrholw
648  zevapcor(:) = zevapcor(:) / xrholw
649  zleg(:) = zleg(:) /(xrholw*plvtt(:))
650  zletr(:) = (zletr(:)/zf2(:))/(xrholw*plvtt(:))
651  zlegi(:) = zlegi(:) /(xrholw*plstt(:))
652 !
653  DO jdt = 1,indt
654 !
655  CALL hydro_soildif(hrunoff, hhort, ztstep, &
656  pbcoef, pwsat, pcondsat, pmpotsat, pwfc, &
657  pd_g, pdzg, pdzdif, zpg, zletr, zleg, zevapcor, &
658  pf2wght, pwg, pwgi, ptg, pps, zqsat, zqsati, &
659  zdrain, zhorton, pfsat, kwg_layer, inl, &
660  klayer_hort, ptopqs, zqsb, pfwtd, pwtd )
661 !
662  CALL ice_soildif(ztstep, ptauice, zksfc_iveg, zlegi, &
663  psoilhcapz, pwsat, pmpotsat, pbcoef, &
664  ptg, pwgi, pwg, kwg_layer, &
665  pdzg, zwgi_excess )
666 !
667  pdrain(:) = pdrain(:) + (zdrain(:)+zqsb(:)+zwgi_excess(:))/REAL(indt)
668  pqsb(:) = pqsb(:) + zqsb(:)/REAL(indt)
669  phorton(:) = phorton(:) + zhorton(:)/REAL(indt)
670 !
671 ! Output diagnostics:
672 ! Compute latent heating from phase change only in surface layer and total soil column,
673 ! then adjust surface and total soil heat content to maintain balance.
674 !
675  pdelphaseg_sfc(:) = (pwgi(:,1)-zwgi0(:,1))*(xlmtt*xrholw/ptstep)*pdzg(:,1) + zlegi(:)*(xrholw*xlstt)
676  pdelphaseg(:) = pdelphaseg_sfc(:)
677  DO jl=2,inl
678  DO jj=1,ini
679  pdelphaseg(jj) = pdelphaseg(jj) + (pwgi(jj,jl)-zwgi0(jj,jl))*(xlmtt*xrholw/ptstep)*pdzg(jj,jl)
680  ENDDO
681  ENDDO
682  pdelheatg_sfc(:) = pdelheatg_sfc(:) + pdelphaseg_sfc(:)
683  pdelheatg(:) = pdelheatg(:) + pdelphaseg(:)
684 
685  ENDDO
686 !
687 ELSE
688 !
689  DO jdt = 1,indt
690 !
691 ! Only layer 1 and 2 are used for soil freezing (ZWG3 not used)
692  CALL ice_soilfr(hsnow_isba, hsoilfrz, ztstep, zksfc_iveg, pcg, pct, &
693  ppsng, pffg, ptauice, zdwgi1, zdwgi2, pwsat, &
694  pmpotsat, pbcoef, pd_g, ptg, pwgi, pwg )
695 !
696  CALL hydro_soil(hisba, &
697  ztstep, &
698  zletr, zleg, zpg, zevapcor, &
699  pwdrain, &
700  pc1, pc2, pc3, pc4b, pc4ref, pwgeq, &
701  pd_g(:,2), zdg3, zwsat_avg, zwfc_avg, &
702  zdwgi1, zdwgi2, zlegi, pd_g(:,1), pcg, pct, &
703  ptg(:,1), ptg(:,2), &
704  pwg(:,1), pwg(:,2), zwg3(:), &
705  pwgi(:,1), pwgi(:,2), &
706  zrunoff,zdrain,hksat,zwwilt_avg )
707 !
708  pdrain(:) = pdrain(:) + zdrain(:)/REAL(indt)
709  prunoff(:) = prunoff(:) + zrunoff(:)/REAL(indt)
710 !
711  ENDDO
712 !
713 ! Output diagnostics:
714 ! Compute latent heating from phase change only in surface layer and total soil column,
715 ! then adjust surface and total soil heat content to maintain balance.
716 !
717  pdelphaseg_sfc(:) = (pwgi(:,1)-zwgi0(:,1))*(xlmtt*xrholw/ptstep)*pd_g(:,1) + zlegi(:)
718  pdelphaseg(:) = (pwgi(:,2)-zwgi0(:,2))*(xlmtt*xrholw/ptstep)*pd_g(:,2)
719  pdelheatg_sfc(:) = pdelheatg_sfc(:) + pdelphaseg_sfc(:)
720  pdelheatg(:) = pdelheatg(:) + pdelphaseg(:)
721 !
722  IF (hisba == '3-L') pwg(:,3) = zwg3(:)
723 !
724 #ifdef TOPD
725  IF (lcoupl_topd) THEN
726  !runoff topo cumule (kg/mē)
727  DO jj=1,SIZE(nmaskt_patch)
728  IF (nmaskt_patch(jj)/=0) THEN
729  IF ( xatop(nmaskt_patch(jj))/=xundef) THEN
730  xrunoff_top(nmaskt_patch(jj)) = xrunoff_top(nmaskt_patch(jj)) + &
731  (prunoff(jj)+ phorton(jj))*xatop(nmaskt_patch(jj))*ptstep
732  IF (hrunoff=='TOPD') THEN
733  xrunoff_top(nmaskt_patch(jj)) = xrunoff_top(nmaskt_patch(jj)) + zdunne(jj)*ptstep
734  ELSE
735  ! ZDUNNE contains only saturated pixels on mesh so only catchment
736  xrunoff_top(nmaskt_patch(jj)) = xrunoff_top(nmaskt_patch(jj)) + zdunne(jj)*xatop(nmaskt_patch(jj))*ptstep
737  ENDIF
738  ENDIF
739  ENDIF
740  ! ZDUNNE concerns all the mesh so not only catchment =>*XATOP
741  ENDDO
742  ENDIF
743 #endif
744  !
745 ENDIF
746 !
747 !-------------------------------------------------------------------------------
748 !
749 ! Add sub-grid surface and subsurface runoff to saturation excess:
750 !
751 prunoff(:) = prunoff(:) + zdunne(:) + phorton(:)
752 !
753 !-------------------------------------------------------------------------------
754 !
755 IF (lhook) CALL dr_hook('HYDRO',1,zhook_handle)
756 !
757 !-------------------------------------------------------------------------------
758 !
759 END SUBROUTINE hydro
subroutine hydro_snow(OGLACIER, PTSTEP, PVEGTYPE, PSR, PLES, PMELT, PSNOWSWE, PSNOWALB, PSNOWRHO, PPG_MELT)
Definition: hydro_snow.F90:6
subroutine hydro_veg(HRAIN, PTSTEP, PMUF, PRR, PLEV, PLETR, PVEG, PPSNV, PWR, PWRMAX, PPG, PDRIP, PRRVEG, PLVTT)
Definition: hydro_veg.F90:6
subroutine hydro_soil(HISBA, PTSTEP, PLETR, PLEG, PPG, PEVAPCOR, PWDRAIN, PC1, PC2, PC3, PC4B, PC4REF, PWGEQ, PD_G2, PD_G3, PWSAT, PWFC, PDWGI1, PDWGI2, PLEGI, PD_G1, PCG, PCT, PTG, PTG2, PWG1, PWG2, PWG3, PWGI1, PWGI2, PRUNOFF, PDRAIN, HKSAT, PWWILT)
Definition: hydro_soil.F90:6
subroutine ice_soildif(PTSTEP, PTAUICE, PKSFC_IVEG, PLEGI, PSOILHCAPZ, PWSATZ, PMPOTSATZ, PBCOEFZ, PTG, PWGI, PWG, KWG_LAYER, PDZG, PWGI_EXCESS)
Definition: ice_soildif.F90:6
subroutine ice_soilfr(HSNOW_ISBA, HSOILFRZ, PTSTEP, PKSFC_IVEG, PCG, PCT, PPSNG, PFFG, PTAUICE, PDWGI1, PDWGI2, PWSATZ, PMPOTSATZ, PBCOEFZ, PD_G, PTG, PWGI, PWG)
Definition: ice_soilfr.F90:5
subroutine hydro_sgh(HISBA, HRUNOFF, HRAIN, HHORT, PTSTEP, PD_G, PDZG, PWSAT, PWFC, PWWILT, PWG, PWGI, KWG_LAYER, PPG, PPG_MELT, PMUF, PCONDSAT, PBCOEF, PMPOTSAT, PKSAT_ICE, PD_ICE, PFSAT, PHORTON, PDUNNE, PFFLOOD, PPIFLOOD, PIFLOOD, PPFLOOD, PRUNOFFB, PRUNOFFD, PCG, PSOILWGHT, OFLOOD, KLAYER_HORT, KLAYER_DUN)
Definition: hydro_sgh.F90:6
subroutine hydro_soildif(HRUNOFF, HHORT, PTSTEP, PBCOEF, PWSAT, PCONDSAT, PMPOTSAT, PWFC, PDG, PDZG, PDZDIF, PPG, PLETR, PLEG, PEVAPCOR, PF2WGHT, PWG, PWGI, PTG, PPS, PQSAT, PQSATI, PDRAIN, PHORTON, PFSAT, KWG_LAYER, KMAX_LAYER, KLAYER_HORT, PTOPQS, PQSB, PFWTD, PWTD)
subroutine hydro(HISBA, HSNOW_ISBA, HRUNOFF, HSOILFRZ, OMEB, OGLACIER, OFLOOD, PTSTEP, PVEGTYPE, PRR, PSR, PLEV, PLETR, PLEG, PLES, PRUNOFFB, PWDRAIN, PC1, PC2, PC3, PC4B, PC4REF, PWGEQ, PCG, PCT, PVEG, PLAI, PWRMAX, PMELT, PTAUICE, PLEGI, PRUNOFFD, PSOILWGHT, KLAYER_HORT, KLAYER_DUN, PPSNV, PPSNG, PSNOW_THRUFAL, PEVAPCOR, PSUBVCOR, PWR, PSOILHCAPZ, PSNOWSWE, PSNOWALB, PSNOWRHO, PBCOEF, PWSAT, PCONDSAT, PMPOTSAT, PWFC, PWWILT, PF2WGHT, PF2, PD_G, PDZG, PDZDIF, PPS, PWG, PWGI, PTG, KWG_LAYER, PDRAIN, PRUNOFF, PTOPQS, PIRRIG, PWATSUP, PTHRESHOLD, LIRRIDAY, LIRRIGATE, HKSAT, HRAIN, HHORT, PMUF, PFSAT, PKSAT_ICE, PD_ICE, PHORTON, PDRIP, PFFG, PFFV, PFFLOOD, PPIFLOOD, PIFLOOD, PPFLOOD, PRRVEG, PIRRIG_FLUX, PIRRIG_GR, PQSB, PFWTD, PWTD, PDELHEATG, PDELHEATG_SFC, PDELPHASEG, PDELPHASEG_SFC, PLVTT, PLSTT)
Definition: hydro.F90:6