\hypertarget{namespacemom__wave__interface}{}\doxysection{mom\+\_\+wave\+\_\+interface Module Reference}
\label{namespacemom__wave__interface}\index{mom\_wave\_interface@{mom\_wave\_interface}}


\doxysubsection{Detailed Description}
Interface for surface waves. 

\begin{DoxyAuthor}{Author}
Brandon Reichl, 2018.
\end{DoxyAuthor}
This module should be moved as wave coupling progresses and likely will should mirror the iceberg or sea-\/ice model set-\/up.

This module is meant to contain the routines to read in and interpret surface wave data for M\+O\+M6. In its original form, the capabilities include setting the Stokes drift in the model (from a variety of sources including prescribed, empirical, and input files). In short order, the plan is to also ammend the subroutine to accept Stokes drift information from an external coupler. Eventually, it will be necessary to break this file apart so that general wave information may be stored in the control structure and the Stokes drift effect can be isolated from processes such as sea-\/state dependent momentum fluxes, gas fluxes, and other wave related air-\/sea interaction and boundary layer phenomenon.

The Stokes drift are stored on the C-\/grid with the conventional protocol to interpolate to the h-\/grid to compute Langmuir number, the primary quantity needed for Langmuir turbulence parameterizations in both the e\+P\+BL and K\+PP approach. This module also computes full 3d Stokes drift profiles, which will be useful if second-\/order type boundary layer parameterizations are implemented (perhaps via G\+O\+TM, work in progress). \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em Container for all surface wave related parameters. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_a3003dfe4e2167905ae8760bb1115b3cb}{mom\+\_\+wave\+\_\+interface\+\_\+init}} (time, G, GV, US, param\+\_\+file, CS, diag)
\begin{DoxyCompactList}\small\item\em Initializes parameters related to M\+O\+M\+\_\+wave\+\_\+interface. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_ad2bad416c49ca81a4e5822b70d2e14b9}{mom\+\_\+wave\+\_\+interface\+\_\+init\+\_\+lite}} (param\+\_\+file)
\begin{DoxyCompactList}\small\item\em A \textquotesingle{}lite\textquotesingle{} init subroutine to initialize a few inputs needed if using wave information with the wind-\/speed dependent Stokes drift formulation of L\+F17. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_ad7c744e81248040ad319e0b608c52284}{update\+\_\+surface\+\_\+waves}} (G, GV, US, Day, dt, CS)
\begin{DoxyCompactList}\small\item\em Subroutine that handles updating of surface wave/\+Stokes drift related properties. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_a42b769030d04a1c087e168de36ce7285}{update\+\_\+stokes\+\_\+drift}} (G, GV, US, CS, h, ustar)
\begin{DoxyCompactList}\small\item\em Constructs the Stokes Drift profile on the model grid based on desired coupling options. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_a01dd0c089dab89934450a7a699255658}{surface\+\_\+bands\+\_\+by\+\_\+data\+\_\+override}} (day\+\_\+center, G, GV, US, CS)
\begin{DoxyCompactList}\small\item\em A subroutine to fill the Stokes drift from a Net\+C\+DF file using the data\+\_\+override procedures. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_aa07c73f561840851981d6a013423dd6e}{get\+\_\+langmuir\+\_\+number}} (LA, G, GV, US, H\+BL, ustar, i, j, H, U\+\_\+H, V\+\_\+H, Override\+\_\+\+MA, Waves)
\begin{DoxyCompactList}\small\item\em Interface to get Langmuir number based on options stored in wave structure. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_a42ca9104192ff12c44c28b705d137eb9}{get\+\_\+stokessl\+\_\+lifoxkemper}} (ustar, hbl, GV, US, U\+Stokes\+\_\+\+SL, LA)
\begin{DoxyCompactList}\small\item\em Get SL averaged Stokes drift from Li/\+FK 17 method. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_ae631a776ca48a5b8be572bed00e6f5c1}{get\+\_\+sl\+\_\+average\+\_\+prof}} (GV, Avg\+Depth, H, Profile, Average)
\begin{DoxyCompactList}\small\item\em Get SL Averaged Stokes drift from a Stokes drift Profile. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_a5ebd32de10bed6d66c0a95a4a15cc81a}{get\+\_\+sl\+\_\+average\+\_\+band}} (GV, Avg\+Depth, NB, Wave\+Numbers, Surf\+Stokes, Average)
\begin{DoxyCompactList}\small\item\em Get SL averaged Stokes drift from the banded Spectrum method. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_af4594bd7d4bc3eed353357d436a551c4}{dhh85\+\_\+mid}} (GV, US, zpt, U\+Stokes)
\begin{DoxyCompactList}\small\item\em Compute the Stokes drift at a given depth. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_a86d1b417862d641edb7996ff136c4b93}{stokesmixing}} (G, GV, dt, h, u, v, Waves)
\begin{DoxyCompactList}\small\item\em Explicit solver for Stokes mixing. Still in development do not use. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_a0c3ce75d6b2e9f338ca4c7e5ec63f71b}{coriolisstokes}} (G, GV, DT, h, u, v, W\+A\+V\+ES, US)
\begin{DoxyCompactList}\small\item\em Solver to add Coriolis-\/\+Stokes to model Still in development and not meant for general use. Can be activated (with code intervention) for L\+ES comparison C\+H\+E\+CK T\+H\+AT R\+I\+G\+HT T\+I\+M\+E\+S\+T\+EP IS P\+A\+S\+S\+ED IF Y\+OU U\+SE T\+H\+I\+S$\ast$$\ast$. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__wave__interface_ae771d75c78a0370ad163edd5b1c19965}{ust\+\_\+2\+\_\+u10\+\_\+coare3p5}} (U\+S\+Tair, U10, GV, US)
\begin{DoxyCompactList}\small\item\em Computes wind speed from ustar\+\_\+air based on C\+O\+A\+RE 3.\+5 Cd relationship Probably doesn\textquotesingle{}t belong in this module, but it is used here to estimate wind speed for wind-\/wave relationships. Should be a fine way to estimate the neutral wind-\/speed as written here. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__wave__interface_a503d3ffc8d297c000dc72e2bfb7eb1b1}{waves\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Clear pointers, deallocate memory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
integer \mbox{\hyperlink{namespacemom__wave__interface_ad81e4ea1a9510437272f5871af6993ad}{wavemethod}} =-\/99
\begin{DoxyCompactList}\small\item\em Options for including wave information Valid (tested) choices are\+: 0 -\/ Test Profile 1 -\/ Surface Stokes Drift Bands 2 -\/ D\+H\+H85 3 -\/ L\+F17 -\/99 -\/ No waves computed, but empirical Langmuir number used. \end{DoxyCompactList}\item 
integer, public \mbox{\hyperlink{namespacemom__wave__interface_ab514cf456c7f7953f4c304b941ff4c53}{numbands}} =0
\begin{DoxyCompactList}\small\item\em Number of wavenumber/frequency partitions to receive This needs to match the number of bands provided via either coupling or file. \end{DoxyCompactList}\item 
integer, public \mbox{\hyperlink{namespacemom__wave__interface_a91f7f974e91056f48cb04fb01b8f0d15}{partitionmode}}
\begin{DoxyCompactList}\small\item\em Method for partition mode (meant to check input) 0 -\/ wavenumbers 1 -\/ frequencies. \end{DoxyCompactList}\item 
integer \mbox{\hyperlink{namespacemom__wave__interface_af159120455d0f0afae144afc6a587561}{datasource}}
\begin{DoxyCompactList}\small\item\em Integer that specifies where the Model Looks for Data Valid choices are\+: 1 -\/ F\+MS Data\+Override Routine 2 -\/ Reserved For Coupler 3 -\/ User input (fixed values, useful for 1d testing) \end{DoxyCompactList}\item 
character(len=40) \mbox{\hyperlink{namespacemom__wave__interface_a14b0aa4752008d5a52dbbb5e16751122}{surfbandfilename}}
\begin{DoxyCompactList}\small\item\em Filename if using Data\+Override. \end{DoxyCompactList}\item 
logical \mbox{\hyperlink{namespacemom__wave__interface_a86e86d267dc214498fcd8088349d5d57}{dataoverrideisinitialized}}
\begin{DoxyCompactList}\small\item\em Flag for Data\+Override Initialization. \end{DoxyCompactList}\item 
real \mbox{\hyperlink{namespacemom__wave__interface_abc7136c467d4f1def8b2a32dfd335c3f}{la\+\_\+frachbl}}
\begin{DoxyCompactList}\small\item\em Fraction of O\+S\+BL for averaging Langmuir number. \end{DoxyCompactList}\item 
logical \mbox{\hyperlink{namespacemom__wave__interface_aab4d6b9f7e8823615c5ff975e0e40d22}{la\+\_\+misalignment}} = .false.
\begin{DoxyCompactList}\small\item\em Flag to use misalignment in Langmuir number. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__wave__interface_a55a67e21539483f4da8d0c8a33f36dc1}\label{namespacemom__wave__interface_a55a67e21539483f4da8d0c8a33f36dc1}} 
character(len=40) \mbox{\hyperlink{namespacemom__wave__interface_a55a67e21539483f4da8d0c8a33f36dc1}{mdl}} = \char`\"{}M\+O\+M\+\_\+wave\+\_\+interface\char`\"{}
\begin{DoxyCompactList}\small\item\em This module\textquotesingle{}s name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__wave__interface_a0c3ce75d6b2e9f338ca4c7e5ec63f71b}\label{namespacemom__wave__interface_a0c3ce75d6b2e9f338ca4c7e5ec63f71b}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!coriolisstokes@{coriolisstokes}}
\index{coriolisstokes@{coriolisstokes}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{coriolisstokes()}{coriolisstokes()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::coriolisstokes (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{real, intent(in)}]{DT,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h,  }\item[{real, dimension(szib\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(inout)}]{u,  }\item[{real, dimension(szi\+\_\+(g),szjb\+\_\+(g),szk\+\_\+(g)), intent(inout)}]{v,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{W\+A\+V\+ES,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US }\end{DoxyParamCaption})}



Solver to add Coriolis-\/\+Stokes to model Still in development and not meant for general use. Can be activated (with code intervention) for L\+ES comparison C\+H\+E\+CK T\+H\+AT R\+I\+G\+HT T\+I\+M\+E\+S\+T\+EP IS P\+A\+S\+S\+ED IF Y\+OU U\+SE T\+H\+I\+S$\ast$$\ast$. 

Not accessed in the standard code. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Ocean grid \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid \\
\hline
\mbox{\texttt{ in}}  & {\em dt} & Time step of M\+O\+M6 \mbox{[}s\mbox{]} C\+H\+E\+CK IF P\+A\+S\+S\+I\+NG R\+I\+G\+HT T\+I\+M\+E\+S\+T\+EP \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em u} & Velocity i-\/component \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em v} & Velocity j-\/component \mbox{[}m s-\/1\mbox{]} \\
\hline
 & {\em waves} & Surface wave related control structure. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 1288 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1288   \textcolor{keywordtype}{type}(ocean\_grid\_type), \&}
