\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{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em h\+\_\+old} & Layer thickness before entrainment \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em h\+\_\+new} & Layer thickness after entrainment \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}.\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em hml} & Mixed layer depth \mbox{[}Z $\sim$$>$ m\mbox{]}\\
\hline
\mbox{\tt in}  & {\em dt} & The amount of time covered by this call \mbox{[}T $\sim$$>$ s\mbox{]}\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt 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{\tt in}  & {\em debug} & If true calculate checksums\\
\hline
\mbox{\tt 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{\tt 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}
381   \textcolor{keywordtype}{type}(ocean\_grid\_type),                 \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{      !< The ocean's grid structure.}
382   \textcolor{keywordtype}{type}(verticalGrid\_type),               \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{     !< The ocean's vertical grid structure.}
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}
384 \textcolor{comment}{                                                              !! [H ~> m or kg m-2].}
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}
386 \textcolor{comment}{                                                              !! [H ~> m or kg m-2].}
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}
388 \textcolor{comment}{                                          !! fluid entrained from the layer above during this call}
389 \textcolor{comment}{                                          !! will be added [H ~> m or kg m-2].}
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}
391 \textcolor{comment}{                                          !! fluid entrained from the layer below during this call}
392 \textcolor{comment}{                                          !! will be added [H ~> m or kg m-2].}
393   \textcolor{keywordtype}{type}(forcing),                         \textcolor{keywordtype}{intent(in)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to}
394 \textcolor{comment}{                                                              !! any possible forcing fields.}
395 \textcolor{comment}{                                                              !! Unused fields have NULL ptrs.}
396   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))},      \textcolor{keywordtype}{intent(in)} :: Hml\textcolor{comment}{    !< Mixed layer depth [Z ~> m]}
397   \textcolor{keywordtype}{real},                                  \textcolor{keywordtype}{intent(in)} :: dt\textcolor{comment}{     !< The amount of time covered by this}
398 \textcolor{comment}{                                                              !! call [T ~> s]}
399   \textcolor{keywordtype}{type}(unit\_scale\_type),                 \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{     !< A dimensional unit scaling type}
400   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),                 \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{     !< A structure pointing to various}
401 \textcolor{comment}{                                                              !! thermodynamic variables.}
402   \textcolor{keywordtype}{type}(optics\_type),                     \textcolor{keywordtype}{pointer}    :: optics\textcolor{comment}{ !< The structure containing optical}
403 \textcolor{comment}{                                                              !! properties.}
404   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),          \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{     !< The control structure returned by}
405 \textcolor{comment}{                                                              !! a previous call to}
406 \textcolor{comment}{                                                              !! call\_tracer\_register.}
407   \textcolor{keywordtype}{logical},                               \textcolor{keywordtype}{intent(in)} :: debug\textcolor{comment}{  !< If true calculate checksums}
408   \textcolor{keywordtype}{real},                        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: evap\_CFL\_limit\textcolor{comment}{ !< Limit on the fraction of}
409 \textcolor{comment}{                                                              !! the water that can be fluxed out}
410 \textcolor{comment}{                                                              !! of the top layer in a timestep [nondim]}
411   \textcolor{keywordtype}{real},                        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: minimum\_forcing\_depth\textcolor{comment}{ !< The smallest depth over}
412 \textcolor{comment}{                                                              !! which fluxes can be applied [H ~> m or kg
       m-2]}
