\hypertarget{namespacedyed__obcs__initialization}{}\section{dyed\+\_\+obcs\+\_\+initialization Module Reference}
\label{namespacedyed__obcs__initialization}\index{dyed\_obcs\_initialization@{dyed\_obcs\_initialization}}


\subsection{Detailed Description}
Dyed open boundary conditions. 

Setting dyes, one for painting the inflow on each side. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacedyed__obcs__initialization_a46b0e1f06662e2a74b9912114ed0ebcb}{dyed\+\_\+obcs\+\_\+set\+\_\+obc\+\_\+data}} (O\+BC, G, GV, param\+\_\+file, tr\+\_\+\+Reg)
\begin{DoxyCompactList}\small\item\em This subroutine sets the dye properties at open boundary conditions. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
integer \mbox{\hyperlink{namespacedyed__obcs__initialization_a29ed29b248ce766691e964a173c7ceda}{ntr}} = 0
\begin{DoxyCompactList}\small\item\em Number of dye tracers. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacedyed__obcs__initialization_a46b0e1f06662e2a74b9912114ed0ebcb}\label{namespacedyed__obcs__initialization_a46b0e1f06662e2a74b9912114ed0ebcb}} 
\index{dyed\_obcs\_initialization@{dyed\_obcs\_initialization}!dyed\_obcs\_set\_obc\_data@{dyed\_obcs\_set\_obc\_data}}
\index{dyed\_obcs\_set\_obc\_data@{dyed\_obcs\_set\_obc\_data}!dyed\_obcs\_initialization@{dyed\_obcs\_initialization}}
\subsubsection{\texorpdfstring{dyed\_obcs\_set\_obc\_data()}{dyed\_obcs\_set\_obc\_data()}}
{\footnotesize\ttfamily subroutine, public dyed\+\_\+obcs\+\_\+initialization\+::dyed\+\_\+obcs\+\_\+set\+\_\+obc\+\_\+data (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+obc\+\_\+type), pointer}]{O\+BC,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(tracer\+\_\+registry\+\_\+type), pointer}]{tr\+\_\+\+Reg }\end{DoxyParamCaption})}



This subroutine sets the dye properties at open boundary conditions. 


\begin{DoxyParams}[1]{Parameters}
 & {\em obc} & This open boundary condition type specifies whether, where, and what open boundary conditions are used. \\
\hline
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
 & {\em tr\+\_\+reg} & Tracer registry. \\
\hline
\end{DoxyParams}