\DoxyCodeLine{1289        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{     !< Ocean grid}}
\DoxyCodeLine{1290   \textcolor{keywordtype}{type}(verticalGrid\_type), \&}
\DoxyCodeLine{1291        \textcolor{keywordtype}{intent(in)}   :: GV\textcolor{comment}{     !< Ocean vertical grid}}
\DoxyCodeLine{1292 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: Dt\textcolor{comment}{     !< Time step of MOM6 [s] CHECK IF PASSING RIGHT TIMESTEP}}
\DoxyCodeLine{1293 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))},  \&}
\DoxyCodeLine{1294        \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Layer thicknesses [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{1295 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{1296        \textcolor{keywordtype}{intent(inout)} :: u\textcolor{comment}{     !< Velocity i-\/component [m s-\/1]}}
\DoxyCodeLine{1297 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{1298        \textcolor{keywordtype}{intent(inout)} :: v\textcolor{comment}{     !< Velocity j-\/component [m s-\/1]}}
\DoxyCodeLine{1299   \textcolor{keywordtype}{type}(Wave\_parameters\_CS), \&}
\DoxyCodeLine{1300        \textcolor{keywordtype}{pointer}       :: Waves\textcolor{comment}{ !< Surface wave related control structure.}}
\DoxyCodeLine{1301   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{     !< A dimensional unit scaling type}}
\DoxyCodeLine{1302   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1303 \textcolor{keywordtype}{  real} :: DVel \textcolor{comment}{! A rescaled velocity change [m s-\/1 T-\/1 \string~> m s-\/2]}}
\DoxyCodeLine{1304   \textcolor{keywordtype}{integer} :: i,j,k}
\DoxyCodeLine{1305 }
\DoxyCodeLine{1306   \textcolor{keywordflow}{do} k = 1, g\%ke}
\DoxyCodeLine{1307     \textcolor{keywordflow}{do} j = g\%jsc, g\%jec}
\DoxyCodeLine{1308       \textcolor{keywordflow}{do} i = g\%iscB, g\%iecB}
\DoxyCodeLine{1309         dvel = 0.25*(waves\%us\_y(i,j+1,k)+waves\%us\_y(i-\/1,j+1,k))*g\%CoriolisBu(i,j+1) + \&}
\DoxyCodeLine{1310                0.25*(waves\%us\_y(i,j,k)+waves\%us\_y(i-\/1,j,k))*g\%CoriolisBu(i,j)}
\DoxyCodeLine{1311         u(i,j,k) = u(i,j,k) + dvel*us\%s\_to\_T*dt}
\DoxyCodeLine{1312 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{1313 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{1314 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1315 }
\DoxyCodeLine{1316   \textcolor{keywordflow}{do} k = 1, g\%ke}
\DoxyCodeLine{1317     \textcolor{keywordflow}{do} j = g\%jscB, g\%jecB}
\DoxyCodeLine{1318       \textcolor{keywordflow}{do} i = g\%isc, g\%iec}
\DoxyCodeLine{1319         dvel = 0.25*(waves\%us\_x(i+1,j,k)+waves\%us\_x(i+1,j-\/1,k))*g\%CoriolisBu(i+1,j) + \&}
\DoxyCodeLine{1320                0.25*(waves\%us\_x(i,j,k)+waves\%us\_x(i,j-\/1,k))*g\%CoriolisBu(i,j)}
\DoxyCodeLine{1321         v(i,j,k) = v(i,j,k) -\/ dvel*us\%s\_to\_T*dt}
\DoxyCodeLine{1322 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{1323 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{1324 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_af4594bd7d4bc3eed353357d436a551c4}\label{namespacemom__wave__interface_af4594bd7d4bc3eed353357d436a551c4}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!dhh85\_mid@{dhh85\_mid}}
\index{dhh85\_mid@{dhh85\_mid}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{dhh85\_mid()}{dhh85\_mid()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::dhh85\+\_\+mid (\begin{DoxyParamCaption}\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{real, intent(in)}]{zpt,  }\item[{real, intent(out)}]{U\+Stokes }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Compute the Stokes drift at a given depth. 

Taken from Qing Li (Brown) use for comparing M\+O\+M6 simulation to his L\+ES computed at z mid point (I think) and not depth averaged. Should be fine to integrate in frequency from 0.\+1 to sqrt(-\/0.\+2$\ast$grav$\ast$2pi/dz 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em zpt} & Depth to get Stokes drift \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em ustokes} & Stokes drift \mbox{[}m s-\/1\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 1163 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1163   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{  !< Ocean vertical grid}}
\DoxyCodeLine{1164   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{  !< A dimensional unit scaling type}}
\DoxyCodeLine{1165 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: zpt\textcolor{comment}{   !< Depth to get Stokes drift [Z \string~> m].}}
\DoxyCodeLine{1166 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: UStokes\textcolor{comment}{ !< Stokes drift [m s-\/1]}}
\DoxyCodeLine{1167   \textcolor{comment}{!}}
\DoxyCodeLine{1168 \textcolor{keywordtype}{  real} :: ann, Bnn, Snn, Cnn, Dnn}
\DoxyCodeLine{1169 \textcolor{keywordtype}{  real} :: omega\_peak, omega, u10, WA, domega}
\DoxyCodeLine{1170 \textcolor{keywordtype}{  real} :: omega\_min, omega\_max, wavespec, Stokes}
\DoxyCodeLine{1171 \textcolor{keywordtype}{  real} :: g\_Earth \textcolor{comment}{! Gravitational acceleration [m s-\/2]}}
\DoxyCodeLine{1172   \textcolor{keywordtype}{integer} :: Nomega, OI}
\DoxyCodeLine{1173 }
\DoxyCodeLine{1174   wa = waveage}
\DoxyCodeLine{1175   u10 = wavewind}
\DoxyCodeLine{1176   g\_earth = us\%L\_T\_to\_m\_s**2*us\%m\_to\_Z * gv\%g\_Earth}
\DoxyCodeLine{1177 }
\DoxyCodeLine{1178   \textcolor{comment}{!/}}
\DoxyCodeLine{1179   omega\_min = 0.1 \textcolor{comment}{! Hz}}
\DoxyCodeLine{1180   \textcolor{comment}{! Cut off at 30cm for now...}}
\DoxyCodeLine{1181   omega\_max = 10. \textcolor{comment}{! \string~sqrt(0.2*g\_Earth*2*pi/0.3)}}
\DoxyCodeLine{1182   nomega = 1000}
\DoxyCodeLine{1183   domega = (omega\_max-\/omega\_min)/real(nomega)}
\DoxyCodeLine{1184 }
\DoxyCodeLine{1185   \textcolor{comment}{!}}
\DoxyCodeLine{1186   \textcolor{keywordflow}{if} (waveagepeakfreq) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1187     omega\_peak = g\_earth / (wa * u10)}
\DoxyCodeLine{1188   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1189     omega\_peak = 2. * pi * 0.13 * g\_earth / u10}
\DoxyCodeLine{1190 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1191   \textcolor{comment}{!/}}
\DoxyCodeLine{1192   ann = 0.006 * waveage**(-\/0.55)}
\DoxyCodeLine{1193   bnn = 1.0}
\DoxyCodeLine{1194   snn = 0.08 * (1.0 + 4.0 * waveage**3)}
\DoxyCodeLine{1195   cnn = 1.7}
\DoxyCodeLine{1196   \textcolor{keywordflow}{if} (wa < 1.) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1197     cnn = cnn -\/ 6.0*log10(wa)}
\DoxyCodeLine{1198 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1199   \textcolor{comment}{!/}}
\DoxyCodeLine{1200   ustokes = 0.0}
\DoxyCodeLine{1201   omega = omega\_min + 0.5*domega}
\DoxyCodeLine{1202   \textcolor{keywordflow}{do} oi = 1,nomega-\/1}
\DoxyCodeLine{1203     dnn = exp( -\/0.5 * (omega-\/omega\_peak)**2 / (snn**2 * omega\_peak**2) )}
\DoxyCodeLine{1204     \textcolor{comment}{! wavespec units = m2s}}
\DoxyCodeLine{1205     wavespec = (ann * g\_earth**2 / (omega\_peak*omega**4 ) ) * \&}
\DoxyCodeLine{1206                exp(-\/bnn*(omega\_peak/omega)**4)*cnn**dnn}
\DoxyCodeLine{1207     \textcolor{comment}{! Stokes units m  (multiply by frequency range for units of m/s)}}
\DoxyCodeLine{1208     stokes = 2.0 * wavespec * omega**3 * \&}
\DoxyCodeLine{1209          exp( 2.0 * omega**2 * us\%Z\_to\_m*zpt / g\_earth) / g\_earth}
\DoxyCodeLine{1210     ustokes = ustokes + stokes*domega}
\DoxyCodeLine{1211     omega = omega + domega}
\DoxyCodeLine{1212 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1213 }
\DoxyCodeLine{1214   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_aa07c73f561840851981d6a013423dd6e}\label{namespacemom__wave__interface_aa07c73f561840851981d6a013423dd6e}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!get\_langmuir\_number@{get\_langmuir\_number}}
\index{get\_langmuir\_number@{get\_langmuir\_number}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{get\_langmuir\_number()}{get\_langmuir\_number()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::get\+\_\+langmuir\+\_\+number (\begin{DoxyParamCaption}\item[{real, intent(out)}]{LA,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{real, intent(in)}]{H\+BL,  }\item[{real, intent(in)}]{ustar,  }\item[{integer, intent(in)}]{i,  }\item[{integer, intent(in)}]{j,  }\item[{real, dimension( gv \%ke), intent(in), optional}]{H,  }\item[{real, dimension( gv \%ke), intent(in), optional}]{U\+\_\+H,  }\item[{real, dimension( gv \%ke), intent(in), optional}]{V\+\_\+H,  }\item[{logical, intent(in), optional}]{Override\+\_\+\+MA,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{Waves }\end{DoxyParamCaption})}



Interface to get Langmuir number based on options stored in wave structure. 

Note this can be called with an unallocated Waves pointer, which is okay if we want the wind-\/speed only dependent Langmuir number. Therefore, we need to be careful about what we try to access here. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Ocean grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em i} & Meridional index of h-\/point \\
\hline
\mbox{\texttt{ in}}  & {\em j} & Zonal index of h-\/point \\
\hline
\mbox{\texttt{ in}}  & {\em ustar} & Friction velocity \mbox{[}Z T-\/1 $\sim$$>$ m s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em hbl} & (Positive) thickness of boundary layer \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em override\+\_\+ma} & Override to use misalignment in LA calculation. This can be used if diagnostic LA outputs are desired that are different than those used by the dynamical model. \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Grid layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+h} & Zonal velocity at H point \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+h} & Meridional velocity at H point \mbox{[}m s-\/1\mbox{]} \\
\hline
 & {\em waves} & Surface wave control structure. \\
\hline
\mbox{\texttt{ out}}  & {\em la} & Langmuir number \\
\hline
\end{DoxyParams}


Definition at line 880 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{880   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{  !< Ocean grid structure}}
\DoxyCodeLine{881   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{ !< Ocean vertical grid structure}}
\DoxyCodeLine{882   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{883   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: i\textcolor{comment}{      !< Meridional index of h-\/point}}
\DoxyCodeLine{884   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: j\textcolor{comment}{      !< Zonal index of h-\/point}}
\DoxyCodeLine{885 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}    :: ustar\textcolor{comment}{  !< Friction velocity [Z T-\/1 \string~> m s-\/1].}}
\DoxyCodeLine{886 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}    :: HBL\textcolor{comment}{    !< (Positive) thickness of boundary layer [Z \string~> m].}}
\DoxyCodeLine{887   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},       \textcolor{keywordtype}{intent(in)} :: Override\_MA\textcolor{comment}{ !< Override to use misalignment in LA}}
\DoxyCodeLine{888 \textcolor{comment}{                                !! calculation. This can be used if diagnostic}}
\DoxyCodeLine{889 \textcolor{comment}{                                !! LA outputs are desired that are different than}}
\DoxyCodeLine{890 \textcolor{comment}{                                !! those used by the dynamical model.}}
\DoxyCodeLine{891 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV))}, \textcolor{keywordtype}{optional}, \&}
\DoxyCodeLine{892        \textcolor{keywordtype}{intent(in)}      :: H\textcolor{comment}{     !< Grid layer thickness [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{893 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV))}, \textcolor{keywordtype}{optional}, \&}
\DoxyCodeLine{894        \textcolor{keywordtype}{intent(in)}      :: U\_H\textcolor{comment}{   !< Zonal velocity at H point [m s-\/1]}}
\DoxyCodeLine{895 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV))}, \textcolor{keywordtype}{optional}, \&}
\DoxyCodeLine{896        \textcolor{keywordtype}{intent(in)}      :: V\_H\textcolor{comment}{   !< Meridional velocity at H point [m s-\/1]}}
\DoxyCodeLine{897   \textcolor{keywordtype}{type}(Wave\_parameters\_CS), \&}
\DoxyCodeLine{898        \textcolor{keywordtype}{pointer}         :: Waves\textcolor{comment}{ !< Surface wave control structure.}}
\DoxyCodeLine{899 }
\DoxyCodeLine{900 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: LA\textcolor{comment}{    !< Langmuir number}}
\DoxyCodeLine{901 }
\DoxyCodeLine{902 \textcolor{comment}{!Local Variables}}
\DoxyCodeLine{903 \textcolor{keywordtype}{  real} :: Top, bottom, midpoint}
\DoxyCodeLine{904 \textcolor{keywordtype}{  real} :: Dpt\_LASL, ShearDirection, WaveDirection}
\DoxyCodeLine{905 \textcolor{keywordtype}{  real} :: LA\_STKx, LA\_STKy, LA\_STK \textcolor{comment}{! Stokes velocities in [m s-\/1]}}
\DoxyCodeLine{906   \textcolor{keywordtype}{logical} :: ContinueLoop, USE\_MA}
\DoxyCodeLine{907 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(G))} :: US\_H, VS\_H}
\DoxyCodeLine{908 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(NumBands)} :: StkBand\_X, StkBand\_Y}
\DoxyCodeLine{909   \textcolor{keywordtype}{integer} :: KK, BB}
\DoxyCodeLine{910 }
\DoxyCodeLine{911  \textcolor{comment}{! Compute averaging depth for Stokes drift (negative)}}
\DoxyCodeLine{912   dpt\_lasl = min(-\/0.1*us\%m\_to\_Z, -\/la\_frachbl*hbl)}
\DoxyCodeLine{913 }
\DoxyCodeLine{914   use\_ma = la\_misalignment}
\DoxyCodeLine{915   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(override\_ma)) use\_ma = override\_ma}
\DoxyCodeLine{916 }
\DoxyCodeLine{917   \textcolor{comment}{! If requesting to use misalignment in the Langmuir number compute the Shear Direction}}
\DoxyCodeLine{918   \textcolor{keywordflow}{if} (use\_ma) \textcolor{keywordflow}{then}}
\DoxyCodeLine{919     \textcolor{keywordflow}{if} (.not.(\textcolor{keyword}{present}(h).and.\textcolor{keyword}{present}(u\_h).and.\textcolor{keyword}{present}(v\_h))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{920       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Get\_LA\_waves requested to consider misalignment.'})}
\DoxyCodeLine{921 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{922     continueloop = .true.}
\DoxyCodeLine{923     bottom = 0.0}
\DoxyCodeLine{924     \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{925       top = bottom}
\DoxyCodeLine{926       midpoint = bottom + gv\%H\_to\_Z*0.5*h(kk)}
\DoxyCodeLine{927       bottom = bottom + gv\%H\_to\_Z*h(kk)}
\DoxyCodeLine{928       \textcolor{keywordflow}{if} (midpoint > dpt\_lasl .and. kk > 1 .and. continueloop) \textcolor{keywordflow}{then}}
\DoxyCodeLine{929         sheardirection = atan2(v\_h(1)-\/v\_h(kk),u\_h(1)-\/u\_h(kk))}
\DoxyCodeLine{930         continueloop = .false.}
\DoxyCodeLine{931 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{932 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{933 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{934 }
\DoxyCodeLine{935   \textcolor{keywordflow}{if} (wavemethod==testprof) \textcolor{keywordflow}{then}}
\DoxyCodeLine{936     \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{937       us\_h(kk) = 0.5*(waves\%US\_X(i,j,kk)+waves\%US\_X(i-\/1,j,kk))}
\DoxyCodeLine{938       vs\_h(kk) = 0.5*(waves\%US\_Y(i,j,kk)+waves\%US\_Y(i,j-\/1,kk))}
\DoxyCodeLine{939 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{940     \textcolor{keyword}{call }get\_sl\_average\_prof( gv, dpt\_lasl, h, us\_h, la\_stkx)}
\DoxyCodeLine{941     \textcolor{keyword}{call }get\_sl\_average\_prof( gv, dpt\_lasl, h, vs\_h, la\_stky)}
\DoxyCodeLine{942     la\_stk = sqrt(la\_stkx*la\_stkx+la\_stky*la\_stky)}
\DoxyCodeLine{943   \textcolor{keywordflow}{elseif} (wavemethod==surfbands) \textcolor{keywordflow}{then}}
\DoxyCodeLine{944     \textcolor{keywordflow}{do} bb = 1,numbands}
\DoxyCodeLine{945       stkband\_x(bb) = 0.5*(waves\%STKx0(i,j,bb)+waves\%STKx0(i-\/1,j,bb))}
\DoxyCodeLine{946       stkband\_y(bb) = 0.5*(waves\%STKy0(i,j,bb)+waves\%STKy0(i,j-\/1,bb))}
\DoxyCodeLine{947 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{948     \textcolor{keyword}{call }get\_sl\_average\_band(gv, dpt\_lasl, numbands, waves\%WaveNum\_Cen, stkband\_x, la\_stkx )}
\DoxyCodeLine{949     \textcolor{keyword}{call }get\_sl\_average\_band(gv, dpt\_lasl, numbands, waves\%WaveNum\_Cen, stkband\_y, la\_stky )}
\DoxyCodeLine{950     la\_stk = sqrt(la\_stkx**2 + la\_stky**2)}
\DoxyCodeLine{951   \textcolor{keywordflow}{elseif} (wavemethod==dhh85) \textcolor{keywordflow}{then}}
\DoxyCodeLine{952     \textcolor{comment}{! Temporarily integrating profile rather than spectrum for simplicity}}
\DoxyCodeLine{953     \textcolor{keywordflow}{do} kk = 1,gv\%ke}
\DoxyCodeLine{954       us\_h(kk) = 0.5*(waves\%US\_X(i,j,kk)+waves\%US\_X(i-\/1,j,kk))}
\DoxyCodeLine{955       vs\_h(kk) = 0.5*(waves\%US\_Y(i,j,kk)+waves\%US\_Y(i,j-\/1,kk))}
\DoxyCodeLine{956 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{957     \textcolor{keyword}{call }get\_sl\_average\_prof( gv, dpt\_lasl, h, us\_h, la\_stkx)}
\DoxyCodeLine{958     \textcolor{keyword}{call }get\_sl\_average\_prof( gv, dpt\_lasl, h, vs\_h, la\_stky)}
\DoxyCodeLine{959     la\_stk = sqrt(la\_stkx**2 + la\_stky**2)}
\DoxyCodeLine{960   \textcolor{keywordflow}{elseif} (wavemethod==lf17) \textcolor{keywordflow}{then}}
\DoxyCodeLine{961     \textcolor{keyword}{call }get\_stokessl\_lifoxkemper(ustar, hbl*la\_frachbl, gv, us, la\_stk, la)}
\DoxyCodeLine{962   \textcolor{keywordflow}{elseif} (wavemethod==null\_wavemethod) \textcolor{keywordflow}{then}}
\DoxyCodeLine{963     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"Get\_Langmuir\_number called without defining a WaveMethod. "}//\&}
\DoxyCodeLine{964                           \textcolor{stringliteral}{"Suggest to make sure USE\_LT is set/overridden to False or "}//\&}
\DoxyCodeLine{965                           \textcolor{stringliteral}{"choose a wave method (or set USE\_LA\_LI2016 to use statistical "}//\&}
\DoxyCodeLine{966                           \textcolor{stringliteral}{"waves."})}
\DoxyCodeLine{967 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{968 }
\DoxyCodeLine{969   \textcolor{keywordflow}{if} (.not.(wavemethod==lf17)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{970     \textcolor{comment}{! This is an arbitrary lower bound on Langmuir number.}}
\DoxyCodeLine{971     \textcolor{comment}{! We shouldn't expect values lower than this, but}}
\DoxyCodeLine{972     \textcolor{comment}{! there is also no good reason to cap it here other then}}
\DoxyCodeLine{973     \textcolor{comment}{! to prevent large enhancements in unconstrained parts of}}
\DoxyCodeLine{974     \textcolor{comment}{! the curve fit parameterizations.}}
\DoxyCodeLine{975     \textcolor{comment}{! Note the dimensional constant background Stokes velocity of 10\string^-\/10 m s-\/1.}}
\DoxyCodeLine{976     la = max(waves\%La\_min, sqrt(us\%Z\_to\_m*us\%s\_to\_T*ustar / (la\_stk+1.e-\/10)))}
\DoxyCodeLine{977 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{978 }
\DoxyCodeLine{979   \textcolor{keywordflow}{if} (use\_ma) \textcolor{keywordflow}{then}}
\DoxyCodeLine{980     wavedirection = atan2(la\_stky, la\_stkx)}
\DoxyCodeLine{981     la = la / sqrt(max(1.e-\/8, cos( wavedirection -\/ sheardirection)))}
\DoxyCodeLine{982 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{983 }
\DoxyCodeLine{984   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a5ebd32de10bed6d66c0a95a4a15cc81a}\label{namespacemom__wave__interface_a5ebd32de10bed6d66c0a95a4a15cc81a}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!get\_sl\_average\_band@{get\_sl\_average\_band}}
\index{get\_sl\_average\_band@{get\_sl\_average\_band}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{get\_sl\_average\_band()}{get\_sl\_average\_band()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::get\+\_\+sl\+\_\+average\+\_\+band (\begin{DoxyParamCaption}\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{real, intent(in)}]{Avg\+Depth,  }\item[{integer, intent(in)}]{NB,  }\item[{real, dimension(nb), intent(in)}]{Wave\+Numbers,  }\item[{real, dimension(nb), intent(in)}]{Surf\+Stokes,  }\item[{real, intent(out)}]{Average }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Get SL averaged Stokes drift from the banded Spectrum method. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid \\
\hline
\mbox{\texttt{ in}}  & {\em avgdepth} & Depth to average over \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em nb} & Number of bands used \\
\hline
\mbox{\texttt{ in}}  & {\em wavenumbers} & Wavenumber corresponding to each band \mbox{[}Z-\/1 $\sim$$>$ m-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em surfstokes} & Surface Stokes drift for each band \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em average} & Output average Stokes drift over depth Avg\+Depth \mbox{[}m s-\/1\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 1130 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1130   \textcolor{keywordtype}{type}(verticalGrid\_type),  \&}
\DoxyCodeLine{1131        \textcolor{keywordtype}{intent(in)}     :: GV\textcolor{comment}{          !< Ocean vertical grid}}
\DoxyCodeLine{1132 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}    :: AvgDepth\textcolor{comment}{    !< Depth to average over [Z \string~> m].}}
\DoxyCodeLine{1133   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: NB\textcolor{comment}{          !< Number of bands used}}
\DoxyCodeLine{1134 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(NB)}, \&}
\DoxyCodeLine{1135        \textcolor{keywordtype}{intent(in)}     :: WaveNumbers\textcolor{comment}{ !< Wavenumber corresponding to each band [Z-\/1 \string~> m-\/1]}}
\DoxyCodeLine{1136 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(NB)}, \&}
\DoxyCodeLine{1137        \textcolor{keywordtype}{intent(in)}     :: SurfStokes\textcolor{comment}{  !< Surface Stokes drift for each band [m s-\/1]}}
\DoxyCodeLine{1138 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}   :: Average\textcolor{comment}{     !< Output average Stokes drift over depth AvgDepth [m s-\/1]}}
\DoxyCodeLine{1139 }
\DoxyCodeLine{1140   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1141   \textcolor{keywordtype}{integer} :: bb}
\DoxyCodeLine{1142 }
\DoxyCodeLine{1143   \textcolor{comment}{! Loop over bands}}
\DoxyCodeLine{1144   average = 0.0}
\DoxyCodeLine{1145   \textcolor{keywordflow}{do} bb = 1, nb}
\DoxyCodeLine{1146     \textcolor{comment}{! Factor includes analytical integration of e(2kz)}}
\DoxyCodeLine{1147     \textcolor{comment}{!  -\/ divided by (-\/H\_LA) to get average from integral.}}
\DoxyCodeLine{1148     average = average + surfstokes(bb) * \&}
\DoxyCodeLine{1149               (1.-\/exp(-\/abs(avgdepth * 2.0 * wavenumbers(bb)))) / \&}
\DoxyCodeLine{1150               abs(avgdepth * 2.0 * wavenumbers(bb))}
\DoxyCodeLine{1151 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1152 }
\DoxyCodeLine{1153   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ae631a776ca48a5b8be572bed00e6f5c1}\label{namespacemom__wave__interface_ae631a776ca48a5b8be572bed00e6f5c1}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!get\_sl\_average\_prof@{get\_sl\_average\_prof}}
\index{get\_sl\_average\_prof@{get\_sl\_average\_prof}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{get\_sl\_average\_prof()}{get\_sl\_average\_prof()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::get\+\_\+sl\+\_\+average\+\_\+prof (\begin{DoxyParamCaption}\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{real, intent(in)}]{Avg\+Depth,  }\item[{real, dimension(szk\+\_\+(gv)), intent(in)}]{H,  }\item[{real, dimension(szk\+\_\+(gv)), intent(in)}]{Profile,  }\item[{real, intent(out)}]{Average }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Get SL Averaged Stokes drift from a Stokes drift Profile. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em avgdepth} & Depth to average over (negative) \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Grid thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em profile} & Profile of quantity to be averaged \mbox{[}arbitrary\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em average} & Output quantity averaged over depth Avg\+Depth \mbox{[}arbitrary\mbox{]} (used here for Stokes drift) \\
\hline
\end{DoxyParams}


Definition at line 1083 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1083   \textcolor{keywordtype}{type}(verticalGrid\_type),  \&}
\DoxyCodeLine{1084        \textcolor{keywordtype}{intent(in)}   :: GV\textcolor{comment}{       !< Ocean vertical grid structure}}
\DoxyCodeLine{1085 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: AvgDepth\textcolor{comment}{ !< Depth to average over (negative) [Z \string~> m].}}
\DoxyCodeLine{1086 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV))}, \&}
\DoxyCodeLine{1087        \textcolor{keywordtype}{intent(in)}   :: H\textcolor{comment}{        !< Grid thickness [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{1088 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV))}, \&}
\DoxyCodeLine{1089        \textcolor{keywordtype}{intent(in)}   :: Profile\textcolor{comment}{  !< Profile of quantity to be averaged [arbitrary]}}
\DoxyCodeLine{1090 \textcolor{comment}{                                !! (used here for Stokes drift)}}
\DoxyCodeLine{1091 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: Average\textcolor{comment}{  !< Output quantity averaged over depth AvgDepth [arbitrary]}}
\DoxyCodeLine{1092 \textcolor{comment}{                                !! (used here for Stokes drift)}}
\DoxyCodeLine{1093   \textcolor{comment}{!Local variables}}
\DoxyCodeLine{1094 \textcolor{keywordtype}{  real} :: top, midpoint, bottom \textcolor{comment}{! Depths, negative downward [Z \string~> m].}}
\DoxyCodeLine{1095 \textcolor{keywordtype}{  real} :: Sum}
\DoxyCodeLine{1096   \textcolor{keywordtype}{integer} :: kk}
\DoxyCodeLine{1097 }
\DoxyCodeLine{1098   \textcolor{comment}{! Initializing sum}}
\DoxyCodeLine{1099   sum = 0.0}
\DoxyCodeLine{1100 }
\DoxyCodeLine{1101   \textcolor{comment}{! Integrate}}
\DoxyCodeLine{1102   bottom = 0.0}
\DoxyCodeLine{1103   \textcolor{keywordflow}{do} kk = 1, gv\%ke}
\DoxyCodeLine{1104     top = bottom}
\DoxyCodeLine{1105     midpoint = bottom -\/ gv\%H\_to\_Z * 0.5*h(kk)}
\DoxyCodeLine{1106     bottom = bottom -\/ gv\%H\_to\_Z * h(kk)}
\DoxyCodeLine{1107     \textcolor{keywordflow}{if} (avgdepth < bottom) \textcolor{keywordflow}{then} \textcolor{comment}{! The whole cell is within H\_LA}}
\DoxyCodeLine{1108       sum = sum + profile(kk) * (gv\%H\_to\_Z * h(kk))}
\DoxyCodeLine{1109     \textcolor{keywordflow}{elseif} (avgdepth < top) \textcolor{keywordflow}{then} \textcolor{comment}{! A partial cell is within H\_LA}}
\DoxyCodeLine{1110       sum = sum + profile(kk) * (top-\/avgdepth)}
\DoxyCodeLine{1111       \textcolor{keywordflow}{exit}}
\DoxyCodeLine{1112     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1113       \textcolor{keywordflow}{exit}}
\DoxyCodeLine{1114 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1115 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1116 }
\DoxyCodeLine{1117   \textcolor{comment}{! Divide by AvgDepth or the depth in the column, whichever is smaller.}}
\DoxyCodeLine{1118   \textcolor{keywordflow}{if} (abs(avgdepth) <= abs(bottom)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1119     average = sum / abs(avgdepth)}
\DoxyCodeLine{1120   \textcolor{keywordflow}{elseif} (abs(bottom) > 0.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1121     average = sum / abs(bottom)}
\DoxyCodeLine{1122   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1123     average = 0.0}
\DoxyCodeLine{1124 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1125 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a42ca9104192ff12c44c28b705d137eb9}\label{namespacemom__wave__interface_a42ca9104192ff12c44c28b705d137eb9}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!get\_stokessl\_lifoxkemper@{get\_stokessl\_lifoxkemper}}
\index{get\_stokessl\_lifoxkemper@{get\_stokessl\_lifoxkemper}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{get\_stokessl\_lifoxkemper()}{get\_stokessl\_lifoxkemper()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::get\+\_\+stokessl\+\_\+lifoxkemper (\begin{DoxyParamCaption}\item[{real, intent(in)}]{ustar,  }\item[{real, intent(in)}]{hbl,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{real, intent(out)}]{U\+Stokes\+\_\+\+SL,  }\item[{real, intent(out)}]{LA }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Get SL averaged Stokes drift from Li/\+FK 17 method. 

Original description\+:
\begin{DoxyItemize}
\item This function returns the enhancement factor, given the 10-\/meter wind \mbox{[}m s-\/1\mbox{]}, friction velocity \mbox{[}m s-\/1\mbox{]} and the boundary layer depth \mbox{[}m\mbox{]}.
\end{DoxyItemize}

Update (Jan/25)\+:
\begin{DoxyItemize}
\item Converted from function to subroutine, now returns Langmuir number.
\item Computs 10m wind internally, so only ustar and hbl need passed to subroutine.
\end{DoxyItemize}

Qing Li, 160606
\begin{DoxyItemize}
\item B\+GR port from C\+V\+Mix to M\+O\+M6 Jan/25/2017
\item B\+GR change output to LA from Efactor
\item B\+GR remove u10 input
\item B\+GR note\+: fixed parameter values should be changed to \char`\"{}get\+\_\+params\char`\"{} 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ustar} & water-\/side surface friction velocity \mbox{[}Z T-\/1 $\sim$$>$ m s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em hbl} & boundary layer depth \mbox{[}Z $\sim$$>$ m\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ out}}  & {\em ustokes\+\_\+sl} & Surface layer averaged Stokes drift \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em la} & Langmuir number \\
\hline
\end{DoxyParams}

\end{DoxyItemize}

Definition at line 1004 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1004 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: ustar\textcolor{comment}{ !< water-\/side surface friction velocity [Z T-\/1 \string~> m s-\/1].}}
\DoxyCodeLine{1005 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: hbl\textcolor{comment}{   !< boundary layer depth [Z \string~> m].}}
\DoxyCodeLine{1006   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{ !< Ocean vertical grid structure}}
\DoxyCodeLine{1007   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{1008 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: UStokes\_SL\textcolor{comment}{ !< Surface layer averaged Stokes drift [m s-\/1]}}
\DoxyCodeLine{1009 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: LA\textcolor{comment}{    !< Langmuir number}}
\DoxyCodeLine{1010   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1011   \textcolor{comment}{! parameters}}
\DoxyCodeLine{1012 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{parameter} :: \&}
\DoxyCodeLine{1013        \textcolor{comment}{! ratio of U19.5 to U10 (Holthuijsen, 2007)}}
\DoxyCodeLine{1014        u19p5\_to\_u10 = 1.075, \&}
\DoxyCodeLine{1015        \textcolor{comment}{! ratio of mean frequency to peak frequency for}}
\DoxyCodeLine{1016        \textcolor{comment}{! Pierson-\/Moskowitz spectrum (Webb, 2011)}}
\DoxyCodeLine{1017        fm\_into\_fp = 1.296, \&}
\DoxyCodeLine{1018        \textcolor{comment}{! ratio of surface Stokes drift to U10}}
\DoxyCodeLine{1019        us\_to\_u10 = 0.0162, \&}
\DoxyCodeLine{1020        \textcolor{comment}{! loss ratio of Stokes transport}}
\DoxyCodeLine{1021        r\_loss = 0.667}
\DoxyCodeLine{1022 \textcolor{keywordtype}{  real} :: UStokes, hm0, fm, fp, vstokes, kphil, kstar}
\DoxyCodeLine{1023 \textcolor{keywordtype}{  real} :: z0, z0i, r1, r2, r3, r4, tmp, lasl\_sqr\_i}
\DoxyCodeLine{1024 \textcolor{keywordtype}{  real} :: u10}
\DoxyCodeLine{1025 }
\DoxyCodeLine{1026   \textcolor{keywordflow}{if} (ustar > 0.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1027     \textcolor{comment}{! Computing u10 based on u\_star and COARE 3.5 relationships}}
\DoxyCodeLine{1028     \textcolor{keyword}{call }ust\_2\_u10\_coare3p5(us\%Z\_to\_m*us\%s\_to\_T*ustar*sqrt(us\%R\_to\_kg\_m3*gv\%Rho0/1.225), u10, gv, us)}
\DoxyCodeLine{1029     \textcolor{comment}{! surface Stokes drift}}
\DoxyCodeLine{1030     ustokes = us\_to\_u10*u10}
\DoxyCodeLine{1031     \textcolor{comment}{!}}
\DoxyCodeLine{1032     \textcolor{comment}{! significant wave height from Pierson-\/Moskowitz}}
\DoxyCodeLine{1033     \textcolor{comment}{! spectrum (Bouws, 1998)}}
\DoxyCodeLine{1034     hm0 = 0.0246 *u10**2}
\DoxyCodeLine{1035     \textcolor{comment}{!}}
\DoxyCodeLine{1036     \textcolor{comment}{! peak frequency (PM, Bouws, 1998)}}
\DoxyCodeLine{1037     tmp = 2.0 * pi * u19p5\_to\_u10 * u10}
\DoxyCodeLine{1038     fp = 0.877 * us\%L\_T\_to\_m\_s**2*us\%m\_to\_Z * gv\%g\_Earth / tmp}
\DoxyCodeLine{1039     \textcolor{comment}{!}}
\DoxyCodeLine{1040     \textcolor{comment}{! mean frequency}}
\DoxyCodeLine{1041     fm = fm\_into\_fp * fp}
\DoxyCodeLine{1042     \textcolor{comment}{!}}
\DoxyCodeLine{1043     \textcolor{comment}{! total Stokes transport (a factor r\_loss is applied to account}}
\DoxyCodeLine{1044     \textcolor{comment}{!  for the effect of directional spreading, multidirectional waves}}
\DoxyCodeLine{1045     \textcolor{comment}{!  and the use of PM peak frequency and PM significant wave height}}
\DoxyCodeLine{1046     \textcolor{comment}{!  on estimating the Stokes transport)}}
\DoxyCodeLine{1047     vstokes = 0.125 * pi * r\_loss * fm * hm0**2}
\DoxyCodeLine{1048     \textcolor{comment}{!}}
\DoxyCodeLine{1049     \textcolor{comment}{! the general peak wavenumber for Phillips' spectrum}}
\DoxyCodeLine{1050     \textcolor{comment}{! (Breivik et al., 2016) with correction of directional spreading}}
\DoxyCodeLine{1051     kphil = 0.176 * ustokes / vstokes}
\DoxyCodeLine{1052     \textcolor{comment}{!}}
\DoxyCodeLine{1053     \textcolor{comment}{! surface layer averaged Stokes dirft with Stokes drift profile}}
\DoxyCodeLine{1054     \textcolor{comment}{! estimated from Phillips' spectrum (Breivik et al., 2016)}}
\DoxyCodeLine{1055     \textcolor{comment}{! the directional spreading effect from Webb and Fox-\/Kemper, 2015}}
\DoxyCodeLine{1056     \textcolor{comment}{! is also included}}
\DoxyCodeLine{1057     kstar = kphil * 2.56}
\DoxyCodeLine{1058     \textcolor{comment}{! surface layer}}
\DoxyCodeLine{1059     z0 = abs(us\%Z\_to\_m*hbl)}
\DoxyCodeLine{1060     z0i = 1.0 / z0}
\DoxyCodeLine{1061     \textcolor{comment}{! term 1 to 4}}
\DoxyCodeLine{1062     r1 = ( 0.151 / kphil * z0i -\/0.84 ) * \&}
\DoxyCodeLine{1063          ( 1.0 -\/ exp(-\/2.0 * kphil * z0) )}
\DoxyCodeLine{1064     r2 = -\/( 0.84 + 0.0591 / kphil * z0i ) * \&}
\DoxyCodeLine{1065          sqrt( 2.0 * pi * kphil * z0 ) * \&}
\DoxyCodeLine{1066          erfc( sqrt( 2.0 * kphil * z0 ) )}
\DoxyCodeLine{1067     r3 = ( 0.0632 / kstar * z0i + 0.125 ) * \&}
\DoxyCodeLine{1068          (1.0 -\/ exp(-\/2.0 * kstar * z0) )}
\DoxyCodeLine{1069     r4 = ( 0.125 + 0.0946 / kstar * z0i ) * \&}
\DoxyCodeLine{1070          sqrt( 2.0 * pi *kstar * z0) * \&}
\DoxyCodeLine{1071          erfc( sqrt( 2.0 * kstar * z0 ) )}
\DoxyCodeLine{1072     ustokes\_sl = ustokes * (0.715 + r1 + r2 + r3 + r4)}
\DoxyCodeLine{1073     la = sqrt(us\%Z\_to\_m*us\%s\_to\_T*ustar / ustokes\_sl)}
\DoxyCodeLine{1074   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1075     ustokes\_sl = 0.0}
\DoxyCodeLine{1076     la=1.e8}
\DoxyCodeLine{1077 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1078 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a3003dfe4e2167905ae8760bb1115b3cb}\label{namespacemom__wave__interface_a3003dfe4e2167905ae8760bb1115b3cb}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!mom\_wave\_interface\_init@{mom\_wave\_interface\_init}}
\index{mom\_wave\_interface\_init@{mom\_wave\_interface\_init}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{mom\_wave\_interface\_init()}{mom\_wave\_interface\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::mom\+\_\+wave\+\_\+interface\+\_\+init (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in), target}]{time,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{CS,  }\item[{type(diag\+\_\+ctrl), intent(inout), target}]{diag }\end{DoxyParamCaption})}



Initializes parameters related to M\+O\+M\+\_\+wave\+\_\+interface. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em time} & Model time \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & Grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Input parameter structure \\
\hline
 & {\em cs} & Wave parameter control structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em diag} & Diagnostic Pointer \\
\hline
\end{DoxyParams}


Definition at line 193 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{193   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)}    :: Time\textcolor{comment}{       !< Model time}}
\DoxyCodeLine{194   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{          !< Grid structure}}
\DoxyCodeLine{195   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{         !< Vertical grid structure}}
\DoxyCodeLine{196   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{         !< A dimensional unit scaling type}}
\DoxyCodeLine{197   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< Input parameter structure}}
\DoxyCodeLine{198   \textcolor{keywordtype}{type}(wave\_parameters\_CS), \textcolor{keywordtype}{pointer}      :: CS\textcolor{comment}{         !< Wave parameter control structure}}
\DoxyCodeLine{199   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(inout)} :: diag\textcolor{comment}{       !< Diagnostic Pointer}}
\DoxyCodeLine{200   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{201   \textcolor{comment}{! I/O}}
\DoxyCodeLine{202   \textcolor{keywordtype}{character*(13)} :: TMPSTRING1,TMPSTRING2}
\DoxyCodeLine{203   \textcolor{keywordtype}{character*(5)}, \textcolor{keywordtype}{parameter}  :: NULL\_STRING      = \textcolor{stringliteral}{"EMPTY"}}
\DoxyCodeLine{204   \textcolor{keywordtype}{character*(12)}, \textcolor{keywordtype}{parameter} :: TESTPROF\_STRING  = \textcolor{stringliteral}{"TEST\_PROFILE"}}
\DoxyCodeLine{205   \textcolor{keywordtype}{character*(13)}, \textcolor{keywordtype}{parameter} :: SURFBANDS\_STRING = \textcolor{stringliteral}{"SURFACE\_BANDS"}}
\DoxyCodeLine{206   \textcolor{keywordtype}{character*(5)}, \textcolor{keywordtype}{parameter}  :: DHH85\_STRING     = \textcolor{stringliteral}{"DHH85"}}
\DoxyCodeLine{207   \textcolor{keywordtype}{character*(4)}, \textcolor{keywordtype}{parameter}  :: LF17\_STRING      = \textcolor{stringliteral}{"LF17"}}
\DoxyCodeLine{208   \textcolor{keywordtype}{character*(12)}, \textcolor{keywordtype}{parameter} :: DATAOVR\_STRING   = \textcolor{stringliteral}{"DATAOVERRIDE"}}
\DoxyCodeLine{209   \textcolor{keywordtype}{character*(7)}, \textcolor{keywordtype}{parameter}  :: COUPLER\_STRING   = \textcolor{stringliteral}{"COUPLER"}}
\DoxyCodeLine{210   \textcolor{keywordtype}{character*(5)}, \textcolor{keywordtype}{parameter}  :: INPUT\_STRING     = \textcolor{stringliteral}{"INPUT"}}
\DoxyCodeLine{211 }
\DoxyCodeLine{212   \textcolor{comment}{! Dummy Check}}
\DoxyCodeLine{213   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{214      \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"wave\_interface\_init called with an associated"}//\&}
\DoxyCodeLine{215                              \textcolor{stringliteral}{"control structure."})}
\DoxyCodeLine{216      \textcolor{keywordflow}{return}}
\DoxyCodeLine{217 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{218 }
\DoxyCodeLine{219   pi=4.0*atan(1.0)}
\DoxyCodeLine{220 }
\DoxyCodeLine{221   \textcolor{comment}{! Allocate CS and set pointers}}
\DoxyCodeLine{222   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{223 }
\DoxyCodeLine{224   cs\%diag => diag}
\DoxyCodeLine{225   cs\%Time => time}
\DoxyCodeLine{226 }
\DoxyCodeLine{227   \textcolor{comment}{! Add any initializations needed here}}
\DoxyCodeLine{228   dataoverrideisinitialized = .false.}
\DoxyCodeLine{229 }
\DoxyCodeLine{230   \textcolor{comment}{! The only way to get here is with UseWaves enabled.}}
\DoxyCodeLine{231   cs\%UseWaves=.true.}
\DoxyCodeLine{232 }
\DoxyCodeLine{233   \textcolor{keyword}{call }log\_version(param\_file, mdl, version)}
\DoxyCodeLine{234 }
\DoxyCodeLine{235   \textcolor{comment}{! Wave modified physics}}
\DoxyCodeLine{236   \textcolor{comment}{!  Presently these are all in research mode}}
\DoxyCodeLine{237   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"LAGRANGIAN\_MIXING"}, cs\%LagrangianMixing, \&}
\DoxyCodeLine{238        \textcolor{stringliteral}{"Flag to use Lagrangian Mixing of momentum"}, units=\textcolor{stringliteral}{""}, \&}
\DoxyCodeLine{239        default=.false.)}
\DoxyCodeLine{240   \textcolor{keywordflow}{if} (cs\%LagrangianMixing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{241     \textcolor{comment}{! Force Code Intervention}}
\DoxyCodeLine{242     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Should you be enabling Lagrangian Mixing? Code not ready."})}
\DoxyCodeLine{243 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{244   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"STOKES\_MIXING"}, cs\%StokesMixing, \&}
\DoxyCodeLine{245        \textcolor{stringliteral}{"Flag to use Stokes Mixing of momentum"}, units=\textcolor{stringliteral}{""}, \&}
\DoxyCodeLine{246        default=.false.)}
\DoxyCodeLine{247   \textcolor{keywordflow}{if} (cs\%StokesMixing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{248     \textcolor{comment}{! Force Code Intervention}}
\DoxyCodeLine{249     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Should you be enabling Stokes Mixing? Code not ready."})}
\DoxyCodeLine{250 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{251   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CORIOLIS\_STOKES"}, cs\%CoriolisStokes, \&}
\DoxyCodeLine{252        \textcolor{stringliteral}{"Flag to use Coriolis Stokes acceleration"}, units=\textcolor{stringliteral}{""}, \&}
\DoxyCodeLine{253        default=.false.)}
\DoxyCodeLine{254   \textcolor{keywordflow}{if} (cs\%CoriolisStokes) \textcolor{keywordflow}{then}}
\DoxyCodeLine{255     \textcolor{comment}{! Force Code Intervention}}
\DoxyCodeLine{256     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Should you be enabling Coriolis-\/Stokes? Code not ready."})}
\DoxyCodeLine{257 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{258 }
\DoxyCodeLine{259   \textcolor{comment}{! Get Wave Method and write to integer WaveMethod}}
\DoxyCodeLine{260   \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"WAVE\_METHOD"},tmpstring1,             \&}
\DoxyCodeLine{261        \textcolor{stringliteral}{"Choice of wave method, valid options include: \(\backslash\)n"}//           \&}
\DoxyCodeLine{262        \textcolor{stringliteral}{" TEST\_PROFILE  -\/ Prescribed from surface Stokes drift \(\backslash\)n"}//   \&}
\DoxyCodeLine{263        \textcolor{stringliteral}{"                 and a decay wavelength.\(\backslash\)n"}//                 \&}
\DoxyCodeLine{264        \textcolor{stringliteral}{" SURFACE\_BANDS -\/ Computed from multiple surface values \(\backslash\)n"}//  \&}
\DoxyCodeLine{265        \textcolor{stringliteral}{"                 and decay wavelengths.\(\backslash\)n"}//                  \&}
\DoxyCodeLine{266        \textcolor{stringliteral}{" DHH85         -\/ Uses Donelan et al. 1985 empirical \(\backslash\)n"}//     \&}
\DoxyCodeLine{267        \textcolor{stringliteral}{"                 wave spectrum with prescribed values. \(\backslash\)n"}//  \&}
\DoxyCodeLine{268        \textcolor{stringliteral}{" LF17          -\/ Infers Stokes drift profile from wind \(\backslash\)n"}//  \&}
\DoxyCodeLine{269        \textcolor{stringliteral}{"                 speed following Li and Fox-\/Kemper 2017.\(\backslash\)n"},  \&}
\DoxyCodeLine{270        units=\textcolor{stringliteral}{''}, default=null\_string)}
\DoxyCodeLine{271   \textcolor{keywordflow}{select case} (trim(tmpstring1))}
\DoxyCodeLine{272   \textcolor{keywordflow}{case} (null\_string)\textcolor{comment}{! No Waves}}
\DoxyCodeLine{273     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"wave\_interface\_init called with no specified "}//\&}
\DoxyCodeLine{274                            \textcolor{stringliteral}{"WAVE\_METHOD."})}
\DoxyCodeLine{275   \textcolor{keywordflow}{case} (testprof\_string)\textcolor{comment}{! Test Profile}}
\DoxyCodeLine{276     wavemethod = testprof}
\DoxyCodeLine{277     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"TP\_STKX\_SURF"},tp\_stkx0,\&}
\DoxyCodeLine{278          \textcolor{stringliteral}{'Surface Stokes (x) for test profile'},\&}
\DoxyCodeLine{279          units=\textcolor{stringliteral}{'m/s'},default=0.1)}
\DoxyCodeLine{280     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"TP\_STKY\_SURF"},tp\_stky0,\&}
\DoxyCodeLine{281          \textcolor{stringliteral}{'Surface Stokes (y) for test profile'},\&}
\DoxyCodeLine{282          units=\textcolor{stringliteral}{'m/s'},default=0.0)}
\DoxyCodeLine{283     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"TP\_WVL"},tp\_wvl,\&}
\DoxyCodeLine{284          units=\textcolor{stringliteral}{'m'}, default=50.0, scale=us\%m\_to\_Z)}
\DoxyCodeLine{285   \textcolor{keywordflow}{case} (surfbands\_string)\textcolor{comment}{! Surface Stokes Drift Bands}}
\DoxyCodeLine{286     wavemethod = surfbands}
\DoxyCodeLine{287     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SURFBAND\_SOURCE"},tmpstring2,       \&}
\DoxyCodeLine{288        \textcolor{stringliteral}{"Choice of SURFACE\_BANDS data mode, valid options include: \(\backslash\)n"}// \&}
\DoxyCodeLine{289        \textcolor{stringliteral}{" DATAOVERRIDE  -\/ Read from NetCDF using FMS DataOverride. \(\backslash\)n"}// \&}
\DoxyCodeLine{290        \textcolor{stringliteral}{" COUPLER       -\/ Look for variables from coupler pass \(\backslash\)n"}//     \&}
\DoxyCodeLine{291        \textcolor{stringliteral}{" INPUT         -\/ Testing with fixed values."},                   \&}
\DoxyCodeLine{292        units=\textcolor{stringliteral}{''}, default=null\_string)}
\DoxyCodeLine{293     \textcolor{keywordflow}{select case} (trim(tmpstring2))}
\DoxyCodeLine{294     \textcolor{keywordflow}{case} (null\_string)\textcolor{comment}{! Default}}
\DoxyCodeLine{295       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"wave\_interface\_init called with SURFACE\_BANDS"}//\&}
\DoxyCodeLine{296                            \textcolor{stringliteral}{" but no SURFBAND\_SOURCE."})}
\DoxyCodeLine{297     \textcolor{keywordflow}{case} (dataovr\_string)\textcolor{comment}{! Using Data Override}}
\DoxyCodeLine{298       datasource = dataovr}
\DoxyCodeLine{299       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"SURFBAND\_FILENAME"}, surfbandfilename, \&}
\DoxyCodeLine{300            \textcolor{stringliteral}{"Filename of surface Stokes drift input band data."}, default=\textcolor{stringliteral}{"StkSpec.nc"})}
\DoxyCodeLine{301     \textcolor{keywordflow}{case} (coupler\_string)\textcolor{comment}{! Reserved for coupling}}
\DoxyCodeLine{302       datasource = coupler}
\DoxyCodeLine{303     \textcolor{keywordflow}{case} (input\_string)\textcolor{comment}{! A method to input the Stokes band (globally uniform)}}
\DoxyCodeLine{304       datasource = input}
\DoxyCodeLine{305       \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"SURFBAND\_NB"},numbands,                 \&}
\DoxyCodeLine{306          \textcolor{stringliteral}{"Prescribe number of wavenumber bands for Stokes drift. "}//      \&}
\DoxyCodeLine{307          \textcolor{stringliteral}{"Make sure this is consistnet w/ WAVENUMBERS, STOKES\_X, and "}// \&}
\DoxyCodeLine{308          \textcolor{stringliteral}{"STOKES\_Y, there are no safety checks in the code."},              \&}
\DoxyCodeLine{309          units=\textcolor{stringliteral}{''}, default=1)}
\DoxyCodeLine{310       \textcolor{keyword}{allocate}( cs\%WaveNum\_Cen(1:numbands) )}
\DoxyCodeLine{311       cs\%WaveNum\_Cen(:) = 0.0}
\DoxyCodeLine{312       \textcolor{keyword}{allocate}( cs\%PrescribedSurfStkX(1:numbands))}
\DoxyCodeLine{313       cs\%PrescribedSurfStkX(:) = 0.0}
\DoxyCodeLine{314       \textcolor{keyword}{allocate}( cs\%PrescribedSurfStkY(1:numbands))}
\DoxyCodeLine{315       cs\%PrescribedSurfStkY(:) = 0.0}
\DoxyCodeLine{316       \textcolor{keyword}{allocate}( cs\%STKx0(g\%isdB:g\%iedB,g\%jsd:g\%jed,1:numbands))}
\DoxyCodeLine{317       cs\%STKx0(:,:,:) = 0.0}
\DoxyCodeLine{318       \textcolor{keyword}{allocate}( cs\%STKy0(g\%isd:g\%ied,g\%jsdB:g\%jedB,1:numbands))}
\DoxyCodeLine{319       cs\%STKy0(:,:,:) = 0.0}
\DoxyCodeLine{320       partitionmode=0}
\DoxyCodeLine{321       \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"SURFBAND\_WAVENUMBERS"},cs\%WaveNum\_Cen,      \&}
\DoxyCodeLine{322            \textcolor{stringliteral}{"Central wavenumbers for surface Stokes drift bands."},units=\textcolor{stringliteral}{'rad/m'}, \&}
\DoxyCodeLine{323            default=0.12566)}
\DoxyCodeLine{324       \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"SURFBAND\_STOKES\_X"},cs\%PrescribedSurfStkX,      \&}
\DoxyCodeLine{325            \textcolor{stringliteral}{"X-\/direction surface Stokes drift for bands."},units=\textcolor{stringliteral}{'m/s'}, \&}
\DoxyCodeLine{326            default=0.15)}
\DoxyCodeLine{327       \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"SURFBAND\_STOKES\_Y"},cs\%PrescribedSurfStkY,      \&}
\DoxyCodeLine{328            \textcolor{stringliteral}{"Y-\/direction surface Stokes drift for bands."},units=\textcolor{stringliteral}{'m/s'}, \&}
\DoxyCodeLine{329            default=0.0)}
\DoxyCodeLine{330 \textcolor{keywordflow}{   case default}\textcolor{comment}{! No method provided}}
\DoxyCodeLine{331      \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Check WAVE\_METHOD.'})}
\DoxyCodeLine{332 \textcolor{keywordflow}{   end select}}
\DoxyCodeLine{333 }
\DoxyCodeLine{334   \textcolor{keywordflow}{case} (dhh85\_string)\textcolor{comment}{!Donelan et al., 1985 spectrum}}
\DoxyCodeLine{335     wavemethod = dhh85}
\DoxyCodeLine{336     \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"DHH85 only ever set-\/up for uniform cases w/"}//\&}
\DoxyCodeLine{337                            \textcolor{stringliteral}{" Stokes drift in x-\/direction."})}
\DoxyCodeLine{338     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"DHH85\_AGE\_FP"},waveagepeakfreq,   \&}
\DoxyCodeLine{339          \textcolor{stringliteral}{"Choose true to use waveage in peak frequency."}, \&}
\DoxyCodeLine{340          units=\textcolor{stringliteral}{''}, default=.false.)}
\DoxyCodeLine{341     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"DHH85\_AGE"},waveage,   \&}
\DoxyCodeLine{342          \textcolor{stringliteral}{"Wave Age for DHH85 spectrum."}, \&}
\DoxyCodeLine{343          units=\textcolor{stringliteral}{''}, default=1.2)}
\DoxyCodeLine{344     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"DHH85\_WIND"},wavewind,   \&}
\DoxyCodeLine{345          \textcolor{stringliteral}{"Wind speed for DHH85 spectrum."}, \&}
\DoxyCodeLine{346          units=\textcolor{stringliteral}{''}, default=10.0)}
\DoxyCodeLine{347     \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"STATIC\_DHH85"},staticwaves,   \&}
\DoxyCodeLine{348          \textcolor{stringliteral}{"Flag to disable updating DHH85 Stokes drift."}, \&}
\DoxyCodeLine{349           default=.false.)}
\DoxyCodeLine{350   \textcolor{keywordflow}{case} (lf17\_string)\textcolor{comment}{!Li and Fox-\/Kemper 17 wind-\/sea Langmuir number}}
\DoxyCodeLine{351     wavemethod = lf17}
\DoxyCodeLine{352 \textcolor{keywordflow}{   case default}}
\DoxyCodeLine{353      \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Check WAVE\_METHOD.'})}
\DoxyCodeLine{354 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{355 }
\DoxyCodeLine{356   \textcolor{comment}{! Langmuir number Options}}
\DoxyCodeLine{357   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"LA\_DEPTH\_RATIO"}, la\_frachbl,              \&}
\DoxyCodeLine{358          \textcolor{stringliteral}{"The depth (normalized by BLD) to average Stokes drift over in "}//\&}
\DoxyCodeLine{359          \textcolor{stringliteral}{"Langmuir number calculation, where La = sqrt(ust/Stokes)."},       \&}
\DoxyCodeLine{360          units=\textcolor{stringliteral}{"nondim"},default=0.04)}
\DoxyCodeLine{361   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"LA\_MISALIGNMENT"}, la\_misalignment,    \&}
\DoxyCodeLine{362          \textcolor{stringliteral}{"Flag (logical) if using misalignment bt shear and waves in LA"},\&}
\DoxyCodeLine{363          default=.false.)}
\DoxyCodeLine{364   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"MIN\_LANGMUIR"}, cs\%La\_min,    \&}
\DoxyCodeLine{365          \textcolor{stringliteral}{"A minimum value for all Langmuir numbers that is not physical, "}//\&}
\DoxyCodeLine{366          \textcolor{stringliteral}{"but is likely only encountered when the wind is very small and "}//\&}
\DoxyCodeLine{367          \textcolor{stringliteral}{"therefore its effects should be mostly benign."},units=\textcolor{stringliteral}{"nondim"},\&}
\DoxyCodeLine{368          default=0.05)}
\DoxyCodeLine{369 }
\DoxyCodeLine{370   \textcolor{comment}{! Allocate and initialize}}
\DoxyCodeLine{371   \textcolor{comment}{! a. Stokes driftProfiles}}
\DoxyCodeLine{372   \textcolor{keyword}{allocate}(cs\%Us\_x(g\%isdB:g\%IedB,g\%jsd:g\%jed,g\%ke))}
\DoxyCodeLine{373   cs\%Us\_x(:,:,:) = 0.0}
\DoxyCodeLine{374   \textcolor{keyword}{allocate}(cs\%Us\_y(g\%isd:g\%Ied,g\%jsdB:g\%jedB,g\%ke))}
\DoxyCodeLine{375   cs\%Us\_y(:,:,:) = 0.0}
\DoxyCodeLine{376   \textcolor{comment}{! b. Surface Values}}
\DoxyCodeLine{377   \textcolor{keyword}{allocate}(cs\%US0\_x(g\%isdB:g\%iedB,g\%jsd:g\%jed))}
\DoxyCodeLine{378   cs\%US0\_x(:,:) = 0.0}
\DoxyCodeLine{379   \textcolor{keyword}{allocate}(cs\%US0\_y(g\%isd:g\%ied,g\%jsdB:g\%jedB))}
\DoxyCodeLine{380   cs\%US0\_y(:,:) = 0.0}
\DoxyCodeLine{381   \textcolor{comment}{! c. Langmuir number}}
\DoxyCodeLine{382   \textcolor{keyword}{allocate}(cs\%La\_SL(g\%isc:g\%iec,g\%jsc:g\%jec))}
\DoxyCodeLine{383   \textcolor{keyword}{allocate}(cs\%La\_turb(g\%isc:g\%iec,g\%jsc:g\%jec))}
\DoxyCodeLine{384   cs\%La\_SL(:,:) = 0.0}
\DoxyCodeLine{385   cs\%La\_turb (:,:) = 0.0}
\DoxyCodeLine{386   \textcolor{comment}{! d. Viscosity for Stokes drift}}
\DoxyCodeLine{387   \textcolor{keywordflow}{if} (cs\%StokesMixing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{388     \textcolor{keyword}{allocate}(cs\%KvS(g\%isd:g\%Ied,g\%jsd:g\%jed,g\%ke))}
\DoxyCodeLine{389     cs\%KvS(:,:,:) = 0.0}
\DoxyCodeLine{390 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{391 }
\DoxyCodeLine{392   \textcolor{comment}{! Initialize Wave related outputs}}
\DoxyCodeLine{393   cs\%id\_surfacestokes\_y = register\_diag\_field(\textcolor{stringliteral}{'ocean\_model'},\textcolor{stringliteral}{'surface\_stokes\_y'}, \&}
\DoxyCodeLine{394        cs\%diag\%axesCu1,time,\textcolor{stringliteral}{'Surface Stokes drift (y)'},\textcolor{stringliteral}{'m s-\/1'})}
\DoxyCodeLine{395   cs\%id\_surfacestokes\_x = register\_diag\_field(\textcolor{stringliteral}{'ocean\_model'},\textcolor{stringliteral}{'surface\_stokes\_x'}, \&}
\DoxyCodeLine{396        cs\%diag\%axesCv1,time,\textcolor{stringliteral}{'Surface Stokes drift (x)'},\textcolor{stringliteral}{'m s-\/1'})}
\DoxyCodeLine{397   cs\%id\_3dstokes\_y = register\_diag\_field(\textcolor{stringliteral}{'ocean\_model'},\textcolor{stringliteral}{'3d\_stokes\_y'}, \&}
\DoxyCodeLine{398        cs\%diag\%axesCvL,time,\textcolor{stringliteral}{'3d Stokes drift (y)'},\textcolor{stringliteral}{'m s-\/1'})}
\DoxyCodeLine{399   cs\%id\_3dstokes\_x = register\_diag\_field(\textcolor{stringliteral}{'ocean\_model'},\textcolor{stringliteral}{'3d\_stokes\_x'}, \&}
\DoxyCodeLine{400        cs\%diag\%axesCuL,time,\textcolor{stringliteral}{'3d Stokes drift (y)'},\textcolor{stringliteral}{'m s-\/1'})}
\DoxyCodeLine{401   cs\%id\_La\_turb = register\_diag\_field(\textcolor{stringliteral}{'ocean\_model'},\textcolor{stringliteral}{'La\_turbulent'},\&}
\DoxyCodeLine{402        cs\%diag\%axesT1,time,\textcolor{stringliteral}{'Surface (turbulent) Langmuir number'},\textcolor{stringliteral}{'nondim'})}
\DoxyCodeLine{403 }
\DoxyCodeLine{404   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ad2bad416c49ca81a4e5822b70d2e14b9}\label{namespacemom__wave__interface_ad2bad416c49ca81a4e5822b70d2e14b9}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!mom\_wave\_interface\_init\_lite@{mom\_wave\_interface\_init\_lite}}
\index{mom\_wave\_interface\_init\_lite@{mom\_wave\_interface\_init\_lite}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{mom\_wave\_interface\_init\_lite()}{mom\_wave\_interface\_init\_lite()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::mom\+\_\+wave\+\_\+interface\+\_\+init\+\_\+lite (\begin{DoxyParamCaption}\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})}



A \textquotesingle{}lite\textquotesingle{} init subroutine to initialize a few inputs needed if using wave information with the wind-\/speed dependent Stokes drift formulation of L\+F17. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Input parameter structure \\
\hline
\end{DoxyParams}


Definition at line 410 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{410   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< Input parameter structure}}
\DoxyCodeLine{411   \textcolor{keywordtype}{character*(5)}, \textcolor{keywordtype}{parameter}  :: NULL\_STRING      = \textcolor{stringliteral}{"EMPTY"}}
\DoxyCodeLine{412   \textcolor{keywordtype}{character*(4)}, \textcolor{keywordtype}{parameter}  :: LF17\_STRING      = \textcolor{stringliteral}{"LF17"}}
\DoxyCodeLine{413   \textcolor{keywordtype}{character*(13)} :: TMPSTRING1}
\DoxyCodeLine{414   \textcolor{keywordtype}{logical} :: StatisticalWaves}
\DoxyCodeLine{415 }
\DoxyCodeLine{416   \textcolor{comment}{! Langmuir number Options}}
\DoxyCodeLine{417   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"LA\_DEPTH\_RATIO"}, la\_frachbl,              \&}
\DoxyCodeLine{418        \textcolor{stringliteral}{"The depth (normalized by BLD) to average Stokes drift over in "}//\&}
\DoxyCodeLine{419        \textcolor{stringliteral}{"Langmuir number calculation, where La = sqrt(ust/Stokes)."},       \&}
\DoxyCodeLine{420        units=\textcolor{stringliteral}{"nondim"},default=0.04)}
\DoxyCodeLine{421 }
\DoxyCodeLine{422   \textcolor{comment}{! Check if using LA\_LI2016}}
\DoxyCodeLine{423   \textcolor{keyword}{call }get\_param(param\_file,mdl,\textcolor{stringliteral}{"USE\_LA\_LI2016"},statisticalwaves,     \&}
\DoxyCodeLine{424                  do\_not\_log=.true.,default=.false.)}
\DoxyCodeLine{425   \textcolor{keywordflow}{if} (statisticalwaves) \textcolor{keywordflow}{then}}
\DoxyCodeLine{426     wavemethod = lf17}
\DoxyCodeLine{427     pi=4.0*atan(1.0)}
\DoxyCodeLine{428   \textcolor{keywordflow}{else}}
\DoxyCodeLine{429     wavemethod = null\_wavemethod}
\DoxyCodeLine{430 \textcolor{keywordflow}{  end if}}
\DoxyCodeLine{431 }
\DoxyCodeLine{432   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a86d1b417862d641edb7996ff136c4b93}\label{namespacemom__wave__interface_a86d1b417862d641edb7996ff136c4b93}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!stokesmixing@{stokesmixing}}
\index{stokesmixing@{stokesmixing}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{stokesmixing()}{stokesmixing()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::stokesmixing (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{real, intent(in)}]{dt,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h,  }\item[{real, dimension(szib\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(inout)}]{u,  }\item[{real, dimension(szi\+\_\+(g),szjb\+\_\+(g),szk\+\_\+(g)), intent(inout)}]{v,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{Waves }\end{DoxyParamCaption})}



Explicit solver for Stokes mixing. Still in development do not use. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Ocean grid \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Ocean vertical grid \\
\hline
\mbox{\texttt{ in}}  & {\em dt} & Time step of M\+O\+M6 \mbox{[}T $\sim$$>$ s\mbox{]} for explicit solver \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em u} & Velocity i-\/component \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em v} & Velocity j-\/component \mbox{[}m s-\/1\mbox{]} \\
\hline
 & {\em waves} & Surface wave related control structure. \\
\hline
\end{DoxyParams}


Definition at line 1220 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1220   \textcolor{keywordtype}{type}(ocean\_grid\_type), \&}
\DoxyCodeLine{1221        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{     !< Ocean grid}}
\DoxyCodeLine{1222   \textcolor{keywordtype}{type}(verticalGrid\_type), \&}
\DoxyCodeLine{1223        \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{    !< Ocean vertical grid}}
\DoxyCodeLine{1224 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}   :: dt\textcolor{comment}{    !< Time step of MOM6 [T \string~> s] for explicit solver}}
\DoxyCodeLine{1225 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))},\&}
\DoxyCodeLine{1226        \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Layer thicknesses [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{1227 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{1228        \textcolor{keywordtype}{intent(inout)} :: u\textcolor{comment}{     !< Velocity i-\/component [m s-\/1]}}
\DoxyCodeLine{1229 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{1230        \textcolor{keywordtype}{intent(inout)} :: v\textcolor{comment}{     !< Velocity j-\/component [m s-\/1]}}
\DoxyCodeLine{1231   \textcolor{keywordtype}{type}(Wave\_parameters\_CS), \&}
\DoxyCodeLine{1232        \textcolor{keywordtype}{pointer}       :: Waves\textcolor{comment}{ !< Surface wave related control structure.}}
\DoxyCodeLine{1233   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1234 \textcolor{keywordtype}{  real} :: dTauUp, dTauDn \textcolor{comment}{! Vertical momentum fluxes [Z T-\/1 m s-\/1]}}
\DoxyCodeLine{1235 \textcolor{keywordtype}{  real} :: h\_Lay  \textcolor{comment}{! The layer thickness at a velocity point [Z \string~> m].}}
\DoxyCodeLine{1236   \textcolor{keywordtype}{integer} :: i,j,k}
\DoxyCodeLine{1237 }
\DoxyCodeLine{1238 \textcolor{comment}{! This is a template to think about down-\/Stokes mixing.}}
\DoxyCodeLine{1239 \textcolor{comment}{! This is not ready for use...}}
\DoxyCodeLine{1240 }
\DoxyCodeLine{1241   \textcolor{keywordflow}{do} k = 1, g\%ke}
\DoxyCodeLine{1242     \textcolor{keywordflow}{do} j = g\%jsc, g\%jec}
\DoxyCodeLine{1243       \textcolor{keywordflow}{do} i = g\%iscB, g\%iecB}
\DoxyCodeLine{1244         h\_lay = gv\%H\_to\_Z*0.5*(h(i,j,k)+h(i+1,j,k))}
\DoxyCodeLine{1245         dtauup = 0.0}
\DoxyCodeLine{1246         \textcolor{keywordflow}{if} (k > 1) \&}
\DoxyCodeLine{1247           dtauup = 0.5*(waves\%Kvs(i,j,k)+waves\%Kvs(i+1,j,k)) * \&}
\DoxyCodeLine{1248                (waves\%us\_x(i,j,k-\/1)-\/waves\%us\_x(i,j,k)) / \&}
\DoxyCodeLine{1249                (0.5*(h\_lay + gv\%H\_to\_Z*0.5*(h(i,j,k-\/1)+h(i+1,j,k-\/1)) ))}
\DoxyCodeLine{1250         dtaudn = 0.0}
\DoxyCodeLine{1251         \textcolor{keywordflow}{if} (k < g\%ke-\/1) \&}
\DoxyCodeLine{1252           dtaudn = 0.5*(waves\%Kvs(i,j,k+1)+waves\%Kvs(i+1,j,k+1)) * \&}
\DoxyCodeLine{1253                (waves\%us\_x(i,j,k)-\/waves\%us\_x(i,j,k+1)) / \&}
\DoxyCodeLine{1254                (0.5*(h\_lay + gv\%H\_to\_Z*0.5*(h(i,j,k+1)+h(i+1,j,k+1)) ))}
\DoxyCodeLine{1255         u(i,j,k) = u(i,j,k) + dt * (dtauup-\/dtaudn) / h\_lay}
\DoxyCodeLine{1256 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{1257 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{1258 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1259 }
\DoxyCodeLine{1260   \textcolor{keywordflow}{do} k = 1, g\%ke}
\DoxyCodeLine{1261     \textcolor{keywordflow}{do} j = g\%jscB, g\%jecB}
\DoxyCodeLine{1262       \textcolor{keywordflow}{do} i = g\%isc, g\%iec}
\DoxyCodeLine{1263         h\_lay = gv\%H\_to\_Z*0.5*(h(i,j,k)+h(i,j+1,k))}
\DoxyCodeLine{1264         dtauup = 0.}
\DoxyCodeLine{1265         \textcolor{keywordflow}{if} (k > 1) \&}
\DoxyCodeLine{1266           dtauup = 0.5*(waves\%Kvs(i,j,k)+waves\%Kvs(i,j+1,k)) * \&}
\DoxyCodeLine{1267                (waves\%us\_y(i,j,k-\/1)-\/waves\%us\_y(i,j,k)) / \&}
\DoxyCodeLine{1268                (0.5*(h\_lay + gv\%H\_to\_Z*0.5*(h(i,j,k-\/1)+h(i,j+1,k-\/1)) ))}
\DoxyCodeLine{1269         dtaudn = 0.0}
\DoxyCodeLine{1270         \textcolor{keywordflow}{if} (k < g\%ke-\/1) \&}
\DoxyCodeLine{1271           dtaudn =0.5*(waves\%Kvs(i,j,k+1)+waves\%Kvs(i,j+1,k+1)) * \&}
\DoxyCodeLine{1272                (waves\%us\_y(i,j,k)-\/waves\%us\_y(i,j,k+1)) / \&}
\DoxyCodeLine{1273                (0.5*(h\_lay + gv\%H\_to\_Z*0.5*(h(i,j,k+1)+h(i,j+1,k+1)) ))}
\DoxyCodeLine{1274         v(i,j,k) = v(i,j,k) + dt * (dtauup-\/dtaudn) / h\_lay}
\DoxyCodeLine{1275 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{1276 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{1277 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1278 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a01dd0c089dab89934450a7a699255658}\label{namespacemom__wave__interface_a01dd0c089dab89934450a7a699255658}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!surface\_bands\_by\_data\_override@{surface\_bands\_by\_data\_override}}
\index{surface\_bands\_by\_data\_override@{surface\_bands\_by\_data\_override}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{surface\_bands\_by\_data\_override()}{surface\_bands\_by\_data\_override()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::surface\+\_\+bands\+\_\+by\+\_\+data\+\_\+override (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in)}]{day\+\_\+center,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



A subroutine to fill the Stokes drift from a Net\+C\+DF file using the data\+\_\+override procedures. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em day\+\_\+center} & Center of timestep \\
\hline
 & {\em cs} & Wave structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & Grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 710 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{710   \textcolor{keywordtype}{use }netcdf}
\DoxyCodeLine{711   \textcolor{keywordtype}{type}(time\_type),          \textcolor{keywordtype}{intent(in)} :: day\_center\textcolor{comment}{ !< Center of timestep}}
\DoxyCodeLine{712   \textcolor{keywordtype}{type}(wave\_parameters\_CS), \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{         !< Wave structure}}
\DoxyCodeLine{713   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{          !< Grid structure}}
\DoxyCodeLine{714   \textcolor{keywordtype}{type}(verticalGrid\_type),  \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{         !< Vertical grid structure}}
\DoxyCodeLine{715   \textcolor{keywordtype}{type}(unit\_scale\_type),    \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{         !< A dimensional unit scaling type}}
\DoxyCodeLine{716   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{717 \textcolor{keywordtype}{  real}    :: temp\_x(SZI\_(G),SZJ\_(G)) \textcolor{comment}{! Pseudo-\/zonal Stokes drift of band at h-\/points [m s-\/1]}}
\DoxyCodeLine{718 \textcolor{keywordtype}{  real}    :: temp\_y(SZI\_(G),SZJ\_(G)) \textcolor{comment}{! Psuedo-\/meridional Stokes drift of band at h-\/points [m s-\/1]}}
\DoxyCodeLine{719 \textcolor{keywordtype}{  real}    :: Top, MidPoint}
\DoxyCodeLine{720   \textcolor{keywordtype}{integer} :: b}
\DoxyCodeLine{721   \textcolor{keywordtype}{integer} :: i, j}
\DoxyCodeLine{722   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(4)} :: start, counter, dims, dim\_id}
\DoxyCodeLine{723   \textcolor{keywordtype}{character(len=12)}  :: dim\_name(4)}
\DoxyCodeLine{724   \textcolor{keywordtype}{character(20)} :: varname, varread1, varread2}
\DoxyCodeLine{725   \textcolor{keywordtype}{integer} :: rcode\_fr, rcode\_wn, ncid, varid\_fr, varid\_wn, id, ndims}
\DoxyCodeLine{726 }
\DoxyCodeLine{727   \textcolor{keywordflow}{if} (.not.dataoverrideisinitialized) \textcolor{keywordflow}{then}}
\DoxyCodeLine{728     \textcolor{keyword}{call }data\_override\_init(ocean\_domain\_in=g\%Domain\%mpp\_domain)}
\DoxyCodeLine{729     dataoverrideisinitialized = .true.}
\DoxyCodeLine{730 }
\DoxyCodeLine{731     \textcolor{comment}{! Read in number of wavenumber bands in file to set number to be read in}}
\DoxyCodeLine{732     \textcolor{comment}{! Hardcoded filename/variables}}
\DoxyCodeLine{733     varread1 = \textcolor{stringliteral}{'wavenumber'} \textcolor{comment}{!Old method gives wavenumber}}
\DoxyCodeLine{734     varread2 = \textcolor{stringliteral}{'frequency'}  \textcolor{comment}{!New method gives frequency}}
\DoxyCodeLine{735     rcode\_wn = nf90\_open(trim(surfbandfilename), nf90\_nowrite, ncid)}
\DoxyCodeLine{736     \textcolor{keywordflow}{if} (rcode\_wn /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{737       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error opening file "}//trim(surfbandfilename)//\&}
\DoxyCodeLine{738             \textcolor{stringliteral}{" in MOM\_wave\_interface."})}
\DoxyCodeLine{739 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{740 }
\DoxyCodeLine{741     \textcolor{comment}{! Check if rcode\_wn or rcode\_fr is 0 (checks if input has wavenumber or frequency)}}
\DoxyCodeLine{742     rcode\_wn = nf90\_inq\_varid(ncid, varread1, varid\_wn)}
\DoxyCodeLine{743     rcode\_fr = nf90\_inq\_varid(ncid, varread2, varid\_fr)}
\DoxyCodeLine{744 }
\DoxyCodeLine{745     \textcolor{keywordflow}{if} (rcode\_wn /= 0 .and. rcode\_fr /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{746       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error finding variable "}//trim(varread1)//\&}
\DoxyCodeLine{747          \textcolor{stringliteral}{" or "}//trim(varread2)//\textcolor{stringliteral}{" in file "}//trim(surfbandfilename)//\textcolor{stringliteral}{" in MOM\_wave\_interface."})}
\DoxyCodeLine{748 }
\DoxyCodeLine{749     \textcolor{keywordflow}{elseif} (rcode\_wn == 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{750       \textcolor{comment}{! wavenumbers found:}}
\DoxyCodeLine{751       partitionmode = 0}
\DoxyCodeLine{752       rcode\_wn = nf90\_inquire\_variable(ncid, varid\_wn, ndims=ndims, \&}
\DoxyCodeLine{753            dimids=dims)}
\DoxyCodeLine{754       \textcolor{keywordflow}{if} (rcode\_wn /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{755         \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{756              \textcolor{stringliteral}{'error inquiring dimensions MOM\_wave\_interface.'})}
\DoxyCodeLine{757 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{758       rcode\_wn = nf90\_inquire\_dimension(ncid, dims(1), dim\_name(1), len=id)}
\DoxyCodeLine{759       \textcolor{keywordflow}{if} (rcode\_wn /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{760         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error reading dimension 1 data for "}// \&}
\DoxyCodeLine{761              trim(varread1)//\textcolor{stringliteral}{" in file "}// trim(surfbandfilename)//          \&}
\DoxyCodeLine{762              \textcolor{stringliteral}{" in MOM\_wave\_interface."})}
\DoxyCodeLine{763 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{764       rcode\_wn = nf90\_inq\_varid(ncid, dim\_name(1), dim\_id(1))}
\DoxyCodeLine{765       \textcolor{keywordflow}{if} (rcode\_wn /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{766         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error finding variable "}//trim(dim\_name(1))//\&}
\DoxyCodeLine{767           \textcolor{stringliteral}{" in file "}//trim(surfbandfilename)//\textcolor{stringliteral}{" in MOM\_wave\_interace."})}
\DoxyCodeLine{768 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{769       \textcolor{comment}{! Allocating size of wavenumber bins}}
\DoxyCodeLine{770       \textcolor{keyword}{allocate}( cs\%WaveNum\_Cen(1:id) )}
\DoxyCodeLine{771       cs\%WaveNum\_Cen(:) = 0.0}
\DoxyCodeLine{772     \textcolor{keywordflow}{elseif} (rcode\_fr == 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{773       \textcolor{comment}{! frequencies found:}}
\DoxyCodeLine{774       partitionmode = 1}
\DoxyCodeLine{775       rcode\_fr = nf90\_inquire\_variable(ncid, varid\_fr, ndims=ndims, \&}
\DoxyCodeLine{776            dimids=dims)}
\DoxyCodeLine{777       \textcolor{keywordflow}{if} (rcode\_fr /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{778         \textcolor{keyword}{call }mom\_error(fatal,\&}
\DoxyCodeLine{779              \textcolor{stringliteral}{'error inquiring dimensions MOM\_wave\_interface.'})}
\DoxyCodeLine{780 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{781       rcode\_fr = nf90\_inquire\_dimension(ncid, dims(1), dim\_name(1), len=id)}
\DoxyCodeLine{782       \textcolor{keywordflow}{if} (rcode\_fr /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{783         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error reading dimension 1 data for "}// \&}
\DoxyCodeLine{784              trim(varread2)//\textcolor{stringliteral}{" in file "}// trim(surfbandfilename)// \&}
\DoxyCodeLine{785              \textcolor{stringliteral}{" in MOM\_wave\_interface."})}
\DoxyCodeLine{786 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{787       rcode\_fr = nf90\_inq\_varid(ncid, dim\_name(1), dim\_id(1))}
\DoxyCodeLine{788       \textcolor{keywordflow}{if} (rcode\_fr /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{789         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"error finding variable "}//trim(dim\_name(1))//\&}
\DoxyCodeLine{790              \textcolor{stringliteral}{" in file "}//trim(surfbandfilename)//\textcolor{stringliteral}{" in MOM\_wave\_interace."})}
\DoxyCodeLine{791 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{792       \textcolor{comment}{! Allocating size of frequency bins}}
\DoxyCodeLine{793       \textcolor{keyword}{allocate}( cs\%Freq\_Cen(1:id) )}
\DoxyCodeLine{794       cs\%Freq\_Cen(:) = 0.0}
\DoxyCodeLine{795       \textcolor{comment}{! Allocating size of wavenumber bins}}
\DoxyCodeLine{796       \textcolor{keyword}{allocate}( cs\%WaveNum\_Cen(1:id) )}
\DoxyCodeLine{797       cs\%WaveNum\_Cen(:) = 0.0}
\DoxyCodeLine{798       \textcolor{keyword}{allocate}( cs\%STKx0(g\%isdB:g\%iedB,g\%jsd:g\%jed,1:id))}
\DoxyCodeLine{799       cs\%STKx0(:,:,:) = 0.0}
\DoxyCodeLine{800       \textcolor{keyword}{allocate}( cs\%STKy0(g\%isd:g\%ied,g\%jsdB:g\%jedB,1:id))}
\DoxyCodeLine{801       cs\%STKy0(:,:,:) = 0.0}
\DoxyCodeLine{802 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{803 }
\DoxyCodeLine{804     \textcolor{comment}{! Reading wavenumber bins/Frequencies}}
\DoxyCodeLine{805     start(:) = 1 \textcolor{comment}{! Set all start to 1}}
\DoxyCodeLine{806     counter(:) = 1 \textcolor{comment}{! Set all counter to 1}}
\DoxyCodeLine{807     counter(1) = id \textcolor{comment}{! Set counter(1) to id (number of frequency bins)}}
\DoxyCodeLine{808     \textcolor{keywordflow}{if} (partitionmode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{809       rcode\_wn = nf90\_get\_var(ncid, dim\_id(1), cs\%WaveNum\_Cen, start, counter)}
\DoxyCodeLine{810       \textcolor{keywordflow}{if} (rcode\_wn /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{811         \textcolor{keyword}{call }mom\_error(fatal,\&}
\DoxyCodeLine{812              \textcolor{stringliteral}{"error reading dimension 1 values for var\_name "}// \&}
\DoxyCodeLine{813              trim(varread1)//\textcolor{stringliteral}{",dim\_name "}//trim(dim\_name(1))//  \&}
\DoxyCodeLine{814              \textcolor{stringliteral}{" in file "}// trim(surfbandfilename)//\textcolor{stringliteral}{" in MOM\_wave\_interface"})}
\DoxyCodeLine{815 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{816       numbands = id}
\DoxyCodeLine{817       \textcolor{keywordflow}{do} b = 1,numbands ; cs\%WaveNum\_Cen(b) = us\%Z\_to\_m*cs\%WaveNum\_Cen(b) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{818     \textcolor{keywordflow}{elseif} (partitionmode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{819       rcode\_fr = nf90\_get\_var(ncid, dim\_id(1), cs\%Freq\_Cen, start, counter)}
\DoxyCodeLine{820       \textcolor{keywordflow}{if} (rcode\_fr /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{821         \textcolor{keyword}{call }mom\_error(fatal,\&}
\DoxyCodeLine{822              \textcolor{stringliteral}{"error reading dimension 1 values for var\_name "}// \&}
\DoxyCodeLine{823              trim(varread2)//\textcolor{stringliteral}{",dim\_name "}//trim(dim\_name(1))//  \&}
\DoxyCodeLine{824              \textcolor{stringliteral}{" in file "}// trim(surfbandfilename)//\textcolor{stringliteral}{" in MOM\_wave\_interface"})}
\DoxyCodeLine{825 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{826       numbands = id}
\DoxyCodeLine{827       \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{828         cs\%WaveNum\_Cen(b) = (2.*pi*cs\%Freq\_Cen(b)*us\%T\_to\_s)**2 / (us\%L\_to\_Z**2*gv\%g\_Earth)}
\DoxyCodeLine{829 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{830 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{831 }
\DoxyCodeLine{832 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{833 }
\DoxyCodeLine{834   \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{835     temp\_x(:,:) = 0.0}
\DoxyCodeLine{836     temp\_y(:,:) = 0.0}
\DoxyCodeLine{837     varname = \textcolor{stringliteral}{'                    '}}
\DoxyCodeLine{838     \textcolor{keyword}{write}(varname,\textcolor{stringliteral}{"(A3,I0)"})\textcolor{stringliteral}{'Usx'},b}
\DoxyCodeLine{839     \textcolor{keyword}{call }data\_override(\textcolor{stringliteral}{'OCN'},trim(varname), temp\_x, day\_center)}
\DoxyCodeLine{840     varname = \textcolor{stringliteral}{'                    '}}
\DoxyCodeLine{841     \textcolor{keyword}{write}(varname,\textcolor{stringliteral}{'(A3,I0)'})\textcolor{stringliteral}{'Usy'},b}
\DoxyCodeLine{842     \textcolor{keyword}{call }data\_override(\textcolor{stringliteral}{'OCN'},trim(varname), temp\_y, day\_center)}
\DoxyCodeLine{843     \textcolor{comment}{! Disperse into halo on h-\/grid}}
\DoxyCodeLine{844     \textcolor{keyword}{call }pass\_vector(temp\_x, temp\_y, g\%Domain, to\_all, agrid)}
\DoxyCodeLine{845     \textcolor{comment}{!Filter land values}}
\DoxyCodeLine{846     \textcolor{keywordflow}{do} j = g\%jsd,g\%jed}
\DoxyCodeLine{847       \textcolor{keywordflow}{do} i = g\%Isd,g\%Ied}
\DoxyCodeLine{848         \textcolor{keywordflow}{if} (abs(temp\_x(i,j)) > 10. .or. abs(temp\_y(i,j)) > 10.) \textcolor{keywordflow}{then}}
\DoxyCodeLine{849           \textcolor{comment}{! Assume land-\/mask and zero out}}
\DoxyCodeLine{850           temp\_x(i,j) = 0.0}
\DoxyCodeLine{851           temp\_y(i,j) = 0.0}
\DoxyCodeLine{852 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{853 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{854 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{855 }
\DoxyCodeLine{856     \textcolor{comment}{! Interpolate to u/v grids}}
\DoxyCodeLine{857     \textcolor{keywordflow}{do} j = g\%jsc,g\%jec}
\DoxyCodeLine{858       \textcolor{keywordflow}{do} i = g\%IscB,g\%IecB}
\DoxyCodeLine{859         cs\%STKx0(i,j,b) = 0.5 * (temp\_x(i,j) + temp\_x(i+1,j))}
\DoxyCodeLine{860 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{861 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{862     \textcolor{keywordflow}{do} j = g\%JscB,g\%JecB}
\DoxyCodeLine{863       \textcolor{keywordflow}{do} i = g\%isc,g\%iec}
\DoxyCodeLine{864         cs\%STKy0(i,j,b) = 0.5 * (temp\_y(i,j) + temp\_y(i,j+1))}
\DoxyCodeLine{865 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{866 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{867     \textcolor{comment}{! Disperse into halo on u/v grids}}
\DoxyCodeLine{868     \textcolor{keyword}{call }pass\_vector(cs\%STKx0(:,:,b),cs\%STKy0(:,:,b), g\%Domain, to\_all)}
\DoxyCodeLine{869 \textcolor{keywordflow}{  enddo} \textcolor{comment}{!Closes b-\/loop}}
\DoxyCodeLine{870 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a42b769030d04a1c087e168de36ce7285}\label{namespacemom__wave__interface_a42b769030d04a1c087e168de36ce7285}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!update\_stokes\_drift@{update\_stokes\_drift}}
\index{update\_stokes\_drift@{update\_stokes\_drift}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{update\_stokes\_drift()}{update\_stokes\_drift()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::update\+\_\+stokes\+\_\+drift (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{CS,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed), intent(in)}]{ustar }\end{DoxyParamCaption})}



Constructs the Stokes Drift profile on the model grid based on desired coupling options. 


\begin{DoxyParams}[1]{Parameters}
 & {\em cs} & Wave parameter Control structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & Grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em ustar} & Wind friction velocity \mbox{[}Z T-\/1 $\sim$$>$ m s-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 479 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{479   \textcolor{keywordtype}{type}(wave\_parameters\_CS),  \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{    !< Wave parameter Control structure}}
\DoxyCodeLine{480   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{     !< Grid structure}}
\DoxyCodeLine{481   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{    !< Vertical grid structure}}
\DoxyCodeLine{482   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{    !< A dimensional unit scaling type}}
\DoxyCodeLine{483 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{484        \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Thickness [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{485 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))}, \&}
\DoxyCodeLine{486        \textcolor{keywordtype}{intent(in)}    :: ustar\textcolor{comment}{ !< Wind friction velocity [Z T-\/1 \string~> m s-\/1].}}
\DoxyCodeLine{487   \textcolor{comment}{! Local Variables}}
\DoxyCodeLine{488 \textcolor{keywordtype}{  real}    :: Top, MidPoint, Bottom, one\_cm}
\DoxyCodeLine{489 \textcolor{keywordtype}{  real}    :: DecayScale}
\DoxyCodeLine{490 \textcolor{keywordtype}{  real}    :: CMN\_FAC, WN, UStokes}
\DoxyCodeLine{491 \textcolor{keywordtype}{  real}    :: La}
\DoxyCodeLine{492   \textcolor{keywordtype}{integer} :: ii, jj, kk, b, iim1, jjm1}
\DoxyCodeLine{493 }
\DoxyCodeLine{494   one\_cm = 0.01*us\%m\_to\_Z}
\DoxyCodeLine{495 }
\DoxyCodeLine{496   \textcolor{comment}{! 1. If Test Profile Option is chosen}}
\DoxyCodeLine{497   \textcolor{comment}{!    Computing mid-\/point value from surface value and decay wavelength}}
\DoxyCodeLine{498   \textcolor{keywordflow}{if} (wavemethod==testprof) \textcolor{keywordflow}{then}}
\DoxyCodeLine{499     decayscale = 4.*pi / tp\_wvl \textcolor{comment}{!4pi}}
\DoxyCodeLine{500     \textcolor{keywordflow}{do} ii = g\%isdB,g\%iedB}
\DoxyCodeLine{501       \textcolor{keywordflow}{do} jj = g\%jsd,g\%jed}
\DoxyCodeLine{502         iim1 = max(1,ii-\/1)}
\DoxyCodeLine{503         bottom = 0.0}
\DoxyCodeLine{504         midpoint = 0.0}
\DoxyCodeLine{505         \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{506           top = bottom}
\DoxyCodeLine{507           midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{508           bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{509           cs\%Us\_x(ii,jj,kk) = tp\_stkx0*exp(midpoint*decayscale)}
\DoxyCodeLine{510 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{511 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{512 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{513     \textcolor{keywordflow}{do} ii = g\%isd,g\%ied}
\DoxyCodeLine{514       \textcolor{keywordflow}{do} jj = g\%jsdB,g\%jedB}
\DoxyCodeLine{515         jjm1 = max(1,jj-\/1)}
\DoxyCodeLine{516         bottom = 0.0}
\DoxyCodeLine{517         midpoint = 0.0}
\DoxyCodeLine{518         \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{519           top = bottom}
\DoxyCodeLine{520           midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{521           bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{522           cs\%Us\_y(ii,jj,kk) = tp\_stky0*exp(midpoint*decayscale)}
\DoxyCodeLine{523 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{524 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{525 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{526   \textcolor{comment}{! 2. If Surface Bands is chosen}}
\DoxyCodeLine{527   \textcolor{comment}{!    In wavenumber mode compute integral for layer averaged Stokes drift.}}
\DoxyCodeLine{528   \textcolor{comment}{!    In frequency mode compuate value at midpoint.}}
\DoxyCodeLine{529   \textcolor{keywordflow}{elseif} (wavemethod==surfbands) \textcolor{keywordflow}{then}}
\DoxyCodeLine{530     cs\%Us\_x(:,:,:) = 0.0}
\DoxyCodeLine{531     cs\%Us\_y(:,:,:) = 0.0}
\DoxyCodeLine{532     cs\%Us0\_x(:,:) = 0.0}
\DoxyCodeLine{533     cs\%Us0\_y(:,:) = 0.0}
\DoxyCodeLine{534     \textcolor{comment}{! Computing X direction Stokes drift}}
\DoxyCodeLine{535     \textcolor{keywordflow}{do} ii = g\%isdB,g\%iedB}
\DoxyCodeLine{536       \textcolor{keywordflow}{do} jj = g\%jsd,g\%jed}
\DoxyCodeLine{537         \textcolor{comment}{! 1. First compute the surface Stokes drift}}
\DoxyCodeLine{538         \textcolor{comment}{!    by integrating over the partitionas.}}
\DoxyCodeLine{539         \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{540           \textcolor{keywordflow}{if} (partitionmode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{541             \textcolor{comment}{! In wavenumber we are averaging over (small) level}}
\DoxyCodeLine{542             cmn\_fac = (1.0-\/exp(-\/one\_cm*2.*cs\%WaveNum\_Cen(b))) / \&}
\DoxyCodeLine{543                       (one\_cm*2.*cs\%WaveNum\_Cen(b))}
\DoxyCodeLine{544           \textcolor{keywordflow}{elseif} (partitionmode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{545              \textcolor{comment}{! In frequency we are not averaging over level and taking top}}
\DoxyCodeLine{546             cmn\_fac = 1.0}
\DoxyCodeLine{547 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{548           cs\%US0\_x(ii,jj) = cs\%US0\_x(ii,jj) + cs\%STKx0(ii,jj,b)*cmn\_fac}
\DoxyCodeLine{549 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{550         \textcolor{comment}{! 2. Second compute the level averaged Stokes drift}}
\DoxyCodeLine{551         bottom = 0.0}
\DoxyCodeLine{552         \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{553           top = bottom}
\DoxyCodeLine{554           iim1 = max(ii-\/1,1)}
\DoxyCodeLine{555           midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{556           bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{557           \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{558             \textcolor{keywordflow}{if} (partitionmode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{559               \textcolor{comment}{! In wavenumber we are averaging over level}}
\DoxyCodeLine{560               cmn\_fac = (exp(top*2.*cs\%WaveNum\_Cen(b))-\/exp(bottom*2.*cs\%WaveNum\_Cen(b)))\&}
\DoxyCodeLine{561                         / ((top-\/bottom)*(2.*cs\%WaveNum\_Cen(b)))}
\DoxyCodeLine{562             \textcolor{keywordflow}{elseif} (partitionmode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{563               \textcolor{keywordflow}{if} (cs\%StkLevelMode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{564                 \textcolor{comment}{! Take the value at the midpoint}}
\DoxyCodeLine{565                 cmn\_fac = exp(midpoint*2.*(2.*pi*cs\%Freq\_Cen(b)*us\%T\_to\_s)**2/(us\%L\_to\_Z**2*gv\%g\_Earth))}
\DoxyCodeLine{566               \textcolor{keywordflow}{elseif} (cs\%StkLevelMode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{567                 \textcolor{comment}{! Use a numerical integration and then}}
\DoxyCodeLine{568                 \textcolor{comment}{! divide by layer thickness}}
\DoxyCodeLine{569                 wn = (2.*pi*cs\%Freq\_Cen(b)*us\%T\_to\_s)**2 / (us\%L\_to\_Z**2*gv\%g\_Earth) \textcolor{comment}{!bgr bug-\/fix missing g}}
\DoxyCodeLine{570                 cmn\_fac = (exp(2.*wn*top)-\/exp(2.*wn*bottom)) / (2.*wn*(top-\/bottom))}
\DoxyCodeLine{571 \textcolor{keywordflow}{              endif}}
\DoxyCodeLine{572 \textcolor{keywordflow}{            endif}}
\DoxyCodeLine{573             cs\%US\_x(ii,jj,kk) = cs\%US\_x(ii,jj,kk) + cs\%STKx0(ii,jj,b)*cmn\_fac}
\DoxyCodeLine{574 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{575 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{576 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{577 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{578     \textcolor{comment}{! Computing Y direction Stokes drift}}
\DoxyCodeLine{579     \textcolor{keywordflow}{do} ii = g\%isd,g\%ied}
\DoxyCodeLine{580       \textcolor{keywordflow}{do} jj = g\%jsdB,g\%jedB}
\DoxyCodeLine{581         \textcolor{comment}{! Compute the surface values.}}
\DoxyCodeLine{582         \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{583           \textcolor{keywordflow}{if} (partitionmode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{584             \textcolor{comment}{! In wavenumber we are averaging over (small) level}}
\DoxyCodeLine{585             cmn\_fac = (1.0-\/exp(-\/one\_cm*2.*cs\%WaveNum\_Cen(b))) / \&}
\DoxyCodeLine{586                       (one\_cm*2.*cs\%WaveNum\_Cen(b))}
\DoxyCodeLine{587           \textcolor{keywordflow}{elseif} (partitionmode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{588             \textcolor{comment}{! In frequency we are not averaging over level and taking top}}
\DoxyCodeLine{589             cmn\_fac = 1.0}
\DoxyCodeLine{590 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{591           cs\%US0\_y(ii,jj) = cs\%US0\_y(ii,jj) + cs\%STKy0(ii,jj,b)*cmn\_fac}
\DoxyCodeLine{592 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{593         \textcolor{comment}{! Compute the level averages.}}
\DoxyCodeLine{594         bottom = 0.0}
\DoxyCodeLine{595         \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{596           top = bottom}
\DoxyCodeLine{597           jjm1 = max(jj-\/1,1)}
\DoxyCodeLine{598           midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{599           bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{600           \textcolor{keywordflow}{do} b = 1,numbands}
\DoxyCodeLine{601             \textcolor{keywordflow}{if} (partitionmode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{602               \textcolor{comment}{! In wavenumber we are averaging over level}}
\DoxyCodeLine{603               cmn\_fac = (exp(top*2.*cs\%WaveNum\_Cen(b)) -\/ \&}
\DoxyCodeLine{604                          exp(bottom*2.*cs\%WaveNum\_Cen(b))) / \&}
\DoxyCodeLine{605                         ((top-\/bottom)*(2.*cs\%WaveNum\_Cen(b)))}
\DoxyCodeLine{606             \textcolor{keywordflow}{elseif} (partitionmode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{607               \textcolor{keywordflow}{if} (cs\%StkLevelMode==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{608                 \textcolor{comment}{! Take the value at the midpoint}}
\DoxyCodeLine{609                 cmn\_fac = exp(midpoint*2.*(2.*pi*cs\%Freq\_Cen(b)*us\%T\_to\_s)**2/(us\%L\_to\_Z**2*gv\%g\_Earth))}
\DoxyCodeLine{610               \textcolor{keywordflow}{elseif} (cs\%StkLevelMode==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{611                 \textcolor{comment}{! Use a numerical integration and then}}
\DoxyCodeLine{612                 \textcolor{comment}{! divide by layer thickness}}
\DoxyCodeLine{613                 wn = (2.*pi*cs\%Freq\_Cen(b)*us\%T\_to\_s)**2 / (us\%L\_to\_Z**2*gv\%g\_Earth)}
\DoxyCodeLine{614                 cmn\_fac = (exp(2.*wn*top)-\/exp(2.*wn*bottom)) / (2.*wn*(top-\/bottom))}
\DoxyCodeLine{615 \textcolor{keywordflow}{              endif}}
\DoxyCodeLine{616 \textcolor{keywordflow}{            endif}}
\DoxyCodeLine{617             cs\%US\_y(ii,jj,kk) = cs\%US\_y(ii,jj,kk) + cs\%STKy0(ii,jj,b)*cmn\_fac}
\DoxyCodeLine{618 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{619 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{620 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{621 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{622   \textcolor{keywordflow}{elseif} (wavemethod==dhh85) \textcolor{keywordflow}{then}}
\DoxyCodeLine{623     \textcolor{keywordflow}{if} (.not.(staticwaves .and. dhh85\_is\_set)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{624       \textcolor{keywordflow}{do} ii = g\%isdB,g\%iedB}
\DoxyCodeLine{625         \textcolor{keywordflow}{do} jj = g\%jsd,g\%jed}
\DoxyCodeLine{626           bottom = 0.0}
\DoxyCodeLine{627           \textcolor{keywordflow}{do} kk = 1,g\%ke}
\DoxyCodeLine{628             top = bottom}
\DoxyCodeLine{629             iim1 = max(ii-\/1,1)}
\DoxyCodeLine{630             midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{631             bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(iim1,jj,kk))}
\DoxyCodeLine{632             \textcolor{comment}{!bgr note that this is using a u-\/point ii on h-\/point ustar}}
\DoxyCodeLine{633             \textcolor{comment}{!    this code has only been previous used for uniform}}
\DoxyCodeLine{634             \textcolor{comment}{!    grid cases.  This needs fixed if DHH85 is used for non}}
\DoxyCodeLine{635             \textcolor{comment}{!    uniform cases.}}
\DoxyCodeLine{636             \textcolor{keyword}{call }dhh85\_mid(gv, us, midpoint, ustokes)}
\DoxyCodeLine{637             \textcolor{comment}{! Putting into x-\/direction (no option for direction}}
\DoxyCodeLine{638             cs\%US\_x(ii,jj,kk) = ustokes}
\DoxyCodeLine{639 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{640 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{641 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{642       \textcolor{keywordflow}{do} ii = g\%isd,g\%ied}
\DoxyCodeLine{643         \textcolor{keywordflow}{do} jj = g\%jsdB,g\%jedB}
\DoxyCodeLine{644           bottom = 0.0}
\DoxyCodeLine{645           \textcolor{keywordflow}{do} kk=1, g\%ke}
\DoxyCodeLine{646             top = bottom}
\DoxyCodeLine{647             jjm1 = max(jj-\/1,1)}
\DoxyCodeLine{648             midpoint = bottom -\/ gv\%H\_to\_Z*0.25*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{649             bottom = bottom -\/ gv\%H\_to\_Z*0.5*(h(ii,jj,kk)+h(ii,jjm1,kk))}
\DoxyCodeLine{650             \textcolor{comment}{!bgr note that this is using a v-\/point jj on h-\/point ustar}}
\DoxyCodeLine{651             \textcolor{comment}{!    this code has only been previous used for uniform}}
\DoxyCodeLine{652             \textcolor{comment}{!    grid cases.  This needs fixed if DHH85 is used for non}}
\DoxyCodeLine{653             \textcolor{comment}{!    uniform cases.}}
\DoxyCodeLine{654             \textcolor{comment}{! call DHH85\_mid(GV, US, Midpoint, UStokes)}}
\DoxyCodeLine{655             \textcolor{comment}{! Putting into x-\/direction, so setting y direction to 0}}
\DoxyCodeLine{656             cs\%US\_y(ii,jj,kk) = 0.0}
\DoxyCodeLine{657             \textcolor{comment}{! For rotational symmetry there should be the option for this to become = UStokes}}
\DoxyCodeLine{658             \textcolor{comment}{!    bgr -\/ see note above, but this is true}}
\DoxyCodeLine{659             \textcolor{comment}{!          if this is used for anything}}
\DoxyCodeLine{660             \textcolor{comment}{!          other than simple LES comparison}}
\DoxyCodeLine{661 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{662 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{663 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{664       dhh85\_is\_set = .true.}
\DoxyCodeLine{665 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{666   else\textcolor{comment}{! Keep this else, fallback to 0 Stokes drift}}
\DoxyCodeLine{667     \textcolor{keywordflow}{do} kk= 1,g\%ke}
\DoxyCodeLine{668       \textcolor{keywordflow}{do} ii = g\%isdB,g\%iedB}
\DoxyCodeLine{669         \textcolor{keywordflow}{do} jj = g\%jsd,g\%jed}
\DoxyCodeLine{670           cs\%Us\_x(ii,jj,kk) = 0.}
\DoxyCodeLine{671 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{672 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{673       \textcolor{keywordflow}{do} ii = g\%isd,g\%ied}
\DoxyCodeLine{674         \textcolor{keywordflow}{do} jj = g\%jsdB,g\%jedB}
\DoxyCodeLine{675           cs\%Us\_y(ii,jj,kk) = 0.}
\DoxyCodeLine{676 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{677 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{678 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{679 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{680 }
\DoxyCodeLine{681   \textcolor{comment}{! Turbulent Langmuir number is computed here and available to use anywhere.}}
\DoxyCodeLine{682   \textcolor{comment}{! SL Langmuir number requires mixing layer depth, and therefore is computed}}
\DoxyCodeLine{683   \textcolor{comment}{! in the routine it is needed by (e.g. KPP or ePBL).}}
\DoxyCodeLine{684   \textcolor{keywordflow}{do} ii = g\%isc,g\%iec}
\DoxyCodeLine{685     \textcolor{keywordflow}{do} jj = g\%jsc, g\%jec}
\DoxyCodeLine{686       top = h(ii,jj,1)*gv\%H\_to\_Z}
\DoxyCodeLine{687       \textcolor{keyword}{call }get\_langmuir\_number( la, g, gv, us, top, ustar(ii,jj), ii, jj, \&}
\DoxyCodeLine{688              h(ii,jj,:),override\_ma=.false.,waves=cs)}
\DoxyCodeLine{689       cs\%La\_turb(ii,jj) = la}
\DoxyCodeLine{690 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{691 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{692 }
\DoxyCodeLine{693   \textcolor{comment}{! Output any desired quantities}}
\DoxyCodeLine{694   \textcolor{keywordflow}{if} (cs\%id\_surfacestokes\_y>0) \&}
\DoxyCodeLine{695     \textcolor{keyword}{call }post\_data(cs\%id\_surfacestokes\_y, cs\%us0\_y, cs\%diag)}
\DoxyCodeLine{696   \textcolor{keywordflow}{if} (cs\%id\_surfacestokes\_x>0) \&}
\DoxyCodeLine{697     \textcolor{keyword}{call }post\_data(cs\%id\_surfacestokes\_x, cs\%us0\_x, cs\%diag)}
\DoxyCodeLine{698   \textcolor{keywordflow}{if} (cs\%id\_3dstokes\_y>0) \&}
\DoxyCodeLine{699     \textcolor{keyword}{call }post\_data(cs\%id\_3dstokes\_y, cs\%us\_y, cs\%diag)}
\DoxyCodeLine{700   \textcolor{keywordflow}{if} (cs\%id\_3dstokes\_x>0) \&}
\DoxyCodeLine{701     \textcolor{keyword}{call }post\_data(cs\%id\_3dstokes\_x, cs\%us\_x, cs\%diag)}
\DoxyCodeLine{702   \textcolor{keywordflow}{if} (cs\%id\_La\_turb>0) \&}
\DoxyCodeLine{703     \textcolor{keyword}{call }post\_data(cs\%id\_La\_turb, cs\%La\_turb, cs\%diag)}
\DoxyCodeLine{704 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ad7c744e81248040ad319e0b608c52284}\label{namespacemom__wave__interface_ad7c744e81248040ad319e0b608c52284}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!update\_surface\_waves@{update\_surface\_waves}}
\index{update\_surface\_waves@{update\_surface\_waves}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{update\_surface\_waves()}{update\_surface\_waves()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::update\+\_\+surface\+\_\+waves (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(time\+\_\+type), intent(in)}]{Day,  }\item[{type(time\+\_\+type), intent(in)}]{dt,  }\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Subroutine that handles updating of surface wave/\+Stokes drift related properties. 


\begin{DoxyParams}[1]{Parameters}
 & {\em cs} & Wave parameter Control structure \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & Grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em day} & Current model time \\
\hline
\mbox{\texttt{ in}}  & {\em dt} & Timestep as a time-\/type \\
\hline
\end{DoxyParams}


Definition at line 437 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{437   \textcolor{keywordtype}{type}(wave\_parameters\_CS), \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{  !< Wave parameter Control structure}}
\DoxyCodeLine{438   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{   !< Grid structure}}
\DoxyCodeLine{439   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{  !< Vertical grid structure}}
\DoxyCodeLine{440   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{441   \textcolor{keywordtype}{type}(time\_type),         \textcolor{keywordtype}{intent(in)}  :: Day\textcolor{comment}{ !< Current model time}}
\DoxyCodeLine{442   \textcolor{keywordtype}{type}(time\_type),         \textcolor{keywordtype}{intent(in)}  :: dt\textcolor{comment}{  !< Timestep as a time-\/type}}
\DoxyCodeLine{443   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{444   \textcolor{keywordtype}{integer} :: ii, jj, kk, b}
\DoxyCodeLine{445   \textcolor{keywordtype}{type}(time\_type) :: Day\_Center}
\DoxyCodeLine{446 }
\DoxyCodeLine{447   \textcolor{comment}{! Computing central time of time step}}
\DoxyCodeLine{448   day\_center = day + dt/2}
\DoxyCodeLine{449 }
\DoxyCodeLine{450   \textcolor{keywordflow}{if} (wavemethod == testprof) \textcolor{keywordflow}{then}}
\DoxyCodeLine{451     \textcolor{comment}{! Do nothing}}
\DoxyCodeLine{452   \textcolor{keywordflow}{elseif} (wavemethod==surfbands) \textcolor{keywordflow}{then}}
\DoxyCodeLine{453     \textcolor{keywordflow}{if} (datasource==dataovr) \textcolor{keywordflow}{then}}
\DoxyCodeLine{454       \textcolor{keyword}{call }surface\_bands\_by\_data\_override(day\_center, g, gv, us, cs)}
\DoxyCodeLine{455     \textcolor{keywordflow}{elseif} (datasource==coupler) \textcolor{keywordflow}{then}}
\DoxyCodeLine{456       \textcolor{comment}{! Reserve for coupler hooks}}
\DoxyCodeLine{457     \textcolor{keywordflow}{elseif} (datasource==input) \textcolor{keywordflow}{then}}
\DoxyCodeLine{458       \textcolor{keywordflow}{do} b=1,numbands}
\DoxyCodeLine{459         \textcolor{keywordflow}{do} ii=g\%isdB,g\%iedB}
\DoxyCodeLine{460           \textcolor{keywordflow}{do} jj=g\%jsd,g\%jed}
\DoxyCodeLine{461             cs\%STKx0(ii,jj,b) = cs\%PrescribedSurfStkX(b)}
\DoxyCodeLine{462 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{463 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{464         \textcolor{keywordflow}{do} ii=g\%isd,g\%ied}
\DoxyCodeLine{465           \textcolor{keywordflow}{do} jj=g\%jsdB, g\%jedB}
\DoxyCodeLine{466             cs\%STKY0(ii,jj,b) = cs\%PrescribedSurfStkY(b)}
\DoxyCodeLine{467 \textcolor{keywordflow}{          enddo}}
\DoxyCodeLine{468 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{469 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{470 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{471 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{472 }
\DoxyCodeLine{473   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ae771d75c78a0370ad163edd5b1c19965}\label{namespacemom__wave__interface_ae771d75c78a0370ad163edd5b1c19965}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!ust\_2\_u10\_coare3p5@{ust\_2\_u10\_coare3p5}}
\index{ust\_2\_u10\_coare3p5@{ust\_2\_u10\_coare3p5}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{ust\_2\_u10\_coare3p5()}{ust\_2\_u10\_coare3p5()}}
{\footnotesize\ttfamily subroutine mom\+\_\+wave\+\_\+interface\+::ust\+\_\+2\+\_\+u10\+\_\+coare3p5 (\begin{DoxyParamCaption}\item[{real, intent(in)}]{U\+S\+Tair,  }\item[{real, intent(out)}]{U10,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Computes wind speed from ustar\+\_\+air based on C\+O\+A\+RE 3.\+5 Cd relationship Probably doesn\textquotesingle{}t belong in this module, but it is used here to estimate wind speed for wind-\/wave relationships. Should be a fine way to estimate the neutral wind-\/speed as written here. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ustair} & Wind friction velocity \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em u10} & 10-\/m neutral wind speed \mbox{[}m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & vertical grid type \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 1332 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1332 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}                    :: USTair\textcolor{comment}{ !< Wind friction velocity [m s-\/1]}}
\DoxyCodeLine{1333 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}                   :: U10\textcolor{comment}{    !< 10-\/m neutral wind speed [m s-\/1]}}
\DoxyCodeLine{1334   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{     !< vertical grid type}}
\DoxyCodeLine{1335   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{     !< A dimensional unit scaling type}}
\DoxyCodeLine{1336 }
\DoxyCodeLine{1337   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1338 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{parameter} :: vonkar = 0.4 \textcolor{comment}{! Should access a get\_param von karman}}
\DoxyCodeLine{1339 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{parameter} :: nu=1e-\/6 \textcolor{comment}{! Should access a get\_param air-\/viscosity}}
\DoxyCodeLine{1340 \textcolor{keywordtype}{  real} :: z0sm, z0, z0rough, u10a, alpha, CD}
\DoxyCodeLine{1341   \textcolor{keywordtype}{integer} :: CT}
\DoxyCodeLine{1342 }
\DoxyCodeLine{1343   \textcolor{comment}{! Uses empirical formula for z0 to convert ustar\_air to u10 based on the}}
\DoxyCodeLine{1344   \textcolor{comment}{!  COARE 3.5 paper (Edson et al., 2013)}}
\DoxyCodeLine{1345   \textcolor{comment}{! alpha=m*U10+b}}
\DoxyCodeLine{1346   \textcolor{comment}{! Note in Edson et al. 2013, eq. 13 m is given as 0.017.  However,}}
\DoxyCodeLine{1347   \textcolor{comment}{! m=0.0017 reproduces the curve in their figure 6.}}
\DoxyCodeLine{1348 }
\DoxyCodeLine{1349   z0sm = 0.11 * nu * us\%m\_to\_Z / ustair \textcolor{comment}{!Compute z0smooth from ustar guess}}
\DoxyCodeLine{1350   u10 = ustair/sqrt(0.001)  \textcolor{comment}{!Guess for u10}}
\DoxyCodeLine{1351   u10a = 1000}
\DoxyCodeLine{1352 }
\DoxyCodeLine{1353   ct=0}
\DoxyCodeLine{1354   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (abs(u10a/u10-\/1.) > 0.001)}
\DoxyCodeLine{1355     ct=ct+1}
\DoxyCodeLine{1356     u10a = u10}
\DoxyCodeLine{1357     alpha = min(0.028, 0.0017 * u10 -\/ 0.005)}
\DoxyCodeLine{1358     z0rough = alpha * (us\%m\_s\_to\_L\_T*ustair)**2 / gv\%g\_Earth \textcolor{comment}{! Compute z0rough from ustar guess}}
\DoxyCodeLine{1359     z0 = z0sm + z0rough}
\DoxyCodeLine{1360     cd = ( vonkar / log(10.*us\%m\_to\_Z / z0) )**2 \textcolor{comment}{! Compute CD from derived roughness}}
\DoxyCodeLine{1361     u10 = ustair/sqrt(cd)  \textcolor{comment}{! Compute new u10 from derived CD, while loop}}
\DoxyCodeLine{1362                            \textcolor{comment}{! ends and checks for convergence...CT counter}}
\DoxyCodeLine{1363                            \textcolor{comment}{! makes sure loop doesn't run away if function}}
\DoxyCodeLine{1364                            \textcolor{comment}{! doesn't converge.  This code was produced offline}}
\DoxyCodeLine{1365                            \textcolor{comment}{! and converged rapidly (e.g. 2 cycles)}}
\DoxyCodeLine{1366                            \textcolor{comment}{! for ustar=0.0001:0.0001:10.}}
\DoxyCodeLine{1367     \textcolor{keywordflow}{if} (ct>20) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1368       u10 = ustair/sqrt(0.0015) \textcolor{comment}{! I don't expect to get here, but just}}
\DoxyCodeLine{1369                               \textcolor{comment}{!  in case it will output a reasonable value.}}
\DoxyCodeLine{1370       \textcolor{keywordflow}{exit}}
\DoxyCodeLine{1371 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1372 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1373   \textcolor{keywordflow}{return}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a503d3ffc8d297c000dc72e2bfb7eb1b1}\label{namespacemom__wave__interface_a503d3ffc8d297c000dc72e2bfb7eb1b1}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!waves\_end@{waves\_end}}
\index{waves\_end@{waves\_end}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{waves\_end()}{waves\_end()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+wave\+\_\+interface\+::waves\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__wave__interface_1_1wave__parameters__cs}{wave\+\_\+parameters\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Clear pointers, deallocate memory. 


\begin{DoxyParams}{Parameters}
{\em cs} & Control structure \\
\hline
\end{DoxyParams}


Definition at line 1378 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1378   \textcolor{keywordtype}{type}(wave\_parameters\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< Control structure}}
\DoxyCodeLine{1379 }
\DoxyCodeLine{1380   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%WaveNum\_Cen)) \textcolor{keyword}{deallocate}( cs\%WaveNum\_Cen )}
\DoxyCodeLine{1381   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%Freq\_Cen))    \textcolor{keyword}{deallocate}( cs\%Freq\_Cen )}
\DoxyCodeLine{1382   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%Us\_x))        \textcolor{keyword}{deallocate}( cs\%Us\_x )}
\DoxyCodeLine{1383   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%Us\_y))        \textcolor{keyword}{deallocate}( cs\%Us\_y )}
\DoxyCodeLine{1384   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%La\_SL))       \textcolor{keyword}{deallocate}( cs\%La\_SL )}
\DoxyCodeLine{1385   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%La\_turb))     \textcolor{keyword}{deallocate}( cs\%La\_turb )}
\DoxyCodeLine{1386   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%STKx0))       \textcolor{keyword}{deallocate}( cs\%STKx0 )}
\DoxyCodeLine{1387   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%STKy0))       \textcolor{keyword}{deallocate}( cs\%STKy0 )}
\DoxyCodeLine{1388   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%KvS))         \textcolor{keyword}{deallocate}( cs\%KvS )}
\DoxyCodeLine{1389   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%Us0\_y))       \textcolor{keyword}{deallocate}( cs\%Us0\_y )}
\DoxyCodeLine{1390   \textcolor{keywordflow}{if} (\textcolor{keyword}{allocated}(cs\%Us0\_x))       \textcolor{keyword}{deallocate}( cs\%Us0\_x )}
\DoxyCodeLine{1391 }
\DoxyCodeLine{1392   \textcolor{keyword}{deallocate}( cs )}
\DoxyCodeLine{1393 }
\DoxyCodeLine{1394   \textcolor{keywordflow}{return}}

\end{DoxyCode}


\doxysubsection{Variable Documentation}
\mbox{\Hypertarget{namespacemom__wave__interface_a38f7b8c357cf57847a9f9d6db72714b6}\label{namespacemom__wave__interface_a38f7b8c357cf57847a9f9d6db72714b6}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!coupler@{coupler}}
\index{coupler@{coupler}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{coupler}{coupler}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::coupler = 2\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_a86e86d267dc214498fcd8088349d5d57}\label{namespacemom__wave__interface_a86e86d267dc214498fcd8088349d5d57}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!dataoverrideisinitialized@{dataoverrideisinitialized}}
\index{dataoverrideisinitialized@{dataoverrideisinitialized}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{dataoverrideisinitialized}{dataoverrideisinitialized}}
{\footnotesize\ttfamily logical mom\+\_\+wave\+\_\+interface\+::dataoverrideisinitialized\hspace{0.3cm}{\ttfamily [private]}}



Flag for Data\+Override Initialization. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000018}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 159 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{159 \textcolor{keywordtype}{logical} :: dataoverrideisinitialized\textcolor{comment}{ !< Flag for DataOverride Initialization}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a0bb611ec4e2c3c121ed662e75f79bc3d}\label{namespacemom__wave__interface_a0bb611ec4e2c3c121ed662e75f79bc3d}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!dataovr@{dataovr}}
\index{dataovr@{dataovr}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{dataovr}{dataovr}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::dataovr = 1\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_af159120455d0f0afae144afc6a587561}\label{namespacemom__wave__interface_af159120455d0f0afae144afc6a587561}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!datasource@{datasource}}
\index{datasource@{datasource}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{datasource}{datasource}}
{\footnotesize\ttfamily integer mom\+\_\+wave\+\_\+interface\+::datasource\hspace{0.3cm}{\ttfamily [private]}}



Integer that specifies where the Model Looks for Data Valid choices are\+: 1 -\/ F\+MS Data\+Override Routine 2 -\/ Reserved For Coupler 3 -\/ User input (fixed values, useful for 1d testing) 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000016}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 149 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{149 \textcolor{keywordtype}{integer} :: DataSource\textcolor{comment}{ !< Integer that specifies where the Model Looks for Data}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_aba8ac0d96a4986c68452e60e0843d635}\label{namespacemom__wave__interface_aba8ac0d96a4986c68452e60e0843d635}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!dhh85@{dhh85}}
\index{dhh85@{dhh85}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{dhh85}{dhh85}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::dhh85 = 2\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_a3f2253e4bf2bd73d0571270a3a464bb0}\label{namespacemom__wave__interface_a3f2253e4bf2bd73d0571270a3a464bb0}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!dhh85\_is\_set@{dhh85\_is\_set}}
\index{dhh85\_is\_set@{dhh85\_is\_set}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{dhh85\_is\_set}{dhh85\_is\_set}}
{\footnotesize\ttfamily logical mom\+\_\+wave\+\_\+interface\+::dhh85\+\_\+is\+\_\+set\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 184 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_a2d13c62795b8407c1e9d3a3236b61100}\label{namespacemom__wave__interface_a2d13c62795b8407c1e9d3a3236b61100}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!input@{input}}
\index{input@{input}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{input}{input}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::input = 3\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_abc7136c467d4f1def8b2a32dfd335c3f}\label{namespacemom__wave__interface_abc7136c467d4f1def8b2a32dfd335c3f}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!la\_frachbl@{la\_frachbl}}
\index{la\_frachbl@{la\_frachbl}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{la\_frachbl}{la\_frachbl}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::la\+\_\+frachbl\hspace{0.3cm}{\ttfamily [private]}}



Fraction of O\+S\+BL for averaging Langmuir number. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000019}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 163 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{163 \textcolor{keywordtype}{real} :: LA\_FracHBL\textcolor{comment}{         !< Fraction of OSBL for averaging Langmuir number}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_aab4d6b9f7e8823615c5ff975e0e40d22}\label{namespacemom__wave__interface_aab4d6b9f7e8823615c5ff975e0e40d22}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!la\_misalignment@{la\_misalignment}}
\index{la\_misalignment@{la\_misalignment}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{la\_misalignment}{la\_misalignment}}
{\footnotesize\ttfamily logical mom\+\_\+wave\+\_\+interface\+::la\+\_\+misalignment = .false.\hspace{0.3cm}{\ttfamily [private]}}



Flag to use misalignment in Langmuir number. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000020}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 165 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{165 \textcolor{keywordtype}{logical} :: LA\_Misalignment = .false. \textcolor{comment}{!< Flag to use misalignment in Langmuir number}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_aaf3e043506139977c8fbdf2ae0180262}\label{namespacemom__wave__interface_aaf3e043506139977c8fbdf2ae0180262}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!lf17@{lf17}}
\index{lf17@{lf17}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{lf17}{lf17}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::lf17 = 3\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_afcedd2ab70e1d3b83e2802b31a9ae78c}\label{namespacemom__wave__interface_afcedd2ab70e1d3b83e2802b31a9ae78c}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!null\_wavemethod@{null\_wavemethod}}
\index{null\_wavemethod@{null\_wavemethod}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{null\_wavemethod}{null\_wavemethod}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::null\+\_\+wavemethod =-\/99\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_ab514cf456c7f7953f4c304b941ff4c53}\label{namespacemom__wave__interface_ab514cf456c7f7953f4c304b941ff4c53}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!numbands@{numbands}}
\index{numbands@{numbands}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{numbands}{numbands}}
{\footnotesize\ttfamily integer, public mom\+\_\+wave\+\_\+interface\+::numbands =0}



Number of wavenumber/frequency partitions to receive This needs to match the number of bands provided via either coupling or file. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000014}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 141 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{141 \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{public} :: NumBands =0\textcolor{comment}{ !< Number of wavenumber/frequency partitions to receive}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a91f7f974e91056f48cb04fb01b8f0d15}\label{namespacemom__wave__interface_a91f7f974e91056f48cb04fb01b8f0d15}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!partitionmode@{partitionmode}}
\index{partitionmode@{partitionmode}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{partitionmode}{partitionmode}}
{\footnotesize\ttfamily integer, public mom\+\_\+wave\+\_\+interface\+::partitionmode}



Method for partition mode (meant to check input) 0 -\/ wavenumbers 1 -\/ frequencies. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000015}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 145 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{145 \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{public} :: PartitionMode\textcolor{comment}{ !< Method for partition mode (meant to check input)}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a8bac1e68a6349358fbcb6d4586b96492}\label{namespacemom__wave__interface_a8bac1e68a6349358fbcb6d4586b96492}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!pi@{pi}}
\index{pi@{pi}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{pi}{pi}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::pi\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 186 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{186 \textcolor{keywordtype}{real}    :: PI}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a64f1c48b7cda4fbcf16d32efa64e7a65}\label{namespacemom__wave__interface_a64f1c48b7cda4fbcf16d32efa64e7a65}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!staticwaves@{staticwaves}}
\index{staticwaves@{staticwaves}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{staticwaves}{staticwaves}}
{\footnotesize\ttfamily logical mom\+\_\+wave\+\_\+interface\+::staticwaves\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 184 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{184 \textcolor{keywordtype}{logical} :: StaticWaves, DHH85\_Is\_Set}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a14b0aa4752008d5a52dbbb5e16751122}\label{namespacemom__wave__interface_a14b0aa4752008d5a52dbbb5e16751122}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!surfbandfilename@{surfbandfilename}}
\index{surfbandfilename@{surfbandfilename}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{surfbandfilename}{surfbandfilename}}
{\footnotesize\ttfamily character(len=40) mom\+\_\+wave\+\_\+interface\+::surfbandfilename\hspace{0.3cm}{\ttfamily [private]}}



Filename if using Data\+Override. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000017}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 157 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{157 \textcolor{comment}{character(len=40)  :: SurfBandFileName !< Filename if using DataOverride}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_aa3e3dcb7036fc3500e60304d1e632dab}\label{namespacemom__wave__interface_aa3e3dcb7036fc3500e60304d1e632dab}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!surfbands@{surfbands}}
\index{surfbands@{surfbands}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{surfbands}{surfbands}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::surfbands = 1\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_a9add067c6322c0d863978f0a1c13b205}\label{namespacemom__wave__interface_a9add067c6322c0d863978f0a1c13b205}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!testprof@{testprof}}
\index{testprof@{testprof}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{testprof}{testprof}}
{\footnotesize\ttfamily integer, parameter mom\+\_\+wave\+\_\+interface\+::testprof = 0\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 177 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{177 \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{parameter} :: TESTPROF = 0, surfbands = 1, \&}
\DoxyCodeLine{178                       dhh85 = 2, lf17 = 3, null\_wavemethod=-\/99, \&}
\DoxyCodeLine{179                       dataovr = 1, coupler = 2, input = 3}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ad270c0cfd5b154a7c79856dcd65f9b7d}\label{namespacemom__wave__interface_ad270c0cfd5b154a7c79856dcd65f9b7d}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!tp\_stkx0@{tp\_stkx0}}
\index{tp\_stkx0@{tp\_stkx0}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{tp\_stkx0}{tp\_stkx0}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::tp\+\_\+stkx0\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 182 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{182 \textcolor{keywordtype}{Real}    :: TP\_STKX0, TP\_STKY0, TP\_WVL}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a1b1910008053811657e7b0a62bf7b953}\label{namespacemom__wave__interface_a1b1910008053811657e7b0a62bf7b953}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!tp\_stky0@{tp\_stky0}}
\index{tp\_stky0@{tp\_stky0}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{tp\_stky0}{tp\_stky0}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::tp\+\_\+stky0\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 182 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_ac99ef0805fd66b9e7b96ee6c21c819e5}\label{namespacemom__wave__interface_ac99ef0805fd66b9e7b96ee6c21c819e5}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!tp\_wvl@{tp\_wvl}}
\index{tp\_wvl@{tp\_wvl}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{tp\_wvl}{tp\_wvl}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::tp\+\_\+wvl\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 182 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

\mbox{\Hypertarget{namespacemom__wave__interface_ae6655758dbc674bafd3a5f0a51176e80}\label{namespacemom__wave__interface_ae6655758dbc674bafd3a5f0a51176e80}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!waveage@{waveage}}
\index{waveage@{waveage}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{waveage}{waveage}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::waveage\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 185 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{185 \textcolor{keywordtype}{real}    :: WaveAge, WaveWind}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a4d5d36a94c630a4f9e181d8171fc2a35}\label{namespacemom__wave__interface_a4d5d36a94c630a4f9e181d8171fc2a35}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!waveagepeakfreq@{waveagepeakfreq}}
\index{waveagepeakfreq@{waveagepeakfreq}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{waveagepeakfreq}{waveagepeakfreq}}
{\footnotesize\ttfamily logical mom\+\_\+wave\+\_\+interface\+::waveagepeakfreq\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 183 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{183 \textcolor{keywordtype}{logical} :: WaveAgePeakFreq \textcolor{comment}{! Flag to use W}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_ad81e4ea1a9510437272f5871af6993ad}\label{namespacemom__wave__interface_ad81e4ea1a9510437272f5871af6993ad}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!wavemethod@{wavemethod}}
\index{wavemethod@{wavemethod}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{wavemethod}{wavemethod}}
{\footnotesize\ttfamily integer mom\+\_\+wave\+\_\+interface\+::wavemethod =-\/99}



Options for including wave information Valid (tested) choices are\+: 0 -\/ Test Profile 1 -\/ Surface Stokes Drift Bands 2 -\/ D\+H\+H85 3 -\/ L\+F17 -\/99 -\/ No waves computed, but empirical Langmuir number used. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000013}{Todo}}]Module variable! Move into a control structure. \end{DoxyRefDesc}


Definition at line 131 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{131 \textcolor{keywordtype}{integer} :: WaveMethod=-\/99\textcolor{comment}{ !< Options for including wave information}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__wave__interface_a8e5650b8187abcc67bd0e2787322ac75}\label{namespacemom__wave__interface_a8e5650b8187abcc67bd0e2787322ac75}} 
\index{mom\_wave\_interface@{mom\_wave\_interface}!wavewind@{wavewind}}
\index{wavewind@{wavewind}!mom\_wave\_interface@{mom\_wave\_interface}}
\doxysubsubsection{\texorpdfstring{wavewind}{wavewind}}
{\footnotesize\ttfamily real mom\+\_\+wave\+\_\+interface\+::wavewind\hspace{0.3cm}{\ttfamily [private]}}



Undocumented parameters. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000021}{Todo}}]These module variables need to be documented as static/private variables or moved into a control structure. \end{DoxyRefDesc}


Definition at line 185 of file M\+O\+M\+\_\+wave\+\_\+interface.\+F90.

