\hypertarget{namespacedumbbell__initialization}{}\section{dumbbell\+\_\+initialization Module Reference}
\label{namespacedumbbell__initialization}\index{dumbbell\_initialization@{dumbbell\_initialization}}


\subsection{Detailed Description}
Configures the model for the idealized dumbbell test case. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacedumbbell__initialization_aba31e0ec02e4c1c0e5987d8843be5e76}{dumbbell\+\_\+initialize\+\_\+topography}} (D, G, param\+\_\+file, max\+\_\+depth)
\begin{DoxyCompactList}\small\item\em Initialization of topography. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacedumbbell__initialization_a265452b61d468b64683545f2bf0cf2c6}{dumbbell\+\_\+initialize\+\_\+thickness}} (h, G, GV, US, param\+\_\+file, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em Initializes the layer thicknesses to be uniform in the dumbbell test case. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacedumbbell__initialization_ab755e35e9e8cda3c40922930ccf595f8}{dumbbell\+\_\+initialize\+\_\+temperature\+\_\+salinity}} (T, S, h, G, GV, param\+\_\+file, eqn\+\_\+of\+\_\+state, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em Initial values for temperature and salinity for the dumbbell test case. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacedumbbell__initialization_a13361a11ddf3cb55689b7899f281c273}{dumbbell\+\_\+initialize\+\_\+sponges}} (G, GV, US, tv, param\+\_\+file, use\+\_\+\+A\+LE, C\+Sp, A\+C\+Sp)
\begin{DoxyCompactList}\small\item\em Initialize the restoring sponges for the dumbbell test case. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacedumbbell__initialization_a1a1ee45454d965674b4dfa06cccf4403}\label{namespacedumbbell__initialization_a1a1ee45454d965674b4dfa06cccf4403}} 
character(len=40) \mbox{\hyperlink{namespacedumbbell__initialization_a1a1ee45454d965674b4dfa06cccf4403}{mdl}} = \char`\"{}dumbbell\+\_\+initialization\char`\"{}
\begin{DoxyCompactList}\small\item\em This module\textquotesingle{}s name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacedumbbell__initialization_a13361a11ddf3cb55689b7899f281c273}\label{namespacedumbbell__initialization_a13361a11ddf3cb55689b7899f281c273}} 
\index{dumbbell\_initialization@{dumbbell\_initialization}!dumbbell\_initialize\_sponges@{dumbbell\_initialize\_sponges}}
\index{dumbbell\_initialize\_sponges@{dumbbell\_initialize\_sponges}!dumbbell\_initialization@{dumbbell\_initialization}}
\subsubsection{\texorpdfstring{dumbbell\_initialize\_sponges()}{dumbbell\_initialize\_sponges()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+initialization\+::dumbbell\+\_\+initialize\+\_\+sponges (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{logical, intent(in)}]{use\+\_\+\+A\+LE,  }\item[{type(sponge\+\_\+cs), pointer}]{C\+Sp,  }\item[{type(ale\+\_\+sponge\+\_\+cs), pointer}]{A\+C\+Sp }\end{DoxyParamCaption})}



Initialize the restoring sponges for the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Horizontal grid control structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid control structure \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & Thermodynamic variables \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\hline
\mbox{\texttt{ in}}  & {\em use\+\_\+ale} & A\+LE flag \\
\hline
 & {\em csp} & Layered sponge control structure pointer \\
\hline
 & {\em acsp} & A\+LE sponge control structure pointer \\
\hline
\end{DoxyParams}