Definition at line 31 of file dyed\+\_\+obcs\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{31   \textcolor{keywordtype}{type}(ocean\_OBC\_type),       \textcolor{keywordtype}{pointer}    :: OBC\textcolor{comment}{ !< This open boundary condition type specifies}}
\DoxyCodeLine{32 \textcolor{comment}{                                                !! whether, where, and what open boundary}}
\DoxyCodeLine{33 \textcolor{comment}{                                                !! conditions are used.}}
\DoxyCodeLine{34   \textcolor{keywordtype}{type}(ocean\_grid\_type),      \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{   !< The ocean's grid structure.}}
\DoxyCodeLine{35   \textcolor{keywordtype}{type}(verticalGrid\_type),    \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{  !< The ocean's vertical grid structure.}}
\DoxyCodeLine{36   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the open file}}
\DoxyCodeLine{37 \textcolor{comment}{                                                !! to parse for model parameter values.}}
\DoxyCodeLine{38   \textcolor{keywordtype}{type}(tracer\_registry\_type), \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{ !< Tracer registry.}}
\DoxyCodeLine{39   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{40   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"dyed\_obcs\_set\_OBC\_data"} \textcolor{comment}{! This subroutine's name.}}
\DoxyCodeLine{41   \textcolor{keywordtype}{character(len=80)}  :: name, longname}
\DoxyCodeLine{42   \textcolor{keywordtype}{integer} :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, m, n, nz}
\DoxyCodeLine{43   \textcolor{keywordtype}{integer} :: IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{44 \textcolor{keywordtype}{  real} :: dye}
\DoxyCodeLine{45   \textcolor{keywordtype}{type}(OBC\_segment\_type), \textcolor{keywordtype}{pointer} :: segment => null()}
\DoxyCodeLine{46   \textcolor{keywordtype}{type}(tracer\_type), \textcolor{keywordtype}{pointer}      :: tr\_ptr => null()}
\DoxyCodeLine{47 }
\DoxyCodeLine{48   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{49   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{50   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{51 }
\DoxyCodeLine{52   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(obc)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{53 }
\DoxyCodeLine{54   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NUM\_DYE\_TRACERS"}, ntr, \&}
\DoxyCodeLine{55                  \textcolor{stringliteral}{"The number of dye tracers in this run. Each tracer "}//\&}
\DoxyCodeLine{56                  \textcolor{stringliteral}{"should have a separate boundary segment."}, default=0,   \&}
\DoxyCodeLine{57                  do\_not\_log=.true.)}
\DoxyCodeLine{58 }
\DoxyCodeLine{59   \textcolor{keywordflow}{if} (obc\%number\_of\_segments < ntr) \textcolor{keywordflow}{then}}
\DoxyCodeLine{60     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"Error in dyed\_obc segment setup"})}
\DoxyCodeLine{61     \textcolor{keywordflow}{return}   \textcolor{comment}{!!! Need a better error message here}}
\DoxyCodeLine{62 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{63 }
\DoxyCodeLine{64 \textcolor{comment}{! ! Set the inflow values of the dyes, one per segment.}}
\DoxyCodeLine{65 \textcolor{comment}{! ! We know the order: north, south, east, west}}
\DoxyCodeLine{66   \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{67     \textcolor{keyword}{write}(name,\textcolor{stringliteral}{'("dye\_",I2.2)'}) m}
\DoxyCodeLine{68     \textcolor{keyword}{write}(longname,\textcolor{stringliteral}{'("Concentration of dyed\_obc Tracer ",I2.2, " on segment ",I2.2)'}) m, m}
\DoxyCodeLine{69     \textcolor{keyword}{call }tracer\_name\_lookup(tr\_reg, tr\_ptr, name)}
\DoxyCodeLine{70 }
\DoxyCodeLine{71     \textcolor{keywordflow}{do} n=1,obc\%number\_of\_segments}
\DoxyCodeLine{72       \textcolor{keywordflow}{if} (n == m) \textcolor{keywordflow}{then}}
\DoxyCodeLine{73         dye = 1.0}
\DoxyCodeLine{74       \textcolor{keywordflow}{else}}
\DoxyCodeLine{75         dye = 0.0}
\DoxyCodeLine{76 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{77       \textcolor{keyword}{call }register\_segment\_tracer(tr\_ptr, param\_file, gv, \&}
\DoxyCodeLine{78                                    obc\%segment(n), obc\_scalar=dye)}
\DoxyCodeLine{79 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{80 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{81 }

\end{DoxyCode}


\subsection{Variable Documentation}
\mbox{\Hypertarget{namespacedyed__obcs__initialization_a29ed29b248ce766691e964a173c7ceda}\label{namespacedyed__obcs__initialization_a29ed29b248ce766691e964a173c7ceda}} 
\index{dyed\_obcs\_initialization@{dyed\_obcs\_initialization}!ntr@{ntr}}
\index{ntr@{ntr}!dyed\_obcs\_initialization@{dyed\_obcs\_initialization}}
\subsubsection{\texorpdfstring{ntr}{ntr}}
{\footnotesize\ttfamily integer dyed\+\_\+obcs\+\_\+initialization\+::ntr = 0\hspace{0.3cm}{\ttfamily [private]}}



Number of dye tracers. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000011}{Todo}}]This is a module variable. Move this variable into the control structure. \end{DoxyRefDesc}


Definition at line 24 of file dyed\+\_\+obcs\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{24 \textcolor{keywordtype}{integer} :: ntr = 0\textcolor{comment}{ !< Number of dye tracers}}

\end{DoxyCode}
