SURFEX v8.1
General documentation of Surfex
isba_fluxes.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 ! ######spl
6  SUBROUTINE isba_fluxes(IO, KK, PK, PEK, DMK, PTSTEP, &
7  PSW_RAD, PLW_RAD, PTA, PQA, PRHOA, PEXNS, PEXNA, &
8  PHUG, PHUI, PLEG_DELTA, PLEGI_DELTA, PDELTA, PF5, PCS, PTSM, PT2M, &
9  PFROZEN1, PALBT, PEMIST, PQSAT, PDQSAT, PSNOW_THRUFAL, &
10  PRN, PH, PLE, PLEG, PLEGI, PLEV, PLES, PLER, PLETR, PEVAP, &
11  PGFLUX, PMELTADV, PMELT, PSOILCONDZ, PLE_FLOOD, PLEI_FLOOD)
12 ! ##########################################################################
13 !
14 !!**** *ISBA_FLUXES*
15 !!
16 !! PURPOSE
17 !! -------
18 !
19 ! Calculates the simple snowpack schemes melt and the surface fluxes.
20 !
21 !
22 !!** METHOD
23 !! ------
24 !
25 ! 1- snow melt latent heat, liquid rate (DEF option)
26 ! 2- derive the surface fluxes.
27 !
28 !! EXTERNAL
29 !! --------
30 !!
31 !! none
32 !!
33 !! IMPLICIT ARGUMENTS
34 !! ------------------
35 !!
36 !!
37 !! REFERENCE
38 !! ---------
39 !!
40 !! Noilhan and Planton (1989)
41 !! Belair (1995)
42 !! Douville et al. (1995)
43 !! Boone et al. (2000)
44 !!
45 !! AUTHOR
46 !! ------
47 !!
48 !! S. Belair * Meteo-France *
49 !!
50 !! MODIFICATIONS
51 !! -------------
52 !! Original 14/03/95
53 !! (J.Stein) 15/11/95 use the wind components in the flux computation
54 !! (J.Noilhan) 15/03/96 use the potential temperature instead of the
55 !! temperature for the heat flux computation
56 !! (J.Stein) 27/03/96 use only H and LE in the soil scheme
57 !! (A.Boone V.Masson) 05/10/98 splits e_budget in two for CO2
58 !! (A.Boone) 03/10/99 explicit latent heat of sublimation calculated
59 !! (A.Boone) 08/11/00 snow melt changes herein
60 !! (A.Boone) 06/05/02 Updates, ordering.
61 !! Introduction of snow melt timescale to 'DEF' snow option
62 !! (P.LeMoigne) 01/07/05 expression of latent heat flux as a function of
63 !! w'theta' instead of w'T' (divison by surface exner)
64 !! (P.LeMoigne) 28/07/05 dependence on qs for cp
65 !! (A. Dziedzic and PLM) 10/2006 EBA snow option
66 !! (B. Decharme)01/2009 Floodplains
67 !! (R. Hamdi) 01/09 Cp and L are not constants (As in ALADIN)
68 !! (B. Decharme)09/2009 Close the energy budget with the D95 snow scheme
69 !! (A.Boone) 03/2010 Add delta fnctions to force LEG ans LEGI=0
70 !! when hug(i)Qsat < Qa and Qsat > Qa
71 !! (A.Boone) 11/2011 Add RS_max limit to Etv
72 !! (B. Decharme)07/2012 Error in restore flux calculation (only for diag)
73 !! (B. Decharme)10/2012 Melt rate with D95 computed using max(XTAU,PTSTEP)
74 !! (A.Boone) 02/2013 Split soil phase changes into seperate routine
75 !! (B. Decharme)04/2013 Pass soil phase changes routines in hydro.F90
76 !! (B. Decharme)04/2013 Delete PTS_RAD because wrong diagnostic
77 !! (B. Decharme)10/14 "Restore" flux computed in e_budget
78 !-------------------------------------------------------------------------------
79 !
80 !* 0. DECLARATIONS
81 ! ------------
82 !
86 !
87 USE modd_csts, ONLY : xstefan, xcpd, xlstt, xlvtt, xcl, xtt, xpi, xday, &
89 USE modd_surf_par, ONLY : xundef
90 USE modd_isba_par, ONLY : xwgmin, xsphsoil, xdrywght, xrs_max
91 USE modd_snow_par, ONLY : xtau_smelt
92 !
93 USE mode_thermos
94 !
96 !
97 USE yomhook ,ONLY : lhook, dr_hook
98 USE parkind1 ,ONLY : jprb
99 !
100 IMPLICIT NONE
101 !
102 !* 0.1 declarations of arguments
103 !
104 TYPE(isba_options_t), INTENT(INOUT) :: IO
105 TYPE(isba_k_t), INTENT(INOUT) :: KK
106 TYPE(isba_p_t), INTENT(INOUT) :: PK
107 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
108 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
109 !
110 REAL, INTENT (IN) :: PTSTEP ! model time step (s)
111 !
112 REAL, DIMENSION(:), INTENT (IN) :: PSW_RAD, PLW_RAD, PTA, PQA, PRHOA
113 ! PSW_RAD = incoming solar radiation
114 ! PLW_RAD = atmospheric infrared radiation
115 ! PTA = near-ground air temperature
116 ! PQA = near-ground air specific humidity
117 ! PRHOA = near-ground air density
118 !
119 REAL, DIMENSION(:), INTENT(IN) :: PEXNS, PEXNA
120 REAL, DIMENSION(:), INTENT(IN) :: PHUG, PHUI, PDELTA, PF5
121 REAL, DIMENSION(:), INTENT(IN) :: PFROZEN1
122 REAL, DIMENSION(:), INTENT(IN) :: PALBT, PEMIST
123 REAL, DIMENSION(:), INTENT(IN) :: PQSAT, PDQSAT
124 REAL, DIMENSION(:), INTENT(IN) :: PLEG_DELTA, PLEGI_DELTA
125 ! PHUG = relative humidity of the soil
126 ! PF5 = water stress numerical correction factor (based on F2)
127 ! PDELTA = fraction of the foliage covered
128 ! by intercepted water
129 ! PFROZEN1 = fraction of ice in near-surface
130 ! ground
131 ! PALBT = area averaged albedo
132 ! PEMIST = area averaged emissivity
133 ! PQSAT = stauration vapor humidity at 't'
134 ! PDQSAT= stauration vapor humidity derivative at 't'
135 ! PLEG_DELTA = soil evaporation delta fn
136 ! PLEGI_DELTA = soil evaporation delta fn
137 !
138 REAL, DIMENSION(:), INTENT (IN) :: PCS, PT2M, PTSM
139 ! PCS = heat capacity of the snow (K m2 J-1)
140 ! PT2M = mean surface (or restore) temperature at start
141 ! of time step (K)
142 ! PTSM = surface temperature at start
143 ! of time step (K)
144 REAL, DIMENSION(:), INTENT(IN) :: PSNOW_THRUFAL
145 ! PSNOW_THRUFAL = rate that liquid water leaves snow pack:
146 ! ISBA-ES [kg/(m2 s)]
147 REAL, DIMENSION(:,:), INTENT(IN) :: PSOILCONDZ
148 ! PSOILCONDZ= ISBA-DF Soil conductivity profile [W/(m K)]
149 !
150 REAL, DIMENSION(:), INTENT(OUT) :: PLE_FLOOD, PLEI_FLOOD !Floodplains latent heat flux [W/mē]
151 !
152 REAL, DIMENSION(:), INTENT(OUT) :: PRN, PH, PLE, PLEG, PLEV, PLES
153 REAL, DIMENSION(:), INTENT(OUT) :: PLER, PLETR, PEVAP, PGFLUX, PMELTADV, PMELT
154 ! PRN = net radiation at the surface
155 ! PH = sensible heat flux
156 ! PLE = latent heat flux
157 ! PLEG = latent heat flux from the soil surface
158 ! PLEV = latent heat flux from the vegetation
159 ! PLES = latent heat flux from the snow
160 ! PLER = direct evaporation from the fraction
161 ! delta of the foliage
162 ! PLETR = transpiration of the remaining
163 ! part of the leaves
164 ! PEVAP = total evaporative flux (kg/m2/s)
165 ! PGFLUX = ground flux
166 ! PMELTADV = heat advection by melting snow
167 ! (acts to restore temperature to
168 ! melting point) (W/m2)
169 ! PMELT = melting rate of snow (kg m-2 s-1)
170 !
171 REAL, DIMENSION(:), INTENT(OUT) :: PLEGI
172 ! PLEGI = sublimation component of the
173 ! latent heat flux from the soil surface
174 !
175 !* 0.2 declarations of local variables
176 !
177 REAL :: ZKSOIL ! coefficient for soil freeze/thaw
178 !
179 REAL, DIMENSION(SIZE(PTA)) :: ZZHV, ZTN, ZDT
180 ! ZZHV = for the calculation of the latent
181 ! heat of evapotranspiration
182 !! ZTN = average temperature used in
183 ! the calculation of the
184 ! melting effect
185 ! ZDT = temperature change (K)
186 !
187 REAL, DIMENSION(SIZE(PTA)) :: ZPSN, ZPSNV, ZPSNG, ZFRAC
188 ! ZPSN, ZPSNV, ZPSNG = snow fractions corresponding to
189 ! dummy arguments PEK%XPSN(:), PEK%XPSNG(:), PEK%XPSNV(:)
190 ! if PEK%TSNOW%SCHEME = 'DEF' (composite
191 ! or Force-Restore snow scheme), else
192 ! they are zero for explicit snow case
193 ! as snow fluxes calculated outside of
194 ! this routine using the
195 ! PEK%TSNOW%SCHEME = '3-L' option.
196 !
197 REAL, DIMENSION(SIZE(PTA)) :: ZNEXTSNOW
198 ! ZNEXTSNOW = Future snow reservoir to close the
199 ! energy budget (see hydro_snow.f90)
200 !
201 REAL, DIMENSION(SIZE(PTA)) :: ZCONDAVG
202 ! ZCONDAVG = average thermal conductivity of surface
203 ! and sub-surface layers (W m-1 K-1)
204 !
205 !
206 !* 0.2 local arrays for EBA scheme
207 !
208 REAL :: ZEPS1
209 !
210 !* 0.3 declarations of local parameters
211 !
212 INTEGER :: JJ
213 !
214 REAL, DIMENSION(SIZE(PTA)) :: ZWORK1, ZWORK2, ZWORK3
215 !
216 REAL(KIND=JPRB) :: ZHOOK_HANDLE
217 !-------------------------------------------------------------------------------
218 !
219 !-------------------------------------------------------------------------------
220 !
221 !* 0. Initialization
222 ! --------------
223 IF (lhook) CALL dr_hook('ISBA_FLUXES',0,zhook_handle)
224 !
225 IF (pek%TSNOW%SCHEME == 'EBA') zeps1=1.0e-8
226 !
227 pmelt(:) = 0.0
228 pler(:) = 0.0
229 !
230 ztn(:) = 0.0
231 zdt(:) = 0.0
232 !
233 ! If ISBA-ES option in use, then snow covered surface
234 ! fluxes calculated outside of this routine, so set
235 ! the local snow fractions here to zero:
236 !
237 IF(pek%TSNOW%SCHEME == '3-L' .OR. pek%TSNOW%SCHEME == 'CRO' .OR. io%CISBA == 'DIF')THEN
238  zpsn(:) = 0.0
239  zpsng(:) = 0.0
240  zpsnv(:) = 0.0
241 ELSE
242  zpsn(:) = pek%XPSN(:)
243  zpsng(:) = pek%XPSNG(:)+kk%XFFG(:)
244  zpsnv(:) = pek%XPSNV(:)+kk%XFFV(:)
245  zfrac(:) = pek%XPSNG(:)
246 ENDIF
247 !
248 !-------------------------------------------------------------------------------
249 !
250 !* 1. FLUX CALCULATIONS
251 ! -----------------
252 !
253 DO jj=1,SIZE(pek%XTG,1)
254 ! temperature change
255  zdt(jj) = pek%XTG(jj,1) - ptsm(jj)
256 !
257 ! net radiation
258 !
259  prn(jj) = (1. - palbt(jj)) * psw_rad(jj) + pemist(jj) * &
260  (plw_rad(jj) - xstefan * (ptsm(jj)** 3)*(4.*pek%XTG(jj,1) - 3.*ptsm(jj)))
261 !
262 ! sensible heat flux
263 !
264  ph(jj) = prhoa(jj) * pk%XCPS(jj) * (pek%XTG(jj,1) - pta(jj)*pexns(jj)/pexna(jj)) &
265  / pek%XRESA(jj) / pexns(jj)
266 !
267  zwork1(jj) = prhoa(jj) * (1.-pek%XVEG(jj))*(1.-zpsng(jj)) / pek%XRESA(jj)
268  zwork2(jj) = pqsat(jj)+pdqsat(jj)*zdt(jj)
269 ! latent heat of sublimation from
270 ! the ground
271 !
272  plegi(jj) = zwork1(jj) * pk%XLSTT(jj) * ( phui(jj) * zwork2(jj) - pqa(jj)) * pfrozen1(jj) * plegi_delta(jj)
273 !
274 ! total latent heat of evaporation from
275 ! the ground
276 !
277  pleg(jj) = zwork1(jj) * pk%XLVTT(jj) * ( phug(jj) * zwork2(jj) - pqa(jj)) * (1.-pfrozen1(jj)) * pleg_delta(jj)
278 !
279  zwork2(jj) = prhoa(jj) * (zwork2(jj) - pqa(jj))
280  zwork3(jj) = zwork2(jj) / pek%XRESA(jj)
281 ! latent heat of evaporation from
282 ! the snow canopy
283 !
284  ples(jj) = pk%XLSTT(jj) * zpsn(jj) * zwork3(jj)
285 !
286 ! latent heat of evaporation from
287 ! evaporation
288 !
289  plev(jj) = pk%XLVTT(jj) * pek%XVEG(jj)*(1.-zpsnv(jj)) * dmk%XHV(jj) * zwork3(jj)
290 !
291 ! latent heat of evapotranspiration
292 !
293  zzhv(jj) = max(0., sign(1.,pqsat(jj) - pqa(jj)))
294  pletr(jj) = zzhv(jj) * (1. - pdelta(jj)) * pk%XLVTT(jj) * pek%XVEG(jj)*(1-zpsnv(jj)) &
295  * zwork2(jj) *( (1/(pek%XRESA(jj) + dmk%XRS(jj))) - ((1.-pf5(jj))/(pek%XRESA(jj) + xrs_max)) )
296 !
297 !
298  pler(jj) = plev(jj) - pletr(jj)
299 !
300 ! latent heat of free water (floodplains)
301 !
302  ple_flood(jj) = pk%XLVTT(jj) * (1.-kk%XFFROZEN(jj)) * kk%XFF(jj) * zwork3(jj)
303 !
304  plei_flood(jj) = pk%XLSTT(jj) * kk%XFFROZEN(jj) * kk%XFF(jj) * zwork3(jj)
305 !
306 ! total latent heat of evaporation
307 ! without flood
308 !
309  ple(jj) = pleg(jj) + plev(jj) + ples(jj) + plegi(jj)
310 !
311 ! heat flux into the ground
312 ! without flood
313 !
314  pgflux(jj) = prn(jj) - ph(jj) - ple(jj)
315 !
316 ! heat flux due to snow melt
317 ! (ISBA-ES/SNOW3L)
318 !
319  pmeltadv(jj) = psnow_thrufal(jj)*xcl*(xtt - pek%XTG(jj,1))
320 !
321 ! restore heat flux in FR mode,
322 ! or surface to sub-surface heat
323 ! flux using the DIF mode.
324 !
325 !
326  pevap(jj) = ((plev(jj) + pleg(jj))/pk%XLVTT(jj)) + ((plegi(jj) + ples(jj))/pk%XLSTT(jj))
327 ! total evaporative flux (kg/m2/s)
328 ! without flood
329 !
330 ENDDO
331 !
332 !-------------------------------------------------------------------------------
333 !
334 IF(pek%TSNOW%SCHEME == 'D95')THEN
335  DO jj=1,SIZE(pek%XTG,1)
336  ple(jj) = ple(jj) + ple_flood(jj) + plei_flood(jj)
337  pgflux(jj) = pgflux(jj) - ple_flood(jj) - plei_flood(jj)
338  pevap(jj) = pevap(jj) + ple_flood(jj)/pk%XLVTT(jj) + plei_flood(jj)/pk%XLSTT(jj)
339  ENDDO
340 ENDIF
341 !
342 !-------------------------------------------------------------------------------
343 !
344 !* 3. SNOWMELT LATENT HEATING EFFECTS ('DEF' option)
345 ! ----------------------------------------------
346 !
347 IF( (pek%TSNOW%SCHEME == 'D95' .OR. pek%TSNOW%SCHEME == 'EBA') .AND. io%CISBA /= 'DIF' )THEN
348 ! temperature tn
349 !
350  IF (pek%TSNOW%SCHEME == 'D95') THEN
351 !
352  ztn(:) = (1.-pek%XVEG(:))*pek%XTG(:,1) + pek%XVEG(:)*pt2m(:)
353 !
354 ! Only diag
355  dmk%XSNOWTEMP(:,1) = ztn(:)
356 !
357 !
358 ! melting rate
359 ! there is melting only if T > T0 and
360 ! of course when SNOWSWE > 0.
361 !
362  WHERE ( ztn(:) > xtt .AND. pek%TSNOW%WSNOW(:,1) > 0.0 )
363  pmelt(:) = zpsn(:)*(ztn(:)-xtt) / (pcs(:)*xlmtt*max(xtau_smelt,ptstep))
364  END WHERE
365 !
366 ! close the energy budget: cannot melt
367 ! more than the futur available snow
368 !
369  znextsnow(:) = pek%TSNOW%WSNOW(:,1) + ptstep * (dmk%XSRSFC(:) - ples(:) / pk%XLSTT(:))
370 !
371  WHERE ( pmelt(:) > 0.0 )
372 !
373  pmelt(:)=min(pmelt(:),znextsnow(:)/ptstep)
374  znextsnow(:) = znextsnow(:) - ptstep * pmelt
375 !
376 ! removes very small fraction
377  zfrac(:) = snow_frac_ground(znextsnow(:))
378  WHERE(zfrac(:)<1.0e-4)
379  pmelt(:) = pmelt(:) + znextsnow(:) / ptstep
380  ENDWHERE
381 !
382  ENDWHERE
383 !
384  ELSEIF (pek%TSNOW%SCHEME == 'EBA') THEN
385 !
386  pmelt(:)=min( pek%TSNOW%WSNOW(:,1)/ptstep + dmk%XSRSFC(:) - ples(:)/ pk%XLSTT(:) , &
387  max(0.0,(pek%XTG(:,1)-xtt)) / max(zeps1,dmk%XCT*ptstep) / xlmtt )
388 !
389  ENDIF
390 !
391 ! new temperature Ts(t) after melting
392 ! (cooling due to the melting of the
393 ! snow)
394 !
395  pek%XTG(:,1) = pek%XTG(:,1) - dmk%XCT(:)*xlmtt*pmelt(:)*ptstep
396 !
397 ENDIF
398 !
399 !
400 IF (lhook) CALL dr_hook('ISBA_FLUXES',1,zhook_handle)
401 !-------------------------------------------------------------------------------
402 END SUBROUTINE isba_fluxes
403 
404 
405 
406 
407 
408 
409 
410 
411 
412 
413 
real, save xcpd
Definition: modd_csts.F90:63
real, save xstefan
Definition: modd_csts.F90:59
real, save xlvtt
Definition: modd_csts.F90:70
real, save xpi
Definition: modd_csts.F90:43
real, save xlstt
Definition: modd_csts.F90:71
real, parameter xundef
real, save xcondi
Definition: modd_csts.F90:82
real, save xg
Definition: modd_csts.F90:55
integer, parameter jprb
Definition: parkind1.F90:32
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 function, dimension(size(pwsnow)) snow_frac_ground(PWSNOW)
real, save xrholw
Definition: modd_csts.F90:64
subroutine isba_fluxes(IO, KK, PK, PEK, DMK, PTSTEP, PSW_RAD, PLW_RAD, PTA, PQA, PRHOA, PEXNS, P
Definition: isba_fluxes.F90:8
real, save xtt
Definition: modd_csts.F90:66
real, save xlmtt
Definition: modd_csts.F90:72