\hypertarget{namespacemom__tracer__flow__control}{}\section{mom\+\_\+tracer\+\_\+flow\+\_\+control Module Reference}
\label{namespacemom__tracer__flow__control}\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}


\subsection{Detailed Description}
Orchestrates the registration and calling of tracer packages. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em The control structure for orchestrating the calling of tracer packages. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_a736899f8b0b79d0e98384abf2b084880}{call\+\_\+tracer\+\_\+flux\+\_\+init}} (verbosity)
\begin{DoxyCompactList}\small\item\em This subroutine carries out a series of calls to initialize the air-\/sea tracer fluxes, but it does not record the generated indicies, and it may be called {\itshape before} the ocean model has been initialized and may be called on non-\/ocean P\+Es. It is not necessary to call this routine for ocean-\/only runs, because the same calls are made again inside of the routines called by call\+\_\+tracer\+\_\+register. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_aa72e59a493bcf226ece1f0520bec635f}{call\+\_\+tracer\+\_\+register}} (HI, GV, US, param\+\_\+file, CS, tr\+\_\+\+Reg, restart\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em This subroutine determines which tracer packages are to be used and does the calls to register their tracers to be advected, diffused, and read from restarts. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_a23c43fd3e8fd71c7aa132b58eb7768b9}{tracer\+\_\+flow\+\_\+control\+\_\+init}} (restart, day, G, GV, US, h, param\+\_\+file, diag, O\+BC, CS, sponge\+\_\+\+C\+Sp, A\+L\+E\+\_\+sponge\+\_\+\+C\+Sp, tv)
\begin{DoxyCompactList}\small\item\em This subroutine calls all registered tracer initialization subroutines. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_abd2e9269190427ba86fb8a26e6792e66}{get\+\_\+chl\+\_\+from\+\_\+model}} (Chl\+\_\+array, G, CS)
\begin{DoxyCompactList}\small\item\em This subroutine extracts the chlorophyll concentrations from the model state, if possible. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_a7c528b4f0654399b58736530f2ad0df7}{call\+\_\+tracer\+\_\+set\+\_\+forcing}} (sfc\+\_\+state, fluxes, day\+\_\+start, day\+\_\+interval, G, CS)
\begin{DoxyCompactList}\small\item\em This subroutine calls the individual tracer modules\textquotesingle{} subroutines to specify or read quantities related to their surface forcing. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_ae4af301529462d180014b52d0ceea67c}{call\+\_\+tracer\+\_\+column\+\_\+fns}} (h\+\_\+old, h\+\_\+new, ea, eb, fluxes, Hml, dt, G, GV, US, tv, optics, CS, debug, evap\+\_\+\+C\+F\+L\+\_\+limit, minimum\+\_\+forcing\+\_\+depth)
\begin{DoxyCompactList}\small\item\em This subroutine calls all registered tracer column physics subroutines. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_afd8526344e928c8c9505c921bf37447f}{call\+\_\+tracer\+\_\+stocks}} (h, stock\+\_\+values, G, GV, CS, stock\+\_\+names, stock\+\_\+units, num\+\_\+stocks, stock\+\_\+index, got\+\_\+min\+\_\+max, global\+\_\+min, global\+\_\+max, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
\begin{DoxyCompactList}\small\item\em This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__tracer__flow__control_ad43ea30fa52fcb930db39037f5d7e6b9}{store\+\_\+stocks}} (pkg\+\_\+name, ns, names, units, values, index, stock\+\_\+values, set\+\_\+pkg\+\_\+name, max\+\_\+ns, ns\+\_\+tot, stock\+\_\+names, stock\+\_\+units)
\begin{DoxyCompactList}\small\item\em This routine stores the stocks and does error handling for call\+\_\+tracer\+\_\+stocks. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_a0c4fb7a963b5ae8672e2e32ac87fddca}{call\+\_\+tracer\+\_\+surface\+\_\+state}} (sfc\+\_\+state, h, G, CS)
\begin{DoxyCompactList}\small\item\em This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__tracer__flow__control_a3c5edb854704860d08de4d68d815d920}{tracer\+\_\+flow\+\_\+control\+\_\+end}} (CS)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_ae4af301529462d180014b52d0ceea67c}\label{namespacemom__tracer__flow__control_ae4af301529462d180014b52d0ceea67c}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_column\_fns@{call\_tracer\_column\_fns}}
\index{call\_tracer\_column\_fns@{call\_tracer\_column\_fns}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_column\_fns()}{call\_tracer\_column\_fns()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+column\+\_\+fns (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{h\+\_\+old,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{h\+\_\+new,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{ea,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{eb,  }\item[{type(forcing), intent(in)}]{fluxes,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g)), intent(in)}]{Hml,  }\item[{real, intent(in)}]{dt,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv,  }\item[{type(optics\+\_\+type), pointer}]{optics,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS,  }\item[{logical, intent(in)}]{debug,  }\item[{real, intent(in), optional}]{evap\+\_\+\+C\+F\+L\+\_\+limit,  }\item[{real, intent(in), optional}]{minimum\+\_\+forcing\+\_\+depth }\end{DoxyParamCaption})}



This subroutine calls all registered tracer column physics subroutines. 