413 
414   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_column\_fns: "}// &
415          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})
416 
417   \textcolor{comment}{! Use the applyTracerBoundaryFluxesInOut to handle surface fluxes}
418   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(evap\_cfl\_limit) .and. \textcolor{keyword}{present}(minimum\_forcing\_depth)) \textcolor{keywordflow}{then}
419     \textcolor{comment}{! Add calls to tracer column functions here.}
420     \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) &
421       \textcolor{keyword}{call }tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
422                                  g, gv, us, cs%USER\_tracer\_example\_CSp)
423     \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) &
424       \textcolor{keyword}{call }dome\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
425                                       g, gv, us, cs%DOME\_tracer\_CSp, &
426                                       evap\_cfl\_limit=evap\_cfl\_limit, &
427                                       minimum\_forcing\_depth=minimum\_forcing\_depth)
428     \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) &
429       \textcolor{keyword}{call }isomip\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
430                                         g, gv, us, cs%ISOMIP\_tracer\_CSp, &
431                                         evap\_cfl\_limit=evap\_cfl\_limit, &
432                                         minimum\_forcing\_depth=minimum\_forcing\_depth)
433     \textcolor{keywordflow}{if} (cs%use\_RGC\_tracer) &
434       \textcolor{keyword}{call }rgc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
435                                         g, gv, us, cs%RGC\_tracer\_CSp, &
436                                         evap\_cfl\_limit=evap\_cfl\_limit, &
437                                         minimum\_forcing\_depth=minimum\_forcing\_depth)
438     \textcolor{keywordflow}{if} (cs%use\_ideal\_age) &
439       \textcolor{keyword}{call }ideal\_age\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
440                                            g, gv, us, cs%ideal\_age\_tracer\_CSp, &
441                                            evap\_cfl\_limit=evap\_cfl\_limit, &
442                                            minimum\_forcing\_depth=minimum\_forcing\_depth)
443     \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) &
444       \textcolor{keyword}{call }dye\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
445                                      g, gv, us, cs%dye\_tracer\_CSp, &
446                                      evap\_cfl\_limit=evap\_cfl\_limit, &
447                                      minimum\_forcing\_depth=minimum\_forcing\_depth)
448     \textcolor{keywordflow}{if} (cs%use\_oil) &
449       \textcolor{keyword}{call }oil\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
450                                      g, gv, us, cs%oil\_tracer\_CSp, tv, &
451                                      evap\_cfl\_limit=evap\_cfl\_limit, &
452                                      minimum\_forcing\_depth=minimum\_forcing\_depth)
453 
454     \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) &
455       \textcolor{keyword}{call }advection\_test\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
456                                                 g, gv, us, cs%advection\_test\_tracer\_CSp, &
457                                                 evap\_cfl\_limit=evap\_cfl\_limit, &
458                                                 minimum\_forcing\_depth=minimum\_forcing\_depth)
459     \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) &
460       \textcolor{keyword}{call }ocmip2\_cfc\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
461                                      g, gv, us, cs%OCMIP2\_CFC\_CSp, &
462                                      evap\_cfl\_limit=evap\_cfl\_limit, &
463                                      minimum\_forcing\_depth=minimum\_forcing\_depth)
464     \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}
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 "}//&
466             \textcolor{stringliteral}{"has not been written to permit dimensionsal rescaling.  Set all 4 of the "}//&
467             \textcolor{stringliteral}{"[QRZT]\_RESCALE\_POWER parameters to 0."})
468       \textcolor{keyword}{call }mom\_generic\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, hml, us%T\_to\_s*dt, &
469                                              g, gv, cs%MOM\_generic\_tracer\_CSp, tv, optics, &
470                                              evap\_cfl\_limit=evap\_cfl\_limit, &
471                                              minimum\_forcing\_depth=minimum\_forcing\_depth)
472 \textcolor{keywordflow}{    endif}
473     \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) &
474       \textcolor{keyword}{call }pseudo\_salt\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
475                                      g, gv, us, cs%pseudo\_salt\_tracer\_CSp, tv, debug, &
476                                      evap\_cfl\_limit=evap\_cfl\_limit, &
477                                      minimum\_forcing\_depth=minimum\_forcing\_depth)
478     \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) &
479       \textcolor{keyword}{call }boundary\_impulse\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
480                                      g, gv, us, cs%boundary\_impulse\_tracer\_CSp, tv, debug, &
481                                      evap\_cfl\_limit=evap\_cfl\_limit, &
482                                      minimum\_forcing\_depth=minimum\_forcing\_depth)
483     \textcolor{keywordflow}{if} (cs%use\_dyed\_obc\_tracer) &
484       \textcolor{keyword}{call }dyed\_obc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
485                                       g, gv, us, cs%dyed\_obc\_tracer\_CSp, &
486                                       evap\_cfl\_limit=evap\_cfl\_limit, &
487                                       minimum\_forcing\_depth=minimum\_forcing\_depth)
488 
489 
490   \textcolor{keywordflow}{else} \textcolor{comment}{! Apply tracer surface fluxes using ea on the first layer}
491     \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) &
492       \textcolor{keyword}{call }tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
493                                  g, gv, us, cs%USER\_tracer\_example\_CSp)
494     \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) &
495       \textcolor{keyword}{call }dome\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
496                                       g, gv, us, cs%DOME\_tracer\_CSp)
497     \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) &
498       \textcolor{keyword}{call }isomip\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
499                                       g, gv, us, cs%ISOMIP\_tracer\_CSp)
500     \textcolor{keywordflow}{if} (cs%use\_RGC\_tracer) &
501       \textcolor{keyword}{call }rgc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
502                                       g, gv, us, cs%RGC\_tracer\_CSp)
503     \textcolor{keywordflow}{if} (cs%use\_ideal\_age) &
504       \textcolor{keyword}{call }ideal\_age\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
505                                            g, gv, us, cs%ideal\_age\_tracer\_CSp)
506     \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) &
507       \textcolor{keyword}{call }dye\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
508                                            g, gv, us, cs%dye\_tracer\_CSp)
509     \textcolor{keywordflow}{if} (cs%use\_oil) &
510       \textcolor{keyword}{call }oil\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
511                                      g, gv, us, cs%oil\_tracer\_CSp, tv)
512     \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) &
513       \textcolor{keyword}{call }advection\_test\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
514                                       g, gv, us, cs%advection\_test\_tracer\_CSp)
515     \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) &
516       \textcolor{keyword}{call }ocmip2\_cfc\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
517                                      g, gv, us, cs%OCMIP2\_CFC\_CSp)
518     \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}
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 "}//&
520             \textcolor{stringliteral}{"has not been written to permit dimensionsal rescaling.  Set all 4 of the "}//&
521             \textcolor{stringliteral}{"[QRZT]\_RESCALE\_POWER parameters to 0."})
522       \textcolor{keyword}{call }mom\_generic\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, hml, us%T\_to\_s*dt, &
523                                      g, gv, cs%MOM\_generic\_tracer\_CSp, tv, optics)
524 \textcolor{keywordflow}{    endif}
525     \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) &
526       \textcolor{keyword}{call }pseudo\_salt\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
527                                      g, gv, us, cs%pseudo\_salt\_tracer\_CSp, tv, debug)
528     \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) &
529       \textcolor{keyword}{call }boundary\_impulse\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
530                                      g, gv, us, cs%boundary\_impulse\_tracer\_CSp, tv, debug)
531     \textcolor{keywordflow}{if} (cs%use\_dyed\_obc\_tracer) &
532       \textcolor{keyword}{call }dyed\_obc\_tracer\_column\_physics(h\_old, h\_new, ea, eb, fluxes, dt, &
533                                       g, gv, us, cs%dyed\_obc\_tracer\_CSp)
534 
535 \textcolor{keywordflow}{  endif}
536 
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{\tt 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}
113   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: verbosity\textcolor{comment}{ !< A 0-9 integer indicating a level of verbosity.}
114 
115   \textcolor{keywordtype}{type}(param\_file\_type) :: param\_file \textcolor{comment}{! A structure to parse for run-time parameters}
116   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"call\_tracer\_flux\_init"}  \textcolor{comment}{! This module's name.}
117   \textcolor{keywordtype}{logical} :: use\_OCMIP\_CFCs, use\_MOM\_generic\_tracer
118 
119   \textcolor{comment}{! Determine which tracer routines with tracer fluxes are to be called.  Note}
120   \textcolor{comment}{! that not every tracer package is required to have a flux\_init call.}
121   \textcolor{keyword}{call }get\_mom\_input(param\_file, check\_params=.false.)
122 
123   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OCMIP2\_CFC"}, use\_ocmip\_cfcs, &
124                  default=.false., do\_not\_log=.true.)
125   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_generic\_tracer"}, use\_mom\_generic\_tracer,&
126                  default=.false., do\_not\_log=.true.)
127   \textcolor{keyword}{call }close\_param\_file(param\_file, quiet\_close=.true.)
128 
129   \textcolor{keywordflow}{if} (use\_ocmip\_cfcs) \textcolor{keyword}{call }flux\_init\_ocmip2\_cfc(verbosity=verbosity)
130   \textcolor{keywordflow}{if} (use\_mom\_generic\_tracer) \textcolor{keywordflow}{then}
131     \textcolor{keyword}{call }mom\_generic\_flux\_init(verbosity=verbosity)
132 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em hi} & A horizontal index type structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt 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}
142   \textcolor{keywordtype}{type}(hor\_index\_type),         \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{         !< A horizontal index type structure.}
143   \textcolor{keywordtype}{type}(verticalGrid\_type),      \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{         !< The ocean's vertical grid structure.}
144   \textcolor{keywordtype}{type}(unit\_scale\_type),        \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{         !< A dimensional unit scaling type}
145   \textcolor{keywordtype}{type}(param\_file\_type),        \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-time}
146 \textcolor{comment}{                                                         !! parameters.}
147   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{         !< A pointer that is set to point to the}
148 \textcolor{comment}{                                                         !! control structure for this module.}
149   \textcolor{keywordtype}{type}(tracer\_registry\_type),   \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{     !< A pointer that is set to point to the}
150 \textcolor{comment}{                                                         !! control structure for the tracer}
151 \textcolor{comment}{                                                         !! advection and diffusion module.}
152   \textcolor{keywordtype}{type}(MOM\_restart\_CS),         \textcolor{keywordtype}{pointer}    :: restart\_CS\textcolor{comment}{ !< A pointer to the restart control}
153 \textcolor{comment}{                                                         !! structure.}
154 
155 
156   \textcolor{comment}{! This include declares and sets the variable "version".}
157 \textcolor{preprocessor}{# include "version\_variable.h"}
158 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_tracer\_flow\_control"} \textcolor{comment}{! This module's name.}
159 
160   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}
161     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"call\_tracer\_register called with an associated "}// &
162                             \textcolor{stringliteral}{"control structure."})
163     \textcolor{keywordflow}{return}
164   \textcolor{keywordflow}{else} ; \textcolor{keyword}{allocate}(cs) ;\textcolor{keywordflow}{ endif}
165 
166   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}
167   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})
168   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_USER\_TRACER\_EXAMPLE"}, &
169                                 cs%use\_USER\_tracer\_example, &
170                  \textcolor{stringliteral}{"If true, use the USER\_tracer\_example tracer package."}, &
171                  default=.false.)
172   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_DOME\_TRACER"}, cs%use\_DOME\_tracer, &
173                  \textcolor{stringliteral}{"If true, use the DOME\_tracer tracer package."}, &
174                  default=.false.)
175   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_ISOMIP\_TRACER"}, cs%use\_ISOMIP\_tracer, &
176                  \textcolor{stringliteral}{"If true, use the ISOMIP\_tracer tracer package."}, &
177                  default=.false.)
178   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_RGC\_TRACER"}, cs%use\_RGC\_tracer, &
179                  \textcolor{stringliteral}{"If true, use the RGC\_tracer tracer package."}, &
180                  default=.false.)
181   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_IDEAL\_AGE\_TRACER"}, cs%use\_ideal\_age, &
182                  \textcolor{stringliteral}{"If true, use the ideal\_age\_example tracer package."}, &
183                  default=.false.)
184   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_REGIONAL\_DYES"}, cs%use\_regional\_dyes, &
185                  \textcolor{stringliteral}{"If true, use the regional\_dyes tracer package."}, &
186                  default=.false.)
187   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OIL\_TRACER"}, cs%use\_oil, &
188                  \textcolor{stringliteral}{"If true, use the oil\_tracer tracer package."}, &
189                  default=.false.)
190   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_ADVECTION\_TEST\_TRACER"}, cs%use\_advection\_test\_tracer, &
191                  \textcolor{stringliteral}{"If true, use the advection\_test\_tracer tracer package."}, &
192                  default=.false.)
193   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_OCMIP2\_CFC"}, cs%use\_OCMIP2\_CFC, &
194                  \textcolor{stringliteral}{"If true, use the MOM\_OCMIP2\_CFC tracer package."}, &
195                  default=.false.)
196   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_generic\_tracer"}, cs%use\_MOM\_generic\_tracer, &
197                  \textcolor{stringliteral}{"If true and \_USE\_GENERIC\_TRACER is defined as a "}//&
198                  \textcolor{stringliteral}{"preprocessor macro, use the MOM\_generic\_tracer packages."}, &
199                  default=.false.)
200   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_PSEUDO\_SALT\_TRACER"}, cs%use\_pseudo\_salt\_tracer, &
201                  \textcolor{stringliteral}{"If true, use the pseudo salt tracer, typically run as a diagnostic."}, &
202                  default=.false.)
203   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_BOUNDARY\_IMPULSE\_TRACER"}, cs%use\_boundary\_impulse\_tracer, &
204                  \textcolor{stringliteral}{"If true, use the boundary impulse tracer."}, &
205                  default=.false.)
206   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"USE\_DYED\_OBC\_TRACER"}, cs%use\_dyed\_obc\_tracer, &
207                  \textcolor{stringliteral}{"If true, use the dyed\_obc\_tracer tracer package."}, &
208                  default=.false.)
209 
210 \textcolor{comment}{!    Add other user-provided calls to register tracers for restarting here. Each}
211 \textcolor{comment}{!  tracer package registration call returns a logical false if it cannot be run}
212 \textcolor{comment}{!  for some reason.  This then overrides the run-time selection from above.}
213   \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) cs%use\_USER\_tracer\_example = &
214     user\_register\_tracer\_example(hi, gv, param\_file, cs%USER\_tracer\_example\_CSp, &
215                                  tr\_reg, restart\_cs)
216   \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) cs%use\_DOME\_tracer = &
217     register\_dome\_tracer(hi, gv, param\_file, cs%DOME\_tracer\_CSp, &
218                          tr\_reg, restart\_cs)
219   \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) cs%use\_ISOMIP\_tracer = &
220     register\_isomip\_tracer(hi, gv, param\_file, cs%ISOMIP\_tracer\_CSp, &
221                            tr\_reg, restart\_cs)
222   \textcolor{keywordflow}{if} (cs%use\_RGC\_tracer) cs%use\_RGC\_tracer = &
223     register\_rgc\_tracer(hi, gv, param\_file, cs%RGC\_tracer\_CSp, &
224                            tr\_reg, restart\_cs)
225   \textcolor{keywordflow}{if} (cs%use\_ideal\_age) cs%use\_ideal\_age = &
226     register\_ideal\_age\_tracer(hi, gv, param\_file,  cs%ideal\_age\_tracer\_CSp, &
227                               tr\_reg, restart\_cs)
228   \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) cs%use\_regional\_dyes = &
229     register\_dye\_tracer(hi, gv, us, param\_file,  cs%dye\_tracer\_CSp, &
230                         tr\_reg, restart\_cs)
231   \textcolor{keywordflow}{if} (cs%use\_oil) cs%use\_oil = &
232     register\_oil\_tracer(hi, gv, us, param\_file,  cs%oil\_tracer\_CSp, &
233                         tr\_reg, restart\_cs)
234   \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) cs%use\_advection\_test\_tracer = &
235     register\_advection\_test\_tracer(hi, gv, param\_file, cs%advection\_test\_tracer\_CSp, &
236                                    tr\_reg, restart\_cs)
237   \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) cs%use\_OCMIP2\_CFC = &
238     register\_ocmip2\_cfc(hi, gv, param\_file,  cs%OCMIP2\_CFC\_CSp, &
239                         tr\_reg, restart\_cs)
240   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) cs%use\_MOM\_generic\_tracer = &
241     register\_mom\_generic\_tracer(hi, gv, param\_file,  cs%MOM\_generic\_tracer\_CSp, &
242                                 tr\_reg, restart\_cs)
243   \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) cs%use\_pseudo\_salt\_tracer = &
244     register\_pseudo\_salt\_tracer(hi, gv, param\_file,  cs%pseudo\_salt\_tracer\_CSp, &
245                                 tr\_reg, restart\_cs)
246   \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) cs%use\_boundary\_impulse\_tracer = &
247     register\_boundary\_impulse\_tracer(hi, gv, param\_file,  cs%boundary\_impulse\_tracer\_CSp, &
248                                      tr\_reg, restart\_cs)
249   \textcolor{keywordflow}{if} (cs%use\_dyed\_obc\_tracer) cs%use\_dyed\_obc\_tracer = &
250     register\_dyed\_obc\_tracer(hi, gv, param\_file, cs%dyed\_obc\_tracer\_CSp, &
251                              tr\_reg, restart\_cs)
252 
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{\tt in,out}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean.\\
\hline
\mbox{\tt in,out}  & {\em fluxes} & A structure containing pointers to any possible forcing fields. Unused fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em day\+\_\+start} & Start time of the fluxes.\\
\hline
\mbox{\tt in}  & {\em day\+\_\+interval} & Length of time over which these fluxes will be applied.\\
\hline
\mbox{\tt 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}
356 
357   \textcolor{keywordtype}{type}(surface),                \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}
358 \textcolor{comment}{                                                           !! describe the surface state of the}
359 \textcolor{comment}{                                                           !! ocean.}
360   \textcolor{keywordtype}{type}(forcing),                \textcolor{keywordtype}{intent(inout)} :: fluxes\textcolor{comment}{    !< A structure containing pointers to any}
361 \textcolor{comment}{                                                           !! possible forcing fields. Unused fields}
362 \textcolor{comment}{                                                           !! have NULL ptrs.}
363   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)}    :: day\_start\textcolor{comment}{ !< Start time of the fluxes.}
364   \textcolor{keywordtype}{type}(time\_type),              \textcolor{keywordtype}{intent(in)}    :: day\_interval\textcolor{comment}{ !< Length of time over which these}
365 \textcolor{comment}{                                                           !! fluxes will be applied.}
366   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{         !< The ocean's grid structure.}
367   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{        !< The control structure returned by a}
368 \textcolor{comment}{                                                           !! previous call to call\_tracer\_register.}
369 
370   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_set\_forcing"}// &
371          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})
372 \textcolor{comment}{!  if (CS%use\_ideal\_age) &}
373 \textcolor{comment}{!    call ideal\_age\_tracer\_set\_forcing(sfc\_state, fluxes, day\_start, day\_interval, &}
374 \textcolor{comment}{!                                      G, CS%ideal\_age\_tracer\_CSp)}
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{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt 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{\tt out}  & {\em stock\+\_\+names} & Diagnostic names to use for each stock.\\
\hline
\mbox{\tt out}  & {\em stock\+\_\+units} & Units to use in the metadata for each stock.\\
\hline
\mbox{\tt out}  & {\em num\+\_\+stocks} & The number of tracer stocks being returned.\\
\hline
\mbox{\tt 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{\tt in,out}  & {\em got\+\_\+min\+\_\+max} & Indicates whether the global min and\\
\hline
\mbox{\tt out}  & {\em global\+\_\+min} & The global minimum of each tracer\\
\hline
\mbox{\tt out}  & {\em global\+\_\+max} & The global maximum of each tracer\\
\hline
\mbox{\tt out}  & {\em xgmin} & The x-\/position of the global minimum\\
\hline
\mbox{\tt out}  & {\em ygmin} & The y-\/position of the global minimum\\
\hline
\mbox{\tt out}  & {\em zgmin} & The z-\/position of the global minimum\\
\hline
\mbox{\tt out}  & {\em xgmax} & The x-\/position of the global maximum\\
\hline
\mbox{\tt out}  & {\em ygmax} & The y-\/position of the global maximum\\
\hline
\mbox{\tt 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}
545   \textcolor{keywordtype}{type}(ocean\_grid\_type),          \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{           !< The ocean's grid structure.}
546   \textcolor{keywordtype}{type}(verticalGrid\_type),        \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{          !< The ocean's vertical grid structure.}
547   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))},    &
548                                   \textcolor{keywordtype}{intent(in)}  :: h\textcolor{comment}{           !< Layer thicknesses [H ~> m or kg m-2]}
549   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},             \textcolor{keywordtype}{intent(out)} :: stock\_values\textcolor{comment}{ !< The integrated amounts of a tracer}
550 \textcolor{comment}{                             !! on the current PE, usually in kg x concentration [kg conc].}
551   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),   \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{          !< The control structure returned by a}
552 \textcolor{comment}{                                                             !! previous call to}
553 \textcolor{comment}{                                                             !! call\_tracer\_register.}
554   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
555                         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: stock\_names\textcolor{comment}{ !< Diagnostic names to use for each stock.}
556   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
557                         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: stock\_units\textcolor{comment}{ !< Units to use in the metadata for each
       stock.}
