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


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


\begin{DoxyCode}{0}
\DoxyCodeLine{276 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{            !< Longitude [degrees\_E]}}
\DoxyCodeLine{277 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{            !< Latitude [degrees\_N]}}
\DoxyCodeLine{278 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{           !< Longitude of center of ring [degrees\_E]}}
\DoxyCodeLine{279 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{           !< Latitude of center of ring [degrees\_N]}}
\DoxyCodeLine{280 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ring\_radius\textcolor{comment}{    !< Radius of ring [degrees]}}
\DoxyCodeLine{281 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ring\_thickness\textcolor{comment}{ !< Radial thickness of ring [degrees]}}
\DoxyCodeLine{282 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: ridge\_height\textcolor{comment}{   !< Ridge height as fraction of full depth [nondim]}}
\DoxyCodeLine{283 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{284 }
\DoxyCodeLine{285   r = sqrt( (lon - lon0)**2 + (lat - lat0)**2 ) \textcolor{comment}{! Pseudo-distance from a point}}
\DoxyCodeLine{286   r = abs( r - ring\_radius) \textcolor{comment}{! Pseudo-distance from a circle}}
\DoxyCodeLine{287   r = cone(r, 0., ring\_thickness, ridge\_height) \textcolor{comment}{! 0 .. frac\_ridge\_height}}
\DoxyCodeLine{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{\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 293 of file basin\+\_\+builder.\+F90.


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


\begin{DoxyCode}{0}
\DoxyCodeLine{152 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{    !< non-dimensional coordinate [nondim]}}
\DoxyCodeLine{153 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{   !< position of peak [nondim]}}
\DoxyCodeLine{154 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{    !< half-width of base of cone [nondim]}}
\DoxyCodeLine{155 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: clip\textcolor{comment}{ !< clipping height of cone [nondim]}}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   cone = max( 0., 1. - abs(x - x0) / l )}
\DoxyCodeLine{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{\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 174 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{174 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional coordinate [nondim]}}
\DoxyCodeLine{175 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< position of peak [nondim]}}
\DoxyCodeLine{176 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: L\textcolor{comment}{       !< width of profile [nondim]}}
\DoxyCodeLine{177 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lf\textcolor{comment}{      !< fraction of width that is "land" [nondim]}}
\DoxyCodeLine{178 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: bf\textcolor{comment}{      !< fraction of width that is "beach" [nondim]}}
\DoxyCodeLine{179 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sf\textcolor{comment}{      !< fraction of width that is "continental slope" [nondim]}}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{181 \textcolor{keywordtype}{  real} :: s}
\DoxyCodeLine{182 }
\DoxyCodeLine{183   s = max( 0., min( 1.,( x - x0 ) / l ) )}
\DoxyCodeLine{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{\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 189 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{189 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}}
\DoxyCodeLine{190 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}}
\DoxyCodeLine{191 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment [nondim]}}
\DoxyCodeLine{192 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment end[nondim]}}
\DoxyCodeLine{193 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y1\textcolor{comment}{      !< y-position of line segment end[nondim]}}
\DoxyCodeLine{194 \textcolor{keywordtype}{  real} :: dx, yr, dy}
\DoxyCodeLine{195 }
\DoxyCodeLine{196   dx = x - x0}
\DoxyCodeLine{197   yr = min( max(y0,y1), max( min(y0,y1), y ) ) \textcolor{comment}{! bound y by y0,y1}}
\DoxyCodeLine{198   dy = y - yr \textcolor{comment}{! =0 within y0<y<y1, =y0-y for y<y0, =y-y1 for y>y1}}
\DoxyCodeLine{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{\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 204 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{204 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x\textcolor{comment}{       !< non-dimensional x-coordinate [nondim]}}
\DoxyCodeLine{205 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y\textcolor{comment}{       !< non-dimensional y-coordinate [nondim]}}
\DoxyCodeLine{206 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x0\textcolor{comment}{      !< x-position of line segment end[nondim]}}
\DoxyCodeLine{207 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: x1\textcolor{comment}{      !< x-position of line segment end[nondim]}}
\DoxyCodeLine{208 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: y0\textcolor{comment}{      !< y-position of line segment [nondim]}}
\DoxyCodeLine{209 \textcolor{keywordtype}{  real} :: dx, yr, dy}
\DoxyCodeLine{210 }
\DoxyCodeLine{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{\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 latc} & Latitude of coast \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 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 231 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{231 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{232 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{233 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: latC\textcolor{comment}{    !< Latitude of coast [degrees\_N]}}
\DoxyCodeLine{234 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon0\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}}
\DoxyCodeLine{235 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon1\textcolor{comment}{    !< Longitude of coast end [degrees\_E]}}
\DoxyCodeLine{236 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlat\textcolor{comment}{    !< "Radius" of coast profile [degrees]}}
\DoxyCodeLine{237 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{238 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{239 }
\DoxyCodeLine{240   r = dist\_line\_fixed\_y( lon, lat, lon0, lon1, latc )}
\DoxyCodeLine{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{\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 lonc} & 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 216 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{216 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{217 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{218 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lonC\textcolor{comment}{    !< Longitude of coast [degrees\_E]}}
\DoxyCodeLine{219 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}}
\DoxyCodeLine{220 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of coast end [degrees\_N]}}
\DoxyCodeLine{221 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of coast profile [degrees]}}
\DoxyCodeLine{222 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: sh\textcolor{comment}{      !< depth of shelf as fraction of full depth [nondim]}}
\DoxyCodeLine{223 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{224 }
\DoxyCodeLine{225   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )}
\DoxyCodeLine{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{\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 lonc} & 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 246 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{246 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{247 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{248 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lonC\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}}
\DoxyCodeLine{249 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{250 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{251 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of ridge profile [degrees]}}
\DoxyCodeLine{252 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}}
\DoxyCodeLine{253 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{254 }
\DoxyCodeLine{255   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )}
\DoxyCodeLine{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{\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 lonc} & 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 261 of file basin\+\_\+builder.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{261 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lon\textcolor{comment}{     !< Longitude [degrees\_E]}}
\DoxyCodeLine{262 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat\textcolor{comment}{     !< Latitude [degrees\_N]}}
\DoxyCodeLine{263 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lonC\textcolor{comment}{    !< Longitude of ridge center [degrees\_E]}}
\DoxyCodeLine{264 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat0\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{265 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: lat1\textcolor{comment}{    !< Latitude of ridge end [degrees\_N]}}
\DoxyCodeLine{266 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: dlon\textcolor{comment}{    !< "Radius" of ridge profile [degrees]}}
\DoxyCodeLine{267 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)} :: rh\textcolor{comment}{      !< depth of ridge as fraction of full depth [nondim]}}
\DoxyCodeLine{268 \textcolor{keywordtype}{  real} :: r}
\DoxyCodeLine{269 }
\DoxyCodeLine{270   r = dist\_line\_fixed\_x( lon, lat, lonc, lat0, lat1 )}
\DoxyCodeLine{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{\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 163 of file basin\+\_\+builder.\+F90.


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

\end{DoxyCode}
