Common Community Physics Package (CCPP) Scientific Documentation  Version 2.0
subroutine hedmf::hedmf_run ( integer, intent(in)  ix,
integer, intent(in)  im,
integer, intent(in)  km,
integer, intent(in)  ntrac,
integer, intent(in)  ntcw,
real(kind=kind_phys), dimension(im,km), intent(inout)  dv,
real(kind=kind_phys), dimension(im,km), intent(inout)  du,
real(kind=kind_phys), dimension(im,km), intent(inout)  tau,
real(kind=kind_phys), dimension(im,km,ntrac), intent(inout)  rtg,
real(kind=kind_phys), dimension(ix,km), intent(in)  u1,
real(kind=kind_phys), dimension(ix,km), intent(in)  v1,
real(kind=kind_phys), dimension(ix,km), intent(in)  t1,
real(kind=kind_phys), dimension(ix,km,ntrac), intent(in)  q1,
real(kind=kind_phys), dimension(ix,km), intent(in)  swh,
real(kind=kind_phys), dimension(ix,km), intent(in)  hlw,
real(kind=kind_phys), dimension(im), intent(in)  xmu,
real(kind=kind_phys), dimension(im), intent(in)  psk,
real(kind=kind_phys), dimension(im), intent(in)  rbsoil,
real(kind=kind_phys), dimension(im), intent(in)  zorl,
real(kind=kind_phys), dimension(im), intent(in)  u10m,
real(kind=kind_phys), dimension(im), intent(in)  v10m,
real(kind=kind_phys), dimension(im), intent(in)  fm,
real(kind=kind_phys), dimension(im), intent(in)  fh,
real(kind=kind_phys), dimension(im), intent(in)  tsea,
real(kind=kind_phys), dimension(im), intent(in)  heat,
real(kind=kind_phys), dimension(im), intent(in)  evap,
real(kind=kind_phys), dimension(im), intent(in)  stress,
real(kind=kind_phys), dimension(im), intent(in)  spd1,
integer, dimension(im), intent(out)  kpbl,
real(kind=kind_phys), dimension(ix,km+1), intent(in)  prsi,
real(kind=kind_phys), dimension(ix,km), intent(in)  del,
real(kind=kind_phys), dimension(ix,km), intent(in)  prsl,
real(kind=kind_phys), dimension(ix,km), intent(in)  prslk,
real(kind=kind_phys), dimension(ix,km+1), intent(in)  phii,
real(kind=kind_phys), dimension(ix,km), intent(in)  phil,
real(kind=kind_phys), intent(in)  delt,
logical, intent(in)  dspheat,
real(kind=kind_phys), dimension(im), intent(out)  dusfc,
real(kind=kind_phys), dimension(im), intent(out)  dvsfc,
real(kind=kind_phys), dimension(im), intent(out)  dtsfc,
real(kind=kind_phys), dimension(im), intent(out)  dqsfc,
real(kind=kind_phys), dimension(im), intent(out)  hpbl,
real(kind=kind_phys), dimension(im), intent(inout)  hgamt,
real(kind=kind_phys), dimension(im), intent(inout)  hgamq,
real(kind=kind_phys), dimension(im,km-1), intent(out)  dkt,
integer, dimension(im), intent(in)  kinver,
real(kind=kind_phys), intent(in)  xkzm_m,
real(kind=kind_phys), intent(in)  xkzm_h,
real(kind=kind_phys), intent(in)  xkzm_s,
logical, intent(in)  lprnt,
integer, intent(in)  ipr,
real(kind=kind_phys), intent(in)  xkzminv,
real(kind=kind_phys), intent(in)  moninq_fac,
character(len=*), intent(out)  errmsg,
integer, intent(out)  errflg 
)

