\hypertarget{namespacegwdps}{}\doxysubsection{gwdps Module Reference}
\label{namespacegwdps}\index{gwdps@{gwdps}}


This module contains the CCPP-\/compliant orographic gravity wave dray scheme. This version of gwdps is called from the \mbox{\hyperlink{namespaceunified__ugwp}{unified\+\_\+ugwp}} CCPP scheme.  


\doxysubsubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{group__gfs__gwdps_gae1c2848e29d25f5f9202256ccbeb427d_gae1c2848e29d25f5f9202256ccbeb427d}{gwdps\+\_\+run}} (IM, KM, A, B, C, U1, V1, T1, Q1, KPBL, PRSI, DEL, PRSL, PRSLK, PHII, PHIL, DELTIM, KDT, HPRIME, OC, OA4, CLX4, THETA, SIGMA, GAMMA, ELVMAX, DUSFC, DVSFC, dtaux2d\+\_\+ms, dtauy2d\+\_\+ms, dtaux2d\+\_\+bl, dtauy2d\+\_\+bl, dusfc\+\_\+ms, dvsfc\+\_\+ms, dusfc\+\_\+bl, dvsfc\+\_\+bl, G, CP, RD, RV, IMX, nmtvr, cdmbgwd, me, lprnt, ipr, rdxzb, ldiag\+\_\+ugwp, errmsg, errflg)
\end{DoxyCompactItemize}


\doxysubsubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{group__gfs__gwdps_gae1c2848e29d25f5f9202256ccbeb427d_gae1c2848e29d25f5f9202256ccbeb427d}\label{group__gfs__gwdps_gae1c2848e29d25f5f9202256ccbeb427d_gae1c2848e29d25f5f9202256ccbeb427d}} 
\index{gwdps@{gwdps}!gwdps\_run@{gwdps\_run}}
\index{gwdps\_run@{gwdps\_run}!gwdps@{gwdps}}
\doxyparagraph{\texorpdfstring{gwdps\_run()}{gwdps\_run()}}
{\footnotesize\ttfamily subroutine gwdps\+::gwdps\+\_\+run (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{IM,  }\item[{integer, intent(in)}]{KM,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{A,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{B,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{C,  }\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[{integer, dimension(\+:), intent(in)}]{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)}]{DELTIM,  }\item[{integer, intent(in)}]{KDT,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{HPRIME,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{OC,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{OA4,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(in)}]{CLX4,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{THETA,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{SIGMA,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{GAMMA,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{ELVMAX,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{DUSFC,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{DVSFC,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{dtaux2d\+\_\+ms,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{dtauy2d\+\_\+ms,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{dtaux2d\+\_\+bl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:,\+:), intent(inout)}]{dtauy2d\+\_\+bl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{dusfc\+\_\+ms,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{dvsfc\+\_\+ms,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{dusfc\+\_\+bl,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{dvsfc\+\_\+bl,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{G,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{CP,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{RD,  }\item[{real(kind=kind\+\_\+phys), intent(in)}]{RV,  }\item[{integer, intent(in)}]{IMX,  }\item[{integer, intent(in)}]{nmtvr,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(in)}]{cdmbgwd,  }\item[{integer, intent(in)}]{me,  }\item[{logical, intent(in)}]{lprnt,  }\item[{integer, intent(in)}]{ipr,  }\item[{real(kind=kind\+\_\+phys), dimension(\+:), intent(inout)}]{rdxzb,  }\item[{logical, intent(in)}]{ldiag\+\_\+ugwp,  }\item[{character(len=$\ast$), intent(out)}]{errmsg,  }\item[{integer, intent(out)}]{errflg }\end{DoxyParamCaption})}

--- Subgrid Mountain Blocking Section


\begin{DoxyItemize}
\item Compute Brunt-\/\+Vaisala Frequency $N$.
\item Find the dividing streamline height starting from the level above the maximum mountain height and processing downward.
\item Compute wind speed UDS \[ UDS=\max(\sqrt{U1^2+V1^2},minwnd) \] where $ minwnd=0.1 $, $U1$ and $V1$ are zonal and meridional wind components of model layer wind.
\item The dividing streamline height (idxzb), of a subgrid scale obstable, is found by comparing the potential (PE) and kinetic energies (EK) of the upstream large scale wind and subgrid scale air parcel movements. the dividing streamline is found when $PE\geq EK$. Mountain-\/blocked flow is defined to exist between the surface and the dividing streamline height ( $h_d$), which can be found by solving an integral equation for $h_d$\+: \[ \frac{U^{2}(h_{d})}{2}=\int_{h_{d}}^{H} N^{2}(z)(H-z)dz \] where $H$ is the maximum subgrid scale elevation within the grid box of actual orography, $h$, obtained from the GTOPO30 dataset from the U.\+S. Geological Survey.
\item Calculate $ZLEN$, which sums up a number of contributions of elliptic obstables. \[ ZLEN=\sqrt{[\frac{h_{d}-z}{z+h\textnormal{\textquotesingle}}]} \] where $z$ is the height, $h\textnormal{\textquotesingle}$ is the orographic standard deviation (HPRIME).
\item Calculate the drag coefficient to vary with the aspect ratio of the obstable as seen by the incident flow (see eq.\+14 in Lott and Miller (1997) \cite{lott_and_miller_1997}) \[ R=\frac{\cos^{2}\psi+\gamma\sin^{2}\psi}{\gamma\cos^{2}\psi+\sin^{2}\psi} \] where $\psi$, which is derived from THETA, is the angle between the incident flow direction and the normal ridge direcion. $\gamma$ is the orographic anisotropy (GAMMA).
\item In each model layer below the dividing streamlines, a drag from the blocked flow is exerted by the obstacle on the large scale flow. The drag per unit area and per unit height is written (eq.\+15 in Lott and Miller (1997) \cite{lott_and_miller_1997})\+: \[ D_{b}(z)=-C_{d}\max(2-\frac{1}{R},0)\rho\frac{\sigma}{2h\textnormal{\textquotesingle}}ZLEN\max(\cos\psi,\gamma\sin\psi)\frac{UDS}{2} \] where $C_{d}$ is a specified constant, $\sigma$ is the orographic slope.
\end{DoxyItemize}
\begin{DoxyEnumerate}
\item Orographic Gravity Wave Drag Section
\end{DoxyEnumerate}
\begin{DoxyItemize}
\item Calculate the reference level index\+: kref=max(2,KPBL+1). where KPBL is the index for the PBL top layer.
\item Calculate low-\/level horizontal wind direction, the derived orographic asymmetry parameter (OA), and the derived Lx (CLX).
\item Calculate enhancement factor (E),number of mountans (m\textquotesingle{}) and aspect ratio constant. ~\newline
 As in eq.(4.\+9),(4.\+10),(4.\+11) in Kim and Arakawa (1995) \cite{kim_and_arakawa_1995}, we define m\textquotesingle{} and E in such a way that they depend on the geometry and location of the subgrid-\/scale orography through OA and the nonlinearity of flow above the orography through Fr. OC, which is the orographic convexity, and statistically determine how protruded (sharp) the subgrid-\/scale orography is, is included in the saturation flux G\textquotesingle{} in such a way that G\textquotesingle{} is proportional to OC. The forms of E,m\textquotesingle{} and G\textquotesingle{} are\+: \[ E(OA,F_{r_{0}})=(OA+2)^{\delta} \] \[ \delta=C_{E}F_{r_{0}}/F_{r_{c}} \] \[ m\textnormal{\textquotesingle}(OA,CLX)=C_{m}\triangle x(1+CLX)^{OA+1} \] \[ G\textnormal{\textquotesingle}(OC,F_{r_{0}})=\frac{F_{r_{0}}^2}{F_{r_{0}}^2+a^{2}} \] \[ a^{2}=C_{G}OC^{-1} \] where $F_{r_{c}}(=1)$ is the critical Froude number, $F_{r_{0}}$ is the Froude number. $C_{E}$, $C_{m}$, $C_{G}$ are constants.
\item Calculate the reference-\/level drag $\tau_{0}$ (eq.(4.\+8) in Kim and Arakawa (1995) \cite{kim_and_arakawa_1995})\+: \[ \tau_0=E\frac{m\textnormal{\textquotesingle}}{\triangle x}\frac{\rho_{0}U_0^3}{N_{0}}G\textnormal{\textquotesingle} \] where $E$, $m\textnormal{\textquotesingle}$, and $G\textnormal{\textquotesingle}$ are the enhancement factor, \char`\"{}the number of mountains\char`\"{}, and the flux function defined above, respectively.
\item Compute the drag above the reference level ( $k\geq kref$)\+:
\begin{DoxyItemize}
\item Calculate the ratio of the Scorer parameter ( $R_{scor}$). ~\newline
 From a series of experiments, Kim and Arakawa (1995) \cite{kim_and_arakawa_1995} found that the magnitude of drag divergence tends to be underestimated by the revised scheme in low-\/level downstream regions with wave breaking. Therefore, at low levels when OA \texorpdfstring{$>$}{>} 0 (i.\+e., in the \char`\"{}downstream\char`\"{} region) the saturation hypothesis is replaced by the following formula based on the ratio of the the Scorer parameter\+: \[ R_{scor}=\min \left[\frac{\tau_i}{\tau_{i+1}},1\right] \]
\end{DoxyItemize}
\item The drag above the reference level is expressed as\+: \[ \tau=\frac{m\textnormal{\textquotesingle}}{\triangle x}\rho NUh_d^2 \] where $h_{d}$ is the displacement wave amplitude. In the absence of wave breaking, the displacement amplitude for the $i^{th}$ layer can be expressed using the drag for the layer immediately below. Thus, assuming $\tau_i=\tau_{i+1}$, we can get\+: \[ h_{d_i}^2=\frac{\triangle x}{m\textnormal{\textquotesingle}}\frac{\tau_{i+1}}{\rho_{i}N_{i}U_{i}} \]
\item The minimum Richardson number ( $Ri_{m}$) or local wave-\/modified Richardson number, which determines the onset of wave breaking, is expressed in terms of $R_{i}$ and $F_{r_{d}}=Nh_{d}/U$\+: \[ Ri_{m}=\frac{Ri(1-Fr_{d})}{(1+\sqrt{Ri}\cdot Fr_{d})^{2}} \] see eq.(4.\+6) in Kim and Arakawa (1995) \cite{kim_and_arakawa_1995}.
\item Check stability to employ the \textquotesingle{}saturation hypothesis\textquotesingle{} of Lindzen (1981) \cite{lindzen_1981} except at tropospheric downstream regions. ~\newline
 Wave breaking occurs when $Ri_{m}<Ri_{c}=0.25$. Then Lindzen\textquotesingle{}s wave saturation hypothesis resets the displacement amplitude $h_{d}$ to that corresponding to $Ri_{m}=0.25$, we obtain the critical $h_{d}$(or $h_{c}$) expressed in terms of the mean values of $U$, $N$, and $Ri$ ( eq.(4.\+7) in Kim and Arakawa (1995) \cite{kim_and_arakawa_1995})\+: \[ h_{c}=\frac{U}{N}\left\{2(2+\frac{1}{\sqrt{Ri}})^{1/2}-(2+\frac{1}{\sqrt{Ri}})\right\} \] if $Ri_{m}\leq Ri_{c}$, obtain $\tau$ from the drag above the reference level by using $h_{c}$ computed above; otherwise $\tau$ is unchanged (note\+: scaled by the ratio of the Scorer paramter).
\item Calculate outputs\+: A, B, DUSFC, DVSFC (see parameter description).
\begin{DoxyItemize}
\item Below the dividing streamline height (k \texorpdfstring{$<$}{<} idxzb), mountain blocking( $D_{b}$) is applied.
\item Otherwise (k\texorpdfstring{$>$}{>}= idxzb), orographic GWD ( $\tau$) is applied.
\end{DoxyItemize}
\end{DoxyItemize}

Referenced by \mbox{\hyperlink{group__cires__ugwp__run__mod_ga79e2ff37434fd5d1e820a02807c20f5e_ga79e2ff37434fd5d1e820a02807c20f5e}{cires\+\_\+ugwp\+::cires\+\_\+ugwp\+\_\+run()}}, and \mbox{\hyperlink{group__unified__ugwp__mod_ga18e317b5b3d284dc6f946039fcd57cd3_ga18e317b5b3d284dc6f946039fcd57cd3}{unified\+\_\+ugwp\+::unified\+\_\+ugwp\+\_\+run()}}.

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