558   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: num\_stocks\textcolor{comment}{  !< The number of tracer stocks being returned.}
559   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: stock\_index\textcolor{comment}{ !< The integer stock index from}
560 \textcolor{comment}{                             !! stocks\_constants\_mod of the stock to be returned.  If this is}
561 \textcolor{comment}{                             !! present and greater than 0, only a single stock can be returned.}
562   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{dimension(:)}, &
563                       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: got\_min\_max\textcolor{comment}{ !< Indicates whether the global min and}
564 \textcolor{comment}{                                                             !! max are found for each tracer}
565   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: global\_min\textcolor{comment}{  !< The global minimum of each tracer}
566   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: global\_max\textcolor{comment}{  !< The global maximum of each tracer}
567   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: xgmin\textcolor{comment}{       !< The x-position of the global minimum}
568   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: ygmin\textcolor{comment}{       !< The y-position of the global minimum}
569   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: zgmin\textcolor{comment}{       !< The z-position of the global minimum}
570   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: xgmax\textcolor{comment}{       !< The x-position of the global maximum}
571   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: ygmax\textcolor{comment}{       !< The y-position of the global maximum}
572   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: zgmax\textcolor{comment}{       !< The z-position of the global maximum}
573 
574   \textcolor{comment}{! Local variables}
575   \textcolor{keywordtype}{character(len=200)}, \textcolor{keywordtype}{dimension(MAX\_FIELDS\_)} :: names, units
576   \textcolor{keywordtype}{character(len=200)} :: set\_pkg\_name
577   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(MAX\_FIELDS\_)} :: values
578   \textcolor{keywordtype}{integer} :: max\_ns, ns\_tot, ns, index, pkg, max\_pkgs, nn
579 
580   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_stocks: "}// &
581        \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})
582 
583   index = -1 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_index)) index = stock\_index
584   ns\_tot = 0
585   max\_ns = \textcolor{keyword}{size}(stock\_values)
586   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_names)) max\_ns = min(max\_ns,\textcolor{keyword}{size}(stock\_names))
587   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_units)) max\_ns = min(max\_ns,\textcolor{keyword}{size}(stock\_units))
588 
589 \textcolor{comment}{!  Add other user-provided calls here.}
590   \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) \textcolor{keywordflow}{then}
591     ns = user\_tracer\_stock(h, values, g, gv, cs%USER\_tracer\_example\_CSp, &
592                            names, units, stock\_index)
593     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"tracer\_example"}, ns, names, units, values, index, stock\_values, &
594                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
595 \textcolor{keywordflow}{  endif}
596 \textcolor{comment}{! if (CS%use\_DOME\_tracer) then}
597 \textcolor{comment}{!   ns = DOME\_tracer\_stock(h, values, G, GV, CS%DOME\_tracer\_CSp, &}
598 \textcolor{comment}{!                          names, units, stock\_index)}
599 \textcolor{comment}{!   call store\_stocks("DOME\_tracer", ns, names, units, values, index, stock\_values, &}
600 \textcolor{comment}{!                      set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)}
601 \textcolor{comment}{! endif}
602   \textcolor{keywordflow}{if} (cs%use\_ideal\_age) \textcolor{keywordflow}{then}
603     ns = ideal\_age\_stock(h, values, g, gv, cs%ideal\_age\_tracer\_CSp, &
604                          names, units, stock\_index)
605     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"ideal\_age\_example"}, ns, names, units, values, index, &
606            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
607 \textcolor{keywordflow}{  endif}
608   \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) \textcolor{keywordflow}{then}
609     ns = dye\_stock(h, values, g, gv, cs%dye\_tracer\_CSp, &
610                          names, units, stock\_index)
611     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"regional\_dyes"}, ns, names, units, values, index, &
612            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
613 \textcolor{keywordflow}{  endif}
614   \textcolor{keywordflow}{if} (cs%use\_oil) \textcolor{keywordflow}{then}
615     ns = oil\_stock(h, values, g, gv, cs%oil\_tracer\_CSp, &
616                          names, units, stock\_index)
617     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"oil\_tracer"}, ns, names, units, values, index, &
618            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
619 \textcolor{keywordflow}{  endif}
620   \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) \textcolor{keywordflow}{then}
621     ns = ocmip2\_cfc\_stock(h, values, g, gv, cs%OCMIP2\_CFC\_CSp, names, units, stock\_index)
622     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"MOM\_OCMIP2\_CFC"}, ns, names, units, values, index, stock\_values, &
623                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
624 \textcolor{keywordflow}{  endif}
625 
626   \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) \textcolor{keywordflow}{then}
627     ns = advection\_test\_stock( h, values, g, gv, cs%advection\_test\_tracer\_CSp, &
628                          names, units, stock\_index )
629     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"advection\_test\_tracer"}, ns, names, units, values, index, &
630            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
631 \textcolor{keywordflow}{  endif}
632 
633   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}
634     ns = mom\_generic\_tracer\_stock(h, values, g, gv, cs%MOM\_generic\_tracer\_CSp, &
635                                    names, units, stock\_index)
636     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"MOM\_generic\_tracer"}, ns, names, units, values, index, stock\_values, &
637                        set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
638     nn=ns\_tot-ns+1
639     nn=mom\_generic\_tracer\_min\_max(nn, got\_min\_max, global\_min,  global\_max, &
640                                   xgmin, ygmin, zgmin, xgmax, ygmax, zgmax ,&
641                                   g, cs%MOM\_generic\_tracer\_CSp,names, units)
642 
643 \textcolor{keywordflow}{  endif}
644   \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) \textcolor{keywordflow}{then}
645     ns = pseudo\_salt\_stock(h, values, g, gv, cs%pseudo\_salt\_tracer\_CSp, &
646                          names, units, stock\_index)
647     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"pseudo\_salt\_tracer"}, ns, names, units, values, index, &
648            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
649 \textcolor{keywordflow}{  endif}
650 
651   \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) \textcolor{keywordflow}{then}
652     ns = boundary\_impulse\_stock(h, values, g, gv, cs%boundary\_impulse\_tracer\_CSp, &
653                          names, units, stock\_index)
654     \textcolor{keyword}{call }store\_stocks(\textcolor{stringliteral}{"boundary\_impulse\_tracer"}, ns, names, units, values, index, &
655            stock\_values, set\_pkg\_name, max\_ns, ns\_tot, stock\_names, stock\_units)
656 \textcolor{keywordflow}{  endif}
657 
658   \textcolor{keywordflow}{if} (ns\_tot == 0) stock\_values(1) = 0.0
659 
660   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(num\_stocks)) num\_stocks = ns\_tot
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{\tt in,out}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean.\\
\hline
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt 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}
726   \textcolor{keywordtype}{type}(surface),                \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}
727 \textcolor{comment}{                                                       !! describe the surface state of the ocean.}
728   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{     !< The ocean's grid structure.}
729   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
730                                 \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{     !< Layer thicknesses [H ~> m or kg m-2]}
731   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{    !< The control structure returned by a}
732 \textcolor{comment}{                                                       !! previous call to call\_tracer\_register.}
733 
734   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"call\_tracer\_surface\_state: "}// &
735          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})
736 
737 \textcolor{comment}{!  Add other user-provided calls here.}
738   \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) &
739     \textcolor{keyword}{call }user\_tracer\_surface\_state(sfc\_state, h, g, cs%USER\_tracer\_example\_CSp)
740   \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) &
741     \textcolor{keyword}{call }dome\_tracer\_surface\_state(sfc\_state, h, g, cs%DOME\_tracer\_CSp)
742   \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) &
743     \textcolor{keyword}{call }isomip\_tracer\_surface\_state(sfc\_state, h, g, cs%ISOMIP\_tracer\_CSp)
744   \textcolor{keywordflow}{if} (cs%use\_ideal\_age) &
745     \textcolor{keyword}{call }ideal\_age\_tracer\_surface\_state(sfc\_state, h, g, cs%ideal\_age\_tracer\_CSp)
746   \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) &
747     \textcolor{keyword}{call }dye\_tracer\_surface\_state(sfc\_state, h, g, cs%dye\_tracer\_CSp)
748   \textcolor{keywordflow}{if} (cs%use\_oil) &
749     \textcolor{keyword}{call }oil\_tracer\_surface\_state(sfc\_state, h, g, cs%oil\_tracer\_CSp)
750   \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) &
751     \textcolor{keyword}{call }advection\_test\_tracer\_surface\_state(sfc\_state, h, g, cs%advection\_test\_tracer\_CSp)
752   \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) &
753     \textcolor{keyword}{call }ocmip2\_cfc\_surface\_state(sfc\_state, h, g, cs%OCMIP2\_CFC\_CSp)
754   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) &
755     \textcolor{keyword}{call }mom\_generic\_tracer\_surface\_state(sfc\_state, h, g, cs%MOM\_generic\_tracer\_CSp)
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{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt 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}
336   \textcolor{keywordtype}{type}(ocean\_grid\_type),        \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{         !< The ocean's grid structure.}
337   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
338                                 \textcolor{keywordtype}{intent(out)} :: Chl\_array\textcolor{comment}{ !< The array in which to store the model's}
339 \textcolor{comment}{                                                         !! Chlorophyll-A concentrations in mg m-3.}
340   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{        !< The control structure returned by a}
341 \textcolor{comment}{                                                         !! previous call to call\_tracer\_register.}
342 
343   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) \textcolor{keywordflow}{then}
344     \textcolor{keyword}{call }mom\_generic\_tracer\_get(\textcolor{stringliteral}{'chl'}, \textcolor{stringliteral}{'field'}, chl\_array, cs%MOM\_generic\_tracer\_CSp)
345   \textcolor{keywordflow}{else}
346     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"get\_chl\_from\_model was called in a configuration "}// &
347              \textcolor{stringliteral}{"that is unable to provide a sensible model-based value.\(\backslash\)n"}// &
348              \textcolor{stringliteral}{"CS%use\_MOM\_generic\_tracer is false and no other viable options are on."})
349 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em pkg\+\_\+name} & The tracer package name\\
\hline
\mbox{\tt in}  & {\em ns} & The number of stocks associated with this tracer package\\
\hline
\mbox{\tt in}  & {\em names} & Diagnostic names to use for each stock.\\
\hline
\mbox{\tt in}  & {\em units} & Units to use in the metadata for each stock.\\
\hline
\mbox{\tt in}  & {\em values} & The values of the tracer stocks\\
\hline
\mbox{\tt 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{\tt in,out}  & {\em stock\+\_\+values} & The master list of stock values\\
\hline
\mbox{\tt 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{\tt in}  & {\em max\+\_\+ns} & The maximum size of the master stock list\\
\hline
\mbox{\tt in,out}  & {\em ns\+\_\+tot} & The total number of stocks in the master list\\
\hline
\mbox{\tt in,out}  & {\em stock\+\_\+names} & Diagnostic names to use for each stock in the master list\\
\hline
\mbox{\tt 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}
667   \textcolor{keywordtype}{character(len=*)},   \textcolor{keywordtype}{intent(in)}    :: pkg\_name\textcolor{comment}{ !< The tracer package name}
668   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: ns\textcolor{comment}{      !< The number of stocks associated with this tracer package}
669   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
670                       \textcolor{keywordtype}{intent(in)}    :: names\textcolor{comment}{   !< Diagnostic names to use for each stock.}
671   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
672                       \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< Units to use in the metadata for each stock.}
673   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: values\textcolor{comment}{  !< The values of the tracer stocks}
674   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: index\textcolor{comment}{   !< The integer stock index from}
675 \textcolor{comment}{                             !! stocks\_constants\_mod of the stock to be returned.  If this is}
676 \textcolor{comment}{                             !! present and greater than 0, only a single stock can be returned.}
677   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: stock\_values\textcolor{comment}{ !< The master list of stock values}
678   \textcolor{keywordtype}{character(len=*)},   \textcolor{keywordtype}{intent(inout)} :: set\_pkg\_name\textcolor{comment}{ !< The name of the last tracer package whose}
679 \textcolor{comment}{                                               !! stocks were stored for a specific index.  This is}
680 \textcolor{comment}{                                               !! used to trigger an error if there are redundant stocks.}
681   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: max\_ns\textcolor{comment}{  !< The maximum size of the master stock list}
682   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(inout)} :: ns\_tot\textcolor{comment}{  !< The total number of stocks in the master list}
683   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
684             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: stock\_names\textcolor{comment}{ !< Diagnostic names to use for each stock in the master
       list}
