\hypertarget{group___g_f_s__diff__main}{}\doxysubsection{GFS Surface Layer Module}
\label{group___g_f_s__diff__main}\index{GFS Surface Layer Module@{GFS Surface Layer Module}}


This module calculates surface roughness length.

This subroutine includes the surface roughness length formulation based on the surface sublayer scheme in Zeng and Dickinson (1998) \cite{zeng_and_dickinson_1998}.  


\doxysubsubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1}{sfc\+\_\+diff\+::sfc\+\_\+diff\+\_\+run}} (im, rvrdm1, eps, epsm1, grav, ps, t1, q1, z1, garea, wind, prsl1, prslki, prsik1, prslk1, sigmaf, vegtype, shdmax, ivegsrc, z0pert, ztpert, flag\+\_\+iter, redrag, u10m, v10m, sfc\+\_\+z0\+\_\+type, wet, dry, icy, thsfc\+\_\+loc, tskin\+\_\+wat, tskin\+\_\+lnd, tskin\+\_\+ice, tsurf\+\_\+wat, tsurf\+\_\+lnd, tsurf\+\_\+ice, z0rl\+\_\+wat, z0rl\+\_\+lnd, z0rl\+\_\+ice, z0rl\+\_\+wav, ustar\+\_\+wat, ustar\+\_\+lnd, ustar\+\_\+ice, cm\+\_\+wat, cm\+\_\+lnd, cm\+\_\+ice, ch\+\_\+wat, ch\+\_\+lnd, ch\+\_\+ice, rb\+\_\+wat, rb\+\_\+lnd, rb\+\_\+ice, stress\+\_\+wat, stress\+\_\+lnd, stress\+\_\+ice, fm\+\_\+wat, fm\+\_\+lnd, fm\+\_\+ice, fh\+\_\+wat, fh\+\_\+lnd, fh\+\_\+ice, fm10\+\_\+wat, fm10\+\_\+lnd, fm10\+\_\+ice, fh2\+\_\+wat, fh2\+\_\+lnd, fh2\+\_\+ice, ztmax\+\_\+wat, ztmax\+\_\+lnd, ztmax\+\_\+ice, zvfun, errmsg, errflg)
\item 
subroutine, public \mbox{\hyperlink{group___g_f_s__diff__main_gab286fa55ff48bff296b75dd2b6dc4e79_gab286fa55ff48bff296b75dd2b6dc4e79}{sfc\+\_\+diff\+::stability}} (z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, thsfc\+\_\+loc, rb, fm, fh, fm10, fh2, cm, ch, stress, ustar)
\item 
subroutine \mbox{\hyperlink{group___g_f_s__diff__main_ga699273090ce209aa668bd430196c084c_ga699273090ce209aa668bd430196c084c}{sfc\+\_\+diff\+::znot\+\_\+m\+\_\+v6}} (uref, znotm)
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
\hypertarget{group___g_f_s__diff__main_arg_table_sfc_diff_run}{}\doxysubsubsection{Argument Table}\label{group___g_f_s__diff__main_arg_table_sfc_diff_run}
\hypertarget{group___g_f_s__diff__main_general_diff}{}\doxysubsubsection{GFS Surface Layer Scheme General Algorithm}\label{group___g_f_s__diff__main_general_diff}

\begin{DoxyItemize}
\item Calculate the thermal roughness length formulation over the ocean (see eq. (25) and (26) in Zeng et al. (1998) \cite{zeng_et_al_1998}).
\item Calculate Zeng\textquotesingle{}s momentum roughness length formulation over land and sea ice.
\item Calculate the new vegetation-\/dependent formulation of thermal roughness length (Zheng et al.(2012) \cite{zheng_et_al_2012}). Zheng et al. (2012) \cite{zheng_et_al_2012} proposed a new formulation on $ln(Z_{0m}^,/Z_{0t})$ as follows\+: \[ ln(Z_{0m}^,/Z_{0t})=(1-GVF)^2C_{zil}k(u*Z_{0g}/\nu)^{0.5} \] where $Z_{0m}^,$ is the effective momentum roughness length computed in the following equation for each grid, $Z_{0t}$ is the roughness lenghth for heat, $C_{zil}$ is a coefficient (taken as 0.\+8), k is the Von Karman constant (0.\+4), $\nu=1.5\times10^{-5}m^{2}s^{-1}$ is the molecular viscosity, $u*$ is the friction velocity, and $Z_{0g}$ is the bare soil roughness length for momentum (taken as 0.\+01). ~\newline
 In order to consider the convergence of $Z_{0m}$ between fully vegetated and bare soil, the effective $Z_{0m}^,$ is computed\+: \[ \ln(Z_{0m}^,)=(1-GVF)^{2}\ln(Z_{0g})+\left[1-(1-GVF)^{2}\right]\ln(Z_{0m}) \]
\item Calculate the exchange coefficients\+: $cm$, $ch$, and $stress$ as inputs of other {\itshape sfc} schemes. 
\end{DoxyItemize}

\doxysubsubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1}\label{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1}} 
\index{GFS Surface Layer Module@{GFS Surface Layer Module}!sfc\_diff\_run@{sfc\_diff\_run}}
\index{sfc\_diff\_run@{sfc\_diff\_run}!GFS Surface Layer Module@{GFS Surface Layer Module}}
\doxyparagraph{\texorpdfstring{sfc\_diff\_run()}{sfc\_diff\_run()}}
{\footnotesize\ttfamily subroutine, public sfc\+\_\+diff\+::sfc\+\_\+diff\+\_\+run (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{im,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{rvrdm1,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{eps,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{epsm1,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{grav,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{ps,  }\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)}]{z1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{garea,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{wind,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{prsl1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{prslki,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{prsik1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{prslk1,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{sigmaf,  }\item[{integer, dimension(\+:), intent(in)}]{vegtype,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{shdmax,  }\item[{integer, intent(in)}]{ivegsrc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{z0pert,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{ztpert,  }\item[{logical, dimension(\+:), intent(in)}]{flag\+\_\+iter,  }\item[{logical, intent(in)}]{redrag,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{u10m,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{v10m,  }\item[{integer, intent(in)}]{sfc\+\_\+z0\+\_\+type,  }\item[{logical, dimension(\+:), intent(inout)}]{wet,  }\item[{logical, dimension(\+:), intent(in)}]{dry,  }\item[{logical, dimension(\+:), intent(in)}]{icy,  }\item[{logical, intent(in)}]{thsfc\+\_\+loc,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tskin\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tskin\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tskin\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tsurf\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tsurf\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{tsurf\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{z0rl\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{z0rl\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{z0rl\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{z0rl\+\_\+wav,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ustar\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ustar\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ustar\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{cm\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{cm\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{cm\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ch\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ch\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ch\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{rb\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{rb\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{rb\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{stress\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{stress\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{stress\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm10\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm10\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fm10\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh2\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh2\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{fh2\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ztmax\+\_\+wat,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ztmax\+\_\+lnd,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ztmax\+\_\+ice,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(out)}]{zvfun,  }\item[{character(len=$\ast$), intent(out)}]{errmsg,  }\item[{integer, intent(out)}]{errflg }\end{DoxyParamCaption})}



References \mbox{\hyperlink{group___g_f_s__diff__main_gab286fa55ff48bff296b75dd2b6dc4e79_gab286fa55ff48bff296b75dd2b6dc4e79}{sfc\+\_\+diff\+::stability()}}, and \mbox{\hyperlink{group___g_f_s__diff__main_ga699273090ce209aa668bd430196c084c_ga699273090ce209aa668bd430196c084c}{sfc\+\_\+diff\+::znot\+\_\+m\+\_\+v6()}}.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=328pt]{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group___g_f_s__diff__main_gab286fa55ff48bff296b75dd2b6dc4e79_gab286fa55ff48bff296b75dd2b6dc4e79}\label{group___g_f_s__diff__main_gab286fa55ff48bff296b75dd2b6dc4e79_gab286fa55ff48bff296b75dd2b6dc4e79}} 
\index{GFS Surface Layer Module@{GFS Surface Layer Module}!stability@{stability}}
\index{stability@{stability}!GFS Surface Layer Module@{GFS Surface Layer Module}}
\doxyparagraph{\texorpdfstring{stability()}{stability()}}
{\footnotesize\ttfamily subroutine, public sfc\+\_\+diff\+::stability (\begin{DoxyParamCaption}\item[{real(kind=kind\+\_\+phys), intent(in)}]{z1,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{zvfun,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{gdx,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{tv1,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{thv1,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{wind,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{z0max,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{ztmax,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{tvs,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{grav,  }\item[{logical, intent(in)}]{thsfc\+\_\+loc,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{rb,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{fm,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{fh,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{fm10,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{fh2,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{cm,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{ch,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{stress,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{ustar }\end{DoxyParamCaption})}



Referenced by \mbox{\hyperlink{namespacegfs__surface__composites__post_abd297eb58ede40e2996ca201e9fe7ee6_abd297eb58ede40e2996ca201e9fe7ee6}{gfs\+\_\+surface\+\_\+composites\+\_\+post\+::gfs\+\_\+surface\+\_\+composites\+\_\+post\+\_\+run()}}, and \mbox{\hyperlink{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1}{sfc\+\_\+diff\+::sfc\+\_\+diff\+\_\+run()}}.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{group___g_f_s__diff__main_gab286fa55ff48bff296b75dd2b6dc4e79_gab286fa55ff48bff296b75dd2b6dc4e79_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{group___g_f_s__diff__main_ga699273090ce209aa668bd430196c084c_ga699273090ce209aa668bd430196c084c}\label{group___g_f_s__diff__main_ga699273090ce209aa668bd430196c084c_ga699273090ce209aa668bd430196c084c}} 
\index{GFS Surface Layer Module@{GFS Surface Layer Module}!znot\_m\_v6@{znot\_m\_v6}}
\index{znot\_m\_v6@{znot\_m\_v6}!GFS Surface Layer Module@{GFS Surface Layer Module}}
\doxyparagraph{\texorpdfstring{znot\_m\_v6()}{znot\_m\_v6()}}
{\footnotesize\ttfamily subroutine sfc\+\_\+diff\+::znot\+\_\+m\+\_\+v6 (\begin{DoxyParamCaption}\item[{real(kind=kind\+\_\+phys), intent(in)}]{uref,  }\item[{real(kind=kind\+\_\+phys), intent(out)}]{znotm }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Referenced by \mbox{\hyperlink{group___g_f_s__diff__main_ga21cb96270bf86cdc49ca64a91a7400f1_ga21cb96270bf86cdc49ca64a91a7400f1}{sfc\+\_\+diff\+::sfc\+\_\+diff\+\_\+run()}}.

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