SURFEX v8.1
General documentation of Surfex
hydro_soil.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_soil(IO, KK, PK, PEK, DMK, PTSTEP, &
7  PLETR, PLEG, PPG, PEVAPCOR, PD_G3, &
8  PWSAT, PWFC, PDWGI1, PDWGI2, PLEGI,&
9  PWG3, PRUNOFF, PDRAIN, PWWILT )
10 ! #####################################################################
11 !
12 !!**** *HYDRO_SOIL*
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., ALBS and RHOS). 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 !! 15/03/99 A. Boone soil ice modification: advance
58 !! soil ice and liquid water, do budget checks
59 !! 25/01/00 A. Boone : fully implicit method for WG2, WG3
60 !! 05/03/07 A. Boone : changed drainage diagnostic computation for
61 !! single bulk-soil option...i.e. for
62 !! cases when IO%CISBA=2-L or d2>=d3 (IO%CISBA=3-L)
63 !! for tighter water budget closure
64 !! 07/08/12 B. Decharme : Soil ice energy conservation
65 !! 04/13 B. Decharme : Apply physical limits on wg here instead of in hydro.F90
66 !-------------------------------------------------------------------------------
67 !
68 !* 0. DECLARATIONS
69 ! ------------
70 !
74 !
75 USE modd_csts, ONLY : xlvtt, xrholw, xlmtt, xlstt, xday
76 USE modd_isba_par, ONLY : xwgmin
77 !
78 USE yomhook ,ONLY : lhook, dr_hook
79 USE parkind1 ,ONLY : jprb
80 !
81 IMPLICIT NONE
82 !
83 !* 0.1 declarations of arguments
84 !
85 TYPE(isba_options_t), INTENT(INOUT) :: IO
86 TYPE(isba_k_t), INTENT(INOUT) :: KK
87 TYPE(isba_p_t), INTENT(INOUT) :: PK
88 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
89 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
90 !
91 REAL, INTENT(IN) :: PTSTEP
92 ! timestep of the integration (s)
93 !
94 REAL, DIMENSION(:), INTENT(IN) :: PLETR, PLEG, PPG, PEVAPCOR
95 ! PLETR = evapotranspiration of the vegetation (W m-2)
96 ! PLEG = latent heat of evaporation over the ground (W m-2)
97 ! PPG = total water reaching the ground (kg m-2 s-1)
98 ! PEVAPCOR = correction for any excess evaporation
99 ! from snow as it completely ablates (kg m-2 s-1)
100 !
101 REAL, DIMENSION(:), INTENT(IN) :: PD_G3, PWSAT, PWFC
102 ! PD_G3 = depth of the soil column (m)
103 ! PWSAT = saturation volumetric water content
104 ! of the soil (m3 m-3)
105 ! PWFC = field capacity volumetric water
106 ! content (m3 m-3)
107 !
108 REAL, DIMENSION(:), INTENT(IN) :: PDWGI1, PDWGI2, PLEGI
109 ! PDWGI1 = surface layer liquid water equivalent
110 ! volumetric ice content time tendency (m3 m-3)
111 ! PDWGI2 = deep-soil layer liquid water equivalent
112 ! volumetric ice content time tendency (m3 m-3)
113 ! PLEGI = surface soil ice sublimation (W m-2)
114 !
115 REAL, DIMENSION(:), INTENT(INOUT) :: PWG3
116 ! PWG3 = bulk deep-soil moisture at 't+dt' (m3 m-3)
117 !
118 REAL, DIMENSION(:), INTENT(OUT) :: PRUNOFF, PDRAIN
119 ! PRUNOFF = runoff (kg m-2 s-1)
120 ! PDRAIN = drainage (kg m-2 s-1)
121 !
122 REAL, DIMENSION(:), INTENT(IN) :: PWWILT
123 ! PWWILT = wilting point volumetric water
124 ! content (m3 m-3)
125 !* 0.2 declarations of local variables
126 !
127 !
128 REAL, DIMENSION(SIZE(PEK%XTG,1)) :: ZWGI1M, ZWG2M, ZWG3M, ZWGI2M
129 ! Prognostic variables of ISBA at 't-dt'
130 ! ZWG2M = root-soil volumetric water content
131 ! ZWG3M = deep-soil volumetric water content
132 ! ZWGI1M = surface-soil volumetric ice content
133 ! ZWGI2M = deep-soil volumetric ice content
134 !
135 REAL, DIMENSION(SIZE(PEK%XTG,1)) :: ZETR, ZEG
136 ! ZETR = evapotranspiration rate
137 ! ZEG = evaporation rate from the ground
138 !
139 !
140 REAL, DIMENSION(SIZE(PEK%XTG,1)) :: ZWSAT, ZWFC
141 ! ZWSAT = Wsat when ice is present
142 ! ZWFC = Wfc when ice is present
143 !
144 REAL, DIMENSION(SIZE(PWG3)) :: ZC4
145 REAL, DIMENSION(SIZE(PWG3)) :: ZWAVG, ZSINK2, &
146  ZFACTOR, ZDRAINCF2, ZDRAINCF3, ZDRAIN2, &
147  ZDELTA2, ZDELTA3, ZDELTA22, ZDELTA33, &
148  ZWDRAIN2, ZWDRAIN3
149 !
150 REAL, DIMENSION(SIZE(PWG3)) :: ZEXCESSF, ZA2, ZB2, ZC2, ZA3, ZB3, ZC3, ZWDRAIN, ZEXCESSFC
151 !
152 REAL, DIMENSION(SIZE(PWG3)) :: ZWLIM2, ZWLIM3, ZWWILT
153 !
154 INTEGER :: JJ
155 REAL(KIND=JPRB) :: ZHOOK_HANDLE
156 !-------------------------------------------------------------------------------
157 !
158 !* 0. Initialization
159 ! --------------
160 !
161 !
162 IF (lhook) CALL dr_hook('HYDRO_SOIL',0,zhook_handle)
163 zwsat(:) = 0.
164 zwfc(:) = 0.
165 zwwilt(:) = 0.
166 !
167 pdrain(:) = 0.
168 prunoff(:) = 0.
169 !
170 zdrain2(:) = 0.
171 zdraincf2(:) = 0.
172 zdraincf3(:) = 0.
173 zdelta2(:) = 0.0
174 zdelta3(:) = 0.0
175 zdelta22(:) = 0.0
176 zdelta33(:) = 0.0
177 zsink2(:) = 0.
178 zwdrain(:) = 0.0
179 zwdrain2(:) = 0.0
180 zwdrain3(:) = 0.0
181 za2(:) = 0.0
182 zb2(:) = 0.0
183 zc2(:) = 0.0
184 za3(:) = 0.0
185 zb3(:) = 0.0
186 zc3(:) = 0.0
187 !
188 zexcessf(:) = 0.0
189 !
190 ! Fields at time t-dt
191 !
192 zwg2m(:) = pek%XWG(:,2)
193 zwg3m(:) = pwg3(:)
194 zwgi1m(:) = pek%XWGI(:,1)
195 zwgi2m(:) = pek%XWGI(:,2)
196 
197 !-------------------------------------------------------------------------------
198 !
199 DO jj=1,SIZE(pek%XTG,1)
200 !
201 !* 1. New Wsat
202 ! --------
203 !
204  zwsat(jj) = pwsat(jj) - zwgi2m(jj) ! per definition ZWGI2M<PWSAT-0.001
205 ! ! then ZWSAT>0.001
206 !
207  zwfc(jj) = pwfc(jj) * zwsat(jj) / pwsat(jj)
208 !
209  zwwilt(jj) = pwwilt(jj) * zwsat(jj) / pwsat(jj)
210 !
211 !
212 ! evaporation rates
213 !
214  zetr(jj) = pletr(jj) / xlvtt
215 !
216 ! Remove sublimation from total soil evaporation: this is done
217 ! because ZEG is a liquid water sink term. Sublimation
218 ! is removed from the surface ice tendency equation (below):
219 ! PLEG represents the total of sublimation and evaporation.
220 ! Also, add an additional possible correction which is used if
221 ! evaporation from the snow surface exceeds the last amount of
222 ! snow on the surface as the snow completely ablates (this
223 ! is a very small term and is generally negligible HOWEVER
224 ! it is retained here for a high order water budget):
225 !
226  zeg(jj) = pleg(jj) / xlvtt + pevapcor(jj)
227 !
228 !-------------------------------------------------------------------------------
229 !
230 !* 4. EVOLUTION OF THE SUPERFICIAL WATER CONTENT WG1
231 ! ----------------------------------------------
232 !
233 ! updated values for wg
234 !
235  pek%XWG(jj,1) = (pek%XWG(jj,1) - ptstep * &
236  (dmk%XC1(jj)*(zeg(jj)-ppg(jj))/xrholw - dmk%XC2(jj)*dmk%XWGEQ(jj)/xday)) &
237  / (1. + ptstep * dmk%XC2(jj) / xday)
238 !
239 !
240 ENDDO
241 !
242 IF(io%CKSAT=='SGH' .OR. io%CKSAT=='EXP') THEN
243  zwlim2(:)=zwwilt(:)
244  zwlim3(:)=pwwilt(:)
245 ELSE
246  zwlim2(:)=xwgmin
247  zwlim3(:)=xwgmin
248 ENDIF
249 !
250 !-------------------------------------------------------------------------------
251 !
252 !* 5. EVOLUTION OF THE DEEP WATER CONTENT WG2 and WG3
253 ! -----------------------------------------------
254 !
255 !* 5.1 2-L ISBA version
256 ! ----------------
257 !
258 IF (io%CISBA=='2-L') THEN
259 !
260  DO jj=1,SIZE(pek%XTG,1)
261 !
262  pek%XWG(jj,2) = zwg2m(jj) - ptstep*(zeg(jj) + zetr(jj) - ppg(jj)) / (pk%XDG(jj,2) * xrholw)
263 !
264 !* 6. DRAINAGE FROM THE DEEP SOIL
265 ! ------------------
266 !
267  zwdrain(jj) = kk%XWDRAIN(jj) * &
268  max(0.0, min(zwfc(jj),pek%XWG(jj,2))-zwlim2(jj))/(zwfc(jj)-zwlim2(jj))
269 
270  zdrain2(jj) = max( min(zwdrain(jj),pek%XWG(jj,2)) , &
271  pek%XWG(jj,2)-zwfc(jj) )*pk%XC3(jj,1) / (pk%XDG(jj,2)*xday) * ptstep
272 !
273 ! the deep-soil volumetric water content w2
274 ! is modified consequently
275 !
276  pek%XWG(jj,2) = pek%XWG(jj,2) - zdrain2(jj)
277 
278  pdrain(jj) = zdrain2(jj)*pk%XDG(jj,2)*xrholw/ptstep ! Final output units: kg m-2 s-1
279 !
280  ENDDO
281 !
282 ELSE
283 !
284  DO jj=1,SIZE(pek%XTG,1)
285 
286 !* 5.2 3-L ISBA version (with only 2 active layers)
287 ! ----------------
288 !
289  IF (pk%XDG(jj,2) >= pd_g3(jj)) THEN
290 
291  pek%XWG(jj,2) = zwg2m(jj) - ptstep*(zeg(jj) + zetr(jj) - ppg(jj)) &
292  / (pk%XDG(jj,2) * xrholw)
293 
294 !* 6. DRAINAGE FROM THE DEEP SOIL
295 ! ------------------
296 ! when w2 > wfc, there is drainage
297 !
298  zwdrain(jj) = kk%XWDRAIN(jj) * &
299  max(0.0, min(zwfc(jj),pek%XWG(jj,2))-zwlim2(jj))/(zwfc(jj)-zwlim2(jj))
300 
301  zdrain2(jj) = max( min(zwdrain(jj),pek%XWG(jj,2)) , &
302  pek%XWG(jj,2)-zwfc(jj) )*pk%XC3(jj,1) / (pk%XDG(jj,2)*xday) * ptstep
303 
304  pek%XWG(jj,2) = pek%XWG(jj,2) - zdrain2(jj)
305  pwg3(jj) = pek%XWG(jj,2)
306 
307  pdrain(jj) = zdrain2(jj)*pk%XDG(jj,2)*xrholw/ptstep ! Final output units: kg m-2 s-1
308 !
309  ELSE
310 !
311 !* 5.3 3-L ISBA version (with 3 active layers)
312 ! ----------------
313 !
314 ! Linear drainage term check (m3 m-3):
315 ! Use a linear scaling to prevent it from completely drying out the soil. This
316 ! term will, under most conditions, not result in such a drying. Until a more
317 ! rhobust (but more complicated) method is developed for maintaining a minimum river
318 ! flow under dry conditions, this method will be used.
319 !
320  zwdrain2(jj) = kk%XWDRAIN(jj)* max(0.0, min(zwfc(jj),zwg2m(jj))-zwlim2(jj))/(zwfc(jj)-zwlim2(jj))
321  zwdrain3(jj) = kk%XWDRAIN(jj)* max(0.0, min(pwfc(jj),zwg3m(jj))-zwlim3(jj))/(pwfc(jj)-zwlim3(jj))
322 !
323 ! Delta functions:
324 !
325  zdelta2(jj) = 0.0
326  IF ( zwg2m(jj) - zwfc(jj) > zwdrain2(jj) ) zdelta2(jj) = 1.0
327  !
328  zdelta3(jj) = 0.0
329  IF ( zwg3m(jj) - pwfc(jj) > zwdrain3(jj) ) zdelta3(jj) = 1.0
330  !
331  !
332 
333 ! evaluate inter-facial water content, grid factor, and diffusion coefficient:
334 
335  zwavg(jj) = ( ( (zwg2m(jj)**6)* pk%XDG(jj,2) + &
336  (zwg3m(jj)**6)*(pd_g3(jj)-pk%XDG(jj,2)) )/pd_g3(jj) )**(1./6.)
337 
338  zfactor(jj) = pk%XDG(jj,2)/(pd_g3(jj)-pk%XDG(jj,2))
339 
340  zc4(jj) = pk%XC4REF(jj)*(zwavg(jj)**kk%XC4B(jj)) &
341  *(10.**(-kk%XC4B(jj)*pek%XWGI(jj,2)/(pwsat(jj)-xwgmin)))
342 !
343 ! calculate sources/sinks
344 !
345  zsink2(jj) = -(zeg(jj) + zetr(jj) - ppg(jj) )/(pk%XDG(jj,2)*xrholw)
346 
347 ! Compute evolution of water content using linearized equations
348 ! (see Boone 2000, Appendix F.2 for details)
349 !
350 ! sink terms are treated explicitly, other terms are implicit
351 !
352  zdraincf2(jj) = pk%XC3(jj,1) / (pk%XDG(jj,2) * xday)
353  zdelta22(jj) = zdelta2(jj)*zwfc(jj) - (1.0-zdelta2(jj))*zwdrain2(jj)
354  zc2(jj) = 1.0 + ptstep*(zdelta2(jj)*zdraincf2(jj) + (zc4(jj)/xday))
355  zb2(jj) = ptstep*zc4(jj)/(xday*zc2(jj))
356  za2(jj) = ( zwg2m(jj) + ptstep*(zsink2(jj) + zdraincf2(jj)*zdelta22(jj)) )/zc2(jj)
357 !
358  zdraincf3(jj) = pk%XC3(jj,2) / ( (pd_g3(jj)-pk%XDG(jj,2)) * xday)
359  zdelta33(jj) = zdelta3(jj)*pwfc(jj) - (1.0-zdelta3(jj))*zwdrain3(jj)
360  zc3(jj) = 1.0 + ptstep*(zdelta3(jj)*zdraincf3(jj) + zfactor(jj)*(zc4(jj)/xday))
361  zb3(jj) = ptstep*zfactor(jj)*(zdelta2(jj)*zdraincf2(jj) + (zc4(jj)/xday) )/zc3(jj)
362  za3(jj) = ( zwg3m(jj) + ptstep*( &
363  - zfactor(jj)*zdraincf2(jj)*zdelta22(jj) &
364  + zdraincf3(jj)*zdelta33(jj)) )/zc3(jj)
365 !
366 ! Advance volumetric water content values in time:
367 ! system of 2 linear equations:
368 !
369  pek%XWG(jj,2) = ( za2(jj)+zb2(jj)*za3(jj) )/(1.0 - zb2(jj)*zb3(jj))
370  pwg3(jj) = za3(jj) + zb3(jj)*pek%XWG(jj,2)
371 !
372 ! Drainage (kg m-2 s-1): this term is implicit and is extracted directly from
373 ! the drainage computation in the above equations.
374 !
375  zwdrain(jj) = (xrholw*pk%XC3(jj,2)/xday)* &
376  ( zdelta3(jj)*(pwg3(jj)-pwfc(jj)) + (1.0-zdelta3(jj))*zwdrain3(jj) )
377 !
378 ! As drainage is implicit, perform a check to prevent any negative drainage
379 ! (can arise rarely and is generally negligible, but to ensure a high order conservation):
380 !
381  pdrain(jj) = max(0.0, zwdrain(jj))
382  pwg3(jj) = pwg3(jj) + (pdrain(jj) - zwdrain(jj))*ptstep/((pd_g3(jj)-pk%XDG(jj,2))*xrholw)
383 !
384  ENDIF
385  ENDDO
386 END IF
387 !
388 !-------------------------------------------------------------------------------
389 !
390 DO jj=1,SIZE(pek%XTG,1)
391 !* 7. EFFECT OF THE MELTING/FREEZING ON THE SOIL WATER CONTENT
392 ! --------------------------------------------------------
393 !
394 !* 7.1 Effect on surface water liquid and ice reservoirs
395 ! -------------------------------------------------
396 !
397 ! First, advance the surface layer ice content using the time tendency
398 ! and sublimation (*heat effect* of sublimation already accounted
399 ! for in latent heat flux calculation):
400 !
401  pek%XWGI(jj,1) = zwgi1m(jj) + pdwgi1(jj) - plegi(jj)*ptstep/(xlstt*pk%XDG(jj,1)*xrholw)
402 !
403 ! Next, update the liquid water content:
404 !
405  pek%XWG(jj,1) = pek%XWG(jj,1) - pdwgi1(jj)
406 !
407 ! Make sure that ice has not dropped below
408 ! zero due to sublimation (the ONLY way
409 ! it can drop below 0). If it has, then
410 ! freeze the needed liquid water (thus warming the
411 ! layer) to ensure sublimation is accomodated,
412 ! then extract this from liquid water store.
413 ! This is a correction used ONLY when last traces
414 ! of soil ice sublimate within a model time step.
415 !
416  zexcessfc(jj)= 0.0
417 !
418  zexcessf(jj) = max(0.0, - pek%XWGI(jj,1))
419  pek%XWG(jj,1) = pek%XWG(jj,1) - zexcessf(jj)
420  pek%XWGI(jj,1) = pek%XWGI(jj,1) + zexcessf(jj)
421  zexcessfc(jj)= zexcessfc(jj) - zexcessf(jj)
422 !
423 ! Modif H.Douville 26/08/03 (global scale)
424 ! Make sure that ice has not raised above
425 ! saturation (minus XWGMIN) due to sublimation.
426 ! If it has, then melt the needed frozen water
427 ! (thus cooling the layer) to ensure sublimation
428 ! is accomodated, then extract this from frozen water store.
429 !
430  zexcessf(jj) = min(0.0, pwsat(jj) - xwgmin - pek%XWGI(jj,1))
431  pek%XWG(jj,1) = pek%XWG(jj,1) - zexcessf(jj)
432  pek%XWGI(jj,1) = pek%XWGI(jj,1) + zexcessf(jj)
433  zexcessfc(jj)= zexcessfc(jj) - zexcessf(jj)
434 !
435 ! Make sure that liquid has not dropped below
436 ! minimum threshold: this could arise due to
437 ! evaporation and ice formation. Melt the needed water.
438 ! Normally simply a budget check, i.e. usually small but accounted
439 ! for none-the-less to assure high accuracy.
440 !
441  zexcessf(jj) = max(0.0, xwgmin - pek%XWG(jj,1))
442  pek%XWGI(jj,1) = pek%XWGI(jj,1) - zexcessf(jj)
443  pek%XWG(jj,1) = pek%XWG(jj,1) + zexcessf(jj)
444  zexcessfc(jj)= zexcessfc(jj) + zexcessf(jj)
445 !
446 ! removes very small values due to computation precision
447 !
448  IF(pek%XWGI(jj,1) < 1.0e-10) THEN
449  zexcessf(jj) = pek%XWGI(jj,1)
450  pek%XWG(jj,1) = pek%XWG(jj,1) + zexcessf(jj)
451  pek%XWGI(jj,1) = 0.0
452  zexcessfc(jj) = zexcessfc(jj) + zexcessf(jj)
453  ENDIF
454 !
455 ! Cummulative phase change for the ice/liquid budget corrections:
456 !
457  pek%XTG(jj,1) = pek%XTG(jj,1) - zexcessfc(jj)*xlmtt*dmk%XCT(jj)*xrholw*pk%XDG(jj,1)
458 !
459 !
460 !* 7.2 Effect on deep-soil liquid and ice reservoirs
461 ! ---------------------------------------------
462 !
463 ! Update the ice content using the ice tendency:
464 ! Since this reservoir includes surface reservoir, add
465 ! any changes in ice content due to sublimation:
466 !
467  pek%XWGI(jj,2) = zwgi2m(jj) + pdwgi2(jj) - plegi(jj)*ptstep/(xlstt*pk%XDG(jj,2)*xrholw)
468 !
469 ! Update the liquid water content:
470 !
471  pek%XWG(jj,2) = pek%XWG(jj,2) - pdwgi2(jj)
472 !
473 ! Make sure that ice has not dropped below
474 ! zero due to sublimation (as above).
475 !
476  zexcessfc(jj)= 0.0
477 !
478  zexcessf(jj) = max(0.0, -pek%XWGI(jj,2))
479  pek%XWG(jj,2) = pek%XWG(jj,2) - zexcessf(jj)
480  pek%XWGI(jj,2) = pek%XWGI(jj,2) + zexcessf(jj)
481  zexcessfc(jj)= zexcessfc(jj) - zexcessf(jj)
482 !
483 ! Budget check of minimum threshold for liquid
484 ! water as for surface: MUCH LESS likely
485 ! to be utilized, but retained for accuracy
486 ! in energy and water balance (as above).
487 !
488  zexcessf(jj) = max(0.0, xwgmin - pek%XWG(jj,2))
489  pek%XWGI(jj,2) = pek%XWGI(jj,2) - zexcessf(jj)
490  pek%XWG(jj,2) = pek%XWG(jj,2) + zexcessf(jj)
491  zexcessfc(jj)= zexcessfc(jj) + zexcessf(jj)
492 !
493 ! removes very small values due to computation precision
494 !
495  IF (pek%XWGI(jj,2) < 1.0e-10 * ptstep) THEN
496  zexcessf(jj) = pek%XWGI(jj,2)
497  pek%XWG(jj,2) = pek%XWG(jj,2) + zexcessf(jj)
498  pek%XWGI(jj,2) = 0.
499  zexcessfc(jj)= zexcessfc(jj) + zexcessf(jj)
500  ENDIF
501 !
502 ! Cummulative phase change for the ice/liquid budget corrections:
503 !
504  pek%XTG(jj,2) = pek%XTG(jj,2) - zexcessfc(jj)*xlmtt*dmk%XCG(jj)*xrholw*pk%XDG(jj,2)
505 !
506 !
507 ENDDO
508 !
509 !-------------------------------------------------------------------------------
510 !
511 !* 8. PHYSICAL LIMITS AND RUNOFF
512 ! --------------------------
513 !
514 ! runoff of second layer
515 !
516 prunoff(:) = max( 0., pek%XWG(:,2)+pek%XWGI(:,2)-pwsat(:) )*pk%XDG(:,2) * xrholw / ptstep
517 !
518 ! now apply limits:
519 !
520 pek%XWG(:,1) = min( pek%XWG(:,1), pwsat(:) - pek%XWGI(:,1) )
521 pek%XWG(:,1) = max( pek%XWG(:,1), xwgmin )
522 !
523 pek%XWG(:,2) = min( pek%XWG(:,2), pwsat(:) - pek%XWGI(:,2) )
524 pek%XWG(:,2) = max( pek%XWG(:,2), xwgmin )
525 !
526 !runoff of third layer added to drainage
527 !
528 IF (io%CISBA=='3-L') THEN
529  pdrain(:) = pdrain(:) + max( 0., pwg3(:)-pwsat(:) )* (pd_g3(:)-pk%XDG(:,2)) * xrholw / ptstep
530  pwg3(:) = min( pwg3(:), pwsat(:) )
531  pwg3(:) = max( pwg3(:), xwgmin )
532 END IF
533 !
534 IF (lhook) CALL dr_hook('HYDRO_SOIL',1,zhook_handle)
535 !-------------------------------------------------------------------------------
536 !
537 END SUBROUTINE hydro_soil
real, save xlvtt
Definition: modd_csts.F90:70
real, save xlstt
Definition: modd_csts.F90:71
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
integer, parameter jprb
Definition: parkind1.F90:32
real, save xday
Definition: modd_csts.F90:45
logical lhook
Definition: yomhook.F90:15
real, save xrholw
Definition: modd_csts.F90:64
real, save xlmtt
Definition: modd_csts.F90:72