685   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, &
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}
687 
688 \textcolor{comment}{! This routine stores the stocks and does error handling for call\_tracer\_stocks.}
689   \textcolor{keywordtype}{character(len=16)} :: ind\_text, ns\_text, max\_text
690   \textcolor{keywordtype}{integer} :: n
691 
692   \textcolor{keywordflow}{if} ((index > 0) .and. (ns > 0)) \textcolor{keywordflow}{then}
693     \textcolor{keyword}{write}(ind\_text,\textcolor{stringliteral}{'(i8)'}) index
694     \textcolor{keywordflow}{if} (ns > 1) \textcolor{keywordflow}{then}
695       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Tracer package "}//trim(pkg\_name)//&
696           \textcolor{stringliteral}{" is not permitted to return more than one value when queried"}//&
697           \textcolor{stringliteral}{" for specific stock index "}//trim(adjustl(ind\_text))//\textcolor{stringliteral}{"."})
698     \textcolor{keywordflow}{elseif} (ns+ns\_tot > 1) \textcolor{keywordflow}{then}
699       \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Tracer packages "}//trim(pkg\_name)//\textcolor{stringliteral}{" and "}//&
700           trim(set\_pkg\_name)//\textcolor{stringliteral}{" both attempted to set values for"}//&
701           \textcolor{stringliteral}{" specific stock index "}//trim(adjustl(ind\_text))//\textcolor{stringliteral}{"."})
702     \textcolor{keywordflow}{else}
703       set\_pkg\_name = pkg\_name
704 \textcolor{keywordflow}{    endif}
705 \textcolor{keywordflow}{  endif}
706 
707   \textcolor{keywordflow}{if} (ns\_tot+ns > max\_ns) \textcolor{keywordflow}{then}
708     \textcolor{keyword}{write}(ns\_text,\textcolor{stringliteral}{'(i8)'}) ns\_tot+ns ; \textcolor{keyword}{write}(max\_text,\textcolor{stringliteral}{'(i8)'}) max\_ns
709     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"Attempted to return more tracer stock values (at least "}//&
710       trim(adjustl(ns\_text))//\textcolor{stringliteral}{") than the size "}//trim(adjustl(max\_text))//&
711       \textcolor{stringliteral}{"of the smallest value, name, or units array."})
712 \textcolor{keywordflow}{  endif}
713 
714   \textcolor{keywordflow}{do} n=1,ns
715     stock\_values(ns\_tot+n) = values(n)
716     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_names)) stock\_names(ns\_tot+n) = names(n)
717     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_units)) stock\_units(ns\_tot+n) = units(n)
718 \textcolor{keywordflow}{  enddo}
719   ns\_tot = ns\_tot + ns
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}
760   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{    !< The control structure returned by a}
761 \textcolor{comment}{                                                 !! previous call to call\_tracer\_register.}
762 
763   \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) &
764     \textcolor{keyword}{call }user\_tracer\_example\_end(cs%USER\_tracer\_example\_CSp)
765   \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) \textcolor{keyword}{call }dome\_tracer\_end(cs%DOME\_tracer\_CSp)
766   \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) \textcolor{keyword}{call }isomip\_tracer\_end(cs%ISOMIP\_tracer\_CSp)
767   \textcolor{keywordflow}{if} (cs%use\_RGC\_tracer) \textcolor{keyword}{call }rgc\_tracer\_end(cs%RGC\_tracer\_CSp)
768   \textcolor{keywordflow}{if} (cs%use\_ideal\_age) \textcolor{keyword}{call }ideal\_age\_example\_end(cs%ideal\_age\_tracer\_CSp)
769   \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) \textcolor{keyword}{call }regional\_dyes\_end(cs%dye\_tracer\_CSp)
770   \textcolor{keywordflow}{if} (cs%use\_oil) \textcolor{keyword}{call }oil\_tracer\_end(cs%oil\_tracer\_CSp)
771   \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) \textcolor{keyword}{call }advection\_test\_tracer\_end(cs%advection\_test\_tracer\_CSp)
772   \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) \textcolor{keyword}{call }ocmip2\_cfc\_end(cs%OCMIP2\_CFC\_CSp)
773   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) \textcolor{keyword}{call }end\_mom\_generic\_tracer(cs%MOM\_generic\_tracer\_CSp)
774   \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) \textcolor{keyword}{call }pseudo\_salt\_tracer\_end(cs%pseudo\_salt\_tracer\_CSp)
775   \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) \textcolor{keyword}{call }boundary\_impulse\_tracer\_end(cs%boundary\_impulse\_tracer\_CSp)
776   \textcolor{keywordflow}{if} (cs%use\_dyed\_obc\_tracer) \textcolor{keyword}{call }dyed\_obc\_tracer\_end(cs%dyed\_obc\_tracer\_CSp)
777 
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{\tt in}  & {\em restart} & 1 if the fields have already been read from a restart file.\\
\hline
\mbox{\tt in}  & {\em day} & Time of the start of the run.\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters\\
\hline
\mbox{\tt 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{\tt 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}
260   \textcolor{keywordtype}{logical},                               \textcolor{keywordtype}{intent(in)}    :: restart\textcolor{comment}{ !< 1 if the fields have already}
261 \textcolor{comment}{                                                                  !! been read from a restart file.}
262   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target},               \textcolor{keywordtype}{intent(in)}    :: day\textcolor{comment}{     !< Time of the start of the run.}
263   \textcolor{keywordtype}{type}(ocean\_grid\_type),                 \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{       !< The ocean's grid structure.}
264   \textcolor{keywordtype}{type}(verticalGrid\_type),               \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{      !< The ocean's vertical grid}
265 \textcolor{comment}{                                                                  !! structure.}
266   \textcolor{keywordtype}{type}(unit\_scale\_type),                 \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{      !< A dimensional unit scaling type}
267   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, &
268                                          \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{       !< Layer thicknesses [H ~> m or kg m-2]}
269   \textcolor{keywordtype}{type}(param\_file\_type),                 \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for}
270 \textcolor{comment}{                                                                  !! run-time parameters}
271   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target},               \textcolor{keywordtype}{intent(in)}    :: diag\textcolor{comment}{    !< A structure that is used to}
272 \textcolor{comment}{                                                                  !! regulate diagnostic output.}
273   \textcolor{keywordtype}{type}(ocean\_OBC\_type),                  \textcolor{keywordtype}{pointer}       :: OBC\textcolor{comment}{     !< This open boundary condition}
274 \textcolor{comment}{                                                                  !! type specifies whether, where,}
275 \textcolor{comment}{                                                                  !! and what open boundary}
276 \textcolor{comment}{                                                                  !! conditions are used.}
277   \textcolor{keywordtype}{type}(tracer\_flow\_control\_CS),          \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{      !< The control structure returned}
278 \textcolor{comment}{                                                                  !! by a previous call to}
279 \textcolor{comment}{                                                                  !! call\_tracer\_register.}
280   \textcolor{keywordtype}{type}(sponge\_CS),                       \textcolor{keywordtype}{pointer}       :: sponge\_CSp\textcolor{comment}{     !< A pointer to the control}
281 \textcolor{comment}{                                               !! structure for the sponges, if they are in use.}
282 \textcolor{comment}{                                               !! Otherwise this may be unassociated.}
283   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),                   \textcolor{keywordtype}{pointer}       :: ALE\_sponge\_CSp\textcolor{comment}{ !< A pointer to the control}
284 \textcolor{comment}{                                               !! structure for the ALE sponges, if they are in use.}
285 \textcolor{comment}{                                               !! Otherwise this may be unassociated.}
286   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),                 \textcolor{keywordtype}{intent(in)}    :: tv\textcolor{comment}{      !< A structure pointing to various}
287 \textcolor{comment}{                                                                  !! thermodynamic variables}
288 
289   \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(cs)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"tracer\_flow\_control\_init: "}// &
290          \textcolor{stringliteral}{"Module must be initialized via call\_tracer\_register before it is used."})
291 
292 \textcolor{comment}{!  Add other user-provided calls here.}
293   \textcolor{keywordflow}{if} (cs%use\_USER\_tracer\_example) &
294     \textcolor{keyword}{call }user\_initialize\_tracer(restart, day, g, gv, h, diag, obc, cs%USER\_tracer\_example\_CSp, &
295                                 sponge\_csp)
296   \textcolor{keywordflow}{if} (cs%use\_DOME\_tracer) &
297     \textcolor{keyword}{call }initialize\_dome\_tracer(restart, day, g, gv, us, h, diag, obc, cs%DOME\_tracer\_CSp, &
298                                 sponge\_csp, param\_file)
299   \textcolor{keywordflow}{if} (cs%use\_ISOMIP\_tracer) &
300     \textcolor{keyword}{call }initialize\_isomip\_tracer(restart, day, g, gv, h, diag, obc, cs%ISOMIP\_tracer\_CSp, &
301                                 ale\_sponge\_csp)
302   \textcolor{keywordflow}{if} (cs%use\_RGC\_tracer) &
303     \textcolor{keyword}{call }initialize\_rgc\_tracer(restart, day, g, gv, h, diag, obc, &
304                   cs%RGC\_tracer\_CSp, sponge\_csp, ale\_sponge\_csp)
305   \textcolor{keywordflow}{if} (cs%use\_ideal\_age) &
306     \textcolor{keyword}{call }initialize\_ideal\_age\_tracer(restart, day, g, gv, us, h, diag, obc, cs%ideal\_age\_tracer\_CSp, &
307                                      sponge\_csp)
308   \textcolor{keywordflow}{if} (cs%use\_regional\_dyes) &
309     \textcolor{keyword}{call }initialize\_dye\_tracer(restart, day, g, gv, h, diag, obc, cs%dye\_tracer\_CSp, &
310                                      sponge\_csp)
311   \textcolor{keywordflow}{if} (cs%use\_oil) &
312     \textcolor{keyword}{call }initialize\_oil\_tracer(restart, day, g, gv, us, h, diag, obc, cs%oil\_tracer\_CSp, &
313                                      sponge\_csp)
314   \textcolor{keywordflow}{if} (cs%use\_advection\_test\_tracer) &
315     \textcolor{keyword}{call }initialize\_advection\_test\_tracer(restart, day, g, gv, h, diag, obc, cs%advection\_test\_tracer\_CSp, 
      &
316                                 sponge\_csp)
317   \textcolor{keywordflow}{if} (cs%use\_OCMIP2\_CFC) &
318     \textcolor{keyword}{call }initialize\_ocmip2\_cfc(restart, day, g, gv, us, h, diag, obc, cs%OCMIP2\_CFC\_CSp, &
319                                 sponge\_csp)
320   \textcolor{keywordflow}{if} (cs%use\_MOM\_generic\_tracer) &
321     \textcolor{keyword}{call }initialize\_mom\_generic\_tracer(restart, day, g, gv, us, h, param\_file, diag, obc, &
322         cs%MOM\_generic\_tracer\_CSp, sponge\_csp, ale\_sponge\_csp)
323   \textcolor{keywordflow}{if} (cs%use\_pseudo\_salt\_tracer) &
324     \textcolor{keyword}{call }initialize\_pseudo\_salt\_tracer(restart, day, g, gv, h, diag, obc, cs%pseudo\_salt\_tracer\_CSp, &
325                                 sponge\_csp, tv)
326   \textcolor{keywordflow}{if} (cs%use\_boundary\_impulse\_tracer) &
327     \textcolor{keyword}{call }initialize\_boundary\_impulse\_tracer(restart, day, g, gv, h, diag, obc, cs
      %boundary\_impulse\_tracer\_CSp, &
328                                 sponge\_csp, tv)
329   \textcolor{keywordflow}{if} (cs%use\_dyed\_obc\_tracer) &
330     \textcolor{keyword}{call }initialize\_dyed\_obc\_tracer(restart, day, g, gv, h, diag, obc, cs%dyed\_obc\_tracer\_CSp)
331 
\end{DoxyCode}
