\hypertarget{namespacebasin__builder}{}\section{basin\+\_\+builder Module Reference}
\label{namespacebasin__builder}\index{basin\+\_\+builder@{basin\+\_\+builder}}


\subsection{Detailed Description}
An idealized topography building system. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespacebasin__builder_a524460fd80029dfed2504e2c60ed79db}{basin\+\_\+builder\+\_\+topography} (D, G, param\+\_\+file, max\+\_\+depth)
\begin{DoxyCompactList}\small\item\em Constructs idealized topography from simple functions. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_a480411ce31485404b10e592362bfc746}{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{namespacebasin__builder_a473d99acf4faee26a6d527fe3b9399d1}{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{namespacebasin__builder_a525e02a07ebaafbc07a2878c92536536}{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{namespacebasin__builder_acac4411f7fc2a80e56099f61a11433d0}{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{namespacebasin__builder_aacb80910c4e1ff5b68758072491539f7}{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{namespacebasin__builder_aac7a19efa2fe51895657c0e4546d3c08}{ns\+\_\+coast} (lon, lat, lonC, lat0, lat1, dlon, sh)
\begin{DoxyCompactList}\small\item\em A \char`\"{}coast profile\char`\"{} applied in an N-\/S line from lonC,lat0 to lonC,lat1. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_a39b27dd1bba4271dc25d73fa4477ebad}{ew\+\_\+coast} (lon, lat, latC, lon0, lon1, dlat, sh)
\begin{DoxyCompactList}\small\item\em A \char`\"{}coast profile\char`\"{} applied in an E-\/W line from lon0,latC to lon1,latC. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_a49804f1f7b15c9f9895c283852a197f5}{ns\+\_\+conic\+\_\+ridge} (lon, lat, lonC, lat0, lat1, dlon, rh)
\begin{DoxyCompactList}\small\item\em A NS ridge with a cone profile. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_ab38b655582b1ccb64652ae439598e6b7}{ns\+\_\+scurve\+\_\+ridge} (lon, lat, lonC, lat0, lat1, dlon, rh)
\begin{DoxyCompactList}\small\item\em A NS ridge with an scurve profile. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_a0fc72e99a407cc2142fd07eb04597a1d}{circ\+\_\+conic\+\_\+ridge} (lon, lat, lon0, lat0, ring\+\_\+radius, ring\+\_\+thickness, ridge\+\_\+height)
\begin{DoxyCompactList}\small\item\em A circular ridge with cutoff conic profile. \end{DoxyCompactList}\item 
real function \hyperlink{namespacebasin__builder_aa11747d7992074a5335692f0fcf60992}{circ\+\_\+scurve\+\_\+ridge} (lon, lat, lon0, lat0, ring\+\_\+radius, ring\+\_\+thickness, ridge\+\_\+height)
\begin{DoxyCompactList}\small\item\em A circular ridge with cutoff scurve profile. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacebasin__builder_a74e255e5fd9dddd7dab7d72e3b46f521}\label{namespacebasin__builder_a74e255e5fd9dddd7dab7d72e3b46f521}} 
character(len=40) \hyperlink{namespacebasin__builder_a74e255e5fd9dddd7dab7d72e3b46f521}{mdl} = \char`\"{}basin\+\_\+builder\char`\"{}
\begin{DoxyCompactList}\small\item\em This module\textquotesingle{}s name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacebasin__builder_a524460fd80029dfed2504e2c60ed79db}\label{namespacebasin__builder_a524460fd80029dfed2504e2c60ed79db}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!basin\+\_\+builder\+\_\+topography@{basin\+\_\+builder\+\_\+topography}}
\index{basin\+\_\+builder\+\_\+topography@{basin\+\_\+builder\+\_\+topography}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{basin\+\_\+builder\+\_\+topography()}{basin\_builder\_topography()}}
{\footnotesize\ttfamily subroutine, public basin\+\_\+builder\+::basin\+\_\+builder\+\_\+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})}



Constructs idealized topography from simple functions. 


