SURFEX v8.1
General documentation of Surfex
drag_meb.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 !
7 SUBROUTINE drag_meb(IO, PEK, DMK, DK, PTG, PTA, PQA, PVMOD, &
8  PWG, PWGI, PWSAT, PWFC, PEXNS, PEXNA, PPS, PRR, PSR, &
9  PRHOA, PZ0G_WITHOUT_SNOW, PZ0_MEBV, PZ0H_MEBV, &
10  PZ0EFF_MEBV, PZ0_MEBN, PZ0H_MEBN, PZ0EFF_MEBN, PSNOWSWE,&
11  PCHIP, PTSTEP, PRS_VG, PRS_VN, PPALPHAN, PZREF, PUREF, &
12  PDIRCOSZW, PSNCV, PDELTA, PVELC, &
13  PRISNOW, PUSTAR2SNOW, PHUGI, PHVG, PHVN, PLEG_DELTA, &
14  PLEGI_DELTA, PHSGL, PHSGF, PFLXC_C_A, PFLXC_N_A, &
15  PFLXC_G_C, PFLXC_N_C, PFLXC_VG_C, PFLXC_VN_C, PFLXC_MOM,&
16  PQSATG, PQSATV, PQSATC, PQSATN, PDELTAVK )
17 !
18 ! ############################################################################
19 !
20 !!**** *DRAG_MEB*
21 !!
22 !! PURPOSE
23 !! -------
24 !!
25 !! Calculates the coefficients for heat transfers
26 !! for the multiple-energy balance, and Halstead coefficients.
27 !! Also estimate patch average specific and relative humidity, as well
28 !! as exchange coefficients and Richardson's number
29 !!
30 !!
31 !!** METHOD
32 !! ------
33 !!
34 !! EXTERNAL
35 !! --------
36 !!
37 !! IMPLICIT ARGUMENTS
38 !! ------------------
39 !!
40 !! USE MODD_CST
41 !!
42 !!
43 !! REFERENCE
44 !! ---------
45 !!
46 !!
47 !! AUTHOR
48 !! ------
49 !!
50 !! P.Samuelsson/S.Gollvik * SMHI *
51 !!
52 !! MODIFICATIONS
53 !! -------------
54 !! Original 06/2010
55 !! For MEB 01/2011
56 ! 10/2014 (A. Boone) Remove understory compsite vegetation
57 ! 10/2014 (A. Napoly) Added ground/litter resistance
58 !-------------------------------------------------------------------------------
59 !
60 !* 0. DECLARATIONS
61 ! ------------
62 !
64 USE modd_isba_n, ONLY : isba_pe_t
65 USE modd_diag_n, ONLY : diag_t
67 !
68 USE modd_csts, ONLY : xpi
69 USE modd_snow_par, ONLY : xz0sn
70 USE modd_isba_par, ONLY : xwgmin
73 USE modd_meb_par, ONLY : xkdelta_wr
74 !
75 USE modi_surface_cdch_1darp
76 USE modi_wind_threshold
77 USE modi_disph_for_meb
78 USE modi_preps_for_meb_drag
79 USE modi_surface_air_meb
80 !
81 USE mode_thermos, ONLY : qsat, qsati
82 !
83 USE yomhook ,ONLY : lhook, dr_hook
84 USE parkind1 ,ONLY : jprb
85 !
86 IMPLICIT NONE
87 !
88 !* 0.1 declarations of arguments
89 !
90 TYPE(isba_options_t), INTENT(INOUT) :: IO
91 TYPE(isba_pe_t), INTENT(INOUT) :: PEK
92 TYPE(diag_t), INTENT(INOUT) :: DK
93 TYPE(diag_misc_isba_t), INTENT(INOUT) :: DMK
94 !
95 REAL, INTENT(IN) :: PTSTEP
96 ! PTSTEP = Model time step (s)
97 !
98 REAL, DIMENSION(:), INTENT(IN) :: PTG, PTA, PQA, PVMOD, PWG, PWGI, PWSAT, PWFC, &
99  PEXNS, PEXNA, PPS, PSNOWSWE
100 ! PTG = surface temperature
101 ! PSNOWSWE = sfc layer snow water equiv (SWE) kg m-2
102 ! PTA = temperature of the atmosphere/forcing-level
103 ! PQA = specific humidity of the atmosphere/forcing-level
104 ! PVMOD = module of the horizontal wind
105 ! NOTE it should be input as >= 1. (m)
106 ! PWG = near-surface volumetric water content
107 ! PWGI = near-surface frozen volumetric water content
108 ! PWSAT = volumetric water content at saturation
109 ! PWFC = field capacity volumetric water content
110 ! PEXNS = Exner function at the surface
111 ! PEXNA= Exner function of the atmosphere/forcing-level
112 ! PPS = surface pressure
113 !
114 REAL, DIMENSION(:), INTENT(IN) :: PRR, PSR, PRHOA
115 ! PRR = rain rate
116 ! PSR = snow rate
117 ! PRHOA = near-ground air density
118 !
119 REAL, DIMENSION(:), INTENT(IN) :: PZ0G_WITHOUT_SNOW, &
120  PZ0_MEBV, PZ0H_MEBV, PZ0EFF_MEBV, &
121  PZ0_MEBN, PZ0H_MEBN, PZ0EFF_MEBN
122 !
123 ! PZ0G_WITHOUT_SNOW ! roughness length for momentum at snow-free canopy floor
124 ! PZ0_MEBV ! roughness length for momentum over MEB vegetation part of patch
125 ! PZ0H_MEBV ! roughness length for heat over MEB vegetataion part of path
126 ! PZ0_MEBN ! roughness length for momentum over MEB snow part of patch
127 ! PZ0H_MEBN ! roughness length for heat over MEB snow part of path
128 !
129 REAL, DIMENSION(:), INTENT(IN) :: PCHIP
130 ! PCHIP = view factor (for LW)
131 !
132 REAL, DIMENSION(:), INTENT(IN) :: PRS_VG, PRS_VN, PSNCV, &
133  PPALPHAN, PZREF, PUREF, PDIRCOSZW
134 !
135 ! PRS_VG = surface resistance for canopy (1-png)
136 ! PRS_VN = surface resistance for canopy (png)
137 ! PSNCV = fraction of the canopy vegetation covered by snow
138 ! PPALPHAN = weight between canopy air flow and direct flow
139 ! between snow and atmosphere
140 ! PZREF = reference height of the first
141 ! atmospheric level
142 ! PUREF = reference height of the wind
143 ! NOTE this is different from ZZREF
144 ! ONLY in stand-alone/forced mode,
145 ! NOT when coupled to a model (MesoNH)
146 ! PDIRCOSZW= Cosinus of the angle between
147 ! the normal to the surface and the vertical
148 !
149 REAL, DIMENSION(:), INTENT(IN) :: PDELTA
150 ! PDELTA = fraction of the canopy foliage covered
151 ! by intercepted water (-)
152 !
153 REAL, DIMENSION(:), INTENT(OUT) :: PDELTAVK
154 ! PDELTAVK = fraction of the canopy foliage covered
155 ! by intercepted water *including* K-factor (-)
156 ! (i.e. that the intercepted water fraction is not
157 ! necessarily reaching 100%)
158 !
159 REAL, DIMENSION(:), INTENT(OUT) :: PVELC
160 ! PVELC = wind speed at top of vegetation
161 !
162 REAL, DIMENSION(:), INTENT(OUT) :: PHUGI, PHVG, PHVN, PLEG_DELTA, PLEGI_DELTA, PHSGL, PHSGF
163 !
164 ! PHUGI = ground (ice) relative humidity
165 ! PHVN = Halstead coefficient vegetation canopy above snow
166 ! PHVG = Halstead coefficient vegetation canopy above ground
167 ! PLEG_DELTA = soil evaporation delta fn
168 ! PLEGI_DELTA = soil sublimation delta fn
169 ! PHSGL = surface halstead cofficient for bare soil (currently==1)
170 ! PHSGF = surface halstead cofficient for bare soil ice (currently==1)
171 !
172 !
173 REAL, DIMENSION(:), INTENT(OUT) :: PFLXC_C_A, PFLXC_N_A, PFLXC_G_C, PFLXC_N_C, PFLXC_VG_C, PFLXC_VN_C
174 !
175 ! EXCHANGE coefficients i.e. rho/resistance [kg/m2/s]
176 !
177 ! PFLXC_C_A between canopy air and atmosphere
178 ! PFLXC_N_A between the snow on the ground and atmosphere
179 ! PFLXC_G_C between snow-free ground and canopy air
180 ! PFLXC_N_C between snow on the ground and canopy air
181 ! PFLXC_VG_C between canopy over snow-free ground and canopy air
182 ! PFLXC_VN_C between canopy over the snow on the ground and canopy air
183 !
184 REAL, DIMENSION(:), INTENT(OUT) :: PFLXC_MOM, PQSATG, PQSATV, PQSATC, PQSATN
185 ! PFLXC_MOM = effective drag coefficient for momentum [kg/m2/s]
186 ! PQSATG = qsat for PTG
187 ! PQSATV = qsat for PEK%XTV(:)
188 ! PQSATC = qsat for PEK%XTC(:)
189 ! PQSATN = qsat for DMK%XSNOWTEMP(:)
190 !
191 REAL, DIMENSION(:), INTENT(OUT) :: PRISNOW, PUSTAR2SNOW
192 ! PRISNOW = Richardson number over snow (-)
193 ! PUSTAR2SNOW = Surface friction velocity squared (m2 s-2)
194 ! Just a diagnostic, not used in coupling
195 
196 !
197 !* 0.2 declarations of local variables
198 !
199 !
200 !
201 REAL, DIMENSION(SIZE(PTG)) :: ZAC,ZWFC,ZWSAT,ZFP,ZRRCOR
202 ! ZQSATG = specific humidity at saturation at ground
203 ! ZQSATN = specific humidity of snow
204 ! ZAC = aerodynamical conductance
205 ! ZWFC = field capacity in presence of ice
206 ! ZWSAT = saturation in presence of ice
207 ! ZFP = working variable
208 ! ZRRCOR = correction of CD, CH, CDN due to moist-gustiness
209 !
210 REAL, DIMENSION(SIZE(PTG)) :: ZCHIL, ZLAISN, ZLW, ZDISPH, ZVELC, ZRICN, ZRA_C_A, &
211  ZRA_G_C, ZG_VG_C, ZRA_N_C, ZG_VN_C
212 ! ZLAISN = leaf area index for snow covered ground
213 ! ZLW = leaf width
214 ! ZVELC = wind speed at top of vegetation
215 ! ZRICN = Richardson nr between canopy air and atmosphere
216 ! ZRA_C_A = resistance between canopy air and atmosphere
217 ! ZRA_G_C = resistance between canopy air and snow free ground
218 ! ZG_VG_C = conductance between canopy and canopy air (1-png)
219 ! ZRA_N_C = aerodynamic resistance between the partly
220 ! snowcovered (png>0), ground and canopy air
221 ! ZG_VN_C = conductance between canopy and canopy air (png)
222 !
223 REAL, DIMENSION(SIZE(PTG)) :: ZCHCN,ZCDNCN,ZCDCN !exchange coefficients between
224 ! canopy air and atmosphere
225 !
226 REAL, DIMENSION(SIZE(PTG)) :: ZRINN,ZRANN,ZCHNN,ZCDNNN,ZCDNN,ZTEFF,ZDELTAMAX,ZDELTAV,ZVMOD
227 !
228 REAL, DIMENSION(SIZE(PTG)) :: ZRSGL,ZRSGF,ZZ0SN
229 ! ZRSGL = surface resistance for bare soil (currently==0)
230 ! ZRSGF = surface resistance for bare soil ice (currently==0)
231 ! ZZ0SN = array of XZ0SN
232 !
233 REAL, DIMENSION(SIZE(PTG)) :: ZRSNFRAC, ZDENOM
234 ! ZRSNFRAC = fraction to prevent/reduce sublimation of snow if too thin (-)
235 ! ZDENOM = working variable for denominator of an expression (*)
236 !
237 REAL, DIMENSION(SIZE(PTG)) :: ZUSTAR2G, ZCDG, ZCHG, ZRIG, ZPSNA
238 ! ZUSTAR2G = canopy top friction velocity squared (m2/s2)
239 ! ZCDG = drag coefficient (-)
240 ! ZCHG = heat transfor coefficient (ground to canopy air) (-)
241 ! ZRIG = Richardson number (ground to canopy air) (-)!
242 ! ZPSNA = buried (by snow) canopy fraction (-)
243 !
244 !* 0.3 declarations of local parameters
245 !
246 REAL, PARAMETER :: ZRAEPS = 1.e-3 ! Safe limit of aerodynamic resistance to avoid dividing
247 ! ! by zero when calculating exchange coefficients
248 REAL, PARAMETER :: ZSNOWSWESMIN = 1.e-4 ! (kg m-2) Reduce sublimation from ground based snowpack as it
249 ! ! becomes vanishingly thin
250 REAL, PARAMETER :: ZRG_COEF1 = 8.206 ! Ground/litter resistance coefficient
251 REAL, PARAMETER :: ZRG_COEF2 = 4.255 ! Ground/litter resistance coefficient
252 !
253 !
254 REAL(KIND=JPRB) :: ZHOOK_HANDLE
255 !-------------------------------------------------------------------------------
256 !
257 !* 0. Initialization:
258 ! ---------------
259 !
260 IF (lhook) CALL dr_hook('DRAG_MEB',0,zhook_handle)
261 !
262 dk%XCH(:) = 0.
263 dk%XCD(:) = 0.
264 dk%XCDN(:) = 0.
265 dk%XRI(:) = 0.
266 dk%XHUG(:) = 0.
267 !
268 dmk%XHV(:) = 0.
269 dk%XHU(:) = 0.
270 !
271 phugi(:) = 0.
272 phvn(:) = 0.
273 phvg(:) = 0.
274 phsgl(:) = 0.
275 phsgf(:) = 0.
276 !
277 pflxc_c_a(:) = 0.
278 pflxc_g_c(:) = 0.
279 pflxc_n_c(:) = 0.
280 pflxc_vg_c(:) = 0.
281 pflxc_vn_c(:) = 0.
282 pflxc_n_a(:) = 0.
283 pflxc_mom(:) = 0.
284 !
285 zrsgl(:) = 0.
286 zrsgf(:) = 0.
287 zz0sn(:) = xz0sn
288 !
289 !-------------------------------------------------------------------------------
290 !
291 !* 1. RELATIVE HUMIDITY OF THE GROUND HU
292 ! ----------------------------------
293 !
294 ! this relative humidity is related to
295 ! the superficial soil moisture and the
296 ! field capacity of the ground
297 !
298 zwsat(:) = pwsat(:)-pwgi(:)
299 zwfc(:) = pwfc(:)*zwsat(:)/pwsat(:)
300 !
301 dk%XHUG(:) = 0.5 * ( 1.-cos(xpi*min((pwg(:)-xwgmin) /zwfc(:),1.)) )
302 !
303 zwsat(:) = max(xwgmin, pwsat(:)-pwg(:))
304 zwfc(:) = pwfc(:)*zwsat(:)/pwsat(:)
305 phugi(:) = 0.5 * ( 1.-cos(xpi*min(pwgi(:)/zwfc(:),1.)) )
306 !
307 ! there is a specific treatment for dew
308 ! (see Mahfouf and Noilhan, jam, 1991)
309 !
310 pqsatg(:) = qsat(ptg(:),pps(:))
311 pqsatv(:) = qsat(pek%XTV(:),pps(:))
312 pqsatc(:) = qsat(pek%XTC(:),pps(:))
313 pqsatn(:) = qsati(dmk%XSNOWTEMP(:,1),pps(:))
314 !
315 !-------------------------------------------------------------------------------
316 !
317 !* 2. GRID-AVERAGED HUMIDITY OF THE SURFACE
318 ! -------------------------------------
319 ! average of canopy air humidity and saturation humidity of snowpack
320 !
321 !
322 dk%XQS(:) =(1.-pek%XPSN(:)*ppalphan(:))*pek%XQC(:) + pek%XPSN(:)*ppalphan(:)*pqsatn(:)
323 dk%XHU(:) =(1.-pek%XPSN(:)*ppalphan(:))*pek%XQC(:)/pqsatc(:)+ pek%XPSN(:)*ppalphan(:)
324 !
325 !-------------------------------------------------------------------------------
326 !
327 !* 3. SPECIFIC HEAT OF THE SURFACE
328 ! ----------------------------
329 ! Comment S.Gollvik 20110120
330 ! AARON IN E-BUDGET:
331 !
332 !IF (HCPSURF=='DRY') THEN
333 ! PCPS(:) = XCPD
334 !ELSEIF(.NOT.LCPL_ARP)THEN
335 ! PCPS(:) = XCPD + ( XCPV - XCPD ) * PQA(:)
336 !ENDIF
337 !
338 !-------------------------------------------------------------------------------
339 !
340 !* 4. COMPUTATION OF RESISTANCES/CONDUCTIVITES
341 ! ----------------------------------------------
342 !
343 zchil(:)=0.12
344 zlw(:)=0.02
345 !
346 ! Calculate the displacement height
347 !
348  CALL disph_for_meb(zchil,pek%XLAI,zlw,pek%XH_VEG,pzref,pz0_mebv,zdisph)
349 !
350 ! Here ZRICN,ZRA_C_A,ZCHCN,ZCDNCN,ZCDCN are valid for the snow free part in meb:
351 !
352  CALL preps_for_meb_drag(.true.,io%LFORC_MEASURE, pz0_mebv, pz0h_mebv, pz0eff_mebv, &
353  pek%XH_VEG, pzref, pek%XTC, pta, pek%XQC, pqa, puref, &
354  pvmod, pexna, pexns, pdircoszw, zdisph, pvelc, zvmod, zricn,&
355  zra_c_a, zchcn, zcdncn, zcdcn )
356 !
357 IF (lrrgust_arp) THEN
358 
359  zfp(:)=max(0.0,prr(:)+psr(:))
360  zrrcor(:)=sqrt(1.0+((((zfp(:)/(zfp(:)+xrrscale))**xrrgamma)*xutilgust)**2) &
361  & /(zcdcn(:)*zvmod(:)**2))
362 
363  zcdcn(:) = zcdcn(:) * zrrcor(:)
364  zchcn(:) = zchcn(:) * zrrcor(:)
365  zcdncn(:) = zcdncn(:) * zrrcor(:)
366 
367 ENDIF
368 !
369 pflxc_c_a(:)=zchcn(:)*zvmod(:)*prhoa(:)
370 !
371 !
372 ! The momentum drag for this area:
373 !
374 pflxc_mom(:)=zcdcn(:)*zvmod(:)*prhoa(:)
375 !
376 !Calculate the aerodynamic resistance between the snowfree part of the ground
377 !and canopy air, ZRA_G_C, and the conductance between the canopy and canopy air, ZG_VG_C
378 !
379  CALL surface_air_meb(pz0_mebv, pz0h_mebv, pz0g_without_snow, pek%XH_VEG, pek%XLAI, &
380  ptg, pek%XTC, pek%XTV, pvelc, zlw, zdisph, &
381  zra_g_c, zg_vg_c, zustar2g, zcdg, zchg, zrig )
382 !
383 !Compute the lai of the canopy that is above snow
384 !
385 zlaisn(:)= pek%XLAI(:)*(1.-ppalphan(:))
386 !
387 ! Note that we use the same displacement height also for the snow covered part
388 !
389 ! The same as ZRA_G_C/ZG_VG_C but for the snow part (png) =>ZRA_N_C/ZG_VN_C
390 !
391  CALL surface_air_meb(pz0_mebn, pz0h_mebn, zz0sn, pek%XH_VEG, zlaisn, &
392  dmk%XSNOWTEMP(:,1), pek%XTC, pek%XTV, &
393  pvelc, zlw, zdisph, zra_n_c, zg_vn_c, &
394  zustar2g, zcdg, zchg, zrig )
395 
396 ! save values over snow for diagnostic purposes:
397 
398 pustar2snow(:) = zustar2g(:)
399 dmk%XCDSNOW(:) = zcdg(:)
400 dmk%XCHSNOW(:) = zchg(:)
401 prisnow(:) = zrig(:)
402 !
403 !------------------------------------------------------------------------------
404 ! Now calculate the aerodynamic resistance for the completely snow covered part,
405 ! i.e. between the snow surface and atmosphere directly
406 !
407  CALL preps_for_meb_drag(.false.,io%LFORC_MEASURE, &
408  pz0_mebn, pz0h_mebn, pz0eff_mebn, pek%XH_VEG, pzref, &
409  dmk%XSNOWTEMP(:,1), pta, pqsatn, pqa, puref, pvmod, &
410  pexna, pexns, pdircoszw, zdisph, &
411  zvelc, zvmod, zrinn, zrann, &
412  zchnn,zcdnnn,zcdnn )
413 !
414 IF (lrrgust_arp) THEN
415 
416  zrrcor(:)=sqrt(1.0+((((zfp(:)/(zfp(:)+xrrscale))**xrrgamma)*xutilgust)**2) &
417  /(zcdnn(:)*zvmod(:)**2))
418 
419  zcdnn(:) = zcdnn(:) * zrrcor(:)
420  zchnn(:) = zchnn(:) * zrrcor(:)
421  zcdnnn(:) = zcdnnn(:) * zrrcor(:)
422 
423 ENDIF
424 !
425 pflxc_n_a(:)=zchnn(:)*zvmod(:)*prhoa(:)
426 !
427 ! The effective momentum drag:
428 !
429 pflxc_mom(:)=(1.-pek%XPSN(:)*ppalphan(:))*pflxc_mom(:) + &
430  pek%XPSN(:)*ppalphan(:)*zcdnn(:)*zvmod(:)*prhoa(:)
431 !
432 ! Now calculate the aerodynamic resistance for the whole meb-patch
433 !
434 ! Calculate the effective temperature
435 !
436 zpsna(:) = pek%XPSN(:)*ppalphan(:)
437 !
438 zteff(:) = (1.-zpsna(:))*pek%XTC(:)+ zpsna(:)*dmk%XSNOWTEMP(:,1)
439 !
440 ! Some additional diagnostics:
441 !
442 pustar2snow(:) = (1.-zpsna(:))*pustar2snow(:) + zpsna(:)*zcdnn(:)*zvmod(:)**2
443 dmk%XCDSNOW(:) = (1.-zpsna(:))*dmk%XCDSNOW(:) + zpsna(:)*zcdnn(:)
444 dmk%XCHSNOW(:) = (1.-zpsna(:))*dmk%XCHSNOW(:) + zpsna(:)*zchnn(:)
445 prisnow(:) = (1.-zpsna(:))*prisnow(:) + zpsna(:)*zrinn(:)
446 !
447 !-------------------------------------------------------------------------------
448 !
449  CALL preps_for_meb_drag(.false.,io%LFORC_MEASURE, dk%XZ0, dk%XZ0H, dk%XZ0EFF, &
450  pek%XH_VEG, pzref, zteff, pta, dk%XQS, pqa, puref, pvmod, &
451  pexna, pexns, pdircoszw, zdisph, zvelc, zvmod, dk%XRI, &
452  pek%XRESA(:), dk%XCH,dk%XCDN,dk%XCD )
453 !
454 IF (lrrgust_arp) THEN
455 
456  zrrcor(:)=sqrt(1.0+((((zfp(:)/(zfp(:)+xrrscale))**xrrgamma)*xutilgust)**2) &
457  /(dk%XCD(:)*zvmod(:)**2))
458 
459  dk%XCD(:) = dk%XCD(:) * zrrcor(:)
460  dk%XCH(:) = dk%XCH(:) * zrrcor(:)
461  dk%XCDN(:) = dk%XCDN(:) * zrrcor(:)
462 
463 ENDIF
464 
465 !-------------------------------------------------------------------------------
466 ! Now start to define the internal exchange coefficients
467 !-------------------------------------------------------------------------------
468 !
469 ! PFLXC_G_C between snow-free ground and canopy air
470 ! PFLXC_N_C between snow on the ground and canopy air
471 ! PFLXC_VG_C between canopy over snow-free ground and canopy air
472 ! PFLXC_VN_C between canopy over the snow on the ground and canopy air
473 !
474 ! ZRA_G_C = resistance between canopy air and snow free ground
475 ! ZRA_N_C = aerodynamic resistance between the partly
476 ! snowcovered (png>0), ground and canopy air
477 ! ZG_VG_C = conductance between canopy and canopy air (1-png)
478 ! ZG_VN_C = conductance between canopy and canopy air (png)
479 !
480 ! The resistances between ground/snow and canopy air go to zero when lai => 0
481 !
482 zra_g_c(:) = max(zraeps,zra_g_c(:))
483 pflxc_g_c(:) = prhoa(:) / zra_g_c(:)
484 phsgl(:) = zra_g_c(:)/(zra_g_c(:)+zrsgl(:))
485 phsgf(:) = zra_g_c(:)/(zra_g_c(:)+zrsgf(:))
486 
487 zra_n_c(:) = max(zra_n_c(:),zraeps)
488 pflxc_n_c(:) = prhoa(:)/zra_n_c(:)
489 !
490 ! Reduce sublimation from ground based snowpack as it
491 ! becomes vanishingly thin. This is mainly just for numerical reasons within the snow scheme
492 ! and has little to
493 ! no impact on actual grid box average fluxes since sublimation is multiplied by the snow fraction,
494 ! which in this case is quite small.
495 !
496 pflxc_n_c(:) = pflxc_n_c(:)*min(1., (psnowswe(:) + psr(:)*ptstep)/zsnowswesmin)
497 !
498 ! unit conversion:
499 !
500 pflxc_vg_c(:) = prhoa(:)*zg_vg_c(:)
501 pflxc_vn_c(:) = prhoa(:)*zg_vn_c(:)
502 !
503 !-------------------------------------------------------------------------------
504 !
505 !* 5. HALSTEAD COEFFICIENT (RELATIVE HUMIDITY OF THE VEGETATION)
506 ! ----------------------------------------------------------
507 !
508 zdeltamax(:) = (1.-pchip(:))*(1.-pek%XPSN(:)*ppalphan(:))*prr(:)+ pek%XWR(:)/ptstep
509 zdenom(:) = (1.-psncv(:))*xkdelta_wr * &
510  ( pek%XPSN(:)*(1.-ppalphan(:))*pflxc_vn_c(:) + (1.-pek%XPSN(:))*pflxc_vg_c(:) )* &
511  ( pqsatv(:)-pek%XQC(:))
512 zdeltamax(:) = max(0., min(1.0, zdeltamax(:)/max(1.e-10,zdenom(:))))
513 !
514 zdeltav(:) = xkdelta_wr*min(zdeltamax(:),pdelta(:))
515 pdeltavk(:) = xkdelta_wr*pdelta(:) ! delta including K factor
516 !
517 phvg(:) = 1. - max(0.,sign(1.,pqsatv(:)-pek%XQC(:))) &
518  *(1.-zdeltav(:))*prs_vg(:)*zg_vg_c(:) / (1.+prs_vg(:)*zg_vg_c(:))
519 !
520 phvn(:) = 1. - max(0.,sign(1.,pqsatv(:)-pek%XQC(:))) &
521  *(1.-zdeltav(:))*prs_vn(:)*zg_vn_c(:) / (1.+prs_vn(:)*zg_vn_c(:))
522 
523 ! Diagnostics:
524 ! Compute an effective canopy stomatal resistance (s m-1) and Halstead Coef:
525 !
526 dmk%XRS(:) = ppalphan(:)*prs_vn(:) + (1.0-ppalphan(:))*prs_vg(:)
527 dmk%XHV(:) = ppalphan(:)*phvn(:) + (1.0-ppalphan(:))*phvg(:)
528 !
529 !
530 !-------------------------------------------------------------------------
531 !* 6. LITTER/GROUND RESISTANCE
532 ! ------------------------
533 !
534 ! Inclusion of a ground resistance in the computation of the ground evaporation.
535 ! We use the existing LEG_DELTA (formerly a delta function) as a Beta-type-function
536 ! (based on Sellers et al., 1992, J Geophys Res)
537 !
538 IF (io%LMEB_GNDRES) THEN
539  pleg_delta(:) = zra_g_c(:) / ( zra_g_c(:) + exp(zrg_coef1 - zrg_coef2 * pwg(:) / zwsat(:) ) )
540  plegi_delta(:) = zra_g_c(:) / ( zra_g_c(:) + exp(zrg_coef1 - zrg_coef2 * pwgi(:)/ zwsat(:) ) )
541 ELSE
542  pleg_delta(:) = 1.0
543  plegi_delta(:) = 1.0
544 ENDIF
545 !
546 ! when hu*qsat < qa, there are two
547 ! possibilities
548 !
549 ! a) low-level air is dry, i.e.,
550 ! qa < qsat
551 !
552 ! NOTE the additional delta fn's
553 ! here are needed owing to linearization
554 ! of Qsat in the surface energy budget.
555 !
556 WHERE ( dk%XHUG(:)*pqsatg(:) < pek%XQC(:) .AND. pqsatg(:) > pek%XQC(:) )
557  dk%XHUG(:) = pek%XQC(:) / pqsatg(:)
558  pleg_delta(:) = 0.0
559 END WHERE
560 WHERE ( phugi(:)*pqsatg(:) < pek%XQC(:) .AND. pqsatg(:) > pek%XQC(:) )
561  phugi(:) = pek%XQC(:) / pqsatg(:)
562  plegi_delta(:) = 0.0
563 END WHERE
564 !
565 ! b) low-level air is humid, i.e., qa >= qsat (condensation)
566 !
567 WHERE ( dk%XHUG*pqsatg < pek%XQC(:) .AND. pqsatg <= pek%XQC(:) )dk%XHUG(:) = 1.0
568 WHERE ( phugi*pqsatg < pek%XQC(:) .AND. pqsatg <= pek%XQC(:) )phugi(:) = 1.0
569 !
570 !
571 IF (lhook) CALL dr_hook('DRAG_MEB',1,zhook_handle)
572 !
573 END SUBROUTINE drag_meb
subroutine surface_air_meb(PZ0, PZ0H, PZ0G, PH_VEG, PLAI, PTG, PTC, PTV, PVELC, PLW, PDISPH, PRAGNC, PGVNC, PUSTAR2, PCD, PCH, PRI)
subroutine preps_for_meb_drag(LCVEL, LFORC_MEASURE, PZ0, PZ0H, PZ0EFF, PH_VEG, PZREF, PTC, PTA, PQC, PQA, PUREF, PVMOD, PEXNA, PEXNS, PDIRCOSZW, PDISPH, PVELC, PZVMOD, PRI, PRA, PCH, PCDN, PCD)
real, save xpi
Definition: modd_csts.F90:43
logical lrrgust_arp
integer, parameter jprb
Definition: parkind1.F90:32
real, save xkdelta_wr
subroutine disph_for_meb(PCHIL, PLAIV, PLW, PH_VEG, PZREF, PZ0_MEBV, PDISPH)
logical lhook
Definition: yomhook.F90:15
subroutine drag_meb(IO, PEK, DMK, DK, PTG, PTA, PQA, PVMOD, PWG, PWGI, PWSAT, PWFC, PEXNS, PEXNA, PPS, PRR, PSR, PRHOA, PZ0G_WITHOUT_SNOW, PZ0_MEBV, PZ0H_MEBV, PZ0EFF_MEBV, PZ0_MEBN, PZ0H_MEBN, PZ0EFF_MEBN, PSNOWSWE, PCHIP, PTSTEP, PRS_VG, PRS_VN, PPALPHAN, PZREF, PUREF, PDIRCOSZW, PSNCV, PDELTA, PVELC, PRISNOW, PUSTAR2SNOW, PHUGI, PHVG, PHVN, PLEG_DELTA, PLEGI_DELTA, PHSGL, PHSGF, PFLXC_C_A, PFLXC_N_A, PFLXC_G_C, PFLXC_N_C, PFLXC_VG_C, PFLXC_VN_C, PFLXC_MOM, PQSATG, PQSATV, PQSATC, PQSATN, PDELTAVK)
Definition: drag_meb.F90:17
logical ldrag_coef_arp