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


\subsection{Detailed Description}
Initialization for the \char`\"{}\+Neverworld\char`\"{} configuration. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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}


\subsection{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}}
\subsubsection{\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{\tt in}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lon0} & Longitude of center of ring \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat0} & Latitude of center of ring \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em ring\+\_\+radius} & Radius of ring \mbox{[}degrees\mbox{]}\\
\hline
\mbox{\tt in}  & {\em ring\+\_\+thickness} & Radial thickness of ring \mbox{[}degrees\mbox{]}\\
\hline
\mbox{\tt in}  & {\em ridge\+\_\+height} & Ridge height as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
223   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{            !< Longitude [degrees\_E]}
224   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{            !< Latitude [degrees\_N]}
225   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{           !< Longitude of center of ring [degrees\_E]}
226   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{           !< Latitude of center of ring [degrees\_N]}
227   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_radius\textcolor{comment}{    !< Radius of ring [degrees]}
228   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_thickness\textcolor{comment}{ !< Radial thickness of ring [degrees]}
229   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ridge\_height\textcolor{comment}{   !< Ridge height as fraction of full depth [nondim]}
230   \textcolor{keywordtype}{real} :: r
231 
232   r = sqrt( (lon - lon0)**2 + (lat - lat0)**2 ) \textcolor{comment}{! Pseudo-distance from a point}
233   r = abs( r - ring\_radius) \textcolor{comment}{! Pseudo-distance from a circle}
234   r = cone(r, 0., ring\_thickness, ridge\_height) \textcolor{comment}{! 0 .. frac\_ridge\_height}
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em l} & half-\/width of base of cone \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em clip} & clipping height of cone \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
113   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{    !< non-dimensional coordinate [nondim]}
114   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{   !< position of peak [nondim]}
115   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{    !< half-width of base of cone [nondim]}
116   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: clip\textcolor{comment}{ !< clipping height of cone [nondim]}
117 
118   cone = max( 0., 1. - abs(x - x0) / l )
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional position\\
\hline
\mbox{\tt in}  & {\em l} & non-\/dimensional width \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
89   \textcolor{keywordtype}{real} , \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional position}
90   \textcolor{keywordtype}{real} , \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{       !< non-dimensional width}
91   \textcolor{keywordtype}{real}              :: pi\textcolor{comment}{      !< 3.1415926... calculated as 4*atan(1)}
92 
93   pi      = 4.0*atan(1.0)
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em l} & width of profile \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lf} & fraction of width that is \char`\"{}land\char`\"{} \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em bf} & fraction of width that is \char`\"{}beach\char`\"{} \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em sf} & fraction of width that is \char`\"{}continental slope\char`\"{} \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em sh} & depth of shelf as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
135   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional coordinate [nondim]}
136   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}
137   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{       !< width of profile [nondim]}
138   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lf\textcolor{comment}{      !< fraction of width that is "land" [nondim]}
139   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: bf\textcolor{comment}{      !< fraction of width that is "beach" [nondim]}
140   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sf\textcolor{comment}{      !< fraction of width that is "continental slope" [nondim]}
141   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
142   \textcolor{keywordtype}{real} :: s
143 
144   s = max( 0., min( 1.,( x - x0 ) / l ) )
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional x-\/coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em y} & non-\/dimensional y-\/coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x0} & x-\/position of line segment \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em y0} & y-\/position of line segment end\mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em y1} & y-\/position of line segment end\mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
150   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}
151   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}
152   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment [nondim]}
153   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment end[nondim]}
154   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y1\textcolor{comment}{      !< y-position of line segment end[nondim]}
155   \textcolor{keywordtype}{real} :: dx, yr, dy
156 
157   dx = x - x0
158   yr = min( max(y0,y1), max( min(y0,y1), y ) ) \textcolor{comment}{! bound y by y0,y1}
159   dy = y - yr \textcolor{comment}{! =0 within y0<y<y1, =y0-y for y<y0, =y-y1 for y>y1}
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional x-\/coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em y} & non-\/dimensional y-\/coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x0} & x-\/position of line segment end\mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x1} & x-\/position of line segment end\mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em y0} & y-\/position of line segment \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
165   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}
166   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}
167   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment end[nondim]}
168   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x1\textcolor{comment}{      !< x-position of line segment end[nondim]}
169   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment [nondim]}
170   \textcolor{keywordtype}{real} :: dx, yr, dy
171 
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}}
\subsubsection{\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{\tt in}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lon0} & Longitude of coast end \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lon1} & Longitude of coast end \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat0} & Latitude of coast \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em dlat} & \char`\"{}\+Radius\char`\"{} of coast profile \mbox{[}degrees\mbox{]}\\
\hline
\mbox{\tt in}  & {\em sh} & depth of shelf as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
192   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
193   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
194   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}
195   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon1\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}
196   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast [degrees\_N]}
197   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlat\textcolor{comment}{    !< "Radius" of coast profile [degrees]}
198   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
199   \textcolor{keywordtype}{real} :: r
200 
201   r = dist\_line\_fixed\_y( lon, lat, lon0, lon1, lat0 )
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}}
\subsubsection{\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(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[{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{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt out}  & {\em h} & The thickness that is being initialized \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}.\\
\hline
\mbox{\tt 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{\tt in}  & {\em p\+\_\+ref} & The coordinate-\/density reference pressure \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}. \\
\hline
\end{DoxyParams}


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


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


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


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


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


\begin{DoxyCode}
177   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
178   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
179   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast [degrees\_E]}
180   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}
181   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}
182   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of coast profile [degrees]}
183   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
184   \textcolor{keywordtype}{real} :: r
185 
186   r = dist\_line\_fixed\_x( lon, lat, lon0, lat0, lat1 )
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}}
\subsubsection{\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{\tt in}  & {\em lon} & Longitude \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat} & Latitude \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lon0} & Longitude of ridge center \mbox{[}degrees\+\_\+E\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat0} & Latitude of ridge end \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em lat1} & Latitude of ridge end \mbox{[}degrees\+\_\+N\mbox{]}\\
\hline
\mbox{\tt in}  & {\em dlon} & \char`\"{}\+Radius\char`\"{} of ridge profile \mbox{[}degrees\mbox{]}\\
\hline
\mbox{\tt in}  & {\em rh} & depth of ridge as fraction of full depth \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
207   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
208   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
209   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}
210   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
211   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
212   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of ridge profile [degrees]}
213   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}
214   \textcolor{keywordtype}{real} :: r
215 
216   r = dist\_line\_fixed\_x( lon, lat, lon0, lat0, lat1 )
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional coordinate \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em x0} & position of peak \mbox{[}nondim\mbox{]}\\
\hline
\mbox{\tt in}  & {\em l} & half-\/width of base of cone \mbox{[}nondim\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
124   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional coordinate [nondim]}
125   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}
126   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{       !< half-width of base of cone [nondim]}
127   \textcolor{keywordtype}{real} :: s
128 
129   s = max( 0., min( 1.,( x - x0 ) / l ) )
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}}
\subsubsection{\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{\tt in}  & {\em x} & non-\/dimensional position\\
\hline
\mbox{\tt in}  & {\em l} & non-\/dimensional width \\
\hline
\end{DoxyParams}


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


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