SURFEX v8.1
General documentation of Surfex
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(IO, KK, PK, PEK, AG, DEK, DMK, OMEB, PTSTEP, PVEG, &
7  PWRMAX, PSNOW_THRUFAL, PEVAPCOR, PSUBVCOR, PSOILHCAPZ, &
8  PF2WGHT, PF2, PPS, PIRRIG_GR, PDELHEATG, PDELHEATG_SFC,&
9  PDELPHASEG, PDELPHASEG_SFC )
10 ! #####################################################################
11 !
12 !!**** *HYDRO*
13 !!
14 !! PURPOSE
15 !! -------
16 !
17 ! Calculates the evolution of the water variables, i.e., the superficial
18 ! and deep-soil volumetric water content (wg and w2), the equivalent
19 ! liquid water retained in the vegetation canopy (Wr), the equivalent
20 ! water of the snow canopy (Ws), and also of the albedo and density of
21 ! the snow (i.e., SNOWALB and SNOWRHO). Also determine the runoff and drainage
22 ! into the soil.
23 !
24 !
25 !!** METHOD
26 !! ------
27 !
28 !! EXTERNAL
29 !! --------
30 !!
31 !! none
32 !!
33 !! IMPLICIT ARGUMENTS
34 !! ------------------
35 !!
36 !!
37 !!
38 !! REFERENCE
39 !! ---------
40 !!
41 !! Noilhan and Planton (1989)
42 !! Belair (1995)
43 !!
44 !! AUTHOR
45 !! ------
46 !!
47 !! S. Belair * Meteo-France *
48 !!
49 !! MODIFICATIONS
50 !! -------------
51 !!
52 !! Original 14/03/95
53 !! 31/08/98 (V. Masson and F. Habets) add Dumenil et Todini
54 !! runoff scheme
55 !! 31/08/98 (V. Masson and A. Boone) add the third soil-water
56 !! reservoir (WG3,D3)
57 !! 19/07/05 (P. LeMoigne) bug in runoff computation if isba-2L
58 !! 10/10/05 (P. LeMoigne) bug in hydro-soil calling sequence
59 !! 25/05/08 (B. Decharme) Add floodplains
60 !! 27/11/09 (A. Boone) Add possibility to do time-splitting when
61 !! calling hydro_soildif (DIF option only)
62 !! for *very* large time steps (30min to 1h+).
63 !! For *usual* sized time steps, time step
64 !! NOT split.
65 !! 08/11 (B. Decharme) DIF optimization
66 !! 09/12 (B. Decharme) Bug in wg2 ice energy budget
67 !! 10/12 (B. Decharme) EVAPCOR snow correction in DIF
68 !! Add diag IRRIG_FLUX
69 !! 04/13 (B. Decharme) Pass soil phase changes routines here
70 !! Apply physical limits on wg in hydro_soil.F90
71 !! Subsurface runoff if SGH (DIF option only)
72 !! water table / surface coupling
73 !! 02/2013 (C. de Munck) specified irrigation rate of ground added
74 !! 10/2014 (A. Boone) MEB added
75 !! 07/15 (B. Decharme) Numerical adjustement for F2 soilstress function
76 !! 03/16 (B. Decharme) Limit flood infiltration
77 !-------------------------------------------------------------------------------
78 !
79 !* 0. DECLARATIONS
80 ! ------------
81 !
84 USE modd_agri_n, ONLY : agri_t
87 !
88 USE modd_csts, ONLY : xrholw, xday, xtt, xlstt, xlmtt
89 USE modd_isba_par, ONLY : xwgmin, xdenom_min
90 USE modd_surf_par, ONLY : xundef, nundef
91 !
92 #ifdef TOPD
94 #endif
95 !
96 USE modi_hydro_veg
97 USE modi_hydro_snow
98 USE modi_hydro_soil
99 USE modi_hydro_soildif
100 USE modi_hydro_sgh
101 USE modi_ice_soildif
102 USE modi_ice_soilfr
103 !
104 USE mode_thermos
105 !
106 USE yomhook ,ONLY : lhook, dr_hook
107 USE parkind1 ,ONLY : jprb
108 !
109 IMPLICIT NONE
110 !
111 !* 0.1 declarations of arguments
112 !
113 !
114 TYPE(isba_options_t), INTENT(INOUT) :: IO
115 TYPE(isba_k_t), INTENT(INOUT) :: KK
116 TYPE(isba_p_t), INTENT(INOUT) :: PK
117 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
118 TYPE(agri_t), INTENT(INOUT) :: AG
119 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DEK
120 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
121 !
122 LOGICAL, INTENT(IN) :: OMEB ! True = patch with multi-energy balance
123 ! ! False = patch with classical (composite) ISBA
124 REAL, INTENT(IN) :: PTSTEP
125 ! timestep of the integration
126 !
127 REAL, DIMENSION(:), INTENT(IN) :: PVEG, PWRMAX
128 ! PVEG = fraction of vegetation
129 ! PWRMAX = maximum equivalent water content
130 ! in the vegetation canopy
131 !
132 REAL, DIMENSION(:), INTENT(IN) :: PSNOW_THRUFAL, PEVAPCOR, PSUBVCOR
133 ! PSNOW_THRUFAL = rate that liquid water leaves snow pack:
134 ! *ISBA-ES* [kg/(m2 s)]
135 ! PEVAPCOR = correction if evaporation from snow exceeds
136 ! actual amount on the surface [kg/(m2 s)]
137 ! PSUBVCOR = correction if sublimation from snow intercepted
138 ! on the MEB canopy exceeds snow available as it
139 ! disappears [kg/(m2 s)]
140 !
141 REAL, DIMENSION(:), INTENT(IN) :: PPS, PF2
142 ! PPS = surface pressure (Pa)
143 ! PF2 = total water stress factor (-)
144 !
145 REAL, DIMENSION(:,:), INTENT(IN) :: PF2WGHT
146 ! PF2WGHT = water stress factor (profile) (-)
147 !
148 REAL, DIMENSION(:,:), INTENT(IN) :: PSOILHCAPZ
149 ! PSOILHCAPZ = ISBA-DF Soil heat capacity profile [J/(m3 K)]
150 !
151 REAL, DIMENSION(:), INTENT(INOUT) :: PDELHEATG, PDELHEATG_SFC
152 ! PDELHEATG_SFC = change in heat storage of the surface soil layer over the current time step (W m-2)
153 ! PDELHEATG = change in heat storage of the entire soil column over the current time step (W m-2)
154 !
155 REAL, DIMENSION(:), INTENT(OUT) :: PDELPHASEG, PDELPHASEG_SFC
156 ! PDELPHASEG = latent heating due to soil freeze-thaw in the entire soil column (W m-2)
157 ! PDELPHASEG_SFC = latent heating due to soil freeze-thaw in the surface soil layer (W m-2)
158 !
159 REAL ,DIMENSION(:),INTENT(IN) :: PIRRIG_GR ! ground irrigation rate (kg/m2/s)
160 !
161 !* 0.2 declarations of local variables
162 !
163 !
164 INTEGER :: JJ, JL ! loop control
165 INTEGER :: INDT, JDT ! Time splitting indicies
166 INTEGER :: INJ, INL, IDEKTH ! (ISBA-DF option)
167 !
168 REAL :: ZTSTEP ! maximum time split time step (<= PTSTEP)
169 ! ! ONLY used for DIF option.
170 !
171 REAL, DIMENSION(SIZE(PVEG)) :: ZPG, ZPG_MELT, ZDUNNE, &
172  ZLEV, ZLEG, ZLEGI, ZLETR, ZPSNV, &
173  ZRR, ZDG3, ZWG3, ZWSAT_AVG, ZWWILT_AVG, ZWFC_AVG, &
174  ZRUNOFF, ZDRAIN, ZHORTON, ZEVAPCOR, ZQSB
175 ! Prognostic variables of ISBA at 't-dt'
176 ! ZPG = total water reaching the ground
177 ! ZPG_MELT = snowmelt reaching the ground
178 ! ZDUNNE = Dunne runoff
179 ! ZLEV, ZLEG, ZLEGI, ZLETR = Evapotranspiration amounts
180 ! from the non-explicit snow area *ISBA-ES*
181 ! ZPSNV = used to calculate interception of liquid
182 ! water by the vegetation in FR snow method:
183 ! For ES snow method, precipitation already modified
184 ! so set this to zero here for this option.
185 ! ZWSAT_AVG, ZWWILT_AVG, ZWFC_AVG = Average water and ice content
186 ! values over the soil depth D2 (for calculating surface runoff)
187 ! ZDG3, ZWG3, ZRUNOFF, ZDRAIN, ZQSB and ZHORTON are working variables only used for DIF option
188 ! ZEVAPCOR = correction if evaporation from snow exceeds
189 ! actual amount on the surface [m/s]
190 !
191 REAL, DIMENSION(SIZE(PVEG)) :: ZDWGI1, ZDWGI2, ZKSFC_IVEG
192 ! ZDWGI1 = surface layer liquid water equivalent
193 ! volumetric ice content time tendency
194 ! ZDWGI2 = deep-soil layer liquid water equivalent
195 ! volumetric ice content time tendency
196 ! ZKSFC_IVEG = non-dimensional vegetation insolation coefficient
197 !
198 REAL, DIMENSION(SIZE(PVEG)) :: ZWGI_EXCESS, ZF2
199 ! ZWGI_EXCESS = Soil ice excess water content
200 ! ZF2 = Soilstress function for transpiration
201 !
202 REAL, DIMENSION(SIZE(PEK%XWG,1),SIZE(PEK%XWG,2)) :: ZQSAT, ZQSATI, ZTI, ZPS
203 ! For specific humidity at saturation computation (ISBA-DIF)
204 !
205 REAL, DIMENSION(SIZE(PEK%XWG,1),SIZE(PEK%XWG,2)) :: ZWGI0
206 ! ZWGI0 = initial soil ice content (m3 m-3) before update
207 ! for budget diagnostics
208 !
209 !* 0.3 declarations of local parameters
210 !
211 REAL, PARAMETER :: ZINSOLFRZ_VEG = 0.20 ! (-) Vegetation insolation coefficient
212 !
213 REAL, PARAMETER :: ZINSOLFRZ_LAI = 30.0 ! (m2 m-2) Vegetation insolation coefficient
214 
215 REAL, PARAMETER :: ZTIMEMAX = 900. ! s Maximum timescale without time spliting
216 !
217 REAL(KIND=JPRB) :: ZHOOK_HANDLE
218 !-------------------------------------------------------------------------------
219 !
220 !* 0. Initialization:
221 ! ---------------
222 !
223 IF (lhook) CALL dr_hook('HYDRO',0,zhook_handle)
224 !
225 
226 jdt = 0
227 indt = 0
228 ztstep = 0.0
229 !
230 zpg(:) = 0.0
231 zpg_melt(:) = 0.0
232 zdunne(:) = 0.0
233 !
234 zwsat_avg(:) = 0.0
235 zwwilt_avg(:) = 0.0
236 zwfc_avg(:) = 0.0
237 !
238 zrr(:) = dmk%XRRSFC(:)
239 !
240 zdrain(:) = 0.
241 zhorton(:) = 0.
242 zrunoff(:) = 0.
243 zwgi_excess(:) = 0.
244 zevapcor(:) = 0.
245 zqsb(:) = 0.
246 !
247 dek%XDRAIN(:) = 0.
248 dek%XRUNOFF(:) = 0.
249 dek%XHORT(:) = 0.
250 dek%XQSB (:) = 0.
251 !
252 pdelphaseg(:) = 0.0
253 pdelphaseg_sfc(:)= 0.0
254 zwgi0(:,:) = 0.0
255 !
256 zf2(:) = max(xdenom_min,pf2(:))
257 !
258 ! Initialize evaporation components: variable definitions
259 ! depend on snow or explicit canopy scheme:
260 !
261 IF(omeb)THEN
262 !
263 ! MEB uses explicit snow scheme by default, but fluxes already aggregated
264 ! for snow and floods so no need to multiply by fractions here.
265 !
266  zlev(:) = dek%XLEV(:)
267  zletr(:) = dek%XLETR(:)
268  zleg(:) = dek%XLEG(:)
269  zlegi(:) = dek%XLEGI(:)
270  zpsnv(:) = 0.0
271 !
272  zevapcor(:) = pevapcor(:) + psubvcor(:)
273 !
274 ELSE
275 !
276 ! Initialize evaporation components: variable definitions
277 ! depend on snow scheme:
278 !
279  IF(pek%TSNOW%SCHEME == '3-L' .OR. pek%TSNOW%SCHEME == 'CRO' .OR. io%CISBA == 'DIF')THEN
280  zlev(:) = (1.0-pek%XPSNV(:)-kk%XFFV(:)) * dek%XLEV(:)
281  zletr(:) = (1.0-pek%XPSNV(:)-kk%XFFV(:)) * dek%XLETR(:)
282  zleg(:) = (1.0-pek%XPSNG(:)-kk%XFFG(:)) * dek%XLEG(:)
283  zlegi(:) = (1.0-pek%XPSNG(:)-kk%XFFG(:)) * dek%XLEGI(:)
284  zpsnv(:) = 0.0
285  ELSE
286  zlev(:) = dek%XLEV(:)
287  zletr(:) = dek%XLETR(:)
288  zleg(:) = dek%XLEG(:)
289  zlegi(:) = dek%XLEGI(:)
290  zpsnv(:) = pek%XPSNV(:)+kk%XFFV(:)
291  ENDIF
292 !
293  zevapcor(:) = pevapcor(:)
294 
295 ENDIF
296 !
297 ! Initialize average soil hydrological parameters
298 ! over the entire soil column: if Isba Force-Restore
299 ! is in use, then parameter profile is constant
300 ! so simply use first element of this array: if
301 ! the Diffusion option is in force, the relevant
302 ! calculation is done later within this routine.
303 !
304 IF(io%CISBA == '2-L' .OR. io%CISBA == '3-L')THEN
305  zwsat_avg(:) = kk%XWSAT(:,1)
306  zwwilt_avg(:) = kk%XWWILT(:,1)
307  zwfc_avg(:) = kk%XWFC(:,1)
308 ENDIF
309 !
310 IF (io%CISBA == '3-L') THEN
311  zdg3(:) = pk%XDG(:,3)
312  zwg3(:) = pek%XWG(:,3)
313 ELSE
314  zdg3(:) = xundef
315  zwg3(:) = xundef
316 END IF
317 !
318 !-------------------------------------------------------------------------------
319 !
320 !* 1. EVOLUTION OF THE EQUIVALENT WATER CONTENT Wr
321 ! --------------------------------------------
322 !
323 !
324 !
325 IF(.NOT.omeb)THEN ! Canopy Int & Irrig Already accounted for if MEB in use.
326 !
327  dek%XIRRIG_FLUX(:)=0.0
328 !
329 !* add irrigation over vegetation to liquid precipitation (rr)
330 !
331 !
332  IF (ASSOCIATED(ag%LIRRIGATE)) THEN
333  IF (SIZE(ag%LIRRIGATE)>0) THEN
334  WHERE (ag%LIRRIGATE(:) .AND. pek%XIRRIG(:)>0. .AND. pek%XIRRIG(:) /= xundef .AND. (pf2(:)<ag%XTHRESHOLDSPT(:)) )
335  dek%XIRRIG_FLUX(:) = pek%XWATSUP(:) / xday
336  zrr(:) = zrr(:) + pek%XWATSUP(:) / xday
337  ag%LIRRIDAY(:) = .true.
338  END WHERE
339  ENDIF
340  ENDIF
341 !
342 !* interception reservoir and dripping computation
343 !
344  CALL hydro_veg(io%CRAIN, ptstep, kk%XMUF, zrr, zlev, zletr, pveg, &
345  zpsnv, pek%XWR(:), pwrmax, zpg, dek%XDRIP, dek%XRRVEG, pk%XLVTT )
346 !
347 ELSE
348 !
349 ! For MEB case, interception interactions already computed and DMK%XRRSFC represents
350 ! water falling (drip and not intercepted by vegetation) outside of snow covered
351 ! areas. Part for snow covered areas (net outflow at base of snowpack) accounted
352 ! for in PSNOW_THRUFAL.
353 !
354  zpg(:) = dmk%XRRSFC(:)
355 !
356 ENDIF
357 !
358 !* add irrigation over ground to potential soil infiltration (pg)
359 !
360 dek%XIRRIG_FLUX(:) = dek%XIRRIG_FLUX(:) + pirrig_gr(:)
361 !
362 zpg(:) = zpg(:) + pirrig_gr(:)
363 !
364 !-------------------------------------------------------------------------------
365 !
366 !* 2. EVOLUTION OF THE EQUIVALENT WATER CONTENT snowSWE
367 ! -------------------------------------------------
368 !
369 !* 3. EVOLUTION OF SNOW ALBEDO
370 ! ------------------------
371 !
372 !* 4. EVOLUTION OF SNOW DENSITY
373 ! -------------------------
374 !
375 ! Boone and Etchevers '3-L' snow option
376 IF(pek%TSNOW%SCHEME == '3-L' .OR. pek%TSNOW%SCHEME == 'CRO' .OR. io%CISBA == 'DIF')THEN
377 !
378  zpg_melt(:) = zpg_melt(:) + psnow_thrufal(:) ! [kg/(m2 s)]
379 !
380 ! Note that 'melt' is referred to as rain and meltwater
381 ! running off from the snowpack in a timestep for ISBA-ES,
382 ! not the actual amount of ice converted to liquid.
383 !
384  dek%XMELT(:) = dek%XMELT(:) + psnow_thrufal(:) ! [kg/(m2 s)]
385 !
386 ELSE
387  !
388  CALL hydro_snow(io%LGLACIER, ptstep, pk%XVEGTYPE_PATCH(:,:), dmk%XSRSFC, &
389  dek%XLES, dek%XMELT, pek%TSNOW, zpg_melt)
390  !
391 ENDIF
392 !
393 !-------------------------------------------------------------------------------
394 !
395 !* 5. Sub Grid Hydrology
396 ! ------------------
397 !
398 ! - Dunne runoff : Dumenil et Todini (1992) or Topmodel
399 ! - Horton runoff : Direct or exponential precipitation distribution
400 ! - Floodplains interception and infiltration
401 !
402  CALL hydro_sgh(io, kk, pk, pek, dek, dmk, ptstep, zpg, zpg_melt, zdunne )
403 !
404 !----------------------------------------------------------------------------
405 !
406 !* 6. EVOLUTION OF THE SOIL WATER CONTENT
407 ! -----------------------------------
408 !
409 !* 7. EFFECT OF MELTING/FREEZING ON SOIL ICE AND LIQUID WATER CONTENTS
410 ! ----------------------------------------------------------------
411 !
412 !* 8. DRAINAGE FROM THE DEEP SOIL
413 ! ---------------------------
414 !
415 !* 9. RUN-OFF
416 ! -------
417 ! when the soil water exceeds saturation,
418 ! there is fast-time-response runoff
419 !
420 !
421 ! -----------------------------------------------------------------
422 ! Time splitting parameter for *very large time steps* since Richard
423 ! and/or soil freezing equations are very non-linear
424 ! NOTE for NWP/GCM type applications, the time step is generally not split
425 ! (usually just for offline applications with a time step on order of
426 ! 15 minutes to an hour for example)
427 ! ------------------------------------------------------------------
428 !
429 indt = 1
430 IF(ptstep>=ztimemax)THEN
431  indt = max(2,nint(ptstep/ztimemax))
432 ENDIF
433 !
434 ztstep = ptstep/REAL(indt)
435 !
436 ! ------------------------------------------------------------------
437 ! The values for the two coefficients (multiplied by VEG and LAI)
438 ! in the expression below are from
439 ! Giard and Bazile (2000), Mon. Wea. Rev.: they model the effect of insolation due to
440 ! vegetation cover. This used by both 'DEF' (code blocks 3.-4.) and 'DIF' options.
441 ! ------------------------------------------------------------------
442 !
443 WHERE(pek%XLAI(:)/=xundef .AND. pveg(:)/=0.)
444  zksfc_iveg(:) = (1.0-zinsolfrz_veg*pveg(:)) * min(max(1.0-(pek%XLAI(:)/zinsolfrz_lai),0.0),1.0)
445 ELSEWHERE
446  zksfc_iveg(:) = 1.0 ! No vegetation
447 ENDWHERE
448 !
449 !
450 zwgi0(:,:) = pek%XWGI(:,:) ! save initial ice content before phase changes and sublimation
451 !
452 IF (io%CISBA=='DIF') THEN
453 !
454  inj = SIZE(pk%XDG(:,:),1)
455  inl = maxval(pk%NWG_LAYER(:))
456 !
457 ! Initialize some field
458 ! ---------------------
459 !
460  zps(:,:)=xundef
461  zti(:,:)=xundef
462  DO jl=1,inl
463  DO jj=1,inj
464  idekth=pk%NWG_LAYER(jj)
465  IF(jl<=idekth)THEN
466  zps(jj,jl) = pps(jj)
467  zti(jj,jl) = min(xtt,pek%XTG(jj,jl))
468  ENDIF
469  ENDDO
470  ENDDO
471 !
472 ! Compute specific humidity at saturation for the vapor conductivity
473 ! ------------------------------------------------------------------
474 !
475  zqsat(:,:) = qsat(pek%XTG,zps,pk%NWG_LAYER,inl)
476  zqsati(:,:) = qsati(zti,zps,pk%NWG_LAYER,inl)
477 !
478 ! Soil water sink terms: convert from (W m-2) and (kg m-2 s-1) to (m s-1)
479 ! ------------------------------------------------------------------
480 !
481  zpg(:) = zpg(:) / xrholw
482  zevapcor(:) = zevapcor(:) / xrholw
483  zleg(:) = zleg(:) /(xrholw*pk%XLVTT(:))
484  zletr(:) = (zletr(:)/zf2(:))/(xrholw*pk%XLVTT(:))
485  zlegi(:) = zlegi(:) /(xrholw*pk%XLSTT(:))
486 !
487  DO jdt = 1,indt
488 !
489  CALL hydro_soildif(io, kk, pk, pek, ztstep, zpg, zletr, zleg, zevapcor, &
490  pf2wght, pps, zqsat, zqsati, zdrain, zhorton, inl, zqsb )
491 !
492 
493  CALL ice_soildif(kk, pk, pek, ztstep, zksfc_iveg, zlegi, psoilhcapz, zwgi_excess )
494 !
495  dek%XDRAIN(:) = dek%XDRAIN(:) + (zdrain(:)+zqsb(:)+zwgi_excess(:))/REAL(indt)
496  dek%XQSB (:) = dek%XQSB (:) + zqsb(:)/REAL(indt)
497  dek%XHORT (:) = dek%XHORT (:) + zhorton(:)/REAL(indt)
498 !
499 ! Output diagnostics:
500 ! Compute latent heating from phase change only in surface layer and total soil column,
501 ! then adjust surface and total soil heat content to maintain balance.
502 !
503  pdelphaseg_sfc(:) = (pek%XWGI(:,1)-zwgi0(:,1))*(xlmtt*xrholw/ptstep)*pk%XDZG(:,1) + &
504  zlegi(:)*(xrholw*xlstt)
505  pdelphaseg(:) = pdelphaseg_sfc(:)
506  DO jl=2,inl
507  DO jj=1,inj
508  pdelphaseg(jj) = pdelphaseg(jj) + (pek%XWGI(jj,jl)-zwgi0(jj,jl))*&
509  (xlmtt*xrholw/ptstep)*pk%XDZG(jj,jl)
510  ENDDO
511  ENDDO
512  pdelheatg_sfc(:) = pdelheatg_sfc(:) + pdelphaseg_sfc(:)
513  pdelheatg(:) = pdelheatg(:) + pdelphaseg(:)
514 
515  ENDDO
516 !
517 ELSE
518 !
519  DO jdt = 1,indt
520 !
521 ! Only layer 1 and 2 are used for soil freezing (ZWG3 not used)
522  CALL ice_soilfr(io, kk, pk, pek, dmk, ztstep, zksfc_iveg, zdwgi1, zdwgi2)
523 !
524  CALL hydro_soil(io, kk, pk, pek, dmk, ztstep, zletr, zleg, zpg, zevapcor, zdg3, &
525  zwsat_avg, zwfc_avg, zdwgi1, zdwgi2, zlegi, zwg3, zrunoff, zdrain, zwwilt_avg )
526 !
527  dek%XDRAIN (:) = dek%XDRAIN (:) + zdrain(:)/REAL(indt)
528  dek%XRUNOFF(:) = dek%XRUNOFF(:) + zrunoff(:)/REAL(indt)
529 !
530  ENDDO
531 !
532 ! Output diagnostics:
533 ! Compute latent heating from phase change only in surface layer and total soil column,
534 ! then adjust surface and total soil heat content to maintain balance.
535 !
536  pdelphaseg_sfc(:) = (pek%XWGI(:,1)-zwgi0(:,1))*(xlmtt*xrholw/ptstep)*pk%XDG(:,1) + zlegi(:)
537  pdelphaseg(:) = (pek%XWGI(:,2)-zwgi0(:,2))*(xlmtt*xrholw/ptstep)*pk%XDG(:,2)
538  pdelheatg_sfc(:) = pdelheatg_sfc(:) + pdelphaseg_sfc(:)
539  pdelheatg(:) = pdelheatg(:) + pdelphaseg(:)
540 !
541  IF (io%CISBA == '3-L') pek%XWG(:,3) = zwg3(:)
542 !
543 #ifdef TOPD
544  IF (lcoupl_topd) THEN
545  !runoff topo cumule (kg/mē)
546  DO jj=1,SIZE(nmaskt_patch)
547  IF (nmaskt_patch(jj)/=0) THEN
548  IF ( xatop(nmaskt_patch(jj))/=xundef) THEN
550  (dek%XRUNOFF(jj)+ dek%XHORT(jj))*xatop(nmaskt_patch(jj))*ptstep
551  IF (io%CRUNOFF=='TOPD') THEN
552  xrunoff_top(nmaskt_patch(jj)) = xrunoff_top(nmaskt_patch(jj)) + zdunne(jj)*ptstep
553  ELSE
554  ! ZDUNNE contains only saturated pixels on mesh so only catchment
556  zdunne(jj)*xatop(nmaskt_patch(jj))*ptstep
557  ENDIF
558  ENDIF
559  ENDIF
560  ! ZDUNNE concerns all the mesh so not only catchment =>*XATOP
561  ENDDO
562  ENDIF
563 #endif
564  !
565 ENDIF
566 !
567 !-------------------------------------------------------------------------------
568 !
569 ! Add sub-grid surface and subsurface runoff to saturation excess:
570 !
571 dek%XRUNOFF(:) = dek%XRUNOFF(:) + zdunne(:) + dek%XHORT(:)
572 !
573 !-------------------------------------------------------------------------------
574 !
575 IF (lhook) CALL dr_hook('HYDRO',1,zhook_handle)
576 !
577 !-------------------------------------------------------------------------------
578 !
579 END SUBROUTINE hydro
subroutine hydro_veg(HRAIN, PTSTEP, PMUF, PRR, PLEV, PLETR, PVEG, PPSNV, PWR, PWRMAX, PPG, PDRIP, PRRVEG, PLVTT)
Definition: hydro_veg.F90:9
subroutine hydro_soildif(IO, KK, PK, PEK, PTSTEP, PPG, PLETR, PLEG
real, save xlstt
Definition: modd_csts.F90:71
real, dimension(:), allocatable xrunoff_top
subroutine hydro_soil(IO, KK, PK, PEK, DMK, PTSTEP, PLETR, PLEG, PPG, PEVAPCOR, PD_G3, PWSAT, PWFC, PDWGI1, PDWGI2, PLEGI, PWG3, PRUNOFF, PDRAIN, PWWILT)
Definition: hydro_soil.F90:10
subroutine ice_soilfr(IO, KK, PK, PEK, DMK, PTSTEP, PKSFC_IVEG, PD
Definition: ice_soilfr.F90:6
real, parameter xundef
subroutine ice_soildif(KK, PK, PEK, PTSTEP, PKSFC_IVEG, PLEGI, PSO
Definition: ice_soildif.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
integer, dimension(:), allocatable nmaskt_patch
real, dimension(:), allocatable xas_nature
integer, parameter nundef
subroutine hydro_sgh(IO, KK, PK, PEK, DEK, DMK, PTSTEP, PPG, PPG_M
Definition: hydro_sgh.F90:7
real, save xday
Definition: modd_csts.F90:45
logical lhook
Definition: yomhook.F90:15
subroutine hydro_snow(OGLACIER, PTSTEP, PVEGTYPE, PSR, PLES, PMELT
Definition: hydro_snow.F90:7
subroutine hydro(IO, KK, PK, PEK, AG, DEK, DMK, OMEB, PTSTEP, PVEG
Definition: hydro.F90:7
real, save xrholw
Definition: modd_csts.F90:64
real, dimension(:), allocatable xatop
real, save xtt
Definition: modd_csts.F90:66
real, save xlmtt
Definition: modd_csts.F90:72