\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 28 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
28   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),  \textcolor{keywordtype}{intent(in)}  :: g\textcolor{comment}{ !< The dynamic horizontal grid type}
29   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(G%isd:G%ied,G%jsd:G%jed)}, &
30                            \textcolor{keywordtype}{intent(out)} :: d\textcolor{comment}{ !< Ocean bottom depth in the units of depth\_max}
31   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}
32   \textcolor{keywordtype}{real},                    \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum ocean depth in arbitrary units}
33   \textcolor{comment}{! Local variables}
34   \textcolor{keywordtype}{character(len=17)} :: pname1, pname2 \textcolor{comment}{! For construction of parameter names}
35   \textcolor{keywordtype}{character(len=20)} :: funcs \textcolor{comment}{! Basin build function}
36   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(20)} :: pars \textcolor{comment}{! Parameters for each function}
37   \textcolor{keywordtype}{real} :: lon \textcolor{comment}{! Longitude [degrees\_E\}}
38   \textcolor{keywordtype}{real} :: lat \textcolor{comment}{! Latitude [degrees\_N]}
39   \textcolor{keywordtype}{integer} :: i, j, n, n\_funcs
40 
41   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"  basin\_builder.F90, basin\_builder\_topography: setting topography"}, 5)
42   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})
43 
44   \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
45     d(i,j) = 1.0
46 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
47 
48   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"BBUILDER\_N"}, n\_funcs, &
49                  \textcolor{stringliteral}{"Number of pieces of topography to use."}, fail\_if\_missing=.true.)
50 
51   \textcolor{keywordflow}{do} n=1,n\_funcs
52     \textcolor{keyword}{write}( pname1, \textcolor{stringliteral}{"('BBUILDER\_',i3.3,'\_FUNC')"} ) n
53     \textcolor{keyword}{write}( pname2, \textcolor{stringliteral}{"('BBUILDER\_',i3.3,'\_PARS')"} ) n
54     \textcolor{keyword}{call }get\_param(param\_file, mdl, pname1, funcs, &
55                    \textcolor{stringliteral}{"The basin builder function to apply with parameters "}//&
56                    trim(pname2)//\textcolor{stringliteral}{". Choices are: NS\_COAST, EW\_COAST, "}//&
57                    \textcolor{stringliteral}{"CIRC\_CONIC\_RIDGE, NS\_CONIC\_RIDGE, CIRC\_SCURVE\_RIDGE, "}//&
58                    \textcolor{stringliteral}{"NS\_SCURVE\_RIDGE."}, &
59                    fail\_if\_missing=.true.)
60     pars(:) = 0.
61     \textcolor{keywordflow}{if} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'ns\_coast'}) \textcolor{keywordflow}{then}
62       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
63                      \textcolor{stringliteral}{"NS\_COAST parameters: longitude, starting latitude, "}//&
64                      \textcolor{stringliteral}{"ending latitude, footprint radius, shelf depth."}, &
65                      units=\textcolor{stringliteral}{"degrees\_E,degrees\_N,degrees\_N,degrees,m"}, &
66                      fail\_if\_missing=.true.)
67       pars(5) = pars(5) / max\_depth
68       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
69         lon = g%geoLonT(i,j)
70         lat = g%geoLatT(i,j)
71         d(i,j) = min( d(i,j), ns\_coast(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
72 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
73     \textcolor{keywordflow}{elseif} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'ns\_conic\_ridge'}) \textcolor{keywordflow}{then}
74       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
75                      \textcolor{stringliteral}{"NS\_CONIC\_RIDGE parameters: longitude, starting latitude, "}//&
76                      \textcolor{stringliteral}{"ending latitude, footprint radius, ridge height."}, &
77                      units=\textcolor{stringliteral}{"degrees\_E,degrees\_N,degrees\_N,degrees,m"}, &
78                      fail\_if\_missing=.true.)
79       pars(5) = pars(5) / max\_depth
80       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
81         lon = g%geoLonT(i,j)
82         lat = g%geoLatT(i,j)
83         d(i,j) = min( d(i,j), ns\_conic\_ridge(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
84 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
85     \textcolor{keywordflow}{elseif} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'ns\_scurve\_ridge'}) \textcolor{keywordflow}{then}
86       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
87                      \textcolor{stringliteral}{"NS\_SCURVE\_RIDGE parameters: longitude, starting latitude, "}//&
88                      \textcolor{stringliteral}{"ending latitude, footprint radius, ridge height."}, &
89                      units=\textcolor{stringliteral}{"degrees\_E,degrees\_N,degrees\_N,degrees,m"}, &
90                      fail\_if\_missing=.true.)
91       pars(5) = pars(5) / max\_depth
92       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
93         lon = g%geoLonT(i,j)
94         lat = g%geoLatT(i,j)
95         d(i,j) = min( d(i,j), ns\_scurve\_ridge(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
96 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
97     \textcolor{keywordflow}{elseif} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'ew\_coast'}) \textcolor{keywordflow}{then}
98       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
99                      \textcolor{stringliteral}{"EW\_COAST parameters: latitude, starting longitude, "}//&
100                      \textcolor{stringliteral}{"ending longitude, footprint radius, shelf depth."}, &
101                      units=\textcolor{stringliteral}{"degrees\_N,degrees\_E,degrees\_E,degrees,m"}, &
102                      fail\_if\_missing=.true.)
103       pars(5) = pars(5) / max\_depth
104       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
105         lon = g%geoLonT(i,j)
106         lat = g%geoLatT(i,j)
107         d(i,j) = min( d(i,j), ew\_coast(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
108 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
109     \textcolor{keywordflow}{elseif} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'circ\_conic\_ridge'}) \textcolor{keywordflow}{then}
110       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
111                      \textcolor{stringliteral}{"CIRC\_CONIC\_RIDGE parameters: center longitude, center latitude, "}//&
112                      \textcolor{stringliteral}{"ring radius, footprint radius, ridge height."}, &
113                      units=\textcolor{stringliteral}{"degrees\_E,degrees\_N,degrees,degrees,m"}, &
114                      fail\_if\_missing=.true.)
115       pars(5) = pars(5) / max\_depth
116       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
117         lon = g%geoLonT(i,j)
118         lat = g%geoLatT(i,j)
119         d(i,j) = min( d(i,j), circ\_conic\_ridge(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
120 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
121     \textcolor{keywordflow}{elseif} (trim(lowercase(funcs)) == \textcolor{stringliteral}{'circ\_scurve\_ridge'}) \textcolor{keywordflow}{then}
122       \textcolor{keyword}{call }get\_param(param\_file, mdl, pname2, pars(1:5), &
123                      \textcolor{stringliteral}{"CIRC\_SCURVe\_RIDGE parameters: center longitude, center latitude, "}//&
124                      \textcolor{stringliteral}{"ring radius, footprint radius, ridge height."}, &
125                      units=\textcolor{stringliteral}{"degrees\_E,degrees\_N,degrees,degrees,m"}, &
126                      fail\_if\_missing=.true.)
127       pars(5) = pars(5) / max\_depth
128       \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
129         lon = g%geoLonT(i,j)
130         lat = g%geoLatT(i,j)
131         d(i,j) = min( d(i,j), circ\_scurve\_ridge(lon, lat, pars(1), pars(2), pars(3), pars(4), pars(5)) )
132 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}
133     \textcolor{keywordflow}{else}
134       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"basin\_builder.F90, basin\_builer\_topography:\(\backslash\)n"}//&
135                      \textcolor{stringliteral}{"Unrecognized function "}//trim(funcs))
136 \textcolor{keywordflow}{    endif}
137 
138 \textcolor{keywordflow}{  enddo} \textcolor{comment}{! n}
139 
140   \textcolor{keywordflow}{do} j=g%jsc,g%jec ; \textcolor{keywordflow}{do} i=g%isc,g%iec
141     \textcolor{comment}{! Dimensionalize by scaling 1 to max\_depth}
142     d(i,j) = d(i,j) * max\_depth
143 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
144 
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a0fc72e99a407cc2142fd07eb04597a1d}\label{namespacebasin__builder_a0fc72e99a407cc2142fd07eb04597a1d}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!circ\+\_\+conic\+\_\+ridge@{circ\+\_\+conic\+\_\+ridge}}
\index{circ\+\_\+conic\+\_\+ridge@{circ\+\_\+conic\+\_\+ridge}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{circ\+\_\+conic\+\_\+ridge()}{circ\_conic\_ridge()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::circ\+\_\+conic\+\_\+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 with cutoff conic profile. 


\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 276 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
276   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{            !< Longitude [degrees\_E]}
277   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{            !< Latitude [degrees\_N]}
278   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{           !< Longitude of center of ring [degrees\_E]}
279   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{           !< Latitude of center of ring [degrees\_N]}
280   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_radius\textcolor{comment}{    !< Radius of ring [degrees]}
281   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_thickness\textcolor{comment}{ !< Radial thickness of ring [degrees]}
282   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ridge\_height\textcolor{comment}{   !< Ridge height as fraction of full depth [nondim]}
283   \textcolor{keywordtype}{real} :: r
284 
285   r = sqrt( (lon - lon0)**2 + (lat - lat0)**2 ) \textcolor{comment}{! Pseudo-distance from a point}
286   r = abs( r - ring\_radius) \textcolor{comment}{! Pseudo-distance from a circle}
287   r = cone(r, 0., ring\_thickness, ridge\_height) \textcolor{comment}{! 0 .. frac\_ridge\_height}
288   circ\_conic\_ridge = 1. - r \textcolor{comment}{! nondim depths (1-frac\_ridge\_height) .. 1}
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_aa11747d7992074a5335692f0fcf60992}\label{namespacebasin__builder_aa11747d7992074a5335692f0fcf60992}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!circ\+\_\+scurve\+\_\+ridge@{circ\+\_\+scurve\+\_\+ridge}}
\index{circ\+\_\+scurve\+\_\+ridge@{circ\+\_\+scurve\+\_\+ridge}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{circ\+\_\+scurve\+\_\+ridge()}{circ\_scurve\_ridge()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::circ\+\_\+scurve\+\_\+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 with cutoff scurve profile. 


\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 293 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
293   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{            !< Longitude [degrees\_E]}
294   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{            !< Latitude [degrees\_N]}
295   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{           !< Longitude of center of ring [degrees\_E]}
296   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{           !< Latitude of center of ring [degrees\_N]}
297   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_radius\textcolor{comment}{    !< Radius of ring [degrees]}
298   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ring\_thickness\textcolor{comment}{ !< Radial thickness of ring [degrees]}
299   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: ridge\_height\textcolor{comment}{   !< Ridge height as fraction of full depth [nondim]}
300   \textcolor{keywordtype}{real} :: r
301 
302   r = sqrt( (lon - lon0)**2 + (lat - lat0)**2 ) \textcolor{comment}{! Pseudo-distance from a point}
303   r = abs( r - ring\_radius) \textcolor{comment}{! Pseudo-distance from a circle}
304   r = 1. - scurve(r, 0., ring\_thickness) \textcolor{comment}{! 0 .. 1}
305   r = r * ridge\_height \textcolor{comment}{! 0 .. frac\_ridge\_height}
306   circ\_scurve\_ridge = 1. - r \textcolor{comment}{! nondim depths (1-frac\_ridge\_height) .. 1}
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a480411ce31485404b10e592362bfc746}\label{namespacebasin__builder_a480411ce31485404b10e592362bfc746}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!cone@{cone}}
\index{cone@{cone}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{cone()}{cone()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::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 152 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
152   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{    !< non-dimensional coordinate [nondim]}
153   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{   !< position of peak [nondim]}
154   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{    !< half-width of base of cone [nondim]}
155   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: clip\textcolor{comment}{ !< clipping height of cone [nondim]}
156 
157   cone = max( 0., 1. - abs(x - x0) / l )
158   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clip)) cone = min(clip, cone)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a525e02a07ebaafbc07a2878c92536536}\label{namespacebasin__builder_a525e02a07ebaafbc07a2878c92536536}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!cstprof@{cstprof}}
\index{cstprof@{cstprof}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{cstprof()}{cstprof()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::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 174 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
174   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional coordinate [nondim]}
175   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}
176   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{       !< width of profile [nondim]}
177   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lf\textcolor{comment}{      !< fraction of width that is "land" [nondim]}
178   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: bf\textcolor{comment}{      !< fraction of width that is "beach" [nondim]}
179   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sf\textcolor{comment}{      !< fraction of width that is "continental slope" [nondim]}
180   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
181   \textcolor{keywordtype}{real} :: s
182 
183   s = max( 0., min( 1.,( x - x0 ) / l ) )
184   cstprof = sh * scurve(s-lf,0.,bf) + (1.-sh) * scurve(s - (1.-sf),0.,sf)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_acac4411f7fc2a80e56099f61a11433d0}\label{namespacebasin__builder_acac4411f7fc2a80e56099f61a11433d0}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!dist\+\_\+line\+\_\+fixed\+\_\+x@{dist\+\_\+line\+\_\+fixed\+\_\+x}}
\index{dist\+\_\+line\+\_\+fixed\+\_\+x@{dist\+\_\+line\+\_\+fixed\+\_\+x}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{dist\+\_\+line\+\_\+fixed\+\_\+x()}{dist\_line\_fixed\_x()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::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 189 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
189   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}
190   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}
191   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment [nondim]}
192   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment end[nondim]}
193   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y1\textcolor{comment}{      !< y-position of line segment end[nondim]}
194   \textcolor{keywordtype}{real} :: dx, yr, dy
195 
196   dx = x - x0
197   yr = min( max(y0,y1), max( min(y0,y1), y ) ) \textcolor{comment}{! bound y by y0,y1}
198   dy = y - yr \textcolor{comment}{! =0 within y0<y<y1, =y0-y for y<y0, =y-y1 for y>y1}
199   dist\_line\_fixed\_x = sqrt( dx*dx + dy*dy )
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_aacb80910c4e1ff5b68758072491539f7}\label{namespacebasin__builder_aacb80910c4e1ff5b68758072491539f7}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!dist\+\_\+line\+\_\+fixed\+\_\+y@{dist\+\_\+line\+\_\+fixed\+\_\+y}}
\index{dist\+\_\+line\+\_\+fixed\+\_\+y@{dist\+\_\+line\+\_\+fixed\+\_\+y}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{dist\+\_\+line\+\_\+fixed\+\_\+y()}{dist\_line\_fixed\_y()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::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 204 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
204   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}
205   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}
206   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment end[nondim]}
207   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x1\textcolor{comment}{      !< x-position of line segment end[nondim]}
208   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment [nondim]}
209   \textcolor{keywordtype}{real} :: dx, yr, dy
210 
211   dist\_line\_fixed\_y = dist\_line\_fixed\_x(y, x, y0, x0, x1)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a39b27dd1bba4271dc25d73fa4477ebad}\label{namespacebasin__builder_a39b27dd1bba4271dc25d73fa4477ebad}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!ew\+\_\+coast@{ew\+\_\+coast}}
\index{ew\+\_\+coast@{ew\+\_\+coast}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{ew\+\_\+coast()}{ew\_coast()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::ew\+\_\+coast (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{latC,  }\item[{real, intent(in)}]{lon0,  }\item[{real, intent(in)}]{lon1,  }\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,latC to lon1,latC. 


\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 latc} & Latitude of coast \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 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 231 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
231   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
232   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
233   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: latc\textcolor{comment}{    !< Latitude of coast [degrees\_N]}
234   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}
235   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon1\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}
236   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlat\textcolor{comment}{    !< "Radius" of coast profile [degrees]}
237   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
238   \textcolor{keywordtype}{real} :: r
239 
240   r = dist\_line\_fixed\_y( lon, lat, lon0, lon1, latc )
241   ew\_coast = cstprof(r, 0., dlat, 0.125, 0.125, 0.5, sh)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_aac7a19efa2fe51895657c0e4546d3c08}\label{namespacebasin__builder_aac7a19efa2fe51895657c0e4546d3c08}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!ns\+\_\+coast@{ns\+\_\+coast}}
\index{ns\+\_\+coast@{ns\+\_\+coast}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{ns\+\_\+coast()}{ns\_coast()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::ns\+\_\+coast (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lonC,  }\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 lonC,lat0 to lonC,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 lonc} & 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 216 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
216   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
217   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
218   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lonc\textcolor{comment}{    !< Longitude of coast [degrees\_E]}
219   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}
220   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}
221   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of coast profile [degrees]}
222   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}
223   \textcolor{keywordtype}{real} :: r
224 
225   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )
226   ns\_coast = cstprof(r, 0., dlon, 0.125, 0.125, 0.5, sh)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a49804f1f7b15c9f9895c283852a197f5}\label{namespacebasin__builder_a49804f1f7b15c9f9895c283852a197f5}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!ns\+\_\+conic\+\_\+ridge@{ns\+\_\+conic\+\_\+ridge}}
\index{ns\+\_\+conic\+\_\+ridge@{ns\+\_\+conic\+\_\+ridge}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{ns\+\_\+conic\+\_\+ridge()}{ns\_conic\_ridge()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::ns\+\_\+conic\+\_\+ridge (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lonC,  }\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 with a cone profile. 


\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 lonc} & 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 246 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
246   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
247   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
248   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lonc\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}
249   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
250   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
251   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of ridge profile [degrees]}
252   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}
253   \textcolor{keywordtype}{real} :: r
254 
255   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )
256   ns\_conic\_ridge = 1. - rh * cone(r, 0., dlon)
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_ab38b655582b1ccb64652ae439598e6b7}\label{namespacebasin__builder_ab38b655582b1ccb64652ae439598e6b7}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!ns\+\_\+scurve\+\_\+ridge@{ns\+\_\+scurve\+\_\+ridge}}
\index{ns\+\_\+scurve\+\_\+ridge@{ns\+\_\+scurve\+\_\+ridge}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{ns\+\_\+scurve\+\_\+ridge()}{ns\_scurve\_ridge()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::ns\+\_\+scurve\+\_\+ridge (\begin{DoxyParamCaption}\item[{real, intent(in)}]{lon,  }\item[{real, intent(in)}]{lat,  }\item[{real, intent(in)}]{lonC,  }\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 with an scurve profile. 


\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 lonc} & 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 261 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
261   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}
262   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}
263   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lonc\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}
264   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
265   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}
266   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of ridge profile [degrees]}
267   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}
268   \textcolor{keywordtype}{real} :: r
269 
270   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )
271   ns\_scurve\_ridge = 1. - rh * (1. - scurve(r, 0., dlon) )
\end{DoxyCode}
\mbox{\Hypertarget{namespacebasin__builder_a473d99acf4faee26a6d527fe3b9399d1}\label{namespacebasin__builder_a473d99acf4faee26a6d527fe3b9399d1}} 
\index{basin\+\_\+builder@{basin\+\_\+builder}!scurve@{scurve}}
\index{scurve@{scurve}!basin\+\_\+builder@{basin\+\_\+builder}}
\subsubsection{\texorpdfstring{scurve()}{scurve()}}
{\footnotesize\ttfamily real function basin\+\_\+builder\+::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 163 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}
163   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional coordinate [nondim]}
164   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}
165   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)} :: l\textcolor{comment}{       !< half-width of base of cone [nondim]}
166   \textcolor{keywordtype}{real} :: s
167 
168   s = max( 0., min( 1.,( x - x0 ) / l ) )
169   scurve = ( 3. - 2.*s ) * ( s * s )
\end{DoxyCode}