\begin{DoxyParams}[1]{Parameters}
\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 h\+\_\+old} & Layer thickness before entrainment \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em h\+\_\+new} & Layer thickness after entrainment \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em ea} & an array to which the amount of fluid entrained from the layer above during this call will be added \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em eb} & an array to which the amount of fluid entrained from the layer below during this call will be added \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs. \\
\hline
\mbox{\texttt{ in}}  & {\em hml} & Mixed layer depth \mbox{[}Z $\sim$$>$ m\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em dt} & The amount of time covered by this call \mbox{[}T $\sim$$>$ s\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & A structure pointing to various thermodynamic variables. \\
\hline
 & {\em optics} & The structure containing optical properties. \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\mbox{\texttt{ in}}  & {\em debug} & If true calculate checksums \\
\hline
\mbox{\texttt{ in}}  & {\em evap\+\_\+cfl\+\_\+limit} & Limit on the fraction of the water that can be fluxed out of the top layer in a timestep \mbox{[}nondim\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em minimum\+\_\+forcing\+\_\+depth} & The smallest depth over which fluxes can be applied \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line 381 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{381   \textcolor{keywordtype}{type}(ocean\_grid\_type),                 \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{      !< The ocean's grid structure.}}
\DoxyCodeLine{382   \textcolor{keywordtype}{type}(verticalGrid\_type),               \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{     !< The ocean's vertical grid structure.}}
\DoxyCodeLine{383 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \textcolor{keywordtype}{intent(in)} :: h\_old\textcolor{comment}{ !< Layer thickness before entrainment}}
\DoxyCodeLine{384 \textcolor{comment}{                                                              !! [H ~> m or kg m-2].}}
\DoxyCodeLine{385 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \textcolor{keywordtype}{intent(in)} :: h\_new\textcolor{comment}{ !< Layer thickness after entrainment}}
\DoxyCodeLine{386 \textcolor{comment}{                                                              !! [H ~> m or kg m-2].}}
\DoxyCodeLine{387 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \textcolor{keywordtype}{intent(in)} :: ea\textcolor{comment}{ !< an array to which the amount of}}
\DoxyCodeLine{388 \textcolor{comment}{                                          !! fluid entrained from the layer above during this call}}
\DoxyCodeLine{389 \textcolor{comment}{                                          !! will be added [H ~> m or kg m-2].}}
\DoxyCodeLine{390 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \textcolor{keywordtype}{intent(in)} :: eb\textcolor{comment}{ !< an array to which the amount of}}
\DoxyCodeLine{391 \textcolor{comment}{                                          !! fluid entrained from the layer below during this call}}
\DoxyCodeLine{392 \textcolor{comment}{                                          !! will be added [H ~> m or kg m-2].}}
\DoxyCodeLine{393   \textcolor{keywordtype}{type}(forcing),                         \textcolor{keywordtype}{intent(in)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to}}
\DoxyCodeLine{394 \textcolor{comment}{                                                              !! any possible forcing fields.}}
\DoxyCodeLine{395 \textcolor{comment}{                                                              !! Unused fields have NULL ptrs.}}
\DoxyCodeLine{396 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))},      \textcolor{keywordtype}{intent(in)} :: Hml\textcolor{comment}{    !< Mixed layer depth [Z ~> m]}}
\DoxyCodeLine{397 \textcolor{keywordtype}{  real},                                  \textcolor{keywordtype}{intent(in)} :: dt\textcolor{comment}{     !< The amount of time covered by this}}
\DoxyCodeLine{398 \textcolor{comment}{                                                              !! call [T ~> s]}}
\DoxyCodeLine{399   \textcolor{keywordtype}{type}(unit\_scale\_type),                 \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{     !< A dimensional unit scaling type}}
\DoxyCodeLine{400   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),                 \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{     !< A structure pointing to various}}
\DoxyCodeLine{401 \textcolor{comment}{                                                              !! thermodynamic variables.}}
\DoxyCodeLine{402   \textcolor{keywordtype}{type}(optics\_type),                     \textcolor{keywordtype}{pointer}    :: optics\textcolor{comment}{ !< The structure containing optical}}
\DoxyCodeLine{403 \textcolor{comment}{                                                              !! properties.}}
\DoxyCodeLine{404   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),          \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{     !< The control structure returned by}}
\DoxyCodeLine{405 \textcolor{comment}{                                                              !! a previous call to}}
\DoxyCodeLine{406 \textcolor{comment}{                                                              !! call\_tracer\_register.}}
\DoxyCodeLine{407   \textcolor{keywordtype}{logical},                               \textcolor{keywordtype}{intent(in)} :: debug\textcolor{comment}{  !< If true calculate checksums}}
\DoxyCodeLine{408 \textcolor{keywordtype}{  real},                        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: evap\_CFL\_limit\textcolor{comment}{ !< Limit on the fraction of}}
\DoxyCodeLine{409 \textcolor{comment}{                                                              !! the water that can be fluxed out}}
\DoxyCodeLine{410 \textcolor{comment}{                                                              !! of the top layer in a timestep [nondim]}}
\DoxyCodeLine{411 \textcolor{keywordtype}{  real},                        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: minimum\_forcing\_depth\textcolor{comment}{ !< The smallest depth over}}
\DoxyCodeLine{412 \textcolor{comment}{                                                              !! which fluxes can be applied [H ~> m or kg m-2]}}
\DoxyCodeLine{413 }
\DoxyCodeLine{414   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_column\_fns: "}// \&}
\DoxyCodeLine{415          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})}
\DoxyCodeLine{416 }
\DoxyCodeLine{417   \textcolor{comment}{! Use the applyTracerBoundaryFluxesInOut to handle surface fluxes}}
\DoxyCodeLine{418   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(evap\_cfl\_limit) .and. \textcolor{keyword}{present}(minimum\_forcing\_depth)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{419     \textcolor{comment}{! Add calls to tracer column functions here.}}
\DoxyCodeLine{420     \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \&}
\DoxyCodeLine{421       \textcolor{keyword}{call }tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{422                                  g, gv, us, cs\%USER\_tracer\_example\_CSp)}
\DoxyCodeLine{423     \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) \&}
\DoxyCodeLine{424       \textcolor{keyword}{call }dome\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{425                                       g, gv, us, cs\%DOME\_tracer\_CSp, \&}
\DoxyCodeLine{426                                       evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{427                                       minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{428     \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) \&}
\DoxyCodeLine{429       \textcolor{keyword}{call }isomip\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{430                                         g, gv, us, cs\%ISOMIP\_tracer\_CSp, \&}
\DoxyCodeLine{431                                         evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{432                                         minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{433     \textcolor{keywordflow}{if} (cs\%use\_RGC\_tracer) \&}
\DoxyCodeLine{434       \textcolor{keyword}{call }rgc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{435                                         g, gv, us, cs\%RGC\_tracer\_CSp, \&}
\DoxyCodeLine{436                                         evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{437                                         minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{438     \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \&}
\DoxyCodeLine{439       \textcolor{keyword}{call }ideal\_age\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{440                                            g, gv, us, cs\%ideal\_age\_tracer\_CSp, \&}
\DoxyCodeLine{441                                            evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{442                                            minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{443     \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \&}
\DoxyCodeLine{444       \textcolor{keyword}{call }dye\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{445                                      g, gv, us, cs\%dye\_tracer\_CSp, \&}
\DoxyCodeLine{446                                      evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{447                                      minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{448     \textcolor{keywordflow}{if} (cs\%use\_oil) \&}
\DoxyCodeLine{449       \textcolor{keyword}{call }oil\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{450                                      g, gv, us, cs\%oil\_tracer\_CSp, tv, \&}
\DoxyCodeLine{451                                      evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{452                                      minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{453 }
\DoxyCodeLine{454     \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \&}
\DoxyCodeLine{455       \textcolor{keyword}{call }advection\_test\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{456                                                 g, gv, us, cs\%advection\_test\_tracer\_CSp, \&}
\DoxyCodeLine{457                                                 evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{458                                                 minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{459     \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \&}
\DoxyCodeLine{460       \textcolor{keyword}{call }ocmip2\_cfc\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{461                                      g, gv, us, cs\%OCMIP2\_CFC\_CSp, \&}
\DoxyCodeLine{462                                      evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{463                                      minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{464     \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{465       \textcolor{keywordflow}{if} (us\%QRZ\_T\_to\_W\_m2 /= 1.0) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_generic\_tracer\_column\_physics "}//\&}
\DoxyCodeLine{466             \textcolor{stringliteral}{"has not been written to permit dimensionsal rescaling.  Set all 4 of the "}//\&}
\DoxyCodeLine{467             \textcolor{stringliteral}{"[QRZT]\_RESCALE\_POWER parameters to 0."})}
\DoxyCodeLine{468       \textcolor{keyword}{call }mom\_generic\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, hml, us\%T\_to\_s*dt, \&}
\DoxyCodeLine{469                                              g, gv, cs\%MOM\_generic\_tracer\_CSp, tv, optics, \&}
\DoxyCodeLine{470                                              evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{471                                              minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{472 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{473     \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) \&}
\DoxyCodeLine{474       \textcolor{keyword}{call }pseudo\_salt\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{475                                      g, gv, us, cs\%pseudo\_salt\_tracer\_CSp, tv, debug, \&}
\DoxyCodeLine{476                                      evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{477                                      minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{478     \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) \&}
\DoxyCodeLine{479       \textcolor{keyword}{call }boundary\_impulse\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{480                                      g, gv, us, cs\%boundary\_impulse\_tracer\_CSp, tv, debug, \&}
\DoxyCodeLine{481                                      evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{482                                      minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{483     \textcolor{keywordflow}{if} (cs\%use\_dyed\_obc\_tracer) \&}
\DoxyCodeLine{484       \textcolor{keyword}{call }dyed\_obc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{485                                       g, gv, us, cs\%dyed\_obc\_tracer\_CSp, \&}
\DoxyCodeLine{486                                       evap\_cfl\_limit=evap\_cfl\_limit, \&}
\DoxyCodeLine{487                                       minimum\_forcing\_depth=minimum\_forcing\_depth)}
\DoxyCodeLine{488 }
\DoxyCodeLine{489 }
\DoxyCodeLine{490   \textcolor{keywordflow}{else} \textcolor{comment}{! Apply tracer surface fluxes using ea on the first layer}}
\DoxyCodeLine{491     \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \&}
\DoxyCodeLine{492       \textcolor{keyword}{call }tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{493                                  g, gv, us, cs\%USER\_tracer\_example\_CSp)}
\DoxyCodeLine{494     \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) \&}
\DoxyCodeLine{495       \textcolor{keyword}{call }dome\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{496                                       g, gv, us, cs\%DOME\_tracer\_CSp)}
\DoxyCodeLine{497     \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) \&}
\DoxyCodeLine{498       \textcolor{keyword}{call }isomip\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{499                                       g, gv, us, cs\%ISOMIP\_tracer\_CSp)}
\DoxyCodeLine{500     \textcolor{keywordflow}{if} (cs\%use\_RGC\_tracer) \&}
\DoxyCodeLine{501       \textcolor{keyword}{call }rgc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{502                                       g, gv, us, cs\%RGC\_tracer\_CSp)}
\DoxyCodeLine{503     \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \&}
\DoxyCodeLine{504       \textcolor{keyword}{call }ideal\_age\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{505                                            g, gv, us, cs\%ideal\_age\_tracer\_CSp)}
\DoxyCodeLine{506     \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \&}
\DoxyCodeLine{507       \textcolor{keyword}{call }dye\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{508                                            g, gv, us, cs\%dye\_tracer\_CSp)}
\DoxyCodeLine{509     \textcolor{keywordflow}{if} (cs\%use\_oil) \&}
\DoxyCodeLine{510       \textcolor{keyword}{call }oil\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{511                                      g, gv, us, cs\%oil\_tracer\_CSp, tv)}
\DoxyCodeLine{512     \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \&}
\DoxyCodeLine{513       \textcolor{keyword}{call }advection\_test\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{514                                       g, gv, us, cs\%advection\_test\_tracer\_CSp)}
\DoxyCodeLine{515     \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \&}
\DoxyCodeLine{516       \textcolor{keyword}{call }ocmip2\_cfc\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{517                                      g, gv, us, cs\%OCMIP2\_CFC\_CSp)}
\DoxyCodeLine{518     \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{519       \textcolor{keywordflow}{if} (us\%QRZ\_T\_to\_W\_m2 /= 1.0) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_generic\_tracer\_column\_physics "}//\&}
\DoxyCodeLine{520             \textcolor{stringliteral}{"has not been written to permit dimensionsal rescaling.  Set all 4 of the "}//\&}
\DoxyCodeLine{521             \textcolor{stringliteral}{"[QRZT]\_RESCALE\_POWER parameters to 0."})}
\DoxyCodeLine{522       \textcolor{keyword}{call }mom\_generic\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, hml, us\%T\_to\_s*dt, \&}
\DoxyCodeLine{523                                      g, gv, cs\%MOM\_generic\_tracer\_CSp, tv, optics)}
\DoxyCodeLine{524 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{525     \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) \&}
\DoxyCodeLine{526       \textcolor{keyword}{call }pseudo\_salt\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{527                                      g, gv, us, cs\%pseudo\_salt\_tracer\_CSp, tv, debug)}
\DoxyCodeLine{528     \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) \&}
\DoxyCodeLine{529       \textcolor{keyword}{call }boundary\_impulse\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{530                                      g, gv, us, cs\%boundary\_impulse\_tracer\_CSp, tv, debug)}
\DoxyCodeLine{531     \textcolor{keywordflow}{if} (cs\%use\_dyed\_obc\_tracer) \&}
\DoxyCodeLine{532       \textcolor{keyword}{call }dyed\_obc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, \&}
\DoxyCodeLine{533                                       g, gv, us, cs\%dyed\_obc\_tracer\_CSp)}
\DoxyCodeLine{534 }
\DoxyCodeLine{535 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{536 }
\DoxyCodeLine{537 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_a736899f8b0b79d0e98384abf2b084880}\label{namespacemom__tracer__flow__control_a736899f8b0b79d0e98384abf2b084880}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_flux\_init@{call\_tracer\_flux\_init}}
\index{call\_tracer\_flux\_init@{call\_tracer\_flux\_init}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_flux\_init()}{call\_tracer\_flux\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+flux\+\_\+init (\begin{DoxyParamCaption}\item[{integer, intent(in), optional}]{verbosity }\end{DoxyParamCaption})}



This subroutine carries out a series of calls to initialize the air-\/sea tracer fluxes, but it does not record the generated indicies, and it may be called {\itshape before} the ocean model has been initialized and may be called on non-\/ocean P\+Es. It is not necessary to call this routine for ocean-\/only runs, because the same calls are made again inside of the routines called by call\+\_\+tracer\+\_\+register. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em verbosity} & A 0-\/9 integer indicating a level of verbosity. \\
\hline
\end{DoxyParams}


Definition at line 113 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{113   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: verbosity\textcolor{comment}{ !< A 0-9 integer indicating a level of verbosity.}}
\DoxyCodeLine{114 }
\DoxyCodeLine{115   \textcolor{keywordtype}{type}(param\_file\_type) :: param\_file \textcolor{comment}{! A structure to parse for run-time parameters}}
\DoxyCodeLine{116   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"call\_tracer\_flux\_init"}  \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{117   \textcolor{keywordtype}{logical} :: use\_OCMIP\_CFCs, use\_MOM\_generic\_tracer}
\DoxyCodeLine{118 }
\DoxyCodeLine{119   \textcolor{comment}{! Determine which tracer routines with tracer fluxes are to be called.  Note}}
\DoxyCodeLine{120   \textcolor{comment}{! that not every tracer package is required to have a flux\_init call.}}
\DoxyCodeLine{121   \textcolor{keyword}{call }get\_mom\_input(param\_file, check\_params=.false.)}
\DoxyCodeLine{122 }
\DoxyCodeLine{123   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OCMIP2\_CFC"}, use\_ocmip\_cfcs, \&}
\DoxyCodeLine{124                  default=.false., do\_not\_log=.true.)}
\DoxyCodeLine{125   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_generic\_tracer"}, use\_mom\_generic\_tracer,\&}
\DoxyCodeLine{126                  default=.false., do\_not\_log=.true.)}
\DoxyCodeLine{127   \textcolor{keyword}{call }close\_param\_file(param\_file, quiet\_close=.true.)}
\DoxyCodeLine{128 }
\DoxyCodeLine{129   \textcolor{keywordflow}{if} (use\_ocmip\_cfcs) \textcolor{keyword}{call }flux\_init\_ocmip2\_cfc(verbosity=verbosity)}
\DoxyCodeLine{130   \textcolor{keywordflow}{if} (use\_mom\_generic\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{131     \textcolor{keyword}{call }mom\_generic\_flux\_init(verbosity=verbosity)}
\DoxyCodeLine{132 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{133 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_aa72e59a493bcf226ece1f0520bec635f}\label{namespacemom__tracer__flow__control_aa72e59a493bcf226ece1f0520bec635f}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_register@{call\_tracer\_register}}
\index{call\_tracer\_register@{call\_tracer\_register}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_register()}{call\_tracer\_register()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+register (\begin{DoxyParamCaption}\item[{type(hor\+\_\+index\+\_\+type), intent(in)}]{HI,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS,  }\item[{type(tracer\+\_\+registry\+\_\+type), pointer}]{tr\+\_\+\+Reg,  }\item[{type(mom\+\_\+restart\+\_\+cs), pointer}]{restart\+\_\+\+CS }\end{DoxyParamCaption})}



This subroutine determines which tracer packages are to be used and does the calls to register their tracers to be advected, diffused, and read from restarts. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em hi} & A horizontal index type structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters. \\
\hline
 & {\em cs} & A pointer that is set to point to the control structure for this module. \\
\hline
 & {\em tr\+\_\+reg} & A pointer that is set to point to the control structure for the tracer advection and diffusion module. \\
\hline
 & {\em restart\+\_\+cs} & A pointer to the restart control structure. \\
\hline
\end{DoxyParams}


Definition at line 142 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{142   \textcolor{keywordtype}{type}(hor\_index\_type),         \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{         !< A horizontal index type structure.}}
\DoxyCodeLine{143   \textcolor{keywordtype}{type}(verticalGrid\_type),      \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{         !< The ocean's vertical grid structure.}}
\DoxyCodeLine{144   \textcolor{keywordtype}{type}(unit\_scale\_type),        \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{         !< A dimensional unit scaling type}}
\DoxyCodeLine{145   \textcolor{keywordtype}{type}(param\_file\_type),        \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-time}}
\DoxyCodeLine{146 \textcolor{comment}{                                                         !! parameters.}}
\DoxyCodeLine{147   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{         !< A pointer that is set to point to the}}
\DoxyCodeLine{148 \textcolor{comment}{                                                         !! control structure for this module.}}
\DoxyCodeLine{149   \textcolor{keywordtype}{type}(tracer\_registry\_type),   \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{     !< A pointer that is set to point to the}}
\DoxyCodeLine{150 \textcolor{comment}{                                                         !! control structure for the tracer}}
\DoxyCodeLine{151 \textcolor{comment}{                                                         !! advection and diffusion module.}}
\DoxyCodeLine{152   \textcolor{keywordtype}{type}(MOM\_restart\_CS),         \textcolor{keywordtype}{pointer}    :: restart\_CS\textcolor{comment}{ !< A pointer to the restart control}}
\DoxyCodeLine{153 \textcolor{comment}{                                                         !! structure.}}
\DoxyCodeLine{154 }
\DoxyCodeLine{155 }
\DoxyCodeLine{156   \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{157 \textcolor{preprocessor}{\# include "version\_variable.h"}}
\DoxyCodeLine{158 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_tracer\_flow\_control"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{159 }
\DoxyCodeLine{160   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{161     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"call\_tracer\_register called with an associated "}// \&}
\DoxyCodeLine{162                             \textcolor{stringliteral}{"control structure."})}
\DoxyCodeLine{163     \textcolor{keywordflow}{return}}
\DoxyCodeLine{164   \textcolor{keywordflow}{else} ; \textcolor{keyword}{allocate}(cs) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{165 }
\DoxyCodeLine{166   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{167   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{168   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_USER\_TRACER\_EXAMPLE"}, \&}
\DoxyCodeLine{169                                 cs\%use\_USER\_tracer\_example, \&}
\DoxyCodeLine{170                  \textcolor{stringliteral}{"If true, use the USER\_tracer\_example tracer package."}, \&}
\DoxyCodeLine{171                  default=.false.)}
\DoxyCodeLine{172   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_DOME\_TRACER"}, cs\%use\_DOME\_tracer, \&}
\DoxyCodeLine{173                  \textcolor{stringliteral}{"If true, use the DOME\_tracer tracer package."}, \&}
\DoxyCodeLine{174                  default=.false.)}
\DoxyCodeLine{175   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_ISOMIP\_TRACER"}, cs\%use\_ISOMIP\_tracer, \&}
\DoxyCodeLine{176                  \textcolor{stringliteral}{"If true, use the ISOMIP\_tracer tracer package."}, \&}
\DoxyCodeLine{177                  default=.false.)}
\DoxyCodeLine{178   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_RGC\_TRACER"}, cs\%use\_RGC\_tracer, \&}
\DoxyCodeLine{179                  \textcolor{stringliteral}{"If true, use the RGC\_tracer tracer package."}, \&}
\DoxyCodeLine{180                  default=.false.)}
\DoxyCodeLine{181   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_IDEAL\_AGE\_TRACER"}, cs\%use\_ideal\_age, \&}
\DoxyCodeLine{182                  \textcolor{stringliteral}{"If true, use the ideal\_age\_example tracer package."}, \&}
\DoxyCodeLine{183                  default=.false.)}
\DoxyCodeLine{184   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_REGIONAL\_DYES"}, cs\%use\_regional\_dyes, \&}
\DoxyCodeLine{185                  \textcolor{stringliteral}{"If true, use the regional\_dyes tracer package."}, \&}
\DoxyCodeLine{186                  default=.false.)}
\DoxyCodeLine{187   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OIL\_TRACER"}, cs\%use\_oil, \&}
\DoxyCodeLine{188                  \textcolor{stringliteral}{"If true, use the oil\_tracer tracer package."}, \&}
\DoxyCodeLine{189                  default=.false.)}
\DoxyCodeLine{190   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_ADVECTION\_TEST\_TRACER"}, cs\%use\_advection\_test\_tracer, \&}
\DoxyCodeLine{191                  \textcolor{stringliteral}{"If true, use the advection\_test\_tracer tracer package."}, \&}
\DoxyCodeLine{192                  default=.false.)}
\DoxyCodeLine{193   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OCMIP2\_CFC"}, cs\%use\_OCMIP2\_CFC, \&}
\DoxyCodeLine{194                  \textcolor{stringliteral}{"If true, use the MOM\_OCMIP2\_CFC tracer package."}, \&}
\DoxyCodeLine{195                  default=.false.)}
\DoxyCodeLine{196   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_generic\_tracer"}, cs\%use\_MOM\_generic\_tracer, \&}
\DoxyCodeLine{197                  \textcolor{stringliteral}{"If true and \_USE\_GENERIC\_TRACER is defined as a "}//\&}
\DoxyCodeLine{198                  \textcolor{stringliteral}{"preprocessor macro, use the MOM\_generic\_tracer packages."}, \&}
\DoxyCodeLine{199                  default=.false.)}
\DoxyCodeLine{200   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_PSEUDO\_SALT\_TRACER"}, cs\%use\_pseudo\_salt\_tracer, \&}
\DoxyCodeLine{201                  \textcolor{stringliteral}{"If true, use the pseudo salt tracer, typically run as a diagnostic."}, \&}
\DoxyCodeLine{202                  default=.false.)}
\DoxyCodeLine{203   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_BOUNDARY\_IMPULSE\_TRACER"}, cs\%use\_boundary\_impulse\_tracer, \&}
\DoxyCodeLine{204                  \textcolor{stringliteral}{"If true, use the boundary impulse tracer."}, \&}
\DoxyCodeLine{205                  default=.false.)}
\DoxyCodeLine{206   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_DYED\_OBC\_TRACER"}, cs\%use\_dyed\_obc\_tracer, \&}
\DoxyCodeLine{207                  \textcolor{stringliteral}{"If true, use the dyed\_obc\_tracer tracer package."}, \&}
\DoxyCodeLine{208                  default=.false.)}
\DoxyCodeLine{209 }
\DoxyCodeLine{210 \textcolor{comment}{!    Add other user-provided calls to register tracers for restarting here. Each}}
\DoxyCodeLine{211 \textcolor{comment}{!  tracer package registration call returns a logical false if it cannot be run}}
\DoxyCodeLine{212 \textcolor{comment}{!  for some reason.  This then overrides the run-time selection from above.}}
\DoxyCodeLine{213   \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) cs\%use\_USER\_tracer\_example = \&}
\DoxyCodeLine{214     user\_register\_tracer\_example(hi, gv, param\_file, cs\%USER\_tracer\_example\_CSp, \&}
\DoxyCodeLine{215                                  tr\_reg, restart\_cs)}
\DoxyCodeLine{216   \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) cs\%use\_DOME\_tracer = \&}
\DoxyCodeLine{217     register\_dome\_tracer(hi, gv, param\_file, cs\%DOME\_tracer\_CSp, \&}
\DoxyCodeLine{218                          tr\_reg, restart\_cs)}
\DoxyCodeLine{219   \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) cs\%use\_ISOMIP\_tracer = \&}
\DoxyCodeLine{220     register\_isomip\_tracer(hi, gv, param\_file, cs\%ISOMIP\_tracer\_CSp, \&}
\DoxyCodeLine{221                            tr\_reg, restart\_cs)}
\DoxyCodeLine{222   \textcolor{keywordflow}{if} (cs\%use\_RGC\_tracer) cs\%use\_RGC\_tracer = \&}
\DoxyCodeLine{223     register\_rgc\_tracer(hi, gv, param\_file, cs\%RGC\_tracer\_CSp, \&}
\DoxyCodeLine{224                            tr\_reg, restart\_cs)}
\DoxyCodeLine{225   \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) cs\%use\_ideal\_age = \&}
\DoxyCodeLine{226     register\_ideal\_age\_tracer(hi, gv, param\_file,  cs\%ideal\_age\_tracer\_CSp, \&}
\DoxyCodeLine{227                               tr\_reg, restart\_cs)}
\DoxyCodeLine{228   \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) cs\%use\_regional\_dyes = \&}
\DoxyCodeLine{229     register\_dye\_tracer(hi, gv, us, param\_file,  cs\%dye\_tracer\_CSp, \&}
\DoxyCodeLine{230                         tr\_reg, restart\_cs)}
\DoxyCodeLine{231   \textcolor{keywordflow}{if} (cs\%use\_oil) cs\%use\_oil = \&}
\DoxyCodeLine{232     register\_oil\_tracer(hi, gv, us, param\_file,  cs\%oil\_tracer\_CSp, \&}
\DoxyCodeLine{233                         tr\_reg, restart\_cs)}
\DoxyCodeLine{234   \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) cs\%use\_advection\_test\_tracer = \&}
\DoxyCodeLine{235     register\_advection\_test\_tracer(hi, gv, param\_file, cs\%advection\_test\_tracer\_CSp, \&}
\DoxyCodeLine{236                                    tr\_reg, restart\_cs)}
\DoxyCodeLine{237   \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) cs\%use\_OCMIP2\_CFC = \&}
\DoxyCodeLine{238     register\_ocmip2\_cfc(hi, gv, param\_file,  cs\%OCMIP2\_CFC\_CSp, \&}
\DoxyCodeLine{239                         tr\_reg, restart\_cs)}
\DoxyCodeLine{240   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) cs\%use\_MOM\_generic\_tracer = \&}
\DoxyCodeLine{241     register\_mom\_generic\_tracer(hi, gv, param\_file,  cs\%MOM\_generic\_tracer\_CSp, \&}
\DoxyCodeLine{242                                 tr\_reg, restart\_cs)}
\DoxyCodeLine{243   \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) cs\%use\_pseudo\_salt\_tracer = \&}
\DoxyCodeLine{244     register\_pseudo\_salt\_tracer(hi, gv, param\_file,  cs\%pseudo\_salt\_tracer\_CSp, \&}
\DoxyCodeLine{245                                 tr\_reg, restart\_cs)}
\DoxyCodeLine{246   \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) cs\%use\_boundary\_impulse\_tracer = \&}
\DoxyCodeLine{247     register\_boundary\_impulse\_tracer(hi, gv, param\_file,  cs\%boundary\_impulse\_tracer\_CSp, \&}
\DoxyCodeLine{248                                      tr\_reg, restart\_cs)}
\DoxyCodeLine{249   \textcolor{keywordflow}{if} (cs\%use\_dyed\_obc\_tracer) cs\%use\_dyed\_obc\_tracer = \&}
\DoxyCodeLine{250     register\_dyed\_obc\_tracer(hi, gv, param\_file, cs\%dyed\_obc\_tracer\_CSp, \&}
\DoxyCodeLine{251                              tr\_reg, restart\_cs)}
\DoxyCodeLine{252 }
\DoxyCodeLine{253 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_a7c528b4f0654399b58736530f2ad0df7}\label{namespacemom__tracer__flow__control_a7c528b4f0654399b58736530f2ad0df7}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_set\_forcing@{call\_tracer\_set\_forcing}}
\index{call\_tracer\_set\_forcing@{call\_tracer\_set\_forcing}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_set\_forcing()}{call\_tracer\_set\_forcing()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+set\+\_\+forcing (\begin{DoxyParamCaption}\item[{type(surface), intent(inout)}]{sfc\+\_\+state,  }\item[{type(forcing), intent(inout)}]{fluxes,  }\item[{type(time\+\_\+type), intent(in)}]{day\+\_\+start,  }\item[{type(time\+\_\+type), intent(in)}]{day\+\_\+interval,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine calls the individual tracer modules\textquotesingle{} subroutines to specify or read quantities related to their surface forcing. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean. \\
\hline
\mbox{\texttt{ in,out}}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs. \\
\hline
\mbox{\texttt{ in}}  & {\em day\+\_\+start} & Start time of the fluxes. \\
\hline
\mbox{\texttt{ in}}  & {\em day\+\_\+interval} & Length of time over which these fluxes will be applied. \\
\hline
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\end{DoxyParams}


Definition at line 356 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{356 }
\DoxyCodeLine{357   \textcolor{keywordtype}{type}(surface),                \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}}
\DoxyCodeLine{358 \textcolor{comment}{                                                           !! describe the surface state of the}}
\DoxyCodeLine{359 \textcolor{comment}{                                                           !! ocean.}}
\DoxyCodeLine{360   \textcolor{keywordtype}{type}(forcing),                \textcolor{keywordtype}{intent(inout)} :: fluxes\textcolor{comment}{    !< A structure containing pointers to any}}
\DoxyCodeLine{361 \textcolor{comment}{                                                           !! possible forcing fields. Unused fields}}
\DoxyCodeLine{362 \textcolor{comment}{                                                           !! have NULL ptrs.}}
\DoxyCodeLine{363   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)}    :: day\_start\textcolor{comment}{ !< Start time of the fluxes.}}
\DoxyCodeLine{364   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)}    :: day\_interval\textcolor{comment}{ !< Length of time over which these}}
\DoxyCodeLine{365 \textcolor{comment}{                                                           !! fluxes will be applied.}}
\DoxyCodeLine{366   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{         !< The ocean's grid structure.}}
\DoxyCodeLine{367   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{        !< The control structure returned by a}}
\DoxyCodeLine{368 \textcolor{comment}{                                                           !! previous call to call\_tracer\_register.}}
\DoxyCodeLine{369 }
\DoxyCodeLine{370   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_set\_forcing"}// \&}
\DoxyCodeLine{371          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})}
\DoxyCodeLine{372 \textcolor{comment}{!  if (CS\%use\_ideal\_age) \&}}
\DoxyCodeLine{373 \textcolor{comment}{!    call ideal\_age\_tracer\_set\_forcing(sfc\_state, fluxes, day\_start, day\_interval, \&}}
\DoxyCodeLine{374 \textcolor{comment}{!                                      G, CS\%ideal\_age\_tracer\_CSp)}}
\DoxyCodeLine{375 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_afd8526344e928c8c9505c921bf37447f}\label{namespacemom__tracer__flow__control_afd8526344e928c8c9505c921bf37447f}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_stocks@{call\_tracer\_stocks}}
\index{call\_tracer\_stocks@{call\_tracer\_stocks}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_stocks()}{call\_tracer\_stocks()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+stocks (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{h,  }\item[{real, dimension(\+:), intent(out)}]{stock\+\_\+values,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS,  }\item[{character(len=$\ast$), dimension(\+:), intent(out), optional}]{stock\+\_\+names,  }\item[{character(len=$\ast$), dimension(\+:), intent(out), optional}]{stock\+\_\+units,  }\item[{integer, intent(out), optional}]{num\+\_\+stocks,  }\item[{integer, intent(in), optional}]{stock\+\_\+index,  }\item[{logical, dimension(\+:), intent(inout), optional}]{got\+\_\+min\+\_\+max,  }\item[{real, dimension(\+:), intent(out), optional}]{global\+\_\+min,  }\item[{real, dimension(\+:), intent(out), optional}]{global\+\_\+max,  }\item[{real, dimension(\+:), intent(out), optional}]{xgmin,  }\item[{real, dimension(\+:), intent(out), optional}]{ygmin,  }\item[{real, dimension(\+:), intent(out), optional}]{zgmin,  }\item[{real, dimension(\+:), intent(out), optional}]{xgmax,  }\item[{real, dimension(\+:), intent(out), optional}]{ygmax,  }\item[{real, dimension(\+:), intent(out), optional}]{zgmax }\end{DoxyParamCaption})}



This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional. 


\begin{DoxyParams}[1]{Parameters}
\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 h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em stock\+\_\+values} & The integrated amounts of a tracer on the current PE, usually in kg x concentration \mbox{[}kg conc\mbox{]}. \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\mbox{\texttt{ out}}  & {\em stock\+\_\+names} & Diagnostic names to use for each stock. \\
\hline
\mbox{\texttt{ out}}  & {\em stock\+\_\+units} & Units to use in the metadata for each stock. \\
\hline
\mbox{\texttt{ out}}  & {\em num\+\_\+stocks} & The number of tracer stocks being returned. \\
\hline
\mbox{\texttt{ in}}  & {\em stock\+\_\+index} & The integer stock index from stocks\+\_\+constants\+\_\+mod of the stock to be returned. If this is present and greater than 0, only a single stock can be returned. \\
\hline
\mbox{\texttt{ in,out}}  & {\em got\+\_\+min\+\_\+max} & Indicates whether the global min and \\
\hline
\mbox{\texttt{ out}}  & {\em global\+\_\+min} & The global minimum of each tracer \\
\hline
\mbox{\texttt{ out}}  & {\em global\+\_\+max} & The global maximum of each tracer \\
\hline
\mbox{\texttt{ out}}  & {\em xgmin} & The x-\/position of the global minimum \\
\hline
\mbox{\texttt{ out}}  & {\em ygmin} & The y-\/position of the global minimum \\
\hline
\mbox{\texttt{ out}}  & {\em zgmin} & The z-\/position of the global minimum \\
\hline
\mbox{\texttt{ out}}  & {\em xgmax} & The x-\/position of the global maximum \\
\hline
\mbox{\texttt{ out}}  & {\em ygmax} & The y-\/position of the global maximum \\
\hline
\mbox{\texttt{ out}}  & {\em zgmax} & The z-\/position of the global maximum \\
\hline
\end{DoxyParams}


Definition at line 545 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{545   \textcolor{keywordtype}{type}(ocean\_grid\_type),          \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{           !< The ocean's grid structure.}}
\DoxyCodeLine{546   \textcolor{keywordtype}{type}(verticalGrid\_type),        \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{          !< The ocean's vertical grid structure.}}
\DoxyCodeLine{547 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))},    \&}
\DoxyCodeLine{548                                   \textcolor{keywordtype}{intent(in)}  :: h\textcolor{comment}{           !< Layer thicknesses [H ~> m or kg m-2]}}
\DoxyCodeLine{549 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},             \textcolor{keywordtype}{intent(out)} :: stock\_values\textcolor{comment}{ !< The integrated amounts of a tracer}}
\DoxyCodeLine{550 \textcolor{comment}{                             !! on the current PE, usually in kg x concentration [kg conc].}}
\DoxyCodeLine{551   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),   \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{          !< The control structure returned by a}}
\DoxyCodeLine{552 \textcolor{comment}{                                                             !! previous call to}}
\DoxyCodeLine{553 \textcolor{comment}{                                                             !! call\_tracer\_register.}}
\DoxyCodeLine{554   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{555                         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: stock\_names\textcolor{comment}{ !< Diagnostic names to use for each stock.}}
\DoxyCodeLine{556   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{557                         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: stock\_units\textcolor{comment}{ !< Units to use in the metadata for each stock.}}
\DoxyCodeLine{558   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: num\_stocks\textcolor{comment}{  !< The number of tracer stocks being returned.}}
\DoxyCodeLine{559   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: stock\_index\textcolor{comment}{ !< The integer stock index from}}
\DoxyCodeLine{560 \textcolor{comment}{                             !! stocks\_constants\_mod of the stock to be returned.  If this is}}
\DoxyCodeLine{561 \textcolor{comment}{                             !! present and greater than 0, only a single stock can be returned.}}
\DoxyCodeLine{562   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{563                       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: got\_min\_max\textcolor{comment}{ !< Indicates whether the global min and}}
\DoxyCodeLine{564 \textcolor{comment}{                                                             !! max are found for each tracer}}
\DoxyCodeLine{565 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: global\_min\textcolor{comment}{  !< The global minimum of each tracer}}
\DoxyCodeLine{566 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: global\_max\textcolor{comment}{  !< The global maximum of each tracer}}
\DoxyCodeLine{567 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: xgmin\textcolor{comment}{       !< The x-position of the global minimum}}
\DoxyCodeLine{568 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: ygmin\textcolor{comment}{       !< The y-position of the global minimum}}
\DoxyCodeLine{569 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: zgmin\textcolor{comment}{       !< The z-position of the global minimum}}
\DoxyCodeLine{570 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: xgmax\textcolor{comment}{       !< The x-position of the global maximum}}
\DoxyCodeLine{571 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: ygmax\textcolor{comment}{       !< The y-position of the global maximum}}
\DoxyCodeLine{572 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: zgmax\textcolor{comment}{       !< The z-position of the global maximum}}
\DoxyCodeLine{573 }
\DoxyCodeLine{574   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{575   \textcolor{keywordtype}{character(len=200)}, \textcolor{keywordtype}{dimension(MAX\_FIELDS\_)} :: names, units}
\DoxyCodeLine{576   \textcolor{keywordtype}{character(len=200)} :: set\_pkg\_name}
\DoxyCodeLine{577 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(MAX\_FIELDS\_)} :: values}
\DoxyCodeLine{578   \textcolor{keywordtype}{integer} :: max\_ns, ns\_tot, ns, index, pkg, max\_pkgs, nn}
\DoxyCodeLine{579 }
\DoxyCodeLine{580   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_stocks: "}// \&}
\DoxyCodeLine{581        \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})}
\DoxyCodeLine{582 }
\DoxyCodeLine{583   index = -1 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_index)) index = stock\_index}
\DoxyCodeLine{584   ns\_tot = 0}
\DoxyCodeLine{585   max\_ns = \textcolor{keyword}{size}(stock\_values)}
\DoxyCodeLine{586   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_names)) max\_ns = min(max\_ns,\textcolor{keyword}{size}(stock\_names))}
\DoxyCodeLine{587   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_units)) max\_ns = min(max\_ns,\textcolor{keyword}{size}(stock\_units))}
\DoxyCodeLine{588 }
\DoxyCodeLine{589 \textcolor{comment}{!  Add other user-provided calls here.}}
\DoxyCodeLine{590   \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \textcolor{keywordflow}{then}}
\DoxyCodeLine{591     ns = user\_tracer\_stock(h, values, g, gv, cs\%USER\_tracer\_example\_CSp, \&}
\DoxyCodeLine{592                            names, units, stock\_index)}
\DoxyCodeLine{593     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"tracer\_example"}, ns, names, units, values, index, stock\_values, \&}
\DoxyCodeLine{594                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{595 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{596 \textcolor{comment}{! if (CS\%use\_DOME\_tracer) then}}
\DoxyCodeLine{597 \textcolor{comment}{!   ns = DOME\_tracer\_stock(h, values, G, GV, CS\%DOME\_tracer\_CSp, \&}}
\DoxyCodeLine{598 \textcolor{comment}{!                          names, units, stock\_index)}}
\DoxyCodeLine{599 \textcolor{comment}{!   call store\_stocks("DOME\_tracer", ns, names, units, values, index, stock\_values, \&}}
\DoxyCodeLine{600 \textcolor{comment}{!                      set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}}
\DoxyCodeLine{601 \textcolor{comment}{! endif}}
\DoxyCodeLine{602   \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \textcolor{keywordflow}{then}}
\DoxyCodeLine{603     ns = ideal\_age\_stock(h, values, g, gv, cs\%ideal\_age\_tracer\_CSp, \&}
\DoxyCodeLine{604                          names, units, stock\_index)}
\DoxyCodeLine{605     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"ideal\_age\_example"}, ns, names, units, values, index, \&}
\DoxyCodeLine{606            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{607 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{608   \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \textcolor{keywordflow}{then}}
\DoxyCodeLine{609     ns = dye\_stock(h, values, g, gv, cs\%dye\_tracer\_CSp, \&}
\DoxyCodeLine{610                          names, units, stock\_index)}
\DoxyCodeLine{611     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"regional\_dyes"}, ns, names, units, values, index, \&}
\DoxyCodeLine{612            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{613 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{614   \textcolor{keywordflow}{if} (cs\%use\_oil) \textcolor{keywordflow}{then}}
\DoxyCodeLine{615     ns = oil\_stock(h, values, g, gv, cs\%oil\_tracer\_CSp, \&}
\DoxyCodeLine{616                          names, units, stock\_index)}
\DoxyCodeLine{617     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"oil\_tracer"}, ns, names, units, values, index, \&}
\DoxyCodeLine{618            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{619 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{620   \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \textcolor{keywordflow}{then}}
\DoxyCodeLine{621     ns = ocmip2\_cfc\_stock(h, values, g, gv, cs\%OCMIP2\_CFC\_CSp, names, units, stock\_index)}
\DoxyCodeLine{622     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"MOM\_OCMIP2\_CFC"}, ns, names, units, values, index, stock\_values, \&}
\DoxyCodeLine{623                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{624 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{625 }
\DoxyCodeLine{626   \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{627     ns = advection\_test\_stock( h, values, g, gv, cs\%advection\_test\_tracer\_CSp, \&}
\DoxyCodeLine{628                          names, units, stock\_index )}
\DoxyCodeLine{629     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"advection\_test\_tracer"}, ns, names, units, values, index, \&}
\DoxyCodeLine{630            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{631 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{632 }
\DoxyCodeLine{633   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{634     ns = mom\_generic\_tracer\_stock(h, values, g, gv, cs\%MOM\_generic\_tracer\_CSp, \&}
\DoxyCodeLine{635                                    names, units, stock\_index)}
\DoxyCodeLine{636     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"MOM\_generic\_tracer"}, ns, names, units, values, index, stock\_values, \&}
\DoxyCodeLine{637                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{638     nn=ns\_tot-ns+1}
\DoxyCodeLine{639     nn=mom\_generic\_tracer\_min\_max(nn, got\_min\_max, global\_min,  global\_max, \&}
\DoxyCodeLine{640                                   xgmin, ygmin, zgmin, xgmax, ygmax, zgmax ,\&}
\DoxyCodeLine{641                                   g, cs\%MOM\_generic\_tracer\_CSp,names, units)}
\DoxyCodeLine{642 }
\DoxyCodeLine{643 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{644   \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{645     ns = pseudo\_salt\_stock(h, values, g, gv, cs\%pseudo\_salt\_tracer\_CSp, \&}
\DoxyCodeLine{646                          names, units, stock\_index)}
\DoxyCodeLine{647     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"pseudo\_salt\_tracer"}, ns, names, units, values, index, \&}
\DoxyCodeLine{648            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{649 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{650 }
\DoxyCodeLine{651   \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{652     ns = boundary\_impulse\_stock(h, values, g, gv, cs\%boundary\_impulse\_tracer\_CSp, \&}
\DoxyCodeLine{653                          names, units, stock\_index)}
\DoxyCodeLine{654     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"boundary\_impulse\_tracer"}, ns, names, units, values, index, \&}
\DoxyCodeLine{655            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
\DoxyCodeLine{656 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{657 }
\DoxyCodeLine{658   \textcolor{keywordflow}{if} (ns\_tot == 0) stock\_values(1) = 0.0}
\DoxyCodeLine{659 }
\DoxyCodeLine{660   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(num\_stocks)) num\_stocks = ns\_tot}
\DoxyCodeLine{661 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_a0c4fb7a963b5ae8672e2e32ac87fddca}\label{namespacemom__tracer__flow__control_a0c4fb7a963b5ae8672e2e32ac87fddca}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!call\_tracer\_surface\_state@{call\_tracer\_surface\_state}}
\index{call\_tracer\_surface\_state@{call\_tracer\_surface\_state}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{call\_tracer\_surface\_state()}{call\_tracer\_surface\_state()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::call\+\_\+tracer\+\_\+surface\+\_\+state (\begin{DoxyParamCaption}\item[{type(surface), intent(inout)}]{sfc\+\_\+state,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine calls all registered tracer packages to enable them to add to the surface state returned to the coupler. These routines are optional. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean. \\
\hline
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\end{DoxyParams}


Definition at line 726 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{726   \textcolor{keywordtype}{type}(surface),                \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}}
\DoxyCodeLine{727 \textcolor{comment}{                                                       !! describe the surface state of the ocean.}}
\DoxyCodeLine{728   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{     !< The ocean's grid structure.}}
\DoxyCodeLine{729 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{730                                 \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Layer thicknesses [H ~> m or kg m-2]}}
\DoxyCodeLine{731   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{    !< The control structure returned by a}}
\DoxyCodeLine{732 \textcolor{comment}{                                                       !! previous call to call\_tracer\_register.}}
\DoxyCodeLine{733 }
\DoxyCodeLine{734   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_surface\_state: "}// \&}
\DoxyCodeLine{735          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})}
\DoxyCodeLine{736 }
\DoxyCodeLine{737 \textcolor{comment}{!  Add other user-provided calls here.}}
\DoxyCodeLine{738   \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \&}
\DoxyCodeLine{739     \textcolor{keyword}{call }user\_tracer\_surface\_state(sfc\_state, h, g, cs\%USER\_tracer\_example\_CSp)}
\DoxyCodeLine{740   \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) \&}
\DoxyCodeLine{741     \textcolor{keyword}{call }dome\_tracer\_surface\_state(sfc\_state, h, g, cs\%DOME\_tracer\_CSp)}
\DoxyCodeLine{742   \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) \&}
\DoxyCodeLine{743     \textcolor{keyword}{call }isomip\_tracer\_surface\_state(sfc\_state, h, g, cs\%ISOMIP\_tracer\_CSp)}
\DoxyCodeLine{744   \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \&}
\DoxyCodeLine{745     \textcolor{keyword}{call }ideal\_age\_tracer\_surface\_state(sfc\_state, h, g, cs\%ideal\_age\_tracer\_CSp)}
\DoxyCodeLine{746   \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \&}
\DoxyCodeLine{747     \textcolor{keyword}{call }dye\_tracer\_surface\_state(sfc\_state, h, g, cs\%dye\_tracer\_CSp)}
\DoxyCodeLine{748   \textcolor{keywordflow}{if} (cs\%use\_oil) \&}
\DoxyCodeLine{749     \textcolor{keyword}{call }oil\_tracer\_surface\_state(sfc\_state, h, g, cs\%oil\_tracer\_CSp)}
\DoxyCodeLine{750   \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \&}
\DoxyCodeLine{751     \textcolor{keyword}{call }advection\_test\_tracer\_surface\_state(sfc\_state, h, g, cs\%advection\_test\_tracer\_CSp)}
\DoxyCodeLine{752   \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \&}
\DoxyCodeLine{753     \textcolor{keyword}{call }ocmip2\_cfc\_surface\_state(sfc\_state, h, g, cs\%OCMIP2\_CFC\_CSp)}
\DoxyCodeLine{754   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \&}
\DoxyCodeLine{755     \textcolor{keyword}{call }mom\_generic\_tracer\_surface\_state(sfc\_state, h, g, cs\%MOM\_generic\_tracer\_CSp)}
\DoxyCodeLine{756 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_abd2e9269190427ba86fb8a26e6792e66}\label{namespacemom__tracer__flow__control_abd2e9269190427ba86fb8a26e6792e66}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!get\_chl\_from\_model@{get\_chl\_from\_model}}
\index{get\_chl\_from\_model@{get\_chl\_from\_model}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{get\_chl\_from\_model()}{get\_chl\_from\_model()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::get\+\_\+chl\+\_\+from\+\_\+model (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(out)}]{Chl\+\_\+array,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine extracts the chlorophyll concentrations from the model state, if possible. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ out}}  & {\em chl\+\_\+array} & The array in which to store the model\textquotesingle{}s \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\end{DoxyParams}


Definition at line 336 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{336   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{         !< The ocean's grid structure.}}
\DoxyCodeLine{337 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{338                                 \textcolor{keywordtype}{intent(out)} :: Chl\_array\textcolor{comment}{ !< The array in which to store the model's}}
\DoxyCodeLine{339 \textcolor{comment}{                                                         !! Chlorophyll-A concentrations in mg m-3.}}
\DoxyCodeLine{340   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{        !< The control structure returned by a}}
\DoxyCodeLine{341 \textcolor{comment}{                                                         !! previous call to call\_tracer\_register.}}
\DoxyCodeLine{342 }
\DoxyCodeLine{343   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}}
\DoxyCodeLine{344     \textcolor{keyword}{call }mom\_generic\_tracer\_get(\textcolor{stringliteral}{'chl'}, \textcolor{stringliteral}{'field'}, chl\_array, cs\%MOM\_generic\_tracer\_CSp)}
\DoxyCodeLine{345   \textcolor{keywordflow}{else}}
\DoxyCodeLine{346     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"get\_chl\_from\_model was called in a configuration "}// \&}
\DoxyCodeLine{347              \textcolor{stringliteral}{"that is unable to provide a sensible model-based value.\(\backslash\)n"}// \&}
\DoxyCodeLine{348              \textcolor{stringliteral}{"CS\%use\_MOM\_generic\_tracer is false and no other viable options are on."})}
\DoxyCodeLine{349 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{350 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_ad43ea30fa52fcb930db39037f5d7e6b9}\label{namespacemom__tracer__flow__control_ad43ea30fa52fcb930db39037f5d7e6b9}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!store\_stocks@{store\_stocks}}
\index{store\_stocks@{store\_stocks}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{store\_stocks()}{store\_stocks()}}
{\footnotesize\ttfamily subroutine mom\+\_\+tracer\+\_\+flow\+\_\+control\+::store\+\_\+stocks (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{pkg\+\_\+name,  }\item[{integer, intent(in)}]{ns,  }\item[{character(len=$\ast$), dimension(\+:), intent(in)}]{names,  }\item[{character(len=$\ast$), dimension(\+:), intent(in)}]{units,  }\item[{real, dimension(\+:), intent(in)}]{values,  }\item[{integer, intent(in)}]{index,  }\item[{real, dimension(\+:), intent(inout)}]{stock\+\_\+values,  }\item[{character(len=$\ast$), intent(inout)}]{set\+\_\+pkg\+\_\+name,  }\item[{integer, intent(in)}]{max\+\_\+ns,  }\item[{integer, intent(inout)}]{ns\+\_\+tot,  }\item[{character(len=$\ast$), dimension(\+:), intent(inout), optional}]{stock\+\_\+names,  }\item[{character(len=$\ast$), dimension(\+:), intent(inout), optional}]{stock\+\_\+units }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This routine stores the stocks and does error handling for call\+\_\+tracer\+\_\+stocks. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em pkg\+\_\+name} & The tracer package name \\
\hline
\mbox{\texttt{ in}}  & {\em ns} & The number of stocks associated with this tracer package \\
\hline
\mbox{\texttt{ in}}  & {\em names} & Diagnostic names to use for each stock. \\
\hline
\mbox{\texttt{ in}}  & {\em units} & Units to use in the metadata for each stock. \\
\hline
\mbox{\texttt{ in}}  & {\em values} & The values of the tracer stocks \\
\hline
\mbox{\texttt{ in}}  & {\em index} & The integer stock index from stocks\+\_\+constants\+\_\+mod of the stock to be returned. If this is present and greater than 0, only a single stock can be returned. \\
\hline
\mbox{\texttt{ in,out}}  & {\em stock\+\_\+values} & The master list of stock values \\
\hline
\mbox{\texttt{ in,out}}  & {\em set\+\_\+pkg\+\_\+name} & The name of the last tracer package whose stocks were stored for a specific index. This is used to trigger an error if there are redundant stocks. \\
\hline
\mbox{\texttt{ in}}  & {\em max\+\_\+ns} & The maximum size of the master stock list \\
\hline
\mbox{\texttt{ in,out}}  & {\em ns\+\_\+tot} & The total number of stocks in the master list \\
\hline
\mbox{\texttt{ in,out}}  & {\em stock\+\_\+names} & Diagnostic names to use for each stock in the master list \\
\hline
\mbox{\texttt{ in,out}}  & {\em stock\+\_\+units} & Units to use in the metadata for each stock in the master list \\
\hline
\end{DoxyParams}


Definition at line 667 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{667   \textcolor{keywordtype}{character(len=*)},   \textcolor{keywordtype}{intent(in)}    :: pkg\_name\textcolor{comment}{ !< The tracer package name}}
\DoxyCodeLine{668   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: ns\textcolor{comment}{      !< The number of stocks associated with this tracer package}}
\DoxyCodeLine{669   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{670                       \textcolor{keywordtype}{intent(in)}    :: names\textcolor{comment}{   !< Diagnostic names to use for each stock.}}
\DoxyCodeLine{671   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{672                       \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< Units to use in the metadata for each stock.}}
\DoxyCodeLine{673 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: values\textcolor{comment}{  !< The values of the tracer stocks}}
\DoxyCodeLine{674   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: index\textcolor{comment}{   !< The integer stock index from}}
\DoxyCodeLine{675 \textcolor{comment}{                             !! stocks\_constants\_mod of the stock to be returned.  If this is}}
\DoxyCodeLine{676 \textcolor{comment}{                             !! present and greater than 0, only a single stock can be returned.}}
\DoxyCodeLine{677 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: stock\_values\textcolor{comment}{ !< The master list of stock values}}
\DoxyCodeLine{678   \textcolor{keywordtype}{character(len=*)},   \textcolor{keywordtype}{intent(inout)} :: set\_pkg\_name\textcolor{comment}{ !< The name of the last tracer package whose}}
\DoxyCodeLine{679 \textcolor{comment}{                                               !! stocks were stored for a specific index.  This is}}
\DoxyCodeLine{680 \textcolor{comment}{                                               !! used to trigger an error if there are redundant stocks.}}
\DoxyCodeLine{681   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: max\_ns\textcolor{comment}{  !< The maximum size of the master stock list}}
\DoxyCodeLine{682   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(inout)} :: ns\_tot\textcolor{comment}{  !< The total number of stocks in the master list}}
\DoxyCodeLine{683   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{684             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: stock\_names\textcolor{comment}{ !< Diagnostic names to use for each stock in the master list}}
\DoxyCodeLine{685   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \&}
\DoxyCodeLine{686             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: stock\_units\textcolor{comment}{ !< Units to use in the metadata for each stock in the master list}}
\DoxyCodeLine{687 }
\DoxyCodeLine{688 \textcolor{comment}{! This routine stores the stocks and does error handling for call\_tracer\_stocks.}}
\DoxyCodeLine{689   \textcolor{keywordtype}{character(len=16)} :: ind\_text, ns\_text, max\_text}
\DoxyCodeLine{690   \textcolor{keywordtype}{integer} :: n}
\DoxyCodeLine{691 }
\DoxyCodeLine{692   \textcolor{keywordflow}{if} ((index > 0) .and. (ns > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{693     \textcolor{keyword}{write}(ind\_text,\textcolor{stringliteral}{'(i8)'}) index}
\DoxyCodeLine{694     \textcolor{keywordflow}{if} (ns > 1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{695       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Tracer package "}//trim(pkg\_name)//\&}
\DoxyCodeLine{696           \textcolor{stringliteral}{" is not permitted to return more than one value when queried"}//\&}
\DoxyCodeLine{697           \textcolor{stringliteral}{" for specific stock index "}//trim(adjustl(ind\_text))//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{698     \textcolor{keywordflow}{elseif} (ns+ns\_tot > 1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{699       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Tracer packages "}//trim(pkg\_name)//\textcolor{stringliteral}{" and "}//\&}
\DoxyCodeLine{700           trim(set\_pkg\_name)//\textcolor{stringliteral}{" both attempted to set values for"}//\&}
\DoxyCodeLine{701           \textcolor{stringliteral}{" specific stock index "}//trim(adjustl(ind\_text))//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{702     \textcolor{keywordflow}{else}}
\DoxyCodeLine{703       set\_pkg\_name = pkg\_name}
\DoxyCodeLine{704 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{705 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{706 }
\DoxyCodeLine{707   \textcolor{keywordflow}{if} (ns\_tot+ns > max\_ns) \textcolor{keywordflow}{then}}
\DoxyCodeLine{708     \textcolor{keyword}{write}(ns\_text,\textcolor{stringliteral}{'(i8)'}) ns\_tot+ns ; \textcolor{keyword}{write}(max\_text,\textcolor{stringliteral}{'(i8)'}) max\_ns}
\DoxyCodeLine{709     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Attempted to return more tracer stock values (at least "}//\&}
\DoxyCodeLine{710       trim(adjustl(ns\_text))//\textcolor{stringliteral}{") than the size "}//trim(adjustl(max\_text))//\&}
\DoxyCodeLine{711       \textcolor{stringliteral}{"of the smallest value, name, or units array."})}
\DoxyCodeLine{712 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{713 }
\DoxyCodeLine{714   \textcolor{keywordflow}{do} n=1,ns}
\DoxyCodeLine{715     stock\_values(ns\_tot+n) = values(n)}
\DoxyCodeLine{716     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_names)) stock\_names(ns\_tot+n) = names(n)}
\DoxyCodeLine{717     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_units)) stock\_units(ns\_tot+n) = units(n)}
\DoxyCodeLine{718 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{719   ns\_tot = ns\_tot + ns}
\DoxyCodeLine{720 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_a3c5edb854704860d08de4d68d815d920}\label{namespacemom__tracer__flow__control_a3c5edb854704860d08de4d68d815d920}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!tracer\_flow\_control\_end@{tracer\_flow\_control\_end}}
\index{tracer\_flow\_control\_end@{tracer\_flow\_control\_end}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{tracer\_flow\_control\_end()}{tracer\_flow\_control\_end()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::tracer\+\_\+flow\+\_\+control\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}


\begin{DoxyParams}{Parameters}
{\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
\end{DoxyParams}


Definition at line 760 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{760   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{    !< The control structure returned by a}}
\DoxyCodeLine{761 \textcolor{comment}{                                                 !! previous call to call\_tracer\_register.}}
\DoxyCodeLine{762 }
\DoxyCodeLine{763   \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \&}
\DoxyCodeLine{764     \textcolor{keyword}{call }user\_tracer\_example\_end(cs\%USER\_tracer\_example\_CSp)}
\DoxyCodeLine{765   \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) \textcolor{keyword}{call }dome\_tracer\_end(cs\%DOME\_tracer\_CSp)}
\DoxyCodeLine{766   \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) \textcolor{keyword}{call }isomip\_tracer\_end(cs\%ISOMIP\_tracer\_CSp)}
\DoxyCodeLine{767   \textcolor{keywordflow}{if} (cs\%use\_RGC\_tracer) \textcolor{keyword}{call }rgc\_tracer\_end(cs\%RGC\_tracer\_CSp)}
\DoxyCodeLine{768   \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \textcolor{keyword}{call }ideal\_age\_example\_end(cs\%ideal\_age\_tracer\_CSp)}
\DoxyCodeLine{769   \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \textcolor{keyword}{call }regional\_dyes\_end(cs\%dye\_tracer\_CSp)}
\DoxyCodeLine{770   \textcolor{keywordflow}{if} (cs\%use\_oil) \textcolor{keyword}{call }oil\_tracer\_end(cs\%oil\_tracer\_CSp)}
\DoxyCodeLine{771   \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \textcolor{keyword}{call }advection\_test\_tracer\_end(cs\%advection\_test\_tracer\_CSp)}
\DoxyCodeLine{772   \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \textcolor{keyword}{call }ocmip2\_cfc\_end(cs\%OCMIP2\_CFC\_CSp)}
\DoxyCodeLine{773   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \textcolor{keyword}{call }end\_mom\_generic\_tracer(cs\%MOM\_generic\_tracer\_CSp)}
\DoxyCodeLine{774   \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) \textcolor{keyword}{call }pseudo\_salt\_tracer\_end(cs\%pseudo\_salt\_tracer\_CSp)}
\DoxyCodeLine{775   \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) \textcolor{keyword}{call }boundary\_impulse\_tracer\_end(cs\%boundary\_impulse\_tracer\_CSp)}
\DoxyCodeLine{776   \textcolor{keywordflow}{if} (cs\%use\_dyed\_obc\_tracer) \textcolor{keyword}{call }dyed\_obc\_tracer\_end(cs\%dyed\_obc\_tracer\_CSp)}
\DoxyCodeLine{777 }
\DoxyCodeLine{778   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keyword}{deallocate}(cs)}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__tracer__flow__control_a23c43fd3e8fd71c7aa132b58eb7768b9}\label{namespacemom__tracer__flow__control_a23c43fd3e8fd71c7aa132b58eb7768b9}} 
\index{mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}!tracer\_flow\_control\_init@{tracer\_flow\_control\_init}}
\index{tracer\_flow\_control\_init@{tracer\_flow\_control\_init}!mom\_tracer\_flow\_control@{mom\_tracer\_flow\_control}}
\subsubsection{\texorpdfstring{tracer\_flow\_control\_init()}{tracer\_flow\_control\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+tracer\+\_\+flow\+\_\+control\+::tracer\+\_\+flow\+\_\+control\+\_\+init (\begin{DoxyParamCaption}\item[{logical, intent(in)}]{restart,  }\item[{type(time\+\_\+type), intent(in), target}]{day,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(in)}]{h,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(diag\+\_\+ctrl), intent(in), target}]{diag,  }\item[{type(ocean\+\_\+obc\+\_\+type), pointer}]{O\+BC,  }\item[{type(\mbox{\hyperlink{structmom__tracer__flow__control_1_1tracer__flow__control__cs}{tracer\+\_\+flow\+\_\+control\+\_\+cs}}), pointer}]{CS,  }\item[{type(sponge\+\_\+cs), pointer}]{sponge\+\_\+\+C\+Sp,  }\item[{type(ale\+\_\+sponge\+\_\+cs), pointer}]{A\+L\+E\+\_\+sponge\+\_\+\+C\+Sp,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv }\end{DoxyParamCaption})}



This subroutine calls all registered tracer initialization subroutines. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em restart} & 1 if the fields have already been read from a restart file. \\
\hline
\mbox{\texttt{ in}}  & {\em day} & Time of the start of the run. \\
\hline
\mbox{\texttt{ in,out}}  & {\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 us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em diag} & A structure that is used to regulate diagnostic output. \\
\hline
 & {\em obc} & This open boundary condition type specifies whether, where, and what open boundary conditions are used. \\
\hline
 & {\em cs} & The control structure returned by a previous call to call\+\_\+tracer\+\_\+register. \\
\hline
 & {\em sponge\+\_\+csp} & A pointer to the control structure for the sponges, if they are in use. Otherwise this may be unassociated. \\
\hline
 & {\em ale\+\_\+sponge\+\_\+csp} & A pointer to the control structure for the A\+LE sponges, if they are in use. Otherwise this may be unassociated. \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & A structure pointing to various thermodynamic variables \\
\hline
\end{DoxyParams}


Definition at line 260 of file M\+O\+M\+\_\+tracer\+\_\+flow\+\_\+control.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{260   \textcolor{keywordtype}{logical},                               \textcolor{keywordtype}{intent(in)}    :: restart\textcolor{comment}{ !< 1 if the fields have already}}
\DoxyCodeLine{261 \textcolor{comment}{                                                                  !! been read from a restart file.}}
\DoxyCodeLine{262   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target},               \textcolor{keywordtype}{intent(in)}    :: day\textcolor{comment}{     !< Time of the start of the run.}}
\DoxyCodeLine{263   \textcolor{keywordtype}{type}(ocean\_grid\_type),                 \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{       !< The ocean's grid structure.}}
\DoxyCodeLine{264   \textcolor{keywordtype}{type}(verticalGrid\_type),               \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{      !< The ocean's vertical grid}}
\DoxyCodeLine{265 \textcolor{comment}{                                                                  !! structure.}}
\DoxyCodeLine{266   \textcolor{keywordtype}{type}(unit\_scale\_type),                 \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{      !< A dimensional unit scaling type}}
\DoxyCodeLine{267 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \&}
\DoxyCodeLine{268                                          \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{       !< Layer thicknesses [H ~> m or kg m-2]}}
\DoxyCodeLine{269   \textcolor{keywordtype}{type}(param\_file\_type),                 \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for}}
\DoxyCodeLine{270 \textcolor{comment}{                                                                  !! run-time parameters}}
\DoxyCodeLine{271   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target},               \textcolor{keywordtype}{intent(in)}    :: diag\textcolor{comment}{    !< A structure that is used to}}
\DoxyCodeLine{272 \textcolor{comment}{                                                                  !! regulate diagnostic output.}}
\DoxyCodeLine{273   \textcolor{keywordtype}{type}(ocean\_OBC\_type),                  \textcolor{keywordtype}{pointer}       :: OBC\textcolor{comment}{     !< This open boundary condition}}
\DoxyCodeLine{274 \textcolor{comment}{                                                                  !! type specifies whether, where,}}
\DoxyCodeLine{275 \textcolor{comment}{                                                                  !! and what open boundary}}
\DoxyCodeLine{276 \textcolor{comment}{                                                                  !! conditions are used.}}
\DoxyCodeLine{277   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),          \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{      !< The control structure returned}}
\DoxyCodeLine{278 \textcolor{comment}{                                                                  !! by a previous call to}}
\DoxyCodeLine{279 \textcolor{comment}{                                                                  !! call\_tracer\_register.}}
\DoxyCodeLine{280   \textcolor{keywordtype}{type}(sponge\_CS),                       \textcolor{keywordtype}{pointer}       :: sponge\_CSp\textcolor{comment}{     !< A pointer to the control}}
\DoxyCodeLine{281 \textcolor{comment}{                                               !! structure for the sponges, if they are in use.}}
\DoxyCodeLine{282 \textcolor{comment}{                                               !! Otherwise this may be unassociated.}}
\DoxyCodeLine{283   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),                   \textcolor{keywordtype}{pointer}       :: ALE\_sponge\_CSp\textcolor{comment}{ !< A pointer to the control}}
\DoxyCodeLine{284 \textcolor{comment}{                                               !! structure for the ALE sponges, if they are in use.}}
\DoxyCodeLine{285 \textcolor{comment}{                                               !! Otherwise this may be unassociated.}}
\DoxyCodeLine{286   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),                 \textcolor{keywordtype}{intent(in)}    :: tv\textcolor{comment}{      !< A structure pointing to various}}
\DoxyCodeLine{287 \textcolor{comment}{                                                                  !! thermodynamic variables}}
\DoxyCodeLine{288 }
\DoxyCodeLine{289   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"tracer\_flow\_control\_init: "}// \&}
\DoxyCodeLine{290          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})}
\DoxyCodeLine{291 }
\DoxyCodeLine{292 \textcolor{comment}{!  Add other user-provided calls here.}}
\DoxyCodeLine{293   \textcolor{keywordflow}{if} (cs\%use\_USER\_tracer\_example) \&}
\DoxyCodeLine{294     \textcolor{keyword}{call }user\_initialize\_tracer(restart, day, g, gv, h, diag, obc, cs\%USER\_tracer\_example\_CSp, \&}
\DoxyCodeLine{295                                 sponge\_csp)}
\DoxyCodeLine{296   \textcolor{keywordflow}{if} (cs\%use\_DOME\_tracer) \&}
\DoxyCodeLine{297     \textcolor{keyword}{call }initialize\_dome\_tracer(restart, day, g, gv, us, h, diag, obc, cs\%DOME\_tracer\_CSp, \&}
\DoxyCodeLine{298                                 sponge\_csp, param\_file)}
\DoxyCodeLine{299   \textcolor{keywordflow}{if} (cs\%use\_ISOMIP\_tracer) \&}
\DoxyCodeLine{300     \textcolor{keyword}{call }initialize\_isomip\_tracer(restart, day, g, gv, h, diag, obc, cs\%ISOMIP\_tracer\_CSp, \&}
\DoxyCodeLine{301                                 ale\_sponge\_csp)}
\DoxyCodeLine{302   \textcolor{keywordflow}{if} (cs\%use\_RGC\_tracer) \&}
\DoxyCodeLine{303     \textcolor{keyword}{call }initialize\_rgc\_tracer(restart, day, g, gv, h, diag, obc, \&}
\DoxyCodeLine{304                   cs\%RGC\_tracer\_CSp, sponge\_csp, ale\_sponge\_csp)}
\DoxyCodeLine{305   \textcolor{keywordflow}{if} (cs\%use\_ideal\_age) \&}
\DoxyCodeLine{306     \textcolor{keyword}{call }initialize\_ideal\_age\_tracer(restart, day, g, gv, us, h, diag, obc, cs\%ideal\_age\_tracer\_CSp, \&}
\DoxyCodeLine{307                                      sponge\_csp)}
\DoxyCodeLine{308   \textcolor{keywordflow}{if} (cs\%use\_regional\_dyes) \&}
\DoxyCodeLine{309     \textcolor{keyword}{call }initialize\_dye\_tracer(restart, day, g, gv, h, diag, obc, cs\%dye\_tracer\_CSp, \&}
\DoxyCodeLine{310                                      sponge\_csp)}
\DoxyCodeLine{311   \textcolor{keywordflow}{if} (cs\%use\_oil) \&}
\DoxyCodeLine{312     \textcolor{keyword}{call }initialize\_oil\_tracer(restart, day, g, gv, us, h, diag, obc, cs\%oil\_tracer\_CSp, \&}
\DoxyCodeLine{313                                      sponge\_csp)}
\DoxyCodeLine{314   \textcolor{keywordflow}{if} (cs\%use\_advection\_test\_tracer) \&}
\DoxyCodeLine{315     \textcolor{keyword}{call }initialize\_advection\_test\_tracer(restart, day, g, gv, h, diag, obc, cs\%advection\_test\_tracer\_CSp, \&}
\DoxyCodeLine{316                                 sponge\_csp)}
\DoxyCodeLine{317   \textcolor{keywordflow}{if} (cs\%use\_OCMIP2\_CFC) \&}
\DoxyCodeLine{318     \textcolor{keyword}{call }initialize\_ocmip2\_cfc(restart, day, g, gv, us, h, diag, obc, cs\%OCMIP2\_CFC\_CSp, \&}
\DoxyCodeLine{319                                 sponge\_csp)}
\DoxyCodeLine{320   \textcolor{keywordflow}{if} (cs\%use\_MOM\_generic\_tracer) \&}
\DoxyCodeLine{321     \textcolor{keyword}{call }initialize\_mom\_generic\_tracer(restart, day, g, gv, us, h, param\_file, diag, obc, \&}
\DoxyCodeLine{322         cs\%MOM\_generic\_tracer\_CSp, sponge\_csp, ale\_sponge\_csp)}
\DoxyCodeLine{323   \textcolor{keywordflow}{if} (cs\%use\_pseudo\_salt\_tracer) \&}
\DoxyCodeLine{324     \textcolor{keyword}{call }initialize\_pseudo\_salt\_tracer(restart, day, g, gv, h, diag, obc, cs\%pseudo\_salt\_tracer\_CSp, \&}
\DoxyCodeLine{325                                 sponge\_csp, tv)}
\DoxyCodeLine{326   \textcolor{keywordflow}{if} (cs\%use\_boundary\_impulse\_tracer) \&}
\DoxyCodeLine{327     \textcolor{keyword}{call }initialize\_boundary\_impulse\_tracer(restart, day, g, gv, h, diag, obc, cs\%boundary\_impulse\_tracer\_CSp, \&}
\DoxyCodeLine{328                                 sponge\_csp, tv)}
\DoxyCodeLine{329   \textcolor{keywordflow}{if} (cs\%use\_dyed\_obc\_tracer) \&}
\DoxyCodeLine{330     \textcolor{keyword}{call }initialize\_dyed\_obc\_tracer(restart, day, g, gv, h, diag, obc, cs\%dyed\_obc\_tracer\_CSp)}
\DoxyCodeLine{331 }

\end{DoxyCode}
