\hypertarget{group__module__satmedmfvdifq}{}\doxysubsection{GFS TKE-\/\+EDMF PBL Module}
\label{group__module__satmedmfvdifq}\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}


This file contains the CCPP-\/compliant SATMEDMF scheme (updated version) which computes subgrid vertical turbulence mixing using scale-\/aware TKE-\/based moist eddy-\/diffusion mass-\/flux (TKE-\/\+EDMF) parameterization (by Jongil Han).  


\doxysubsubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_gac3efe9c76960ab08fa5c7960462daf1c_gac3efe9c76960ab08fa5c7960462daf1c}{satmedmfvdifq\+::satmedmfvdifq\+\_\+init}} (satmedmf, isatmedmf, isatmedmf\+\_\+vdifq, errmsg, errflg)
\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run}} (im, km, ntrac, ntcw, ntrw, ntiw, ntke, grav, rd, cp, rv, hvap, hfus, fv, eps, epsm1, dv, du, tdt, rtg, u1, v1, t1, q1, swh, hlw, xmu, garea, zvfun, sigmaf, psk, rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1, kpbl, prsi, del, prsl, prslk, phii, phil, delt, dspheat, dusfc, dvsfc, dtsfc, dqsfc, hpbl, dkt, dku, kinver, xkzm\+\_\+m, xkzm\+\_\+h, xkzm\+\_\+s, dspfac, bl\+\_\+upfr, bl\+\_\+dnfr, rlmx, elmx, sfc\+\_\+rlm, tc\+\_\+pbl, ntqv, dtend, dtidx, index\+\_\+of\+\_\+temperature, index\+\_\+of\+\_\+x\+\_\+wind, index\+\_\+of\+\_\+y\+\_\+wind, index\+\_\+of\+\_\+process\+\_\+pbl, gen\+\_\+tend, ldiag3d, errmsg, errflg)
\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_ga44d97b6349e641aca88537f0352261cc_ga44d97b6349e641aca88537f0352261cc}{tridi\+\_\+mod\+::tridi1}} (l, n, cl, cm, cu, r1, au, a1)
\begin{DoxyCompactList}\small\item\em Routine to solve the tridiagonal system to calculate temperature and moisture at $ t + \Delta t $; part of two-\/part process to calculate time tendencies due to vertical diffusion. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e}{tridi\+\_\+mod\+::tridi2}} (l, n, cl, cm, cu, r1, r2, au, a1, a2)
\begin{DoxyCompactList}\small\item\em This subroutine .. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b}{tridi\+\_\+mod\+::tridin}} (l, n, nt, cl, cm, cu, r1, r2, au, a1, a2)
\begin{DoxyCompactList}\small\item\em Routine to solve the tridiagonal system to calculate u-\/ and v-\/momentum at $ t + \Delta t $; part of two-\/part process to calculate time tendencies due to vertical diffusion. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c}{tridi\+\_\+mod\+::tridit}} (l, n, nt, cl, cm, cu, rt, au, at)
\begin{DoxyCompactList}\small\item\em This subroutine solves tridiagonal problem for TKE. \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6}{mfpbltq\+\_\+mod\+::mfpbltq}} (im, ix, km, kmpbl, ntcw, ntrac1, delt,
\begin{DoxyCompactList}\small\item\em This subroutine computes mass flux and updraft parcel properties for thermals driven by surface heating. \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c}{mfscuq\+\_\+mod\+::mfscuq}} (im, ix, km, kmscu, ntcw, ntrac1, delt,
\begin{DoxyCompactList}\small\item\em This subroutine computes mass flux and downdraft parcel properties for stratocumulus-\/top-\/driven turbulence. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
This subroutine contains all of the logic for the scale-\/aware TKE-\/based moist eddy-\/diffusion mass-\/flux (TKE-\/\+EDMF, updated version) scheme. For local turbulence mixing, a TKE closure model is used. Updated version of satmedmfvdif.\+f (May 2019) to have better low level inversion, to reduce the cold bias in lower troposphere, and to reduce the negative wind speed bias in upper troposphere

Incorporate the LES-\/based changes for TC simulation (Chen et al.,2022 \cite{Chen_2022}) with additional improvements on MF working with Cu schemes Xiaomin Chen, 5/2/2022\hypertarget{group__module__satmedmfvdifq_arg_table_satmedmfvdifq_init}{}\doxysubsubsection{Argument Table}\label{group__module__satmedmfvdifq_arg_table_satmedmfvdifq_init}
 

\doxysubsubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{group__module__satmedmfvdifq_gac3efe9c76960ab08fa5c7960462daf1c_gac3efe9c76960ab08fa5c7960462daf1c}\label{group__module__satmedmfvdifq_gac3efe9c76960ab08fa5c7960462daf1c_gac3efe9c76960ab08fa5c7960462daf1c}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!satmedmfvdifq\_init@{satmedmfvdifq\_init}}
\index{satmedmfvdifq\_init@{satmedmfvdifq\_init}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{satmedmfvdifq\_init()}{satmedmfvdifq\_init()}}
{\footnotesize\ttfamily subroutine satmedmfvdifq\+::satmedmfvdifq\+\_\+init (\begin{DoxyParamCaption}\item[{logical, intent(in)}]{satmedmf,  }\item[{integer, intent(in)}]{isatmedmf,  }\item[{integer, intent(in)}]{isatmedmf\+\_\+vdifq,  }\item[{character(len=$\ast$), intent(out)}]{errmsg,  }\item[{integer, intent(out)}]{errflg }\end{DoxyParamCaption})}

