SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
soildif.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 soildif(HDIFSFCOND, OFLOOD, &
7  pveg, pcv, pffg, pffv, &
8  pcg, pct, pfrozen1, &
9  pd_g, pdzg, ptg, pwg, pwgi, kwg_layer, &
10  phcapsoilz, pconddryz, pcondsldz, &
11  pbcoef, pwsat, pmpotsat, psoilcondz, psoilhcapz, &
12  pfwtd, pwtd, pwr )
13 ! ##########################################################################
14 !
15 !!**** *SOIL*
16 !!
17 !! PURPOSE
18 !! -------
19 !
20 ! Calculates the coefficients related to the soil (i.e., surface heat capacities, CG, CT,
21 ! and thermal conductivity and heat capacity profiles)
22 !
23 !
24 !!** METHOD
25 !! ------
26 !
27 ! Direct calculation
28 !
29 !! EXTERNAL
30 !! --------
31 !
32 ! None
33 !!
34 !! IMPLICIT ARGUMENTS
35 !! ------------------
36 !!
37 !! USE MODD_CST
38 !! USE MODD_PARAMETERS
39 !!
40 !!
41 !! REFERENCE
42 !! ---------
43 !!
44 !! Noilhan and Planton (1989)
45 !! Belair (1995)
46 !! Boone (2000)
47 !!
48 !! AUTHOR
49 !! ------
50 !! A. Boone * Meteo-France *
51 !!
52 !! MODIFICATIONS
53 !! -------------
54 !! Original
55 !! 25/03/99 (Boone) Added Johansen (1975)/Peters-Lidard
56 !! option to explicitly compute CG
57 !! 08/25/02 (Boone) DIF option code only
58 !! 25/05/08 (Decharme) Add Flood properties
59 !! 03/08/11 (Decharme) Optimization
60 !! 04/13 (Decharme) good soil moisture extrapolation computation
61 !! 23/07/13 (Decharme) Surface / Water table depth coupling
62 !! 23/10/14 (Decharme) revise all thermo properties
63 !! delete NP89 option for thermal cond
64 !! because not physical with explicit soil.
65 !-------------------------------------------------------------------------------
66 !
67 !* 0. DECLARATIONS
68 ! ------------
69 !
70 USE modd_csts, ONLY : xcl, xci, xrholw, xrholi, xpi, xday, xcondi, xtt, xlmtt, xg
71 USE modd_isba_par, ONLY : xcondwtr, xwgmin, xwtd_maxdepth, &
72  xomrho, xomsph, xomconddry, &
73  xomcondsld, xcvheatf
74 !
75 USE modd_surf_par, ONLY : xundef
76 !
77 USE yomhook ,ONLY : lhook, dr_hook
78 USE parkind1 ,ONLY : jprb
79 !
80 IMPLICIT NONE
81 !
82 !* 0.1 declarations of arguments
83 !
84 !
85  CHARACTER(LEN=*), INTENT(IN) :: hdifsfcond ! NOTE: Only used when HISBA = DIF
86 ! ! MLCH' = include the insulating effect of leaf
87 ! ! litter/mulch on the surface thermal cond.
88 ! ! 'DEF' = no mulch effect
89 !
90 LOGICAL, INTENT(IN) :: oflood ! Flood scheme
91 !
92 REAL, DIMENSION(:), INTENT(IN) :: pveg, pfwtd, pwtd, pcv, pwr
93 ! Soil and vegetation parameters
94 ! PVEG = fraction of vegetation
95 ! PFWTD= grid-cell fraction of water table to rise
96 ! PWTD = water table depth (negative below soil surface)
97 ! PCV = the heat capacity of the vegetation
98 ! PWR = canopy intercepted water
99 !
100 REAL, DIMENSION(:,:), INTENT(IN) :: phcapsoilz, pconddryz, pcondsldz, pd_g, pdzg
101 ! PHCAPSOILZ = soil heat capacity [J/(K m3)]
102 ! PCONDDRYZ = soil dry thermal conductivity
103 ! [W/(m K)]
104 ! PCONDSLDZ = soil solids thermal conductivity
105 ! [W/(m K)]
106 ! PD_G = soil layer depth [m]
107 ! PDZG = soil layers thicknesses [m]
108 !
109 REAL, DIMENSION(:,:), INTENT(IN) :: pbcoef, pwsat, pmpotsat, ptg
110 ! PBCOEF = profile of b-parameter (-)
111 ! PWSAT = profile of porosity (m3/m3)
112 ! PMPOTSAT = profile of matric potential at saturation (m)
113 !
114 REAL, DIMENSION(:,:),INTENT(INOUT):: pwg, pwgi
115 ! PWG = soil liquid water content (m3/m3)
116 ! PWGI = soil frozen water content (m3/m3)
117 !
118 INTEGER, DIMENSION(:), INTENT(IN) :: kwg_layer
119 ! KWG_LAYER = Number of soil moisture layers (DIF option)
120 !
121 REAL, DIMENSION(:), INTENT(OUT) :: pfrozen1, pcg, pct
122 ! PFROZEN1 = fraction of ice in superficial soil
123 ! PCT = averaged surface heat capacity of the grid (m2 K J-1)
124 ! PCG = averaged surface soil heat capacity (m2 K J-1)
125 !
126 REAL, DIMENSION(:,:), INTENT(OUT) :: psoilcondz, psoilhcapz
127 ! PSOILHCAP = soil heat capacity (J m-3 K-1)
128 ! PSOILCOND = soil thermal conductivity (W m-1 K-1)
129 !
130 !
131 REAL, DIMENSION(:), INTENT(IN) :: pffv, pffg
132 ! PFFG = Floodplain fraction over the ground
133 ! without snow (ES)
134 ! PFFV = Floodplain fraction over vegetation
135 ! without snow (ES)
136 !
137 !* 0.2 declarations of local variables
138 !
139 REAL, DIMENSION(SIZE(PTG,1),SIZE(PTG,2)) :: zmatpot, zconddryz, zcondsldz, zvegmulch
140 ! ZMATPOT = soil matric potential (m)
141 !
142 REAL :: zfrozen2df, zunfrozen2df, zcondsatdf, zlog_condi, zlog_condwtr, &
143  zsatdegdf, zkerstendf, zwork1, zwork2, zwork3, zlog, zwtot, zwl
144 !
145 REAL, PARAMETER :: zctmax = 1.e-4 ! Maximum thermal inertia
146 !
147 REAL, PARAMETER :: zthickm = 0.04 ! Mulch thickness (m)
148 !
149 REAL, DIMENSION(SIZE(PVEG)) :: zff, zcf, zcv !Thermal inertia of the flood or vegetation
150 !
151 REAL, DIMENSION(SIZE(PVEG)) :: zwtd ! Water table depth if no coupling (m)
152 !
153 INTEGER :: ini, inl, jj, jl, idepth
154 !
155 REAL(KIND=JPRB) :: zhook_handle
156 !
157 !-------------------------------------------------------------------------------
158 !
159 !* 0. Initialization:
160 ! ---------------
161 !
162 IF (lhook) CALL dr_hook('SOILDIF',0,zhook_handle)
163 !
164 ini=SIZE(pwg,1)
165 inl=SIZE(pwg,2)
166 !
167 zff(:) = 0.0
168 zcf(:) = xundef
169 !
170 !-------------------------------------------------------------------------------
171 !
172 !* 1. WATER TABLE DETH ADJUSTMENT FOR ISBA (m)
173 ! -----------------------------------------
174 !
175 WHERE(pwtd(:)==xundef)
176 ! no water table / surface coupling over some regions
177  zwtd(:) = xwtd_maxdepth
178 ELSEWHERE
179  zwtd(:) = pfwtd(:)/max(-pwtd(:),0.001) + (1.0-pfwtd(:))/max(-pwtd(:),xwtd_maxdepth)
180  zwtd(:) = 1.0/zwtd(:)
181 ENDWHERE
182 !
183 !-------------------------------------------------------------------------------
184 !
185 !* 2. MATRIC POTENTIAL AND MOISTURE EXTRAPOLATION
186 ! -------------------------------------------
187 !
188 DO jl=1,inl
189  DO jj=1,ini
190 !
191  idepth=kwg_layer(jj)
192  IF(jl>idepth)THEN
193 !
194 ! total matric potential
195  zwork1 = min(1.0,(pwg(jj,idepth)+pwgi(jj,idepth))/pwsat(jj,idepth))
196  zlog = pbcoef(jj,idepth)*log(zwork1)
197  zmatpot(jj,idepth) = pmpotsat(jj,idepth)*exp(-zlog)
198 
199 ! extrapolation of total matric potential
200  zwork1 = 0.5*(pd_g(jj,idepth)+pd_g(jj,idepth-1))
201  zwork2 = 0.5*(pd_g(jj,jl)+pd_g(jj,jl-1))
202  zwork3 = max(0.0,(zwtd(jj)-zwork2)/(zwork2-zwork1))
203  zmatpot(jj,jl) = (pmpotsat(jj,jl)+zwork3*zmatpot(jj,idepth))/(1.0+zwork3)
204 !
205 ! total soil water content computation
206  zwork1 = max(1.0,zmatpot(jj,jl)/pmpotsat(jj,jl))
207  zlog = log(zwork1)/pbcoef(jj,jl)
208  zwtot = pwsat(jj,jl)*exp(-zlog)
209  zwtot = max(xwgmin,zwtot)
210 !
211 ! soil liquid water content computation
212  zmatpot(jj,jl) = min(pmpotsat(jj,jl),xlmtt*(ptg(jj,jl)-xtt)/(xg*ptg(jj,jl)))
213 !
214  zwork1 = max(1.0,zmatpot(jj,jl)/pmpotsat(jj,jl))
215  zlog = log(zwork1)/pbcoef(jj,jl)
216  zwl = pwsat(jj,jl)*exp(-zlog)
217  zwl = max(zwl,xwgmin)
218  pwg(jj,jl) = min(zwl,zwtot )
219 !
220 ! soil ice computation
221  pwgi(jj,jl) = max(0.0,zwtot-pwg(jj,jl))
222 !
223  ENDIF
224  ENDDO
225 ENDDO
226 !
227 !-------------------------------------------------------------------------------
228 !
229 !* 3. SURFACE FROZEN FRACTION
230 ! -----------------------
231 !
232 !
233 ! Surface soil water reservoir frozen fraction:
234 !
235 pfrozen1(:) = pwgi(:,1)/(pwgi(:,1) + max(pwg(:,1),xwgmin))
236 !
237 !-------------------------------------------------------------------------------
238 !
239 !* 4. SIMPLE LITTER/MULCH EFFECT
240 ! --------------------------
241 !
242 ! This takes into account the insulating effect of dead vegetation/leaf litter/mulch on
243 ! uppermost soil layers thermal properties. Use organic matter thermal properties.
244 !
245 !
246 zconddryz(:,:) = pconddryz(:,:)
247 zcondsldz(:,:) = pcondsldz(:,:)
248 !
249 IF(hdifsfcond == 'MLCH') THEN
250 !
251  DO jl=1,inl
252  DO jj=1,ini
253 !
254  zvegmulch(jj,jl) = pveg(jj)*min(pdzg(jj,jl),max(0.0,zthickm-pd_g(jj,jl)+pdzg(jj,jl)))/pdzg(jj,jl)
255 !
256  IF(zvegmulch(jj,jl)>0.0)THEN
257  zconddryz(jj,jl) = 1.0/((1.0-zvegmulch(jj,jl))/pconddryz(jj,jl)+zvegmulch(jj,jl)/xomconddry)
258  zcondsldz(jj,jl) = 1.0/((1.0-zvegmulch(jj,jl))/pcondsldz(jj,jl)+zvegmulch(jj,jl)/xomcondsld)
259  ENDIF
260 !
261  ENDDO
262  ENDDO
263 !
264 ENDIF
265 !
266 !-------------------------------------------------------------------------------
267 !
268 !* 5. THE THERMAL CONDUCTIVITY OF BARE-GROUND
269 ! ---------------------------------------
270 !
271 ! Calculate thermal conductivity using PL98 :
272 !
273 zlog_condi = log(xcondi)
274 zlog_condwtr = log(xcondwtr)
275 !
276 DO jl=1,inl
277  DO jj=1,ini
278 !
279  zfrozen2df = pwgi(jj,jl)/(pwgi(jj,jl) + max(pwg(jj,jl),xwgmin))
280  zunfrozen2df = (1.0-zfrozen2df)*pwsat(jj,jl)
281 !
282 !Old: CONDSATDF=(CONDSLDZ**(1.0-WSAT))*(CONDI**(WSAT-UNFROZEN2DF))*(CONDWTR**UNFROZEN2DF)
283  zwork1 = log(zcondsldz(jj,jl))*(1.0-pwsat(jj,jl))
284  zwork2 = zlog_condi*(pwsat(jj,jl)-zunfrozen2df)
285  zwork3 = zlog_condwtr*zunfrozen2df
286  zcondsatdf = exp(zwork1+zwork2+zwork3)
287 !
288  zsatdegdf = max(0.1, (pwgi(jj,jl)+pwg(jj,jl))/pwsat(jj,jl))
289  zsatdegdf = min(1.0,zsatdegdf)
290  zkerstendf = log10(zsatdegdf) + 1.0
291  zkerstendf = (1.0-zfrozen2df)*zkerstendf + zfrozen2df *zsatdegdf
292 !
293 ! Thermal conductivity of soil:
294 !
295  psoilcondz(jj,jl) = zkerstendf*(zcondsatdf-zconddryz(jj,jl)) + zconddryz(jj,jl)
296 !
297  ENDDO
298 ENDDO
299 !
300 !-------------------------------------------------------------------------------
301 !
302 !* 6. THE HEAT CAPACITY OF BARE-GROUND
303 ! --------------------------------
304 !
305 ! Soil Heat capacity [J/(m3 K)]
306 !
307 DO jl=1,inl
308  DO jj=1,ini
309  psoilhcapz(jj,jl) = (1.0-pwsat(jj,jl))*phcapsoilz(jj,jl) + &
310  pwg(jj,jl) *xcl*xrholw + &
311  pwgi(jj,jl) *xci*xrholi
312  ENDDO
313 ENDDO
314 !
315 ! Surface soil thermal inertia [(m2 K)/J]
316 !
317 pcg(:) = 1.0 / ( pd_g(:,1) * psoilhcapz(:,1) )
318 !
319 pcg(:) = min(zctmax,pcg(:))
320 !
321 !-------------------------------------------------------------------------------
322 !
323 !* 7. THE HEAT CAPACITY OF VEGETATION
324 ! --------------------------------
325 !
326 ! Vegetation thermal inertia [(m2 K)/J]
327 !
328 zcv(:) = 1.0 / ( xcvheatf/pcv(:) + xcl * pwr(:) )
329 !
330 zcv(:) = min(zctmax,zcv(:))
331 !
332 !-------------------------------------------------------------------------------
333 !
334 !* 8. THE HEAT CAPACITY OF FLOOD
335 ! --------------------------------
336 !
337 IF(oflood)THEN
338 !
339  zff(:) = pveg(:)*pffv(:) + (1.-pveg(:))*pffg(:)
340 !
341  WHERE(zff(:)>0.0)
342  zcf(:) = 2.0 * sqrt( xpi/(xcondwtr*xrholw*xcl*xday) )
343  ENDWHERE
344 !
345 ENDIF
346 !
347 !-------------------------------------------------------------------------------
348 !
349 !* 9. GRID-AVERAGED HEAT CAPACITY
350 ! ---------------------------
351 !
352 ! With contribution from the ground, flood and vegetation for explicit
353 ! (ISBA-ES) snow scheme option (i.e. no snow effects included here):
354 !
355 pct(:) = 1. / ( (1.-pveg(:))*(1.-pffg(:)) / pcg(:) &
356  + pveg(:) *(1.-pffv(:)) / zcv(:) &
357  + zff(:) / zcf(:) )
358 !
359 !-------------------------------------------------------------------------------
360 !
361 !* 10. RESTORE DEFAULT VALUES
362 ! ----------------------
363 !
364 ! restore default moisture and ice values under moisture soil depth
365 !
366 DO jl=1,inl
367  DO jj=1,ini
368  idepth=kwg_layer(jj)
369  IF(jl>idepth)THEN
370  pwg(jj,jl) = xundef
371  pwgi(jj,jl) = xundef
372  ENDIF
373  ENDDO
374 ENDDO
375 !
376 IF (lhook) CALL dr_hook('SOILDIF',1,zhook_handle)
377 !
378 !-------------------------------------------------------------------------------
379 !
380 END SUBROUTINE soildif
subroutine soildif(HDIFSFCOND, OFLOOD, PVEG, PCV, PFFG, PFFV, PCG, PCT, PFROZEN1, PD_G, PDZG, PTG, PWG, PWGI, KWG_LAYER, PHCAPSOILZ, PCONDDRYZ, PCONDSLDZ, PBCOEF, PWSAT, PMPOTSAT, PSOILCONDZ, PSOILHCAPZ, PFWTD, PWTD, PWR)
Definition: soildif.F90:6