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