Compute preliminary variables from input arguments

  • Compute physical height of the layer centers and interfaces from the geopotential height (zi and zl)
  • Compute reciprocal of \( \Delta z \) (rdzt)
  • Compute reciprocal of pressure (tx1, tx2)
  • Compute background vertical diffusivities for scalars and momentum (xkzo and xkzmo)
  • The background scalar vertical diffusivity is limited to be less than or equal to xkzminv
  • Some output variables and logical flags are initialized
  • Compute \(\theta\) (theta), \(q_l\) (qlx), \(q_t\) (qtx), \(\theta_e\) (thetae), \(\theta_v\) (thvx), \(\theta_{l,v}\) (thlvx)
  • Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx)
  • Set lcld to first index above 2.5km
  • Compute \(\frac{\partial \theta_v}{\partial z}\) (bf) and the wind shear squared (shr2)
  • Calculate \(\frac{g}{\theta}\) (govrth), \(\beta = \frac{\Delta t}{\Delta z}\) (beta), \(u_*\) (ustar), total surface flux (sflux), and set pblflag to false if the total surface energy flux is into the surface

Calculate the first estimate of the PBL height (``Predictor step")

The calculation of the boundary layer height follows Troen and Mahrt (1986) [100] section 3. The approach is to find the level in the column where a modified bulk Richardson number exceeds a critical value.

The temperature of the thermal is of primary importance. For the initial estimate of the PBL height, the thermal is assumed to have one of two temperatures. If the boundary layer is stable, the thermal is assumed to have a temperature equal to the surface virtual temperature. Otherwise, the thermal is assumed to have the same virtual potential temperature as the lowest model level. For the stable case, the critical bulk Richardson number becomes a function of the wind speed and roughness length, otherwise it is set to a tunable constant.

Given the thermal's properties and the critical Richardson number, a loop is executed to find the first level above the surface where the modified Richardson number is greater than the critical Richardson number, using equation 10a from Troen and Mahrt (1986) [100] (also equation 8 from Hong and Pan (1996) [46]):

\[ h = Ri\frac{T_0\left|\vec{v}(h)\right|^2}{g\left(\theta_v(h) - \theta_s\right)} \]

where \(h\) is the PBL height, \(Ri\) is the Richardson number, \(T_0\) is the virtual potential temperature near the surface, \(\left|\vec{v}\right|\) is the wind speed, and \(\theta_s\) is for the thermal. Rearranging this equation to calculate the modified Richardson number at each level, k, for comparison with the critical value yields:

\[ Ri_k = gz(k)\frac{\left(\theta_v(k) - \theta_s\right)}{\theta_v(1)*\vec{v}(k)} \]

Once the level is found, some linear interpolation is performed to find the exact height of the boundary layer top (where \(Ri = Ri_{cr}\)) and the PBL height and the PBL top index are saved (hpblx and kpblx, respectively)

Calculate Monin-Obukhov similarity parameters

Using the initial guess for the PBL height, Monin-Obukhov similarity parameters are calculated. They are needed to refine the PBL height calculation and for calculating diffusion coefficients.

First, calculate the Monin-Obukhov nondimensional stability parameter, commonly referred to as \(\zeta\) using the following equation from Businger et al. (1971) [11] (equation 28):

\[ \zeta = Ri_{sfc}\frac{F_m^2}{F_h} = \frac{z}{L} \]

where \(F_m\) and \(F_h\) are surface Monin-Obukhov stability functions calculated in sfc_diff.f and \(L\) is the Obukhov length. Then, the nondimensional gradients of momentum and temperature (phim and phih) are calculated using equations 5 and 6 from Hong and Pan (1996) [46] depending on the surface layer stability. Then, the velocity scale valid for the surface layer ( \(w_s\), wscale) is calculated using equation 3 from Hong and Pan (1996) [46]. For the neutral and unstable PBL above the surface layer, the convective velocity scale, \(w_*\), is calculated according to:

\[ w_* = \left(\frac{g}{\theta_0}h\overline{w'\theta_0'}\right)^{1/3} \]

and the mixed layer velocity scale is then calculated with equation 6 from Troen and Mahrt (1986) [100]

\[ w_s = (u_*^3 + 7\epsilon k w_*^3)^{1/3} \]

Update thermal properties of surface parcel and recompute PBL height ("Corrector step").

Next, the counter-gradient terms for temperature and humidity are calculated using equation 4 of Hong and Pan (1996) [46] and are used to calculate the "scaled virtual temperature excess near the surface" (equation 9 in Hong and Pan (1996) [46]) so that the properties of the thermal are updated to recalculate the PBL height.

The PBL height calculation follows the same procedure as the predictor step, except that it uses an updated virtual potential temperature for the thermal.

Determine whether stratocumulus layers exist and compute quantities needed for enhanced diffusion

  • Starting at the PBL top and going downward, if the level is less than 2.5 km and \(q_l>q_{l,cr}\) then set kcld = k (find the cloud top index in the PBL). If no cloud water above the threshold is found, scuflg is set to F.
  • Starting at the PBL top and going downward, if the level is less than the cloud top, find the level of the minimum radiative heating rate within the cloud. If the level of the minimum is the lowest model level or the minimum radiative heating rate is positive, then set scuflg to F.
  • Starting at the PBL top and going downward, count the number of levels below the minimum radiative heating rate level that have cloud water above the threshold. If there are none, then set the scuflg to F.
  • Find the height of the interface where the minimum in radiative heating rate is located. If this height is less than the second model interface height, then set the scuflg to F.
  • Calculate the hypothetical \(\theta_v\) at the minimum radiative heating level that a parcel would reach due to radiative cooling after a typical cloud turnover time spent at that level.
  • Determine the distance that a parcel would sink downwards starting from the level of minimum radiative heating rate by comparing the hypothetical minimum \(\theta_v\) calculated above with the environmental \(\theta_v\).
  • Calculate the cloud thickness, where the cloud top is the in-cloud minimum radiative heating level and the bottom is determined previously.
  • Find the largest between the cloud thickness and the distance of a sinking parcel, then determine the smallest of that number and the height of the minimum in radiative heating rate. Set this number to \(zd\). Using \(zd\), calculate the characteristic velocity scale of cloud-top radiative cooling-driven turbulence.

Calculate the inverse Prandtl number

For an unstable PBL, the Prandtl number is calculated according to Hong and Pan (1996) [46], equation 10, whereas for a stable boundary layer, the Prandtl number is simply \(Pr = \frac{\phi_h}{\phi_m}\).

Compute diffusion coefficients below the PBL top

Below the PBL top, the diffusion coefficients ( \(K_m\) and \(K_h\)) are calculated according to equation 2 in Hong and Pan (1996) [46] where a different value for \(w_s\) (PBL vertical velocity scale) is used depending on the PBL stability. \(K_h\) is calculated from \(K_m\) using the Prandtl number. The calculated diffusion coefficients are checked so that they are bounded by maximum values and the local background diffusion coefficients.

Compute diffusion coefficients above the PBL top

Diffusion coefficients above the PBL top are computed as a function of local stability (gradient Richardson number), shear, and a length scale from Louis (1979) [74] :

\[ K_{m,h}=l^2f_{m,h}(Ri_g)\left|\frac{\partial U}{\partial z}\right| \]

The functions used ( \(f_{m,h}\)) depend on the local stability. First, the gradient Richardson number is calculated as

\[ Ri_g=\frac{\frac{g}{T}\frac{\partial \theta_v}{\partial z}}{\frac{\partial U}{\partial z}^2} \]

where \(U\) is the horizontal wind. For the unstable case ( \(Ri_g < 0\)), the Richardson number-dependent functions are given by

\[ f_h(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.286\sqrt{\left|Ri_g\right|}}\\ \]

\[ f_m(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.746\sqrt{\left|Ri_g\right|}}\\ \]

For the stable case, the following formulas are used

\[ f_h(Ri_g) = \frac{1}{\left(1 + 5Ri_g\right)^2}\\ \]

\[ Pr = \frac{K_h}{K_m} = 1 + 2.1Ri_g \]

The source for the formulas used for the Richardson number-dependent functions is unclear. They are different than those used in Hong and Pan (1996) [46] as the previous documentation suggests. They follow equation 14 of Louis (1979) [74] for the unstable case, but it is unclear where the values of the coefficients \(b\) and \(c\) from that equation used in this scheme originate. Finally, the length scale, \(l\) is calculated according to the following formula from Hong and Pan (1996) [46]

\[ \frac{1}{l} = \frac{1}{kz} + \frac{1}{l_0}\\ \]

\[ or\\ \]

\[ l=\frac{l_0kz}{l_0+kz} \]

where \(l_0\) is currently 30 m for stable conditions and 150 m for unstable. Finally, the diffusion coefficients are kept in a range bounded by the background diffusion and the maximum allowable values.

If the PBL is convective, call the mass flux scheme to replace the countergradient terms.

If the PBL is convective, the updraft properties are initialized to be the same as the state variables and the subroutine mfpbl is called.

For details of the mfpbl subroutine, step into its documentation mfpbl

Compute enhanced diffusion coefficients related to stratocumulus-topped PBLs

If a stratocumulus layer has been identified in the PBL, the diffusion coefficients in the PBL are modified in the following way.

  1. First, the criteria for CTEI is checked, using the threshold from equation 13 of Macvean and Mason (1990) [75]. If the criteria is met, the cloud top diffusion is increased:

    \[ K_h^{Sc} = -c\frac{\Delta F_R}{\rho c_p}\frac{1}{\frac{\partial \theta_v}{\partial z}} \]

    where the constant \(c\) is set to 0.2 if the CTEI criterion is not met and 1.0 if it is.
  2. Calculate the diffusion coefficients due to stratocumulus mixing according to equation 5 in Lock et al. (2000) [69] for every level below the stratocumulus top using the characteristic stratocumulus velocity scale previously calculated. The diffusion coefficient for momentum is calculated assuming a constant inverse Prandtl number of 0.75.

After \(K_h^{Sc}\) has been determined from the surface to the top of the stratocumulus layer, it is added to the value for the diffusion coefficient calculated previously using surface-based mixing [see equation 6 of Lock et al. (2000) [69] ].

Solve for the temperature and moisture tendencies due to vertical mixing.

The tendencies of heat, moisture, and momentum due to vertical diffusion are calculated using a two-part process. First, a solution is obtained using an implicit time-stepping scheme, then the time tendency terms are "backed out". The tridiagonal matrix elements for the implicit solution for temperature and moisture are prepared in this section, with differing algorithms depending on whether the PBL was convective (substituting the mass flux term for counter-gradient term), unstable but not convective (using the computed counter-gradient terms), or stable (no counter-gradient terms).

The tridiagonal system is solved by calling the internal tridin subroutine.

After returning with the solution, the tendencies for temperature and moisture are recovered.

Calculate heating due to TKE dissipation and add to the tendency for temperature

Following Han et al. (2015) [40] , turbulence dissipation contributes to the tendency of temperature in the following way. First, turbulence dissipation is calculated by equation 17 of Han et al. (2015) [40] for the PBL and equation 16 for the surface layer.

Next, the temperature tendency is updated following equation 14.

Solve for the horizontal momentum tendencies and add them to the output tendency terms

As with the temperature and moisture tendencies, the horizontal momentum tendencies are calculated by solving tridiagonal matrices after the matrices are prepared in this section.

Finally, the tendencies are recovered from the tridiagonal solutions.

References physcons::con_cp, physcons::con_fvirt, physcons::con_g, physcons::con_hvap, physcons::con_rd, funcphys::fpvs(), mfpbl(), tridi2(), and tridin().

Here is the call graph for this function: