\hypertarget{namespaceneverworld__initialization}{}\doxysection{neverworld\+\_\+initialization Module Reference}
\label{namespaceneverworld__initialization}\index{neverworld\_initialization@{neverworld\_initialization}}


\doxysubsection{Detailed Description}
Initialization for the \char`\"{}\+Neverworld\char`\"{} configuration. \doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespaceneverworld__initialization_a55fbf98c747f8eac649e52ba9c4b7a0f}{neverworld\+\_\+initialize\+\_\+topography}} (D, G, param\+\_\+file, max\+\_\+depth)
\begin{DoxyCompactList}\small\item\em This subroutine sets up the Neverworld test case topography. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a933e6d1f098484f847680acf8a7afde2}{cosbell}} (x, L)
\begin{DoxyCompactList}\small\item\em Returns the value of a cosine-\/bell function evaluated at x/L. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_aa0235fbdd10265375086f1c2f54b9bfd}{spike}} (x, L)
\begin{DoxyCompactList}\small\item\em Returns the value of a sin-\/spike function evaluated at x/L. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a4996a85684224aa2d1247d89965f898e}{cone}} (x, x0, L, clip)
\begin{DoxyCompactList}\small\item\em Returns the value of a triangular function centered at x=x0 with value 1 and linearly decreasing to 0 at x=x0+/-\/L, and 0 otherwise. If clip is present the top of the cone is cut off at \char`\"{}clip\char`\"{}, which effectively defaults to 1. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_abf58f5044ceee8abae5bf44ed3ff9560}{scurve}} (x, x0, L)
\begin{DoxyCompactList}\small\item\em Returns an s-\/curve s(x) s.\+t. s(x0)$<$=0, s(x0+L)$>$=1 and cubic in between. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_ae3527eab32ab2f8760819559aea45c4d}{cstprof}} (x, x0, L, lf, bf, sf, sh)
\begin{DoxyCompactList}\small\item\em Returns a \char`\"{}coastal\char`\"{} profile. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a2f426cd2e8aa8743a31af0a0c620ff54}{dist\+\_\+line\+\_\+fixed\+\_\+x}} (x, y, x0, y0, y1)
\begin{DoxyCompactList}\small\item\em Distance between points x,y and a line segment (x0,y0) and (x0,y1). \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a26e9d9ec42a8940b8e4dda6de549efd6}{dist\+\_\+line\+\_\+fixed\+\_\+y}} (x, y, x0, x1, y0)
\begin{DoxyCompactList}\small\item\em Distance between points x,y and a line segment (x0,y0) and (x1,y0). \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_ad5791672629c93f5f2be778bb3debc89}{ns\+\_\+coast}} (lon, lat, lon0, lat0, lat1, dlon, sh)
\begin{DoxyCompactList}\small\item\em A \char`\"{}coast profile\char`\"{} applied in an N-\/S line from lon0,lat0 to lon0,lat1. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a8ec57ac79a5282b36ccbff978801d81c}{ew\+\_\+coast}} (lon, lat, lon0, lon1, lat0, dlat, sh)
\begin{DoxyCompactList}\small\item\em A \char`\"{}coast profile\char`\"{} applied in an E-\/W line from lon0,lat0 to lon1,lat0. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a1f10b06fdf590379008f20ce04b324ab}{ns\+\_\+ridge}} (lon, lat, lon0, lat0, lat1, dlon, rh)
\begin{DoxyCompactList}\small\item\em A NS ridge. \end{DoxyCompactList}\item 
real function \mbox{\hyperlink{namespaceneverworld__initialization_a7d1e026dddd2c9577bac91dc49260b13}{circ\+\_\+ridge}} (lon, lat, lon0, lat0, ring\+\_\+radius, ring\+\_\+thickness, ridge\+\_\+height)
\begin{DoxyCompactList}\small\item\em A circular ridge. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceneverworld__initialization_a9eb8a6fcc00e356d719df93412e54e73}{neverworld\+\_\+initialize\+\_\+thickness}} (h, G, GV, US, param\+\_\+file, eqn\+\_\+of\+\_\+state, P\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine initializes layer thicknesses for the Neverworld test case, by finding the depths of interfaces in a specified latitude-\/dependent temperature profile with an exponentially decaying thermocline on top of a linear stratification. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespaceneverworld__initialization_a7d1e026dddd2c9577bac91dc49260b13}\label{namespaceneverworld__initialization_a7d1e026dddd2c9577bac91dc49260b13}} 
\index{neverworld\_initialization@{neverworld\_initialization}!circ\_ridge@{circ\_ridge}}
\index{circ\_ridge@{circ\_ridge}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{circ\_ridge()}{circ\_ridge()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::circ\+\_\+ridge (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lon0,  }\item[{real, intent(in)}]{lat0,  }\item[{real, intent(in)}]{ring\+\_\+radius,  }\item[{real, intent(in)}]{ring\+\_\+thickness,  }\item[{real, intent(in)}]{ridge\+\_\+height }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



A circular ridge. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lon0} & Longitude of center of ring \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat0} & Latitude of center of ring \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em ring\+\_\+radius} & Radius of ring \mbox{[}degrees\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em ring\+\_\+thickness} & Radial thickness of ring \mbox{[}degrees\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em ridge\+\_\+height} & Ridge height as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 222 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{223 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{            !< Longitude [degrees\_E]}}
\DoxyCodeLine{224 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{            !< Latitude [degrees\_N]}}
\DoxyCodeLine{225 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{           !< Longitude of center of ring [degrees\_E]}}
\DoxyCodeLine{226 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{           !< Latitude of center of ring [degrees\_N]}}
\DoxyCodeLine{227 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ring\_radius\textcolor{comment}{    !< Radius of ring [degrees]}}
\DoxyCodeLine{228 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ring\_thickness\textcolor{comment}{ !< Radial thickness of ring [degrees]}}
\DoxyCodeLine{229 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ridge\_height\textcolor{comment}{   !< Ridge height as fraction of full depth [nondim]}}
\DoxyCodeLine{230 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{231 }
\DoxyCodeLine{232   r = sqrt( (lon -\/ lon0)**2 + (lat -\/ lat0)**2 ) \textcolor{comment}{! Pseudo-\/distance from a point}}
\DoxyCodeLine{233   r = abs( r -\/ ring\_radius) \textcolor{comment}{! Pseudo-\/distance from a circle}}
\DoxyCodeLine{234   r = cone(r, 0., ring\_thickness, ridge\_height) \textcolor{comment}{! 0 .. frac\_ridge\_height}}
\DoxyCodeLine{235   circ\_ridge = 1. -\/ r \textcolor{comment}{! nondim depths (1-\/frac\_ridge\_height) .. 1}}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a4996a85684224aa2d1247d89965f898e}\label{namespaceneverworld__initialization_a4996a85684224aa2d1247d89965f898e}} 
\index{neverworld\_initialization@{neverworld\_initialization}!cone@{cone}}
\index{cone@{cone}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{cone()}{cone()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::cone (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{x0,  }\item[{real, intent(in)}]{L,  }\item[{real, intent(in), optional}]{clip }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns the value of a triangular function centered at x=x0 with value 1 and linearly decreasing to 0 at x=x0+/-\/L, and 0 otherwise. If clip is present the top of the cone is cut off at \char`\"{}clip\char`\"{}, which effectively defaults to 1. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em l} & half-\/width of base of cone \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em clip} & clipping height of cone \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 112 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{113 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{    !< non-\/dimensional coordinate [nondim]}}
\DoxyCodeLine{114 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{   !< position of peak [nondim]}}
\DoxyCodeLine{115 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{    !< half-\/width of base of cone [nondim]}}
\DoxyCodeLine{116 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: clip\textcolor{comment}{ !< clipping height of cone [nondim]}}
\DoxyCodeLine{117 }
\DoxyCodeLine{118   cone = max( 0., 1. -\/ abs(x -\/ x0) / l )}
\DoxyCodeLine{119   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clip)) cone = min(clip, cone)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a933e6d1f098484f847680acf8a7afde2}\label{namespaceneverworld__initialization_a933e6d1f098484f847680acf8a7afde2}} 
\index{neverworld\_initialization@{neverworld\_initialization}!cosbell@{cosbell}}
\index{cosbell@{cosbell}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{cosbell()}{cosbell()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::cosbell (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{L }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns the value of a cosine-\/bell function evaluated at x/L. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional position \\
\hline
\mbox{\texttt{ in}}  & {\em l} & non-\/dimensional width \\
\hline
\end{DoxyParams}


Definition at line 88 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{89 \textcolor{keywordtype}{  real} , \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional position}}
\DoxyCodeLine{90 \textcolor{keywordtype}{  real} , \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{       !< non-\/dimensional width}}
\DoxyCodeLine{91 \textcolor{keywordtype}{  real}              :: PI\textcolor{comment}{      !< 3.1415926... calculated as 4*atan(1)}}
\DoxyCodeLine{92 }
\DoxyCodeLine{93   pi      = 4.0*atan(1.0)}
\DoxyCodeLine{94   cosbell = 0.5 * (1 + cos(pi*min(abs(x/l),1.0)))}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_ae3527eab32ab2f8760819559aea45c4d}\label{namespaceneverworld__initialization_ae3527eab32ab2f8760819559aea45c4d}} 
\index{neverworld\_initialization@{neverworld\_initialization}!cstprof@{cstprof}}
\index{cstprof@{cstprof}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{cstprof()}{cstprof()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::cstprof (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{x0,  }\item[{real, intent(in)}]{L,  }\item[{real, intent(in)}]{lf,  }\item[{real, intent(in)}]{bf,  }\item[{real, intent(in)}]{sf,  }\item[{real, intent(in)}]{sh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns a \char`\"{}coastal\char`\"{} profile. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em l} & width of profile \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lf} & fraction of width that is \char`\"{}land\char`\"{} \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em bf} & fraction of width that is \char`\"{}beach\char`\"{} \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em sf} & fraction of width that is \char`\"{}continental slope\char`\"{} \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em sh} & depth of shelf as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 134 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{135 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional coordinate [nondim]}}
\DoxyCodeLine{136 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}}
\DoxyCodeLine{137 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{       !< width of profile [nondim]}}
\DoxyCodeLine{138 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lf\textcolor{comment}{      !< fraction of width that is "{}land"{} [nondim]}}
\DoxyCodeLine{139 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: bf\textcolor{comment}{      !< fraction of width that is "{}beach"{} [nondim]}}
\DoxyCodeLine{140 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sf\textcolor{comment}{      !< fraction of width that is "{}continental slope"{} [nondim]}}
\DoxyCodeLine{141 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{142 \textcolor{keywordtype}{  real} :: s}
\DoxyCodeLine{143 }
\DoxyCodeLine{144   s = max( 0., min( 1.,( x -\/ x0 ) / l ) )}
\DoxyCodeLine{145   cstprof = sh * scurve(s-\/lf,0.,bf) + (1.-\/sh) * scurve(s -\/ (1.-\/sf),0.,sf)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a2f426cd2e8aa8743a31af0a0c620ff54}\label{namespaceneverworld__initialization_a2f426cd2e8aa8743a31af0a0c620ff54}} 
\index{neverworld\_initialization@{neverworld\_initialization}!dist\_line\_fixed\_x@{dist\_line\_fixed\_x}}
\index{dist\_line\_fixed\_x@{dist\_line\_fixed\_x}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{dist\_line\_fixed\_x()}{dist\_line\_fixed\_x()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::dist\+\_\+line\+\_\+fixed\+\_\+x (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{y,  }\item[{real, intent(in)}]{x0,  }\item[{real, intent(in)}]{y0,  }\item[{real, intent(in)}]{y1 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Distance between points x,y and a line segment (x0,y0) and (x0,y1). 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional x-\/coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em y} & non-\/dimensional y-\/coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x0} & x-\/position of line segment \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em y0} & y-\/position of line segment end\mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em y1} & y-\/position of line segment end\mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 149 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{150 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional x-\/coordinate [nondim]}}
\DoxyCodeLine{151 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-\/dimensional y-\/coordinate [nondim]}}
\DoxyCodeLine{152 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-\/position of line segment [nondim]}}
\DoxyCodeLine{153 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-\/position of line segment end[nondim]}}
\DoxyCodeLine{154 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y1\textcolor{comment}{      !< y-\/position of line segment end[nondim]}}
\DoxyCodeLine{155 \textcolor{keywordtype}{  real} :: dx, yr, dy}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   dx = x -\/ x0}
\DoxyCodeLine{158   yr = min( max(y0,y1), max( min(y0,y1), y ) ) \textcolor{comment}{! bound y by y0,y1}}
\DoxyCodeLine{159   dy = y -\/ yr \textcolor{comment}{! =0 within y0<y<y1, =y0-\/y for y<y0, =y-\/y1 for y>y1}}
\DoxyCodeLine{160   dist\_line\_fixed\_x = sqrt( dx*dx + dy*dy )}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a26e9d9ec42a8940b8e4dda6de549efd6}\label{namespaceneverworld__initialization_a26e9d9ec42a8940b8e4dda6de549efd6}} 
\index{neverworld\_initialization@{neverworld\_initialization}!dist\_line\_fixed\_y@{dist\_line\_fixed\_y}}
\index{dist\_line\_fixed\_y@{dist\_line\_fixed\_y}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{dist\_line\_fixed\_y()}{dist\_line\_fixed\_y()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::dist\+\_\+line\+\_\+fixed\+\_\+y (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{y,  }\item[{real, intent(in)}]{x0,  }\item[{real, intent(in)}]{x1,  }\item[{real, intent(in)}]{y0 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Distance between points x,y and a line segment (x0,y0) and (x1,y0). 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional x-\/coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em y} & non-\/dimensional y-\/coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x0} & x-\/position of line segment end\mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x1} & x-\/position of line segment end\mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em y0} & y-\/position of line segment \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 164 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{165 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional x-\/coordinate [nondim]}}
\DoxyCodeLine{166 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-\/dimensional y-\/coordinate [nondim]}}
\DoxyCodeLine{167 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-\/position of line segment end[nondim]}}
\DoxyCodeLine{168 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x1\textcolor{comment}{      !< x-\/position of line segment end[nondim]}}
\DoxyCodeLine{169 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-\/position of line segment [nondim]}}
\DoxyCodeLine{170 \textcolor{keywordtype}{  real} :: dx, yr, dy}
\DoxyCodeLine{171 }
\DoxyCodeLine{172   dist\_line\_fixed\_y = dist\_line\_fixed\_x(y, x, y0, x0, x1)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a8ec57ac79a5282b36ccbff978801d81c}\label{namespaceneverworld__initialization_a8ec57ac79a5282b36ccbff978801d81c}} 
\index{neverworld\_initialization@{neverworld\_initialization}!ew\_coast@{ew\_coast}}
\index{ew\_coast@{ew\_coast}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{ew\_coast()}{ew\_coast()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::ew\+\_\+coast (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lon0,  }\item[{real, intent(in)}]{lon1,  }\item[{real, intent(in)}]{lat0,  }\item[{real, intent(in)}]{dlat,  }\item[{real, intent(in)}]{sh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



A \char`\"{}coast profile\char`\"{} applied in an E-\/W line from lon0,lat0 to lon1,lat0. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lon0} & Longitude of coast end \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lon1} & Longitude of coast end \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat0} & Latitude of coast \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em dlat} & \char`\"{}\+Radius\char`\"{} of coast profile \mbox{[}degrees\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em sh} & depth of shelf as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 191 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{192 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{193 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{194 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}}
\DoxyCodeLine{195 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon1\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}}
\DoxyCodeLine{196 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast [degrees\_N]}}
\DoxyCodeLine{197 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlat\textcolor{comment}{    !< "{}Radius"{} of coast profile [degrees]}}
\DoxyCodeLine{198 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{199 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{200 }
\DoxyCodeLine{201   r = dist\_line\_fixed\_y( lon, lat, lon0, lon1, lat0 )}
\DoxyCodeLine{202   ew\_coast = cstprof(r, 0., dlat, 0.125, 0.125, 0.5, sh)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a9eb8a6fcc00e356d719df93412e54e73}\label{namespaceneverworld__initialization_a9eb8a6fcc00e356d719df93412e54e73}} 
\index{neverworld\_initialization@{neverworld\_initialization}!neverworld\_initialize\_thickness@{neverworld\_initialize\_thickness}}
\index{neverworld\_initialize\_thickness@{neverworld\_initialize\_thickness}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{neverworld\_initialize\_thickness()}{neverworld\_initialize\_thickness()}}
{\footnotesize\ttfamily subroutine, public neverworld\+\_\+initialization\+::neverworld\+\_\+initialize\+\_\+thickness (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(out)}]{h,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}}), pointer}]{eqn\+\_\+of\+\_\+state,  }\item[{real, intent(in)}]{P\+\_\+ref }\end{DoxyParamCaption})}



This subroutine initializes layer thicknesses for the Neverworld test case, by finding the depths of interfaces in a specified latitude-\/dependent temperature profile with an exponentially decaying thermocline on top of a linear stratification. 


\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
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure \\
\hline
\mbox{\texttt{ in}}  & {\em p\+\_\+ref} & The coordinate-\/density reference pressure \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 242 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{243   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{                    !< The ocean's grid structure.}}
\DoxyCodeLine{244   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{                   !< The ocean's vertical grid structure.}}
\DoxyCodeLine{245   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{                   !< A dimensional unit scaling type}}
\DoxyCodeLine{246 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))} :: h\textcolor{comment}{ !< The thickness that is being}}
\DoxyCodeLine{247 \textcolor{comment}{                                                              !! initialized [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{248   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{           !< A structure indicating the open}}
\DoxyCodeLine{249 \textcolor{comment}{                                                              !! file to parse for model}}
\DoxyCodeLine{250 \textcolor{comment}{                                                              !! parameter values.}}
\DoxyCodeLine{251   \textcolor{keywordtype}{type}(EOS\_type),          \textcolor{keywordtype}{pointer}    :: eqn\_of\_state\textcolor{comment}{         !< Equation of state structure}}
\DoxyCodeLine{252 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)} :: P\_Ref\textcolor{comment}{                !< The coordinate-\/density}}
\DoxyCodeLine{253 \textcolor{comment}{                                                              !! reference pressure [R L2 T-\/2 \string~> Pa].}}
\DoxyCodeLine{254   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{255 \textcolor{keywordtype}{  real} :: e0(SZK\_(G)+1)     \textcolor{comment}{! The resting interface heights, in depth units [Z \string~> m],}}
\DoxyCodeLine{256                             \textcolor{comment}{! usually negative because it is positive upward.}}
\DoxyCodeLine{257 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZK\_(G))} :: h\_profile \textcolor{comment}{! Vector of initial thickness profile [Z \string~> m].}}
\DoxyCodeLine{258 \textcolor{keywordtype}{  real} :: e\_interface \textcolor{comment}{! Current interface position [Z \string~> m].}}
\DoxyCodeLine{259 \textcolor{keywordtype}{  real} :: x,y,r1,r2 \textcolor{comment}{! x,y and radial coordinates for computation of initial pert.}}
\DoxyCodeLine{260 \textcolor{keywordtype}{  real} :: pert\_amp \textcolor{comment}{! Amplitude of perturbations measured in Angstrom\_H}}
\DoxyCodeLine{261 \textcolor{keywordtype}{  real} :: h\_noise \textcolor{comment}{! Amplitude of noise to scale h by}}
\DoxyCodeLine{262 \textcolor{keywordtype}{  real} :: noise \textcolor{comment}{! Noise}}
\DoxyCodeLine{263   \textcolor{keywordtype}{type}(randomNumberStream) :: rns \textcolor{comment}{! Random numbers for stochastic tidal parameterization}}
\DoxyCodeLine{264   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}Neverworld\_initialize\_thickness"{}} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{265   \textcolor{keywordtype}{integer} :: i, j, k, k1, is, ie, js, je, nz, itt}
\DoxyCodeLine{266 }
\DoxyCodeLine{267   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{268 }
\DoxyCodeLine{269   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"{}  Neverworld\_initialization.F90, Neverworld\_initialize\_thickness: setting thickness"{}}, 5)}
\DoxyCodeLine{270   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}INIT\_THICKNESS\_PROFILE"{}}, h\_profile, \&}
\DoxyCodeLine{271                  \textcolor{stringliteral}{"{}Profile of initial layer thicknesses."{}}, units=\textcolor{stringliteral}{"{}m"{}}, scale=us\%m\_to\_Z, \&}
\DoxyCodeLine{272                  fail\_if\_missing=.true.)}
\DoxyCodeLine{273   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}NL\_THICKNESS\_PERT\_AMP"{}}, pert\_amp, \&}
\DoxyCodeLine{274                  \textcolor{stringliteral}{"{}Amplitude of finite scale perturbations as fraction of depth."{}}, \&}
\DoxyCodeLine{275                  units=\textcolor{stringliteral}{"{}nondim"{}}, default=0.)}
\DoxyCodeLine{276   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}NL\_THICKNESS\_NOISE\_AMP"{}}, h\_noise, \&}
\DoxyCodeLine{277                  \textcolor{stringliteral}{"{}Amplitude of noise to scale layer by."{}}, units=\textcolor{stringliteral}{"{}nondim"{}}, default=0.)}
\DoxyCodeLine{278 }
\DoxyCodeLine{279   \textcolor{comment}{! e0 is the notional position of interfaces}}
\DoxyCodeLine{280   e0(1) = 0. \textcolor{comment}{! The surface}}
\DoxyCodeLine{281   \textcolor{keywordflow}{do} k=1,nz}
\DoxyCodeLine{282     e0(k+1) = e0(k) -\/ h\_profile(k)}
\DoxyCodeLine{283 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{284 }
\DoxyCodeLine{285   \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{286     e\_interface = -\/g\%bathyT(i,j)}
\DoxyCodeLine{287     \textcolor{keywordflow}{do} k=nz,2,-\/1}
\DoxyCodeLine{288       h(i,j,k) = gv\%Z\_to\_H * (e0(k) -\/ e\_interface) \textcolor{comment}{! Nominal thickness}}
\DoxyCodeLine{289       x=(g\%geoLonT(i,j)-\/g\%west\_lon)/g\%len\_lon}
\DoxyCodeLine{290       y=(g\%geoLatT(i,j)-\/g\%south\_lat)/g\%len\_lat}
\DoxyCodeLine{291       r1=sqrt((x-\/0.7)**2+(y-\/0.2)**2)}
\DoxyCodeLine{292       r2=sqrt((x-\/0.3)**2+(y-\/0.25)**2)}
\DoxyCodeLine{293       h(i,j,k) = h(i,j,k) + pert\_amp * (e0(k) -\/ e0(nz+1)) * gv\%Z\_to\_H * \&}
\DoxyCodeLine{294                             (spike(r1,0.15)-\/spike(r2,0.15)) \textcolor{comment}{! Prescribed perturbation}}
\DoxyCodeLine{295       \textcolor{keywordflow}{if} (h\_noise /= 0.) \textcolor{keywordflow}{then}}
\DoxyCodeLine{296         rns = initializerandomnumberstream( int( 4096*(x + (y+1.)) ) )}
\DoxyCodeLine{297         \textcolor{keyword}{call }getrandomnumbers(rns, noise) \textcolor{comment}{! x will be in (0,1)}}
\DoxyCodeLine{298         noise = h\_noise * 2. * ( noise -\/ 0.5 ) \textcolor{comment}{! range -\/h\_noise to h\_noise}}
\DoxyCodeLine{299         h(i,j,k) = ( 1. + noise ) * h(i,j,k)}
\DoxyCodeLine{300 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{301       h(i,j,k) = max( gv\%Angstrom\_H, h(i,j,k) ) \textcolor{comment}{! Limit to non-\/negative}}
\DoxyCodeLine{302       e\_interface = e\_interface + gv\%H\_to\_Z * h(i,j,k) \textcolor{comment}{! Actual position of upper interface}}
\DoxyCodeLine{303 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{304     h(i,j,1) = gv\%Z\_to\_H * (e0(1) -\/ e\_interface) \textcolor{comment}{! Nominal thickness}}
\DoxyCodeLine{305     h(i,j,1) = max( gv\%Angstrom\_H, h(i,j,1) ) \textcolor{comment}{! Limit to non-\/negative}}
\DoxyCodeLine{306 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{307 }

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



This subroutine sets up the Neverworld test case 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 35 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{36   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),  \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< The dynamic horizontal grid type}}
\DoxyCodeLine{37 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:G\%ied,G\%jsd:G\%jed)}, \&}
\DoxyCodeLine{38                            \textcolor{keywordtype}{intent(out)} :: D\textcolor{comment}{ !< Ocean bottom depth in the units of depth\_max}}
\DoxyCodeLine{39   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{40 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum ocean depth in arbitrary units}}
\DoxyCodeLine{41 }
\DoxyCodeLine{42   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{43 \textcolor{keywordtype}{  real} :: PI                   \textcolor{comment}{! 3.1415926... calculated as 4*atan(1)}}
\DoxyCodeLine{44 \textcolor{keywordtype}{  real} :: D0                   \textcolor{comment}{! A constant to make the maximum     !}}
\DoxyCodeLine{45                                \textcolor{comment}{! basin depth MAXIMUM\_DEPTH.         !}}
\DoxyCodeLine{46 \textcolor{keywordtype}{  real} :: x, y}
\DoxyCodeLine{47   \textcolor{comment}{! This include declares and sets the variable "{}version"{}.}}
\DoxyCodeLine{48 \textcolor{preprocessor}{\# include "{}version\_variable.h"{}}}
\DoxyCodeLine{49 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}Neverworld\_initialize\_topography"{}} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{50   \textcolor{keywordtype}{integer} :: i, j, is, ie, js, je, isd, ied, jsd, jed}
\DoxyCodeLine{51 \textcolor{keywordtype}{  real} :: nl\_roughness\_amp, nl\_top\_amp}
\DoxyCodeLine{52   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec}
\DoxyCodeLine{53   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{54 }
\DoxyCodeLine{55   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"{}  Neverworld\_initialization.F90, Neverworld\_initialize\_topography: setting topography"{}}, 5)}
\DoxyCodeLine{56 }
\DoxyCodeLine{57   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{"{}"{}})}
\DoxyCodeLine{58   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}NL\_ROUGHNESS\_AMP"{}}, nl\_roughness\_amp, \&}
\DoxyCodeLine{59                  \textcolor{stringliteral}{"{}Amplitude of wavy signal in bathymetry."{}}, default=0.05)}
\DoxyCodeLine{60   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}NL\_CONTINENT\_AMP"{}}, nl\_top\_amp, \&}
\DoxyCodeLine{61                  \textcolor{stringliteral}{"{}Scale factor for topography -\/ 0.0 for no continents."{}}, default=1.0)}
\DoxyCodeLine{62 }
\DoxyCodeLine{63   pi = 4.0*atan(1.0)}
\DoxyCodeLine{64 }
\DoxyCodeLine{65 \textcolor{comment}{!  Calculate the depth of the bottom.}}
\DoxyCodeLine{66   \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{67     x = (g\%geoLonT(i,j)-\/g\%west\_lon) / g\%len\_lon}
\DoxyCodeLine{68     y =( g\%geoLatT(i,j)-\/g\%south\_lat) / g\%len\_lat}
\DoxyCodeLine{69 \textcolor{comment}{!  This sets topography that has a reentrant channel to the south.}}
\DoxyCodeLine{70     d(i,j) = 1.0 -\/ 1.1 * spike(y-\/1,0.12) -\/ 1.1 * spike(y,0.12) -\/ \& \textcolor{comment}{!< The great northern wall and Antarctica}}
\DoxyCodeLine{71               nl\_top\_amp*( \&}
\DoxyCodeLine{72                 (1.2 * spike(x,0.2) + 1.2 * spike(x-\/1.0,0.2)) * spike(min(0.0,y-\/0.3),0.2) \& \textcolor{comment}{!< South America}}
\DoxyCodeLine{73               +  1.2 * spike(x-\/0.5,0.2) * spike(min(0.0,y-\/0.55),0.2)       \& \textcolor{comment}{!< Africa}}
\DoxyCodeLine{74               +  1.2 * (spike(x,0.12)  + spike(x-\/1,0.12)) * spike(max(0.0,y-\/0.06),0.12)    \& \textcolor{comment}{!< Antarctic Peninsula}}
\DoxyCodeLine{75               +  0.1 * (cosbell(x,0.1) + cosbell(x-\/1,0.1))                 \& \textcolor{comment}{!< Drake Passage ridge}}
\DoxyCodeLine{76               +  0.5 * cosbell(x-\/0.16,0.05) * (cosbell(y-\/0.18,0.13)**0.4)  \& \textcolor{comment}{!< Scotia Arc East}}
\DoxyCodeLine{77               +  0.4 * (cosbell(x-\/0.09,0.08)**0.4) * cosbell(y-\/0.26,0.05)  \& \textcolor{comment}{!< Scotia Arc North}}
\DoxyCodeLine{78               +  0.4 * (cosbell(x-\/0.08,0.08)**0.4) * cosbell(y-\/0.1,0.05))   \& \textcolor{comment}{!< Scotia Arc South}}
\DoxyCodeLine{79               -\/  nl\_roughness\_amp * cos(14*pi*x) * sin(14*pi*y)            \& \textcolor{comment}{!< roughness}}
\DoxyCodeLine{80               -\/  nl\_roughness\_amp * cos(20*pi*x) * cos(20*pi*y)              \textcolor{comment}{!< roughness}}
\DoxyCodeLine{81     \textcolor{keywordflow}{if} (d(i,j) < 0.0) d(i,j) = 0.0}
\DoxyCodeLine{82     d(i,j) = d(i,j) * max\_depth}
\DoxyCodeLine{83 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{84 }

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_ad5791672629c93f5f2be778bb3debc89}\label{namespaceneverworld__initialization_ad5791672629c93f5f2be778bb3debc89}} 
\index{neverworld\_initialization@{neverworld\_initialization}!ns\_coast@{ns\_coast}}
\index{ns\_coast@{ns\_coast}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{ns\_coast()}{ns\_coast()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::ns\+\_\+coast (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lon0,  }\item[{real, intent(in)}]{lat0,  }\item[{real, intent(in)}]{lat1,  }\item[{real, intent(in)}]{dlon,  }\item[{real, intent(in)}]{sh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



A \char`\"{}coast profile\char`\"{} applied in an N-\/S line from lon0,lat0 to lon0,lat1. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lon0} & Longitude of coast \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat0} & Latitude of coast end \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat1} & Latitude of coast end \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em dlon} & \char`\"{}\+Radius\char`\"{} of coast profile \mbox{[}degrees\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em sh} & depth of shelf as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 176 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{177 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{178 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{179 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast [degrees\_E]}}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}}
\DoxyCodeLine{181 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}}
\DoxyCodeLine{182 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "{}Radius"{} of coast profile [degrees]}}
\DoxyCodeLine{183 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{184 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{185 }
\DoxyCodeLine{186   r = dist\_line\_fixed\_x( lon, lat, lon0, lat0, lat1 )}
\DoxyCodeLine{187   ns\_coast = cstprof(r, 0., dlon, 0.125, 0.125, 0.5, sh)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_a1f10b06fdf590379008f20ce04b324ab}\label{namespaceneverworld__initialization_a1f10b06fdf590379008f20ce04b324ab}} 
\index{neverworld\_initialization@{neverworld\_initialization}!ns\_ridge@{ns\_ridge}}
\index{ns\_ridge@{ns\_ridge}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{ns\_ridge()}{ns\_ridge()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::ns\+\_\+ridge (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lon0,  }\item[{real, intent(in)}]{lat0,  }\item[{real, intent(in)}]{lat1,  }\item[{real, intent(in)}]{dlon,  }\item[{real, intent(in)}]{rh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



A NS ridge. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lon0} & Longitude of ridge center \mbox{[}degrees\+\_\+E\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat0} & Latitude of ridge end \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em lat1} & Latitude of ridge end \mbox{[}degrees\+\_\+N\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em dlon} & \char`\"{}\+Radius\char`\"{} of ridge profile \mbox{[}degrees\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em rh} & depth of ridge as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 206 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{207 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{208 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{209 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}}
\DoxyCodeLine{210 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{211 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{212 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "{}Radius"{} of ridge profile [degrees]}}
\DoxyCodeLine{213 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}}
\DoxyCodeLine{214 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{215 }
\DoxyCodeLine{216   r = dist\_line\_fixed\_x( lon, lat, lon0, lat0, lat1 )}
\DoxyCodeLine{217   ns\_ridge = 1. -\/ rh * cone(r, 0., dlon)}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_abf58f5044ceee8abae5bf44ed3ff9560}\label{namespaceneverworld__initialization_abf58f5044ceee8abae5bf44ed3ff9560}} 
\index{neverworld\_initialization@{neverworld\_initialization}!scurve@{scurve}}
\index{scurve@{scurve}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{scurve()}{scurve()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::scurve (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{x0,  }\item[{real, intent(in)}]{L }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns an s-\/curve s(x) s.\+t. s(x0)$<$=0, s(x0+L)$>$=1 and cubic in between. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em l} & half-\/width of base of cone \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 123 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{124 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional coordinate [nondim]}}
\DoxyCodeLine{125 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}}
\DoxyCodeLine{126 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{       !< half-\/width of base of cone [nondim]}}
\DoxyCodeLine{127 \textcolor{keywordtype}{  real} :: s}
\DoxyCodeLine{128 }
\DoxyCodeLine{129   s = max( 0., min( 1.,( x -\/ x0 ) / l ) )}
\DoxyCodeLine{130   scurve = ( 3. -\/ 2.*s ) * ( s * s )}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceneverworld__initialization_aa0235fbdd10265375086f1c2f54b9bfd}\label{namespaceneverworld__initialization_aa0235fbdd10265375086f1c2f54b9bfd}} 
\index{neverworld\_initialization@{neverworld\_initialization}!spike@{spike}}
\index{spike@{spike}!neverworld\_initialization@{neverworld\_initialization}}
\doxysubsubsection{\texorpdfstring{spike()}{spike()}}
{\footnotesize\ttfamily real function neverworld\+\_\+initialization\+::spike (\begin{DoxyParamCaption}\item[{real, intent(in)}]{x,  }\item[{real, intent(in)}]{L }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns the value of a sin-\/spike function evaluated at x/L. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em x} & non-\/dimensional position \\
\hline
\mbox{\texttt{ in}}  & {\em l} & non-\/dimensional width \\
\hline
\end{DoxyParams}


Definition at line 98 of file Neverworld\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{99 }
\DoxyCodeLine{100 \textcolor{keywordtype}{  real} , \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-\/dimensional position}}
\DoxyCodeLine{101 \textcolor{keywordtype}{  real} , \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{       !< non-\/dimensional width}}
\DoxyCodeLine{102 \textcolor{keywordtype}{  real}              :: PI\textcolor{comment}{      !< 3.1415926... calculated as 4*atan(1)}}
\DoxyCodeLine{103 }
\DoxyCodeLine{104   pi    = 4.0*atan(1.0)}
\DoxyCodeLine{105   spike = (1 -\/ sin(pi*min(abs(x/l),0.5)))}

\end{DoxyCode}