Definition at line 288 of file dumbbell\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{288   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{ !< Horizontal grid control structure}}
\DoxyCodeLine{289   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{ !< Vertical grid control structure}}
\DoxyCodeLine{290   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{291   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),   \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{ !< Thermodynamic variables}}
\DoxyCodeLine{292   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{293   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)} :: use\_ALE\textcolor{comment}{ !< ALE flag}}
\DoxyCodeLine{294   \textcolor{keywordtype}{type}(sponge\_CS),         \textcolor{keywordtype}{pointer}    :: CSp\textcolor{comment}{ !< Layered sponge control structure pointer}}
\DoxyCodeLine{295   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),     \textcolor{keywordtype}{pointer}    :: ACSp\textcolor{comment}{ !< ALE sponge control structure pointer}}
\DoxyCodeLine{296 }
\DoxyCodeLine{297 \textcolor{keywordtype}{  real} :: sponge\_time\_scale  \textcolor{comment}{! The damping time scale [T ~> s]}}
\DoxyCodeLine{298 }
\DoxyCodeLine{299 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))} :: Idamp \textcolor{comment}{! inverse damping timescale [T-1 ~> s-1]}}
\DoxyCodeLine{300 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))} :: h, T, S \textcolor{comment}{! sponge thicknesses, temp and salt}}
\DoxyCodeLine{301 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(GV)+1)} :: e0, eta1D \textcolor{comment}{! interface positions for ALE sponge}}
\DoxyCodeLine{302 }
\DoxyCodeLine{303   \textcolor{keywordtype}{integer} :: i, j, k, nz}
\DoxyCodeLine{304 \textcolor{keywordtype}{  real} :: x, zi, zmid, dist, min\_thickness, dblen}
\DoxyCodeLine{305 \textcolor{keywordtype}{  real} :: mld, S\_ref, S\_range, S\_dense, T\_ref, sill\_height}
\DoxyCodeLine{306   \textcolor{keywordtype}{logical} :: dbrotate    \textcolor{comment}{! If true, rotate the domain.}}
\DoxyCodeLine{307 }
\DoxyCodeLine{308   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_LEN"},dblen, \&}
\DoxyCodeLine{309                 \textcolor{stringliteral}{'Lateral Length scale for dumbbell '},\&}
\DoxyCodeLine{310                  units=\textcolor{stringliteral}{'k'}, default=600., do\_not\_log=.true.)}
\DoxyCodeLine{311   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_ROTATION"}, dbrotate, \&}
\DoxyCodeLine{312                 \textcolor{stringliteral}{'Logical for rotation of dumbbell domain.'},\&}
\DoxyCodeLine{313                  units=\textcolor{stringliteral}{'nondim'}, default=.false., do\_not\_log=.true.)}
\DoxyCodeLine{314 }
\DoxyCodeLine{315   \textcolor{keywordflow}{if} (g\%x\_axis\_units == \textcolor{stringliteral}{'m'}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{316     dblen=dblen*1.e3}
\DoxyCodeLine{317 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{318 }
\DoxyCodeLine{319   nz = gv\%ke}
\DoxyCodeLine{320 }
\DoxyCodeLine{321   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_SPONGE\_TIME\_SCALE"}, sponge\_time\_scale, \&}
\DoxyCodeLine{322        \textcolor{stringliteral}{"The time scale in the reservoir for restoring. If zero, the sponge is disabled."}, \&}
\DoxyCodeLine{323        units=\textcolor{stringliteral}{"s"}, default=0., scale=us\%s\_to\_T)}
\DoxyCodeLine{324   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_SREF"}, s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{325   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_S\_RANGE"}, s\_range, do\_not\_log=.true.)}
\DoxyCodeLine{326   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"MIN\_THICKNESS"}, min\_thickness, \&}
\DoxyCodeLine{327                 \textcolor{stringliteral}{'Minimum thickness for layer'},\&}
\DoxyCodeLine{328                  units=\textcolor{stringliteral}{'m'}, default=1.0e-3, do\_not\_log=.true., scale=us\%m\_to\_Z)}
\DoxyCodeLine{329 }
\DoxyCodeLine{330   \textcolor{comment}{! no active sponges}}
\DoxyCodeLine{331   \textcolor{keywordflow}{if} (sponge\_time\_scale <= 0.) \textcolor{keywordflow}{return}}
\DoxyCodeLine{332 }
\DoxyCodeLine{333   \textcolor{comment}{! everywhere is initially unsponged}}
\DoxyCodeLine{334   idamp(:,:) = 0.0}
\DoxyCodeLine{335 }
\DoxyCodeLine{336   \textcolor{keywordflow}{do} j = g\%jsc, g\%jec}
\DoxyCodeLine{337     \textcolor{keywordflow}{do} i = g\%isc,g\%iec}
\DoxyCodeLine{338       \textcolor{keywordflow}{if} (g\%mask2dT(i,j) > 0.) \textcolor{keywordflow}{then}}
\DoxyCodeLine{339         \textcolor{comment}{! nondimensional x position}}
\DoxyCodeLine{340         \textcolor{keywordflow}{if} (dbrotate) \textcolor{keywordflow}{then}}
\DoxyCodeLine{341           \textcolor{comment}{! This is really y in the rotated case}}
\DoxyCodeLine{342           x = ( g\%geoLatT(i,j) ) / dblen}
\DoxyCodeLine{343         \textcolor{keywordflow}{else}}
\DoxyCodeLine{344           x = ( g\%geoLonT(i,j) ) / dblen}
\DoxyCodeLine{345 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{346         \textcolor{keywordflow}{if} (x > 0.25 .or. x < -0.25) \textcolor{keywordflow}{then}}
\DoxyCodeLine{347           \textcolor{comment}{! scale restoring by depth into sponge}}
\DoxyCodeLine{348           idamp(i,j) = 1. / sponge\_time\_scale}
\DoxyCodeLine{349 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{350 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{351 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{352 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{353 }
\DoxyCodeLine{354   \textcolor{keywordflow}{if} (use\_ale) \textcolor{keywordflow}{then}}
\DoxyCodeLine{355     \textcolor{comment}{! construct a uniform grid for the sponge}}
\DoxyCodeLine{356     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{357       eta1d(nz+1) = -g\%bathyT(i,j)}
\DoxyCodeLine{358       \textcolor{keywordflow}{do} k=nz,1,-1}
\DoxyCodeLine{359         eta1d(k) = -g\%max\_depth * real(k-1) / real(nz)}
\DoxyCodeLine{360         \textcolor{keywordflow}{if} (eta1d(k) < (eta1d(k+1) + min\_thickness)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{361           eta1d(k) = eta1d(k+1) + min\_thickness}
\DoxyCodeLine{362           h(i,j,k) = gv\%Z\_to\_H * min\_thickness}
\DoxyCodeLine{363         \textcolor{keywordflow}{else}}
\DoxyCodeLine{364           h(i,j,k) = gv\%Z\_to\_H * (eta1d(k) - eta1d(k+1))}
\DoxyCodeLine{365 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{366 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{367 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{368 }
\DoxyCodeLine{369     \textcolor{keyword}{call }initialize\_ale\_sponge(idamp, g, param\_file, acsp, h, nz)}
\DoxyCodeLine{370 }
\DoxyCodeLine{371     \textcolor{comment}{! construct temperature and salinity for the sponge}}
\DoxyCodeLine{372     \textcolor{comment}{! start with initial condition}}
\DoxyCodeLine{373     s(:,:,:) = 0.0}
\DoxyCodeLine{374 }
\DoxyCodeLine{375     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{376       \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}}
\DoxyCodeLine{377       \textcolor{keywordflow}{if} (dbrotate) \textcolor{keywordflow}{then}}
\DoxyCodeLine{378         \textcolor{comment}{! This is really y in the rotated case}}
\DoxyCodeLine{379         x = ( g\%geoLatT(i,j) ) / dblen}
\DoxyCodeLine{380       \textcolor{keywordflow}{else}}
\DoxyCodeLine{381         x = ( g\%geoLonT(i,j) ) / dblen}
\DoxyCodeLine{382 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{383       \textcolor{keywordflow}{if} (x>=0.25 ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{384         \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{385           s(i,j,k)=s\_ref + 0.5*s\_range}
\DoxyCodeLine{386 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{387 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{388       \textcolor{keywordflow}{if} (x<=-0.25 ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{389         \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{390           s(i,j,k)=s\_ref - 0.5*s\_range}
\DoxyCodeLine{391 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{392 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{393 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{394 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{395 }
\DoxyCodeLine{396   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(tv\%S)) \textcolor{keyword}{call }set\_up\_ale\_sponge\_field(s, g, tv\%S, acsp)}
\DoxyCodeLine{397 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacedumbbell__initialization_ab755e35e9e8cda3c40922930ccf595f8}\label{namespacedumbbell__initialization_ab755e35e9e8cda3c40922930ccf595f8}} 
\index{dumbbell\_initialization@{dumbbell\_initialization}!dumbbell\_initialize\_temperature\_salinity@{dumbbell\_initialize\_temperature\_salinity}}
\index{dumbbell\_initialize\_temperature\_salinity@{dumbbell\_initialize\_temperature\_salinity}!dumbbell\_initialization@{dumbbell\_initialization}}
\subsubsection{\texorpdfstring{dumbbell\_initialize\_temperature\_salinity()}{dumbbell\_initialize\_temperature\_salinity()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+initialization\+::dumbbell\+\_\+initialize\+\_\+temperature\+\_\+salinity (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(out)}]{T,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(out)}]{S,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(in)}]{h,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(eos\+\_\+type), pointer}]{eqn\+\_\+of\+\_\+state,  }\item[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



Initial values for temperature and salinity for the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Ocean grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure \\
\hline
\mbox{\texttt{ out}}  & {\em t} & Potential temperature \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em s} & Salinity \mbox{[}ppt\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\hline
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure \\
\hline
\mbox{\texttt{ in}}  & {\em just\+\_\+read\+\_\+params} & If present and true, this call will only read parameters without changing h. \\
\hline
\end{DoxyParams}


Definition at line 212 of file dumbbell\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{212   \textcolor{keywordtype}{type}(ocean\_grid\_type),                     \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< Ocean grid structure}}
\DoxyCodeLine{213   \textcolor{keywordtype}{type}(verticalGrid\_type),                   \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{ !< Vertical grid structure}}
\DoxyCodeLine{214 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: T\textcolor{comment}{ !< Potential temperature [degC]}}
\DoxyCodeLine{215 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: S\textcolor{comment}{ !< Salinity [ppt]}}
\DoxyCodeLine{216 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(in)}  :: h\textcolor{comment}{ !< Layer thickness [H ~> m or kg m-2]}}
\DoxyCodeLine{217   \textcolor{keywordtype}{type}(param\_file\_type),                     \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{218   \textcolor{keywordtype}{type}(EOS\_type),                            \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}}
\DoxyCodeLine{219   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}}
\DoxyCodeLine{220 \textcolor{comment}{                                                      !! only read parameters without changing h.}}
\DoxyCodeLine{221 }
\DoxyCodeLine{222   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{223   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz, k\_light}
\DoxyCodeLine{224 \textcolor{keywordtype}{  real}    :: xi0, xi1, dxi, r, S\_surf, T\_surf, S\_range, T\_range}
\DoxyCodeLine{225 \textcolor{keywordtype}{  real}    :: x, y, dblen}
\DoxyCodeLine{226 \textcolor{keywordtype}{  real}    :: T\_ref, T\_Light, T\_Dense, S\_ref, S\_Light, S\_Dense, a1, frac\_dense, k\_frac, res\_rat}
\DoxyCodeLine{227   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{228   \textcolor{keywordtype}{logical} :: dbrotate     \textcolor{comment}{! If true, rotate the domain.}}
\DoxyCodeLine{229   \textcolor{keywordtype}{character(len=20)} :: verticalCoordinate, density\_profile}
\DoxyCodeLine{230 }
\DoxyCodeLine{231   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{232 }
\DoxyCodeLine{233   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{234 }
\DoxyCodeLine{235   t\_surf = 20.0}
\DoxyCodeLine{236 }
\DoxyCodeLine{237   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REGRIDDING\_COORDINATE\_MODE"}, verticalcoordinate, \&}
\DoxyCodeLine{238                  default=default\_coordinate\_mode, do\_not\_log=just\_read)}
\DoxyCodeLine{239   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_DENSITY\_PROFILE"}, density\_profile, \&}
\DoxyCodeLine{240                  \textcolor{stringliteral}{'Initial profile shape. Valid values are "linear", "parabolic" '}// \&}
\DoxyCodeLine{241                  \textcolor{stringliteral}{'and "exponential".'}, default=\textcolor{stringliteral}{'linear'}, do\_not\_log=just\_read)}
\DoxyCodeLine{242   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_SREF"}, s\_surf, \&}
\DoxyCodeLine{243                  \textcolor{stringliteral}{'DUMBBELL REFERENCE SALINITY'}, units=\textcolor{stringliteral}{'1e-3'}, default=34., do\_not\_log=just\_read)}
\DoxyCodeLine{244   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_S\_RANGE"}, s\_range, \&}
\DoxyCodeLine{245                  \textcolor{stringliteral}{'DUMBBELL salinity range (right-left)'}, units=\textcolor{stringliteral}{'1e-3'}, \&}
\DoxyCodeLine{246                  default=2., do\_not\_log=just\_read)}
\DoxyCodeLine{247   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_LEN"},dblen, \&}
\DoxyCodeLine{248                 \textcolor{stringliteral}{'Lateral Length scale for dumbbell '},\&}
\DoxyCodeLine{249                  units=\textcolor{stringliteral}{'k'}, default=600., do\_not\_log=just\_read)}
\DoxyCodeLine{250   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_ROTATION"}, dbrotate, \&}
\DoxyCodeLine{251                 \textcolor{stringliteral}{'Logical for rotation of dumbbell domain.'},\&}
\DoxyCodeLine{252                  units=\textcolor{stringliteral}{'nondim'}, default=.false., do\_not\_log=just\_read)}
\DoxyCodeLine{253 }
\DoxyCodeLine{254   \textcolor{keywordflow}{if} (g\%x\_axis\_units == \textcolor{stringliteral}{'m'}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{255     dblen=dblen*1.e3}
\DoxyCodeLine{256 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{257 }
\DoxyCodeLine{258   \textcolor{keywordflow}{do} j=g\%jsc,g\%jec}
\DoxyCodeLine{259     \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{260     \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}}
\DoxyCodeLine{261       \textcolor{keywordflow}{if} (dbrotate) \textcolor{keywordflow}{then}}
\DoxyCodeLine{262         \textcolor{comment}{! This is really y in the rotated case}}
\DoxyCodeLine{263         x = ( g\%geoLatT(i,j) ) / dblen}
\DoxyCodeLine{264       \textcolor{keywordflow}{else}}
\DoxyCodeLine{265         x = ( g\%geoLonT(i,j) ) / dblen}
\DoxyCodeLine{266 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{267       \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{268         t(i,j,k)=t\_surf}
\DoxyCodeLine{269 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{270       \textcolor{keywordflow}{if} (x>=0. ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{271         \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{272           s(i,j,k)=s\_surf + 0.5*s\_range}
\DoxyCodeLine{273 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{274 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{275       \textcolor{keywordflow}{if} (x<0. ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{276         \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{277           s(i,j,k)=s\_surf - 0.5*s\_range}
\DoxyCodeLine{278 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{279 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{280 }
\DoxyCodeLine{281 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{282 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{283 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacedumbbell__initialization_a265452b61d468b64683545f2bf0cf2c6}\label{namespacedumbbell__initialization_a265452b61d468b64683545f2bf0cf2c6}} 
\index{dumbbell\_initialization@{dumbbell\_initialization}!dumbbell\_initialize\_thickness@{dumbbell\_initialize\_thickness}}
\index{dumbbell\_initialize\_thickness@{dumbbell\_initialize\_thickness}!dumbbell\_initialization@{dumbbell\_initialization}}
\subsubsection{\texorpdfstring{dumbbell\_initialize\_thickness()}{dumbbell\_initialize\_thickness()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+initialization\+::dumbbell\+\_\+initialize\+\_\+thickness (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(out)}]{h,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{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[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



Initializes the layer thicknesses to be uniform in the dumbbell test case. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ out}}  & {\em h} & The thickness that is being initialized \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
\mbox{\texttt{ in}}  & {\em just\+\_\+read\+\_\+params} & If present and true, this call will only read parameters without changing h. \\
\hline
\end{DoxyParams}


Definition at line 94 of file dumbbell\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{94   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{           !< The ocean's grid structure.}}
\DoxyCodeLine{95   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{          !< The ocean's vertical grid structure.}}
\DoxyCodeLine{96   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{          !< A dimensional unit scaling type}}
\DoxyCodeLine{97 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \&}
\DoxyCodeLine{98                            \textcolor{keywordtype}{intent(out)} :: h\textcolor{comment}{           !< The thickness that is being initialized [H ~> m or kg m-2].}}
\DoxyCodeLine{99   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{  !< A structure indicating the open file}}
\DoxyCodeLine{100 \textcolor{comment}{                                                      !! to parse for model parameter values.}}
\DoxyCodeLine{101   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}}
\DoxyCodeLine{102 \textcolor{comment}{                                                      !! only read parameters without changing h.}}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{keywordtype}{  real} :: e0(SZK\_(G)+1)   \textcolor{comment}{! The resting interface heights [Z ~> m], usually}}
\DoxyCodeLine{105                           \textcolor{comment}{! negative because it is positive upward.}}
\DoxyCodeLine{106 \textcolor{keywordtype}{  real} :: eta1D(SZK\_(G)+1)\textcolor{comment}{! Interface height relative to the sea surface}}
\DoxyCodeLine{107                           \textcolor{comment}{! positive upward [Z ~> m].}}
\DoxyCodeLine{108 \textcolor{keywordtype}{  real} :: min\_thickness   \textcolor{comment}{! The minimum layer thicknesses [Z ~> m].}}
\DoxyCodeLine{109 \textcolor{keywordtype}{  real} :: S\_surf, S\_range, S\_ref, S\_light, S\_dense \textcolor{comment}{! Various salinities [ppt].}}
\DoxyCodeLine{110 \textcolor{keywordtype}{  real} :: eta\_IC\_quanta   \textcolor{comment}{! The granularity of quantization of intial interface heights [Z-1 ~> m-1].}}
\DoxyCodeLine{111   \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{112 \textcolor{preprocessor}{\# include "version\_variable.h"}}
\DoxyCodeLine{113 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=20)} :: verticalCoordinate}
\DoxyCodeLine{114   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{115   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz}
\DoxyCodeLine{116 }
\DoxyCodeLine{117   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{118 }
\DoxyCodeLine{119   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{120 }
\DoxyCodeLine{121   \textcolor{keywordflow}{if} (.not.just\_read) \&}
\DoxyCodeLine{122     \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"MOM\_initialization.F90, initialize\_thickness\_uniform: setting thickness"})}
\DoxyCodeLine{123 }
\DoxyCodeLine{124   \textcolor{keywordflow}{if} (.not.just\_read) \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{125   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"MIN\_THICKNESS"}, min\_thickness, \&}
\DoxyCodeLine{126                 \textcolor{stringliteral}{'Minimum thickness for layer'},\&}
\DoxyCodeLine{127                  units=\textcolor{stringliteral}{'m'}, default=1.0e-3, do\_not\_log=just\_read, scale=us\%m\_to\_Z)}
\DoxyCodeLine{128   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"REGRIDDING\_COORDINATE\_MODE"}, verticalcoordinate, \&}
\DoxyCodeLine{129                  default=default\_coordinate\_mode, do\_not\_log=just\_read)}
\DoxyCodeLine{130 }
\DoxyCodeLine{131   \textcolor{comment}{! WARNING: this routine specifies the interface heights so that the last layer}}
\DoxyCodeLine{132   \textcolor{comment}{!          is vanished, even at maximum depth. In order to have a uniform}}
\DoxyCodeLine{133   \textcolor{comment}{!          layer distribution, use this line of code within the loop:}}
\DoxyCodeLine{134   \textcolor{comment}{!          e0(k) = -G\%max\_depth * real(k-1) / real(nz)}}
\DoxyCodeLine{135   \textcolor{comment}{!          To obtain a thickness distribution where the last layer is}}
\DoxyCodeLine{136   \textcolor{comment}{!          vanished and the other thicknesses uniformly distributed, use:}}
\DoxyCodeLine{137   \textcolor{comment}{!          e0(k) = -G\%max\_depth * real(k-1) / real(nz-1)}}
\DoxyCodeLine{138   \textcolor{comment}{!do k=1,nz+1}}
\DoxyCodeLine{139   \textcolor{comment}{!  e0(k) = -G\%max\_depth * real(k-1) / real(nz)}}
\DoxyCodeLine{140   \textcolor{comment}{!enddo}}
\DoxyCodeLine{141 }
\DoxyCodeLine{142   \textcolor{keywordflow}{select case} ( coordinatemode(verticalcoordinate) )}
\DoxyCodeLine{143 }
\DoxyCodeLine{144   \textcolor{keywordflow}{case} ( regridding\_layer, regridding\_rho ) \textcolor{comment}{! Initial thicknesses for isopycnal coordinates}}
\DoxyCodeLine{145     \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_SSS"}, s\_surf, default=34., do\_not\_log=.true.)}
\DoxyCodeLine{146     \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_S\_RANGE"}, s\_range, default=2., do\_not\_log=.true.)}
\DoxyCodeLine{147     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"S\_REF"}, s\_ref, default=35.0, do\_not\_log=.true.)}
\DoxyCodeLine{148     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_LIGHT"}, s\_light, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{149     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_DENSE"}, s\_dense, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{150     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"INTERFACE\_IC\_QUANTA"}, eta\_ic\_quanta, \&}
\DoxyCodeLine{151                    \textcolor{stringliteral}{"The granularity of initial interface height values "}//\&}
\DoxyCodeLine{152                    \textcolor{stringliteral}{"per meter, to avoid sensivity to order-of-arithmetic changes."}, \&}
\DoxyCodeLine{153                    default=2048.0, units=\textcolor{stringliteral}{"m-1"}, scale=us\%Z\_to\_m, do\_not\_log=just\_read)}
\DoxyCodeLine{154     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{155 }
\DoxyCodeLine{156     \textcolor{keywordflow}{do} k=1,nz+1}
\DoxyCodeLine{157       \textcolor{comment}{! Salinity of layer k is S\_light + (k-1)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{158       \textcolor{comment}{! Salinity of interface K is S\_light + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{159       \textcolor{comment}{! Salinity at depth z should be S(z) = S\_surf - S\_range * z/max\_depth}}
\DoxyCodeLine{160       \textcolor{comment}{! Equating: S\_surf - S\_range * z/max\_depth = S\_light + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{161       \textcolor{comment}{! Equating: - S\_range * z/max\_depth = S\_light - S\_surf + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{162       \textcolor{comment}{! Equating: z/max\_depth = - ( S\_light - S\_surf + (K-3/2)/(nz-1) * (S\_dense - S\_light) ) / S\_range}}
\DoxyCodeLine{163       e0(k) = - g\%max\_depth * ( ( s\_light  - s\_surf ) + ( s\_dense - s\_light ) * \&}
\DoxyCodeLine{164                 ( (real(k)-1.5) / real(nz-1) ) ) / s\_range}
\DoxyCodeLine{165       \textcolor{comment}{! Force round numbers ... the above expression has irrational factors ...}}
\DoxyCodeLine{166       \textcolor{keywordflow}{if} (eta\_ic\_quanta > 0.0) \&}
\DoxyCodeLine{167         e0(k) = nint(eta\_ic\_quanta*e0(k)) / eta\_ic\_quanta}
\DoxyCodeLine{168       e0(k) = min(real(1-k)*gv\%Angstrom\_Z, e0(k)) \textcolor{comment}{! Bound by surface}}
\DoxyCodeLine{169       e0(k) = max(-g\%max\_depth, e0(k)) \textcolor{comment}{! Bound by bottom}}
\DoxyCodeLine{170 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{171     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{172       eta1d(nz+1) = -g\%bathyT(i,j)}
\DoxyCodeLine{173       \textcolor{keywordflow}{do} k=nz,1,-1}
\DoxyCodeLine{174         eta1d(k) = e0(k)}
\DoxyCodeLine{175         \textcolor{keywordflow}{if} (eta1d(k) < (eta1d(k+1) + gv\%Angstrom\_Z)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{176           eta1d(k) = eta1d(k+1) + gv\%Angstrom\_Z}
\DoxyCodeLine{177           h(i,j,k) = gv\%Angstrom\_H}
\DoxyCodeLine{178         \textcolor{keywordflow}{else}}
\DoxyCodeLine{179           h(i,j,k) = gv\%Z\_to\_H * (eta1d(k) - eta1d(k+1))}
\DoxyCodeLine{180 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{181 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{182 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{183 }
\DoxyCodeLine{184   \textcolor{keywordflow}{case} ( regridding\_zstar )                       \textcolor{comment}{! Initial thicknesses for z coordinates}}
\DoxyCodeLine{185     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{186     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{187       eta1d(nz+1) = -g\%bathyT(i,j)}
\DoxyCodeLine{188       \textcolor{keywordflow}{do} k=nz,1,-1}
\DoxyCodeLine{189         eta1d(k) = -g\%max\_depth * real(k-1) / real(nz)}
\DoxyCodeLine{190         \textcolor{keywordflow}{if} (eta1d(k) < (eta1d(k+1) + min\_thickness)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{191           eta1d(k) = eta1d(k+1) + min\_thickness}
\DoxyCodeLine{192           h(i,j,k) = gv\%Z\_to\_H * min\_thickness}
\DoxyCodeLine{193         \textcolor{keywordflow}{else}}
\DoxyCodeLine{194           h(i,j,k) = gv\%Z\_to\_H * (eta1d(k) - eta1d(k+1))}
\DoxyCodeLine{195 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{196 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{197 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{198 }
\DoxyCodeLine{199   \textcolor{keywordflow}{case} ( regridding\_sigma )             \textcolor{comment}{! Initial thicknesses for sigma coordinates}}
\DoxyCodeLine{200     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{201     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{202       h(i,j,:) = gv\%Z\_to\_H * g\%bathyT(i,j) / dfloat(nz)}
\DoxyCodeLine{203 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{204 }
\DoxyCodeLine{205 \textcolor{keywordflow}{end select}}
\DoxyCodeLine{206 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacedumbbell__initialization_aba31e0ec02e4c1c0e5987d8843be5e76}\label{namespacedumbbell__initialization_aba31e0ec02e4c1c0e5987d8843be5e76}} 
\index{dumbbell\_initialization@{dumbbell\_initialization}!dumbbell\_initialize\_topography@{dumbbell\_initialize\_topography}}
\index{dumbbell\_initialize\_topography@{dumbbell\_initialize\_topography}!dumbbell\_initialization@{dumbbell\_initialization}}
\subsubsection{\texorpdfstring{dumbbell\_initialize\_topography()}{dumbbell\_initialize\_topography()}}
{\footnotesize\ttfamily subroutine, public dumbbell\+\_\+initialization\+::dumbbell\+\_\+initialize\+\_\+topography (\begin{DoxyParamCaption}\item[{real, dimension(g\%isd\+:g\%ied,g\%jsd\+:g\%jed), intent(out)}]{D,  }\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{real, intent(in)}]{max\+\_\+depth }\end{DoxyParamCaption})}



Initialization of topography. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The dynamic horizontal grid type \\
\hline
\mbox{\texttt{ out}}  & {\em d} & Ocean bottom depth in the units of depth\+\_\+max \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\hline
\mbox{\texttt{ in}}  & {\em max\+\_\+depth} & Maximum ocean depth in arbitrary units \\
\hline
\end{DoxyParams}


Definition at line 43 of file dumbbell\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{43   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),  \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< The dynamic horizontal grid type}}
\DoxyCodeLine{44 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:G\%ied,G\%jsd:G\%jed)}, \&}
\DoxyCodeLine{45                            \textcolor{keywordtype}{intent(out)} :: D\textcolor{comment}{ !< Ocean bottom depth in the units of depth\_max}}
\DoxyCodeLine{46   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{47 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum ocean depth in arbitrary units}}
\DoxyCodeLine{48 }
\DoxyCodeLine{49   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{50   \textcolor{keywordtype}{integer}   :: i, j}
\DoxyCodeLine{51 \textcolor{keywordtype}{  real}      :: x, y, delta, dblen, dbfrac}
\DoxyCodeLine{52   \textcolor{keywordtype}{logical}   :: dbrotate}
\DoxyCodeLine{53 }
\DoxyCodeLine{54   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_LEN"},dblen, \&}
\DoxyCodeLine{55                 \textcolor{stringliteral}{'Lateral Length scale for dumbbell.'},\&}
\DoxyCodeLine{56                  units=\textcolor{stringliteral}{'k'}, default=600., do\_not\_log=.false.)}
\DoxyCodeLine{57   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"DUMBBELL\_FRACTION"},dbfrac, \&}
\DoxyCodeLine{58                 \textcolor{stringliteral}{'Meridional fraction for narrow part of dumbbell.'},\&}
\DoxyCodeLine{59                  units=\textcolor{stringliteral}{'nondim'}, default=0.5, do\_not\_log=.false.)}
\DoxyCodeLine{60   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DUMBBELL\_ROTATION"}, dbrotate, \&}
\DoxyCodeLine{61                 \textcolor{stringliteral}{'Logical for rotation of dumbbell domain.'},\&}
\DoxyCodeLine{62                  units=\textcolor{stringliteral}{'nondim'}, default=.false., do\_not\_log=.false.)}
\DoxyCodeLine{63 }
\DoxyCodeLine{64   \textcolor{keywordflow}{if} (g\%x\_axis\_units == \textcolor{stringliteral}{'m'}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{65     dblen=dblen*1.e3}
\DoxyCodeLine{66 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{67 }
\DoxyCodeLine{68   \textcolor{keywordflow}{if} (dbrotate) \textcolor{keywordflow}{then}}
\DoxyCodeLine{69     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{70       \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}}
\DoxyCodeLine{71       x = ( g\%geoLonT(i,j) ) / g\%len\_lon}
\DoxyCodeLine{72       y = ( g\%geoLatT(i,j)  ) / dblen}
\DoxyCodeLine{73       d(i,j) = g\%max\_depth}
\DoxyCodeLine{74       \textcolor{keywordflow}{if} ((y>=-0.25 .and. y<=0.25) .and. (x <= -0.5*dbfrac .or. x >= 0.5*dbfrac)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{75         d(i,j) = 0.0}
\DoxyCodeLine{76 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{77 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{78   \textcolor{keywordflow}{else}}
\DoxyCodeLine{79     \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{80       \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}}
\DoxyCodeLine{81       x = ( g\%geoLonT(i,j) ) / dblen}
\DoxyCodeLine{82       y = ( g\%geoLatT(i,j)  ) / g\%len\_lat}
\DoxyCodeLine{83       d(i,j) = g\%max\_depth}
\DoxyCodeLine{84       \textcolor{keywordflow}{if} ((x>=-0.25 .and. x<=0.25) .and. (y <= -0.5*dbfrac .or. y >= 0.5*dbfrac)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{85         d(i,j) = 0.0}
\DoxyCodeLine{86 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{87 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{88 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{89 }

\end{DoxyCode}
