SURFEX v8.1
General documentation of Surfex
ice_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 ice_soildif(KK, PK, PEK, PTSTEP, PKSFC_IVEG, PLEGI, PSOILHCAPZ, PWGI_EXCESS)
7 ! ##########################################################################
8 !
9 !!**** *ICE_SOILDIF*
10 !
11 !! PURPOSE
12 !! -------
13 ! This subroutine calculates soil water phase changes using the
14 ! available/excess energy approach. Soil temperature and volumetric
15 ! ice content are adjusted due to phase changes. See the references
16 ! Boone et al., 39, JAM, 2000 and Giard and Bazile, 128, MWR, 2000.
17 ! NOTE that more recently a modification was made: freeze/thaw follows
18 ! a relationship between liquid water and temperature derriving from
19 ! the Clausius Clapeyron Eq. This results in little to no freezing for
20 ! sufficiently dry but cold (below freezing) soils. Scatter about this
21 ! curve results due to 'phase change efficiencies' and the surface insolation
22 ! coefficient.
23 !
24 !!** METHOD
25 !! ------
26 !
27 ! Direct calculation
28 !
29 !! EXTERNAL
30 !! --------
31 !
32 ! None
33 !!
34 !! IMPLICIT ARGUMENTS
35 !! ------------------
36 !!
37 !!
38 !! REFERENCE
39 !! ---------
40 !!
41 !! Boone (2000)
42 !! Boone et al., (2000)
43 !!
44 !! AUTHOR
45 !! ------
46 !! A. Boone * Meteo-France *
47 !!
48 !! MODIFICATIONS
49 !! -------------
50 !! Original 28/02/00 Boonei
51 !! Modified 24/11/09 Boone
52 !! Limit energy available for phase change by
53 ! local amount owing to diffusion. Has almost
54 ! no impact except under rare circumstances
55 ! (avoids rare but possible oscillatory behavior)
56 ! Also, add minimum (numerical) melt/freeze efficieny to prevent
57 ! prolonged periods of small ice amounts approaching zero.
58 !
59 !! Modified 01/06/11 Boone
60 ! Use apparent heat capacity linearization for freezing
61 ! (when temperature depenence on ice change is direct)
62 ! Do away with efficiency coefficients as they acted to provide
63 ! numerical stability: not needed as apparent heat capacity increases
64 ! the effective heat capacity thus increasing stability.
65 ! NOTE: for now considers Brooks & Corey type water retention.
66 !
67 ! Modified 08/2011 Decharme
68 ! Optimization
69 ! Modified 10/2013 Boone
70 ! Slight edit to phase computation to improve enthalpy conservation
71 !
72 !-------------------------------------------------------------------------------
73 !
74 !* 0. DECLARATIONS
75 ! ------------
76 !
78 !
79 USE modd_csts, ONLY : xlmtt, xtt, xg, xci, xrholi, xrholw
80 USE modd_isba_par, ONLY : xwgmin
81 !
82 USE yomhook ,ONLY : lhook, dr_hook
83 USE parkind1 ,ONLY : jprb
84 !
85 IMPLICIT NONE
86 !
87 !* 0.1 declarations of arguments
88 !
89 TYPE(isba_k_t), INTENT(INOUT) :: KK
90 TYPE(isba_p_t), INTENT(INOUT) :: PK
91 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
92 !
93 REAL, INTENT(IN) :: PTSTEP ! Model time step (s)
94 !
95 REAL, DIMENSION(:), INTENT(IN) :: PKSFC_IVEG, PLEGI
96 ! PKSFC_IVEG = effect of surface layer insolation on phase changes
97 ! Giard and Bazile (2000): non-dimensional
98 ! PLEGI = ice sublimation (m s-1)
99 !
100 REAL, DIMENSION(:,:), INTENT(IN) :: PSOILHCAPZ
101 ! PSOILHCAPZ = soil heat capacity [J/(m3 K)]
102 !
103 REAL, DIMENSION(:), INTENT(OUT) :: PWGI_EXCESS
104 ! PWGI_EXCESS = Soil ice excess water content
105 !
106 !* 0.2 declarations of local variables
107 !
108 INTEGER :: JJ, JL ! loop control
109 !
110 INTEGER :: INI ! Number of point
111 INTEGER :: INL ! Number of explicit soil layers
112 INTEGER :: IDEPTH ! Total moisture soil depth
113 !
114 REAL, DIMENSION(SIZE(PEK%XTG,1),SIZE(PEK%XTG,2)) :: ZK, ZEXCESSFC
115 !
116 REAL, DIMENSION(SIZE(PEK%XTG,1)) :: ZEXCESS
117 !
118 REAL :: ZWGMAX, ZPSIMAX, ZPSI, ZDELTAT, &
119  ZPHASE, ZTGM, ZWGM, ZWGIM, ZLOG, &
120  ZEFFIC, ZPHASEM, ZPHASEF, ZWORK, &
121  ZAPPHEATCAP
122 !
123 REAL(KIND=JPRB) :: ZHOOK_HANDLE
124 !-------------------------------------------------------------------------------
125 !
126 ! Initialization:
127 ! ---------------
128 !
129 IF (lhook) CALL dr_hook('ICE_SOILDIF',0,zhook_handle)
130 !
131 ini = SIZE(pek%XTG,1)
132 inl = maxval(pk%NWG_LAYER)
133 !
134 zexcessfc(:,:)=0.0
135 zexcess(: )=0.0
136 pwgi_excess(: )=0.0
137 !
138 !-------------------------------------------------------------------------------
139 !
140 ! 1. Surface layer vegetation insulation coefficient (-)
141 ! ---------------------------------------------------
142 !
143 zk(:,:) = 1.0
144 zk(:,1) = pksfc_iveg(:)
145 !
146 ! 2. Soil ice evolution computation:
147 ! -------------------------------
148 !
149 DO jl=1,inl
150  DO jj=1,ini
151  idepth=pk%NWG_LAYER(jj)
152  IF(jl<=idepth)THEN
153 !
154  zwgim = pek%XWGI(jj,jl)
155  zwgm = pek%XWG (jj,jl)
156  ztgm = pek%XTG (jj,jl)
157 
158 ! The maximum liquid water content as
159 ! as function of temperature (sub-freezing)
160 ! based on Gibbs free energy (Fuchs et al., 1978):
161 !
162  zpsimax = min(kk%XMPOTSAT(jj,jl),xlmtt*(pek%XTG(jj,jl)-xtt)/(xg*pek%XTG(jj,jl)))
163 !
164  zwork = zpsimax/kk%XMPOTSAT(jj,jl)
165  zlog = log(zwork)/kk%XBCOEF(jj,jl)
166  zwgmax = kk%XWSAT(jj,jl)*exp(-zlog)
167 !
168 ! Calculate maximum temperature for ice based on Gibbs free energy: first
169 ! compute soil water potential using Brook and Corey (1966) model:
170 ! psi=mpotsat*(w/wsat)**(-bcoef)
171 !
172  zwork = pek%XWG(jj,jl)/kk%XWSAT(jj,jl)
173  zlog = kk%XBCOEF(jj,jl)*log(zwork)
174  zpsi = kk%XMPOTSAT(jj,jl)*exp(-zlog)
175 !
176  zdeltat = pek%XTG(jj,jl) - xlmtt*xtt/(xlmtt-xg*zpsi)
177 !
178 ! Compute apparent heat capacity. This is considered
179 ! only when there is available energy (cold) and liquid water
180 ! available...freezing front.
181 ! This also has the secondary effect of increasing numerical stability
182 ! during freezing (as there is a strong temperature dependence) by
183 ! i) potentially significantly increasing the "apparent" heat capacity and
184 ! ii) this part is also treated implicitly herein.
185 !
186  zwork = (xci*xrholi/(xlmtt*xrholw))*zk(jj,jl)*max(0.0,-zdeltat)
187 !
188  zappheatcap=0.0
189  IF(zdeltat<0.0.AND.zwgm>=zwgmax.AND.zwork>=max(0.0,zwgm-zwgmax))THEN
190  zappheatcap = -(xtt*xrholw*xlmtt*xlmtt/xg)*zwgmax/(zpsimax*kk%XBCOEF(jj,jl)*ztgm*ztgm)
191  ENDIF
192 !
193 ! *Melt* ice if energy and ice available:
194  zphasem = (ptstep/pk%XTAUICE(jj))*min(zk(jj,jl)*xci*xrholi*max(0.0,zdeltat),zwgim*xlmtt*xrholw)
195 !
196 ! *Freeze* liquid water if energy and water available:
197  zphasef = (ptstep/pk%XTAUICE(jj))*min(zk(jj,jl)*xci*xrholi*max(0.0,-zdeltat),max(0.0,zwgm-zwgmax)*xlmtt*xrholw)
198 !
199 ! Update heat content if melting or freezing
200  pek%XTG(jj,jl) = ztgm + (zphasef - zphasem)/(psoilhcapz(jj,jl)+zappheatcap)
201 !
202 ! Get estimate of actual total phase change (J/m3) for equivalent soil water changes:
203  zphase = (psoilhcapz(jj,jl)+zappheatcap)*(pek%XTG(jj,jl)-ztgm)
204 !
205 ! Adjust ice and liquid water conents (m3/m3) accordingly :
206  pek%XWGI(jj,jl) = zwgim + zphase/(xlmtt*xrholw)
207  pek%XWG(jj,jl) = zwgm - zphase/(xlmtt*xrholw)
208 !
209  ENDIF
210  ENDDO
211 ENDDO
212 !
213 ! 3. Adjust surface soil ice content for sublimation
214 ! -----------------------------------------------
215 !
216 pek%XWGI(:,1) = pek%XWGI(:,1) - plegi(:)*ptstep/pk%XDZG(:,1)
217 !
218 ! The remaining code in this block are merely constraints to ensure a highly
219 ! accurate water budget: most of the time this code will not have any
220 ! effect on the soil water profile.
221 ! If sublimation causes all of the remaining ice to be extracted, remove
222 ! some of the liquid (a correction): NOTE that latent heating already accounted
223 ! for in sublimation term, so no need to alter soil temperature.
224 !
225 zexcess(:) = max(0.0, - pek%XWGI(:,1))
226 pek%XWG(:,1) = pek%XWG (:,1) - zexcess(:)
227 pek%XWGI(:,1) = pek%XWGI (:,1) + zexcess(:)
228 zexcessfc(:,1) = zexcessfc(:,1) - zexcess(:)
229 !
230 ! 4. Prevent some possible problems
231 ! ------------------------------
232 !
233 ! If sublimation is negative (condensation), make sure ice does not
234 ! exceed maximum possible. If it does, then put excess ice into layer below:
235 ! This correction should rarely if ever cause any ice accumulation in the
236 ! sub-surface layer: this is especially true of deeper layers but it is
237 ! accounted for none-the-less.
238 !
239 DO jl=1,inl
240  DO jj=1,ini
241  idepth=pk%NWG_LAYER(jj)
242  IF(jl<=idepth)THEN
243  zexcess(jj) = max(0.0, pek%XWGI(jj,jl) - (kk%XWSAT(jj,jl)-xwgmin) )
244  pek%XWGI(jj,jl) = pek%XWGI(jj,jl) - zexcess(jj)
245  zexcessfc(jj,jl) = zexcessfc(jj,jl) + zexcess(jj)
246  IF(jl<idepth)THEN
247  pek%XWGI(jj,jl+1) = pek%XWGI(jj,jl+1) + zexcess(jj)*(pk%XDZG(jj,jl)/pk%XDZG(jj,jl+1))
248  zexcessfc(jj,jl+1) = zexcessfc(jj,jl+1) - zexcess(jj)*(pk%XDZG(jj,jl)/pk%XDZG(jj,jl+1))
249  ELSE
250  pwgi_excess(jj) = zexcess(jj)*pk%XDZG(jj,idepth)*xrholw/ptstep
251  ENDIF
252  ENDIF
253  ENDDO
254 ENDDO
255 !
256 ! Prevent keeping track of very small numbers for ice content: (melt it)
257 ! and conserve energy:
258 !
259 DO jl=1,inl
260  DO jj=1,ini
261  idepth=pk%NWG_LAYER(jj)
262  IF(jl<=idepth.AND.pek%XWGI(jj,jl)>0.0.AND.pek%XWGI(jj,jl)<1.0e-6)THEN
263  pek%XWG (jj,jl) = pek%XWG(jj,jl) + pek%XWGI(jj,jl)
264  zexcessfc(jj,jl) = zexcessfc(jj,jl) + pek%XWGI(jj,jl)
265  pek%XWGI(jj,jl) = 0.0
266  ENDIF
267  pek%XTG(jj,jl) = pek%XTG(jj,jl) - zexcessfc(jj,jl)*xlmtt*xrholw/psoilhcapz(jj,jl)
268  ENDDO
269 ENDDO
270 !
271 !
272 IF (lhook) CALL dr_hook('ICE_SOILDIF',1,zhook_handle)
273 !
274 !-------------------------------------------------------------------------------
275 !
276 END SUBROUTINE ice_soildif
subroutine ice_soildif(KK, PK, PEK, PTSTEP, PKSFC_IVEG, PLEGI, PSO
Definition: ice_soildif.F90:7
real, save xg
Definition: modd_csts.F90:55
integer, parameter jprb
Definition: parkind1.F90:32
real, save xci
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, save xtt
Definition: modd_csts.F90:66
real, save xlmtt
Definition: modd_csts.F90:72