SURFEX v8.1
General documentation of Surfex
hydro_sgh.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_sgh(IO, KK, PK, PEK, DEK, DMK, PTSTEP, PPG, PPG_MELT, PDUNNE )
7 !
8 ! #####################################################################
9 !
10 !!**** *HYDRO_SGH*
11 !!
12 !! PURPOSE
13 !! =======
14 !
15 ! 1. Determine the Horton runoff that take account of a spatial subgri
16 ! exponential distribution of the precipitation and of the surface ksat.
17 ! 1. Determine the surface saturated fraction (dt92 or Topmodel).
18 ! 3. Determine the Dunne runoff (dt92 or Topmodel).
19 ! 4. Determine the infiltration rate.
20 ! 5. Determine the flooplains interception and infiltration rate.
21 !
22 !! MODIFICATIONS
23 !! -------------
24 !!
25 !! 03/16 (B. Decharme) Limit flood infiltration
26 !!
27 !-------------------------------------------------------------------------------
28 !
29 !* 0. DECLARATIONS
30 ! ===================
31 !
36 !
37 USE modd_csts, ONLY : xrholw, xday, xcl, xci, xrholi
38 USE modd_isba_par, ONLY : xwgmin, xsphsoil, xdrywght
39 USE modd_surf_par, ONLY : xundef
40 USE modd_sgh_par, ONLY : xhort_depth
41 !
42 #ifdef TOPD
44 #endif
45 !
46 USE modi_hydro_dt92
47 !
49 !
50 USE yomhook ,ONLY : lhook, dr_hook
51 USE parkind1 ,ONLY : jprb
52 !
53 IMPLICIT NONE
54 !
55 !* 0.1 declarations of arguments
56 !
57 TYPE(isba_options_t), INTENT(INOUT) :: IO
58 TYPE(isba_k_t), INTENT(INOUT) :: KK
59 TYPE(isba_p_t), INTENT(INOUT) :: PK
60 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
61 TYPE(diag_evap_isba_t), INTENT(INOUT) :: DEK
62 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
63 !
64 REAL, INTENT(IN) :: PTSTEP
65 ! timestep of the integration
66 !
67 REAL, DIMENSION(:), INTENT(INOUT):: PPG
68 REAL, DIMENSION(:), INTENT(IN) :: PPG_MELT
69 ! PPG = water reaching the ground
70 ! PPG_MELT = snowmelt reaching the ground
71 !
72 REAL, DIMENSION(:), INTENT(OUT) :: PDUNNE
73 ! PDUNNE = Dunne runoff
74 !
75 !* 0.2 declarations of local variables
76 !
77 REAL, PARAMETER :: ZEICE = 6.0 ! Ice vertical diffusion impedence factor
78 !
79 REAL, DIMENSION(SIZE(PPG)) :: ZPG_INI, ZFROZEN, ZIMAX_ICE, ZIMAX, &
80  ZHORT_R, ZHORT_M, ZSOILMAX, ZIF_MAX,&
81  ZPIFLDMAX
82 ! ZFROZEN = frozen soil fraction for runoff
83 ! ZIMAX_ICE = maximum infiltration rate for frozen soil
84 ! ZIMAX = maximum infiltration rate for unfrozen soil
85 ! ZPIFLDMAX = maximum floodplains infiltration during 1 day (kg/m2/s)
86 REAL, DIMENSION(SIZE(PPG)) :: ZWG2_AVG, ZWGI2_AVG, ZWSAT_AVG, ZWWILT_AVG
87 ! Average water and ice content
88 ! values over the soil depth D2 (for calculating surface runoff)
89 !
90 REAL, DIMENSION(SIZE(PK%XDG,1),SIZE(PK%XDG,2)) :: ZWSAT, ZWFC, ZFRZ
91 !
92 REAL, DIMENSION(SIZE(PPG)) :: ZPG_WORK, ZRUISDT, ZNL_HORT, ZDEPTH
93 !
94 REAL, DIMENSION(SIZE(PPG)) :: ZRUNOFF_TOPD
95 !
96 REAL :: ZEFFICE, ZLOG10, ZLOG, ZS, ZD_H
97 !
98 REAL :: ZTDIURN, ZSOILHEATCAP
99 ! ZTDIURN = thermal penetration depth for restore (m)
100 ! ZSOILHEATCAP = Total soil volumetric heat capacity [J/(m3 K)]
101 !
102 INTEGER :: INJ, INL, JJ, JL, IDEPTH
103 REAL(KIND=JPRB) :: ZHOOK_HANDLE
104 !
105 !-------------------------------------------------------------------------------
106 !
107 !allocate
108 !
109 IF (lhook) CALL dr_hook('HYDRO_SGH',0,zhook_handle)
110 !
111 !initialize
112 !
113 zfrozen(:) = 0.0
114 zimax_ice(:) = 0.0
115 zimax(:) = 0.0
116 !
117 zwsat(:,:) = 0.0
118 zwfc(:,:) = 0.0
119 !
120 zlog10 = log(10.0)
121 !
122 !IO%CRUNOFF = DT92 ZFSAT calculation
123 zwg2_avg(:) = 0.0
124 zwgi2_avg(:) = 0.0
125 zwsat_avg(:) = 0.0
126 zwwilt_avg(:) = 0.0
127 !
128 !IO%CHORT=SGH
129 zhort_r(:) = 0.0
130 zhort_m(:) = 0.0
131 !
132 !DEK%XIFLOOD calculation
133 zsoilmax(:) = 0.0
134 zif_max(:) = 0.0
135 zpifldmax(:) = 0.0
136 !
137 !IO%CRUNOFF = DT92 DUNNE calculation
138 zpg_work(:) = 0.0
139 zruisdt(:) = 0.0
140 !
141 !IO%CRUNOFF = TOPD DUNNE calculation
142 zrunoff_topd(:) = 0.0
143 !
144 !to limit numerical artifacts
145 zpg_ini(:) = ppg(:) + ppg_melt(:)
146 !
147 !
148 inj=SIZE(pk%XDG,1)
149 inl=maxval(pk%NWG_LAYER)
150 !
151 !-------------------------------------------------------------------------------
152 !
153 !* 1. Surface saturated fraction
154 ! -----------------------------
155 !
156 IF( io%CRUNOFF=='DT92' .OR. io%CRUNOFF == 'TOPD' )THEN
157 !
158 ! Calculate the layer average water content for the sub-grid
159 ! surface runoff computation: use PK%XRUNOFFD(:,1) as the depth over which
160 ! runoff is calculated.
161 !
162 ! First, determine a weight for each layer's contribution
163 ! to thickness averaged water content and soil properties for runoff.
164 !
165  IF (io%CISBA == 'DIF') THEN
166 !
167 ! Vertically averaged soil properties and moisture for surface runoff computation:
168 !
169  DO jl=1,io%NLAYER_DUN
170  DO jj=1,inj
171  idepth=pk%NWG_LAYER(jj)
172  IF(jl<=idepth)THEN
173  zwg2_avg(jj) = zwg2_avg(jj) + pk%XSOILWGHT(jj,jl)*pek%XWG (jj,jl) /max(1.e-6,pk%XRUNOFFD(jj))
174  zwgi2_avg(jj) = zwgi2_avg(jj) + pk%XSOILWGHT(jj,jl)*pek%XWGI(jj,jl) /max(1.e-6,pk%XRUNOFFD(jj))
175  zwsat_avg(jj) = zwsat_avg(jj) + pk%XSOILWGHT(jj,jl)*kk%XWSAT (jj,jl)/max(1.e-6,pk%XRUNOFFD(jj))
176  zwwilt_avg(jj) = zwwilt_avg(jj) + pk%XSOILWGHT(jj,jl)*kk%XWWILT(jj,jl)/max(1.e-6,pk%XRUNOFFD(jj))
177  ENDIF
178  ENDDO
179  ENDDO
180 !
181  ELSE
182 !
183  zwg2_avg(:) = pek%XWG (:,2)
184  zwgi2_avg(:) = pek%XWGI(:,2)
185  zwsat_avg(:) = kk%XWSAT (:,1)
186  zwwilt_avg(:) = kk%XWWILT(:,1)
187 !
188  ENDIF
189 !
190  IF(io%CHORT=='SGH')THEN
191  !runoff over frozen soil explicitly calculated
192  zwgi2_avg(:)=0.0
193  ENDIF
194 !
195  DO jj=1,inj
196  zs = min(1.0,(zwg2_avg(jj)+zwgi2_avg(jj)-zwwilt_avg(jj))/(zwsat_avg(jj)-zwwilt_avg(jj)))
197  kk%XFSAT(jj) = 1.0-(1.0-max(0.0,zs))**(kk%XRUNOFFB(jj)/(kk%XRUNOFFB(jj)+1.))
198  ENDDO
199 !
200 ENDIF
201 !
202 !* 2. Horton runoff
203 ! ----------------
204 !
205 IF(io%CHORT=='SGH'.OR.io%LFLOOD)THEN
206 !
207  IF(io%CISBA == 'DIF')THEN
208 !
209 ! no subgrid frozen soil fraction of the grid cells
210  zfrozen(:) = 0.0
211 !
212  DO jl=1,io%NLAYER_HORT
213  DO jj=1,inj
214 !
215 ! Modify soil porosity as ice assumed to become part
216 ! of solid soil matrix (with respect to liquid flow):
217  zwsat(jj,jl) = max(xwgmin, kk%XWSAT(jj,jl)-pek%XWGI(jj,jl))
218  zwfc(jj,jl) = kk%XWFC(jj,jl)*zwsat(jj,jl)/kk%XWSAT(jj,jl)
219 !
220 ! Impedance Factor from (Johnsson and Lundin 1991).
221  zfrz(jj,jl) = exp(zlog10*(-zeice*(pek%XWGI(jj,jl)/(pek%XWGI(jj,jl)+pek%XWG(jj,jl)))))
222 !
223  ENDDO
224  ENDDO
225 !
226 ! Calculate infiltration MAX using green-ampt approximation (derived form)
227  zimax(:) = infmax_func(pek%XWG, zwsat, zfrz, pk%XCONDSAT, kk%XMPOTSAT, kk%XBCOEF, &
228  pk%XDZG, pk%XDG, io%NLAYER_HORT)
229 !
230  ELSE
231 !
232  DO jj=1,inj
233 !
234 ! Total soil volumetric heat capacity [J/(m3 K)]:
235 !
236  zsoilheatcap = xcl*xrholw*pek%XWG (jj,2) + &
237  xci*xrholi*pek%XWGI(jj,2) + &
238  xsphsoil*xdrywght*(1.0-kk%XWSAT(jj,1))
239 !
240 ! Soil thickness which corresponds to the diurnal surface temperature
241 ! wave penetration depth as T2 is the average temperature for this layer:
242 !
243  ztdiurn = min(pk%XDG(jj,2), 4./(zsoilheatcap*dmk%XCG(jj)))
244 !
245 ! Effective frozen depth penetration
246 !
247  zeffice = pk%XDG(jj,2)*pek%XWGI(jj,2)/(pek%XWGI(jj,2)+pek%XWG(jj,2))
248 !
249 ! Modify soil porosity as ice assumed to become part
250 ! of solid soil matrix (with respect to liquid flow):
251 !
252  zwsat(jj,1) = max(xwgmin, kk%XWSAT(jj,1)-pek%XWGI(jj,2))
253 !
254 ! calculate the subgrid frozen soil fraction of the grid cells
255 !
256  zfrozen(jj) = min(1.,zeffice/max(pk%XD_ICE(jj),ztdiurn))
257 !
258 ! Impedance Factor from (Johnsson and Lundin 1991).
259 !
260  zfrz(jj,1) = exp(zlog10*(-zeice*min(1.,zeffice/ztdiurn)))
261 !
262 ! Calculate infiltration MAX on frozen soil as Johnsson and Lundin (1991).
263 ! The max infiltration is equal ,1to the unsaturated conductivity function at a
264 ! water content c,1orresponding to the total porosity less the ice-filled volume.
265 !
266  zs =min(1.,zwsat(jj,1)/kk%XWSAT(jj,1))
267  zimax_ice(jj)=zfrz(jj,1)*pk%XKSAT_ICE(jj)*(zs**(2*kk%XBCOEF(jj,1)+3.))
268 !
269 ! Calculate infiltration MAX on unfrozen soil using green-ampt approximation
270 !
271  zs =min(1.,pek%XWG(jj,2)/zwsat(jj,1))
272  zd_h =min(0.10,pk%XDG(jj,2))
273  zimax(jj)=pk%XCONDSAT(jj,1)*(kk%XBCOEF(jj,1)*kk%XMPOTSAT(jj,1)*(zs-1.0)/zd_h+1.0)
274 !
275  ENDDO
276 !
277  ENDIF
278 !
279 ENDIF
280 !
281 IF(io%CHORT=='SGH')THEN
282 !
283 ! calculate the Horton runoff generated by the rainfall rate
284 !
285  IF(io%CRAIN=='SGH')THEN
286 !
287  WHERE(ppg(:)>0.)
288  zhort_r(:) = (1.- zfrozen(:))* ppg(:)/((zimax(:)*xrholw*kk%XMUF(:)/ppg(:)) + 1.) & !unfrozen soil
289  + zfrozen(:) * ppg(:)/((zimax_ice(:)*xrholw*kk%XMUF(:)/ppg(:)) + 1.) !frozen soil
290  END WHERE
291 !
292  ELSE
293 !
294  zhort_r(:) = (1.- zfrozen(:))* max(0.,ppg(:)-zimax(:)*xrholw) & !unfrozen soil
295  + zfrozen(:) * max(0.,ppg(:)-zimax_ice(:)*xrholw) !frozen soil
296 !
297  ENDIF
298 !
299 ! calculate the Horton runoff generated by the snow melt
300 !
301  zhort_m(:) = (1.- zfrozen(:))* max(0.,ppg_melt(:)-zimax(:)*xrholw) & !unfrozen soil
302  + zfrozen(:) * max(0.,ppg_melt(:)-zimax_ice(:)*xrholw) !frozen soil
303 !
304 ! calculate the total Horton runoff
305 !
306  WHERE(kk%XFFLOOD(:)<=kk%XFSAT(:))
307  dek%XHORT(:) = (1. - kk%XFSAT(:)) * (zhort_r(:) + zhort_m(:))
308  ELSEWHERE
309  dek%XHORT(:) = (1. - kk%XFFLOOD(:)) * (zhort_r(:) + zhort_m(:))
310  ENDWHERE
311 !
312 ELSE
313 !
314  dek%XHORT(:) = 0.0
315 !
316 ENDIF
317 !
318 ! calculate all water reaching the ground
319 !
320 ppg(:) = ppg(:) + ppg_melt(:)
321 !
322 !
323 !* 3. Dunne runoff and flood interception
324 ! --------------------------------------
325 !
326 ! Interception by the flooplains
327 !
328 IF(io%LFLOOD)THEN
329  dek%XPFLOOD(:)=kk%XFFLOOD(:)*max(0.0,ppg(:))
330 ELSE
331  dek%XPFLOOD(:)=0.0
332 ENDIF
333 !
334 IF(io%CRUNOFF=='SGH ')THEN
335 !
336 ! calculate the Dunne runoff with TOPMODEL
337 !
338  pdunne(:) = max(ppg(:),0.0) * max(kk%XFSAT(:)-kk%XFFLOOD(:),0.0)
339 !
340 ELSEIF (io%CRUNOFF=='DT92' .OR. io%CRUNOFF=='TOPD')THEN
341 !
342 !* Dumenil et Todini (1992) RUNOFF SCHEME
343 ! ---------------------------------------
344 !
345 ! surface runoff done only on the Fsat-Fflood fraction
346 !
347  zpg_work(:) = ppg(:) - dek%XHORT(:) - dek%XPFLOOD(:)
348 !
349 #ifdef TOPD
350  IF ( lcoupl_topd.AND.io%CRUNOFF == 'TOPD' )THEN
351  !
352  DO jj=1,SIZE(nmaskt_patch)
353  IF (nmaskt_patch(jj)/=0) THEN
354  IF ( xatop(nmaskt_patch(jj))/=0. .AND. xas_nature(nmaskt_patch(jj))/=xundef ) THEN
355  zrunoff_topd(jj) = max(ppg(jj),0.0) * max(xas_nature(nmaskt_patch(jj)),0.0)
356  ENDIF
357  ENDIF
358  ENDDO
359  !
360  ENDIF
361 #endif
362  !
363  CALL hydro_dt92(ptstep, kk%XRUNOFFB, zwwilt_avg, pk%XRUNOFFD, zwsat_avg, &
364  zwg2_avg, zwgi2_avg, zpg_work, zruisdt )
365 !
366  pdunne(:) = zruisdt(:)*pk%XRUNOFFD(:)*xrholw/ptstep
367  !
368 #ifdef TOPD
369  IF (lcoupl_topd.AND.io%CRUNOFF == 'TOPD') THEN
370  pdunne(:) = zrunoff_topd(:) + pdunne(:)*(1-xatop(nmaskt_patch(:)))
371  ENDIF
372 #endif
373  !
374  IF(io%LFLOOD)THEN
375  WHERE(kk%XFFLOOD(:)>=kk%XFSAT(:).AND.kk%XFFLOOD(:)>0.0)pdunne(:) = 0.0
376  ENDIF
377  !
378 ELSE
379 !
380 ! Default case (no subgrid runoff)
381 !
382  kk%XFSAT (:) = 0.0
383  pdunne(:) = 0.0
384 !
385 ENDIF
386 !
387 ! calculate the infiltration rate after runoff
388 !
389 ppg(:) = ppg(:) - pdunne(:) - dek%XHORT(:) - dek%XPFLOOD(:)
390 !
391 ! Supress numerical artifacts:
392 !
393 WHERE (zpg_ini(:)<0.0)
394  ppg(:) = zpg_ini(:)
395  dek%XHORT(:) = 0.0
396  pdunne(:) = 0.0
397  dek%XPFLOOD(:) = 0.0
398 ENDWHERE
399 !
400 !* 4. infiltration rate from floodplains (à revoir pour DF !!!)
401 ! -------------------------------------
402 !
403 IF(io%LFLOOD)THEN
404 !
405 ! calculate the maximum flood infiltration
406 !
407  zpifldmax(:) = min(kk%XPIFLOOD(:),xrholw/xday) ! no more than 1 meter of water per days
408 !
409  zif_max(:) = max(0.,(1.- zfrozen(:))) * zimax(:)*xrholw & !unfrozen soil
410  + zfrozen(:) * zimax_ice(:)*xrholw !frozen soil
411 !
412  IF(io%CISBA == 'DIF')THEN
413  zdepth(:)=0.0
414  DO jl=1,io%NLAYER_HORT
415  DO jj=1,inj
416  IF(zdepth(jj)<xhort_depth)THEN
417  zsoilmax(jj) = zsoilmax(jj)+max(0.0,zwfc(jj,jl)-pek%XWG(jj,jl))*pk%XDZG(jj,jl)*xrholw/ptstep
418  zdepth(jj) = pk%XDG(jj,jl)
419  ENDIF
420  ENDDO
421  ENDDO
422  ELSE
423  DO jj=1,inj
424  zwsat(jj,1) = max(xwgmin, kk%XWSAT(jj,1)-pek%XWGI(jj,2))
425  zsoilmax(jj) = max(0.0,zwsat(jj,1)-pek%XWG(jj,2))*pk%XDG(jj,2)*xrholw/ptstep
426  ENDDO
427  ENDIF
428 !
429  zsoilmax(:) = min(zsoilmax(:),zif_max(:))
430 !
431  dek%XIFLOOD(:) = max(0.0,(kk%XFFLOOD(:)-kk%XFSAT(:))) * min(zpifldmax(:),zsoilmax(:))
432 !
433 ELSE
434 !
435  dek%XIFLOOD(:)=0.0
436 !
437 ENDIF
438 !
439 !calculate the infiltration rate
440 !
441 ppg(:) = ppg(:) + dek%XIFLOOD(:)
442 !
443 !-------------------------------------------------------------------------------
444 !
445 IF (lhook) CALL dr_hook('HYDRO_SGH',1,zhook_handle)
446 !
447 END SUBROUTINE hydro_sgh
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
integer, dimension(:), allocatable nmaskt_patch
real, dimension(:), allocatable xas_nature
subroutine hydro_sgh(IO, KK, PK, PEK, DEK, DMK, PTSTEP, PPG, PPG_M
Definition: hydro_sgh.F90:7
subroutine hydro_dt92(PTSTEP, PRUNOFFB, PWWILT, PRUNOFFD, PWSAT, PWG2, PWGI2, PPG, PRUISDT)
Definition: hydro_dt92.F90:11
real, save xci
Definition: modd_csts.F90:65
real, save xday
Definition: modd_csts.F90:45
real, save xcl
Definition: modd_csts.F90:65
logical lhook
Definition: yomhook.F90:15
real, save xrholi
Definition: modd_csts.F90:81
real, save xrholw
Definition: modd_csts.F90:64
real, dimension(:), allocatable xatop
real, parameter xhort_depth