\mbox{\Hypertarget{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}\label{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!satmedmfvdifq\_run@{satmedmfvdifq\_run}}
\index{satmedmfvdifq\_run@{satmedmfvdifq\_run}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{satmedmfvdifq\_run()}{satmedmfvdifq\_run()}}
{\footnotesize\ttfamily subroutine satmedmfvdifq\+::satmedmfvdifq\+\_\+run (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{im,  }\item[{integer, intent(in)}]{km,  }\item[{integer, intent(in)}]{ntrac,  }\item[{integer, intent(in)}]{ntcw,  }\item[{integer, intent(in)}]{ntrw,  }\item[{integer, intent(in)}]{ntiw,  }\item[{integer, intent(in)}]{ntke,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{grav,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{rd,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{cp,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{rv,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{hvap,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{hfus,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{fv,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{eps,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{epsm1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{dv,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{du,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{tdt,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:,\+:), intent(inout)}]{rtg,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{u1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{v1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{t1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:,\+:), intent(in)}]{q1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{swh,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{hlw,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{xmu,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{garea,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{zvfun,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{sigmaf,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{psk,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{rbsoil,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{zorl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{u10m,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{v10m,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{fm,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{fh,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tsea,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{heat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{evap,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{stress,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{spd1,  }\item[{integer, dimension(\+:), intent(out)}]{kpbl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{prsi,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{del,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{prsl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{prslk,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{phii,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{phil,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{delt,  }\item[{logical, intent(in)}]{dspheat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{dusfc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{dvsfc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{dtsfc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{dqsfc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{hpbl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(out)}]{dkt,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(out)}]{dku,  }\item[{integer, dimension(\+:), intent(in)}]{kinver,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{xkzm\+\_\+m,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{xkzm\+\_\+h,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{xkzm\+\_\+s,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{dspfac,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{bl\+\_\+upfr,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{bl\+\_\+dnfr,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{rlmx,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{elmx,  }\item[{integer, intent(in)}]{sfc\+\_\+rlm,  }\item[{integer, intent(in)}]{tc\+\_\+pbl,  }\item[{integer, intent(in)}]{ntqv,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:,\+:), intent(inout)}]{dtend,  }\item[{integer, dimension(\+:,\+:), intent(in)}]{dtidx,  }\item[{integer, intent(in)}]{index\+\_\+of\+\_\+temperature,  }\item[{integer, intent(in)}]{index\+\_\+of\+\_\+x\+\_\+wind,  }\item[{integer, intent(in)}]{index\+\_\+of\+\_\+y\+\_\+wind,  }\item[{integer, intent(in)}]{index\+\_\+of\+\_\+process\+\_\+pbl,  }\item[{logical, intent(in)}]{gen\+\_\+tend,  }\item[{logical, intent(in)}]{ldiag3d,  }\item[{character(len=$\ast$), intent(out)}]{errmsg,  }\item[{integer, intent(out)}]{errflg }\end{DoxyParamCaption})}

\hypertarget{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_arg_table_satmedmfvdifq_run}{}\doxysubsubsection{Argument Table}\label{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_arg_table_satmedmfvdifq_run}
\hypertarget{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gen_satmedmfvdifq}{}\doxysubsubsection{GFS satmedmfvdifq General Algorithm}\label{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gen_satmedmfvdifq}
\mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+\_\+run()}} computes subgrid vertical turbulence mixing using the scale-\/aware TKE-\/based moist eddy-\/diffusion mass-\/flux (EDMF) parameterization of Han and Bretherton (2019) \cite{Han_2019} .
\begin{DoxyEnumerate}
\item The local turbulent mixing is represented by an eddy-\/diffusivity scheme which is a function of a prognostic TKE.
\item For the convective boundary layer, nonlocal transport by large eddies (mfpbltq.\+f), is represented using a mass flux approach (Siebesma et al.(2007) \cite{Siebesma_2007} ).
\item A mass-\/flux approach is also used to represent the stratocumulus-\/top-\/induced turbulence (mfscuq.\+f). 
\end{DoxyEnumerate}\hypertarget{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_detail_satmedmfvidfq}{}\doxysubsubsection{GFS satmedmfvdifq Detailed Algorithm}\label{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_detail_satmedmfvidfq}
\hypertarget{group__module__satmedmfvdifq_autotoc_md6}{}\doxyparagraph{Compute preliminary variables from input arguments}\label{group__module__satmedmfvdifq_autotoc_md6}

\begin{DoxyItemize}
\item Compute physical height of the layer centers and interfaces from the geopotential height ({\ttfamily zi} and {\ttfamily zl})
\item Compute horizontal grid size ({\ttfamily gdx})
\item Initialize tke value at vertical layer centers and interfaces from tracer ({\ttfamily tke} and {\ttfamily tkeh})
\item Compute reciprocal of $ \Delta z $ (rdzt)
\item Compute reciprocal of pressure (tx1, tx2)
\item Compute minimum turbulent mixing length (rlmnz)
\item Compute background vertical diffusivities for scalars and momentum (xkzo and xkzmo)
\item set background diffusivities with xkzm\+\_\+h \& xkzm\+\_\+m for gdx \texorpdfstring{$>$}{>}= xkgdx and as a function of horizontal grid size for gdx \texorpdfstring{$<$}{<} xkgdx ~\newline
 xkzm\+\_\+hx = xkzm\+\_\+h $\ast$ (gdx / xkgdx) ~\newline
 xkzm\+\_\+mx = xkzm\+\_\+m $\ast$ (gdx / xkgdx)
\item Some output variables and logical flags are initialized
\item Compute a function for green vegetation fraction and surface roughness. Entrainment rate in updraft is a function of vegetation fraction and surface roughness length
\item Compute $\theta$(theta), and $q_l$(qlx), $\theta_e$(thetae), $\theta_v$(thvx), $\theta_{l,v}$ (thlvx) including ice water
\item Compute an empirical cloud fraction based on Xu and Randall (1996) \cite{xu_and_randall_1996}
\item Compute buoyancy modified by clouds
\item Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx)
\item Compute stable/unstable PBL flag (pblflg) based on the total surface energy flux ({\itshape false} if the total surface energy flux is into the surface)
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md7}{}\doxyparagraph{Calculate the PBL height}\label{group__module__satmedmfvdifq_autotoc_md7}
The calculation of the boundary layer height follows Troen and Mahrt (1986) \cite{troen_and_mahrt_1986} section 3. The approach is to find the level in the column where a modified bulk Richardson number exceeds a critical value.
\begin{DoxyItemize}
\item Compute critical bulk Richardson number ( $Rb_{cr}$) (crb)
\item For the unstable PBL, crb is a constant (0.\+25)
\item For the stable boundary layer (SBL), $Rb_{cr}$ varies with the surface Rossby number, $R_{0}$, as given by Vickers and Mahrt (2004) \cite{Vickers_2004} \[ Rb_{cr}=0.16(10^{-7}R_{0})^{-0.18} \] \[ R_{0}=\frac{U_{10}}{f_{0}z_{0}} \] where $U_{10}$ is the wind speed at 10m above the ground surface, $f_0$ the Coriolis parameter, and $z_{0}$ the surface roughness length. To avoid too much variation, we restrict $Rb_{cr}$ to vary within the range of 0.\+15$\sim$0.35
\end{DoxyItemize}

Compute $\frac{\Delta t}{\Delta z}$ , $u_*$


\begin{DoxyItemize}
\item Compute buoyancy $\frac{\partial \theta_v}{\partial z}$ (bf) and the wind shear squared (shr2)
\item Given the thermal\textquotesingle{}s properties and the critical Richardson number, a loop is executed to find the first level above the surface (kpblx) where the modified Richardson number is greater than the critical Richardson number, using equation 10a from Troen and Mahrt (1996) \cite{troen_and_mahrt_1986} (also equation 8 from Hong and Pan (1996) \cite{hong_and_pan_1996})\+:
\item Once the level is found, some linear interpolation is performed to find the exact height of the boundary layer top (where $R_{i} > Rb_{cr}$) and the PBL height (hpbl and kpbl) and the PBL top index are saved.
\item Compute mean tke within pbl
\item Compute wind shear term as a sink term for updraft and downdraft velocity
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md8}{}\doxyparagraph{Compute Monin-\/\+Obukhov similarity parameters}\label{group__module__satmedmfvdifq_autotoc_md8}

\begin{DoxyItemize}
\item Calculate the Monin-\/\+Obukhov nondimensional stability paramter, commonly referred to as $\zeta$ using the following equation from Businger et al.(1971) \cite{businger_et_al_1971} (eqn 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.
\end{DoxyItemize}

Calculate the nondimensional gradients of momentum and temperature ( $\phi_m$ (phim) and $\phi_h$(phih)) are calculated using eqns 5 and 6 from Hong and Pan (1996) \cite{hong_and_pan_1996} depending on the surface layer stability\+:
\begin{DoxyItemize}
\item For the unstable and neutral conditions\+: \[ \phi_m=(1-16\frac{0.1h}{L})^{-1/4} \phi_h=(1-16\frac{0.1h}{L})^{-1/2} \]
\item For the stable regime \[ \phi_m=\phi_t=(1+5\frac{0.1h}{L}) \]
\end{DoxyItemize}

The $z/L$ (zol) is used as the stability criterion for the PBL.\+Currently, strong unstable (convective) PBL for $z/L < -0.02$ and weakly and moderately unstable PBL for $0>z/L>-0.02$
\begin{DoxyItemize}
\item Compute the velocity scale $w_s$ (wscale) (eqn 22 of Han et al. 2019). It is represented by the value scaled at the top of the surface layer\+: \[ w_s=(u_*^3+7\alpha\kappa w_*^3)^{1/3} \] where $u_*$ (ustar) is the surface friction velocity, $\alpha$ is the ratio of the surface layer height to the PBL height (specified as sfcfrac =0.\+1), $\kappa =0.4$ is the von Karman constant, and $w_*$ is the convective velocity scale defined as eqn23 of Han et al.(2019)\+: \[ w_{*}=[(g/T)\overline{(w\textnormal{\textquotesingle}\theta_v^{\textnormal{\textquotesingle}})}_0h]^{1/3} \]
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md9}{}\doxyparagraph{The counter-\/gradient terms for temperature and humidity are calculated.}\label{group__module__satmedmfvdifq_autotoc_md9}

\begin{DoxyItemize}
\item Equation 4 of Hong and Pan (1996) \cite{hong_and_pan_1996} and are used to calculate the \char`\"{}scaled virtual temperature excess near the surface\char`\"{} (equation 9 in Hong and Pan (1996) \cite{hong_and_pan_1996}) for use in the mass-\/flux algorithm.
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md10}{}\doxyparagraph{Determine whether stratocumulus layers exist and compute quantities}\label{group__module__satmedmfvdifq_autotoc_md10}

\begin{DoxyItemize}
\item Starting at the PBL top and going downward, if the level is less than 2.\+5 km and $q_l\geq q_{lcr}$ then set kcld = k (find the cloud top index in the PBL. If no cloud water above the threshold is hound, {\itshape scuflg} is set to F.
\end{DoxyItemize}

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 wihin 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.\hypertarget{group__module__satmedmfvdifq_autotoc_md11}{}\doxyparagraph{Compute components for mass flux mixing by large thermals}\label{group__module__satmedmfvdifq_autotoc_md11}

\begin{DoxyItemize}
\item If the PBL is convective, the updraft properties are initialized to be the same as the state variables.
\end{DoxyItemize}

Call \mbox{\hyperlink{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6}{mfpbltq()}}, which is an EDMF parameterization (Siebesma et al.(2007) \cite{Siebesma_2007}) to take into account nonlocal transport by large eddies. For details of the mfpbltq subroutine, step into its documentation \+::mfpbltq


\begin{DoxyItemize}
\item Call \mbox{\hyperlink{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c}{mfscuq()}}, which is a new mass-\/flux parameterization for stratocumulus-\/top-\/induced turbulence mixing. For details of the mfscuq subroutine, step into its documentation \+::mfscuq
\item unify mass fluxes with Cu
\item taper off MF in high-\/wind conditions
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md12}{}\doxyparagraph{Compute Prandtl number \textbackslash{}f\$\+P\+\_\+r\textbackslash{}f\$ (prn) and exchange coefficient varying with height}\label{group__module__satmedmfvdifq_autotoc_md12}
\hypertarget{group__module__satmedmfvdifq_autotoc_md13}{}\doxyparagraph{Compute an asymtotic mixing length}\label{group__module__satmedmfvdifq_autotoc_md13}

\begin{DoxyItemize}
\item Following Bougeault and Lacarrere(1989), the characteristic length scale ( $l_2$) (eqn 10 in Han et al.(2019) \cite{Han_2019}) is given by\+: \[ l_2=min(l_{up},l_{down}) \] and dissipation length scale $l_d$ is given by\+: \[ l_d=(l_{up}l_{down})^{1/2} \] where $l_{up}$ and $l_{down}$ are the distances that a parcel having an initial TKE can travel upward and downward before being stopped by buoyancy effects.
\item Compute the surface layer length scale ( $l_1$) following Nakanishi (2001) \cite{Nakanish_2001} (eqn 9 of Han et al.(2019) \cite{Han_2019})
\item If sfc\+\_\+rlm=1, use zk for elm within surface layer
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md14}{}\doxyparagraph{Compute eddy diffusivities}\label{group__module__satmedmfvdifq_autotoc_md14}
\hypertarget{group__module__satmedmfvdifq_autotoc_md15}{}\doxyparagraph{Compute TKE.}\label{group__module__satmedmfvdifq_autotoc_md15}

\begin{DoxyItemize}
\item Compute a minimum TKE deduced from background diffusivity for momentum.
\end{DoxyItemize}

Compute buoyancy and shear productions of TKE


\begin{DoxyItemize}
\item First predict tke due to tke production \& dissipation(diss) ~\newline

\item Compute updraft \& downdraft properties for TKE
\item Compute tridiagonal matrix elements for turbulent kinetic energy
\item Call \mbox{\hyperlink{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c}{tridit()}} to solve tridiagonal problem for TKE
\item Recover the tendency of tke
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md16}{}\doxyparagraph{Compute tridiagonal matrix elements for heat and moisture}\label{group__module__satmedmfvdifq_autotoc_md16}

\begin{DoxyItemize}
\item Call \mbox{\hyperlink{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b}{tridin()}} to solve tridiagonal problem for heat and moisture
\item Recover the tendencies of heat and moisture
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md17}{}\doxyparagraph{Add TKE dissipative heating to temperature tendency}\label{group__module__satmedmfvdifq_autotoc_md17}
\hypertarget{group__module__satmedmfvdifq_autotoc_md18}{}\doxyparagraph{Compute tridiagonal matrix elements for momentum}\label{group__module__satmedmfvdifq_autotoc_md18}

\begin{DoxyItemize}
\item Call \mbox{\hyperlink{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e}{tridi2()}} to solve tridiagonal problem for momentum
\item Recover the tendencies of momentum
\end{DoxyItemize}\hypertarget{group__module__satmedmfvdifq_autotoc_md19}{}\doxyparagraph{Save PBL height for diagnostic purpose}\label{group__module__satmedmfvdifq_autotoc_md19}


References \mbox{\hyperlink{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6}{mfpbltq\+\_\+mod\+::mfpbltq()}}, \mbox{\hyperlink{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c}{mfscuq\+\_\+mod\+::mfscuq()}}, \mbox{\hyperlink{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e}{tridi\+\_\+mod\+::tridi2()}}, \mbox{\hyperlink{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b}{tridi\+\_\+mod\+::tridin()}}, and \mbox{\hyperlink{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c}{tridi\+\_\+mod\+::tridit()}}.

Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6}\label{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!mfpbltq@{mfpbltq}}
\index{mfpbltq@{mfpbltq}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{mfpbltq()}{mfpbltq()}}
{\footnotesize\ttfamily subroutine mfpbltq\+\_\+mod\+::mfpbltq (\begin{DoxyParamCaption}\item[{integer}]{im,  }\item[{integer}]{ix,  }\item[{integer}]{km,  }\item[{integer}]{kmpbl,  }\item[{integer}]{ntcw,  }\item[{integer}]{ntrac1,  }\item[{real(kind=kind\+\_\+phys)}]{delt }\end{DoxyParamCaption})}

\hypertarget{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_mfpbltq_gen}{}\doxysubsubsection{GFS mfpblt General Algorithm}\label{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_mfpbltq_gen}

\begin{DoxyItemize}
\item Compute thermal excess
\item Compute entrainment rate
\item Compute buoyancy for updraft air parcel
\item Compute updraft velocity square(wu2, eqn 13 in Han et al.(2019) \cite{Han_2019})
\item Update pbl height as the height where updraft velocity vanishes
\item Update entrainment rate
\item Compute entrainment rate averaged over the whole pbl
\item Updraft mass flux as a function of updraft velocity profile
\item Compute updraft fraction as a function of mean entrainment rate (Grell and Freitas (2014) \cite{grell_and_freitas_2014}
\item Compute scale-\/aware function based on Arakawa and Wu (2013) \cite{arakawa_and_wu_2013}
\item Final scale-\/aware updraft mass flux
\item Compute updraft property using updated entranment rate
\end{DoxyItemize}

Referenced by \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run()}}.

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_ga15bba20685ffc8340f58dce1d887fdb6_ga15bba20685ffc8340f58dce1d887fdb6_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c}\label{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!mfscuq@{mfscuq}}
\index{mfscuq@{mfscuq}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{mfscuq()}{mfscuq()}}
{\footnotesize\ttfamily subroutine mfscuq\+\_\+mod\+::mfscuq (\begin{DoxyParamCaption}\item[{integer}]{im,  }\item[{integer}]{ix,  }\item[{integer}]{km,  }\item[{integer}]{kmscu,  }\item[{integer}]{ntcw,  }\item[{integer}]{ntrac1,  }\item[{real(kind=kind\+\_\+phys)}]{delt }\end{DoxyParamCaption})}

\hypertarget{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_mfscuq}{}\doxysubsubsection{GFS mfscu General Algorithm}\label{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_mfscuq}

\begin{DoxyItemize}
\item Specify downdraft fraction
\item If the condition for cloud-\/top instability is met, increase downdraft fraction
\item First-\/guess level of downdraft extension (mrad)
\item Compute entrainment rate
\item Compute buoyancy for downdraft air parcel
\item Compute downdraft velocity square(wd2)
\item Update entrainment rate
\item Compute entrainment rate averaged over the whole downdraft layers
\item Compute downdraft mass flux
\item Compute downdraft fraction as a function of mean entrainment rate (Grell and Freitas(2014) \cite{grell_and_freitas_2014}
\item Compute scale-\/aware function based on Arakawa and Wu (2013) \cite{arakawa_and_wu_2013}
\item Compute final scale-\/aware downdraft mass flux
\item Compute downdraft property using updated entranment rate
\end{DoxyItemize}

Referenced by \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run()}}.

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_ga860b6176c81a0b7b5a8dd27b6aff850c_ga860b6176c81a0b7b5a8dd27b6aff850c_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group__module__satmedmfvdifq_ga44d97b6349e641aca88537f0352261cc_ga44d97b6349e641aca88537f0352261cc}\label{group__module__satmedmfvdifq_ga44d97b6349e641aca88537f0352261cc_ga44d97b6349e641aca88537f0352261cc}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!tridi1@{tridi1}}
\index{tridi1@{tridi1}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{tridi1()}{tridi1()}}
{\footnotesize\ttfamily subroutine tridi\+\_\+mod\+::tridi1 (\begin{DoxyParamCaption}\item[{integer}]{l,  }\item[{integer}]{n,  }\item[{real(kind=kind\+\_\+phys), dimension(l,2\+:n)}]{cl,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{cm,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{cu,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{r1,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{au,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{a1 }\end{DoxyParamCaption})}

\mbox{\Hypertarget{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e}\label{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!tridi2@{tridi2}}
\index{tridi2@{tridi2}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{tridi2()}{tridi2()}}
{\footnotesize\ttfamily subroutine tridi\+\_\+mod\+::tridi2 (\begin{DoxyParamCaption}\item[{integer}]{l,  }\item[{integer}]{n,  }\item[{real(kind=kind\+\_\+phys), dimension(l,2\+:n)}]{cl,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{cm,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{cu,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{r1,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{r2,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{au,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{a1,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{a2 }\end{DoxyParamCaption})}



Referenced by \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run()}}.

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_gafeb82aad16f009ddfae09ae940c52f7e_gafeb82aad16f009ddfae09ae940c52f7e_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b}\label{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!tridin@{tridin}}
\index{tridin@{tridin}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{tridin()}{tridin()}}
{\footnotesize\ttfamily subroutine tridi\+\_\+mod\+::tridin (\begin{DoxyParamCaption}\item[{integer}]{l,  }\item[{integer}]{n,  }\item[{integer}]{nt,  }\item[{real(kind=kind\+\_\+phys), dimension(l,2\+:n)}]{cl,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{cm,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{cu,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{r1,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n$\ast$nt)}]{r2,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{au,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{a1,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n$\ast$nt)}]{a2 }\end{DoxyParamCaption})}



Referenced by \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run()}}.

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_ga9031977c1d186acb458ef87523aaff5b_ga9031977c1d186acb458ef87523aaff5b_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c}\label{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c}} 
\index{GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}!tridit@{tridit}}
\index{tridit@{tridit}!GFS TKE-\/EDMF PBL Module@{GFS TKE-\/EDMF PBL Module}}
\doxyparagraph{\texorpdfstring{tridit()}{tridit()}}
{\footnotesize\ttfamily subroutine tridi\+\_\+mod\+::tridit (\begin{DoxyParamCaption}\item[{integer}]{l,  }\item[{integer}]{n,  }\item[{integer}]{nt,  }\item[{real(kind=kind\+\_\+phys), dimension(l,2\+:n)}]{cl,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n)}]{cm,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{cu,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n$\ast$nt)}]{rt,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n-\/1)}]{au,  }\item[{real(kind=kind\+\_\+phys), dimension(l,n$\ast$nt)}]{at }\end{DoxyParamCaption})}



Referenced by \mbox{\hyperlink{group__module__satmedmfvdifq_gab8c41e2463540b19aee80386e7a1fbdc_gab8c41e2463540b19aee80386e7a1fbdc}{satmedmfvdifq\+::satmedmfvdifq\+\_\+run()}}.

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group__module__satmedmfvdifq_ga5f820ea7a901b9154fc66428d371c02c_ga5f820ea7a901b9154fc66428d371c02c_icgraph}
\end{center}
\end{figure}
