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