\hypertarget{namespacepseudo__salt__tracer}{}\doxysection{pseudo\+\_\+salt\+\_\+tracer Module Reference}
\label{namespacepseudo__salt__tracer}\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}


\doxysubsection{Detailed Description}
A tracer package that mimics salinity. 

By Andrew Shao, 2016

This file contains the routines necessary to model a passive tracer that uses the same boundary fluxes as salinity. At the beginning of the run, salt is set to the same as tvS. Any deviations between this salt-\/like tracer and tvS signifies a difference between how active and passive tracers are treated. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em The control structure for the pseudo-\/salt tracer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
logical function, public \mbox{\hyperlink{namespacepseudo__salt__tracer_a147eabcabc9a787c01310dd67a5bab08}{register\+\_\+pseudo\+\_\+salt\+\_\+tracer}} (HI, GV, param\+\_\+file, CS, tr\+\_\+\+Reg, restart\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em Register the pseudo-\/salt tracer with M\+O\+M6. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacepseudo__salt__tracer_a012fcdab14755a8eec9c68f0ddbff012}{initialize\+\_\+pseudo\+\_\+salt\+\_\+tracer}} (restart, day, G, GV, h, diag, O\+BC, CS, sponge\+\_\+\+C\+Sp, tv)
\begin{DoxyCompactList}\small\item\em Initialize the pseudo-\/salt tracer. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacepseudo__salt__tracer_a7c534dce5f33ab195485552f63cff657}{pseudo\+\_\+salt\+\_\+tracer\+\_\+column\+\_\+physics}} (h\+\_\+old, h\+\_\+new, ea, eb, fluxes, dt, G, GV, US, CS, tv, debug, evap\+\_\+\+C\+F\+L\+\_\+limit, minimum\+\_\+forcing\+\_\+depth)
\begin{DoxyCompactList}\small\item\em Apply sources, sinks and diapycnal diffusion to the tracers in this package. \end{DoxyCompactList}\item 
integer function, public \mbox{\hyperlink{namespacepseudo__salt__tracer_a282f3c84b7e7ccdaa6d9344342705a6e}{pseudo\+\_\+salt\+\_\+stock}} (h, stocks, G, GV, CS, names, units, stock\+\_\+index)
\begin{DoxyCompactList}\small\item\em Calculates the mass-\/weighted integral of all tracer stocks, returning the number of stocks it has calculated. If the stock\+\_\+index is present, only the stock corresponding to that coded index is returned. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacepseudo__salt__tracer_aae962f10f82225feec43dd4a11faca6a}{pseudo\+\_\+salt\+\_\+tracer\+\_\+surface\+\_\+state}} (sfc\+\_\+state, h, G, CS)
\begin{DoxyCompactList}\small\item\em This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations. This particular tracer package does not report anything back to the coupler. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacepseudo__salt__tracer_a97689343fce90aaa0a60f836b7dea9ad}{pseudo\+\_\+salt\+\_\+tracer\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Deallocate memory associated with this tracer package. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_a012fcdab14755a8eec9c68f0ddbff012}\label{namespacepseudo__salt__tracer_a012fcdab14755a8eec9c68f0ddbff012}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!initialize\_pseudo\_salt\_tracer@{initialize\_pseudo\_salt\_tracer}}
\index{initialize\_pseudo\_salt\_tracer@{initialize\_pseudo\_salt\_tracer}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{initialize\_pseudo\_salt\_tracer()}{initialize\_pseudo\_salt\_tracer()}}
{\footnotesize\ttfamily subroutine, public pseudo\+\_\+salt\+\_\+tracer\+::initialize\+\_\+pseudo\+\_\+salt\+\_\+tracer (\begin{DoxyParamCaption}\item[{logical, intent(in)}]{restart,  }\item[{type(time\+\_\+type), intent(in), target}]{day,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{type(diag\+\_\+ctrl), intent(in), target}]{diag,  }\item[{type(ocean\+\_\+obc\+\_\+type), pointer}]{O\+BC,  }\item[{type(\mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{type(sponge\+\_\+cs), pointer}]{sponge\+\_\+\+C\+Sp,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv }\end{DoxyParamCaption})}



Initialize the pseudo-\/salt tracer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em restart} & .true. 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}}  & {\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{ 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 register\+\_\+pseudo\+\_\+salt\+\_\+tracer. \\
\hline
 & {\em sponge\+\_\+csp} & Pointer to the control structure for the sponges. \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & A structure pointing to various thermodynamic variables \\
\hline
\end{DoxyParams}


Definition at line 118 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{118   \textcolor{keywordtype}{logical},                            \textcolor{keywordtype}{intent(in)} :: restart\textcolor{comment}{ !< .true. if the fields have already}}
\DoxyCodeLine{119 \textcolor{comment}{                                                         !! been read from a restart file.}}
\DoxyCodeLine{120   \textcolor{keywordtype}{type}(time\_type),            \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: day\textcolor{comment}{  !< Time of the start of the run.}}
\DoxyCodeLine{121   \textcolor{keywordtype}{type}(ocean\_grid\_type),              \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{122   \textcolor{keywordtype}{type}(verticalGrid\_type),            \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{123 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{124                                       \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{    !< Layer thicknesses [H ~> m or kg m-\/2]}}
\DoxyCodeLine{125   \textcolor{keywordtype}{type}(diag\_ctrl),            \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{ !< A structure that is used to regulate}}
\DoxyCodeLine{126 \textcolor{comment}{                                                         !! diagnostic output.}}
\DoxyCodeLine{127   \textcolor{keywordtype}{type}(ocean\_OBC\_type),               \textcolor{keywordtype}{pointer}    :: OBC\textcolor{comment}{  !< This open boundary condition type specifies}}
\DoxyCodeLine{128 \textcolor{comment}{                                                         !! whether, where, and what open boundary}}
\DoxyCodeLine{129 \textcolor{comment}{                                                         !! conditions are used.}}
\DoxyCodeLine{130   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS),        \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{131 \textcolor{comment}{                                                       !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{132   \textcolor{keywordtype}{type}(sponge\_CS),                    \textcolor{keywordtype}{pointer}    :: sponge\_CSp\textcolor{comment}{ !< Pointer to the control structure for the sponges.}}
\DoxyCodeLine{133   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),              \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{   !< A structure pointing to various thermodynamic variables}}
\DoxyCodeLine{134 \textcolor{comment}{!   This subroutine initializes the tracer fields in CS\%ps(:,:,:).}}
\DoxyCodeLine{135 }
\DoxyCodeLine{136   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{137   \textcolor{keywordtype}{character(len=16)} :: name     \textcolor{comment}{! A variable's name in a NetCDF file.}}
\DoxyCodeLine{138   \textcolor{keywordtype}{character(len=72)} :: longname \textcolor{comment}{! The long name of that variable.}}
\DoxyCodeLine{139   \textcolor{keywordtype}{character(len=48)} :: units    \textcolor{comment}{! The dimensions of the variable.}}
\DoxyCodeLine{140   \textcolor{keywordtype}{character(len=48)} :: flux\_units \textcolor{comment}{! The units for age tracer fluxes, either}}
\DoxyCodeLine{141                                 \textcolor{comment}{! years m3 s-\/1 or years kg s-\/1.}}
\DoxyCodeLine{142   \textcolor{keywordtype}{logical} :: OK}
\DoxyCodeLine{143   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz}
\DoxyCodeLine{144   \textcolor{keywordtype}{integer} :: IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{145 }
\DoxyCodeLine{146   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{147   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs\%diff)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{148 }
\DoxyCodeLine{149   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = gv\%ke}
\DoxyCodeLine{150   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{151   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{152 }
\DoxyCodeLine{153   cs\%Time => day}
\DoxyCodeLine{154   cs\%diag => diag}
\DoxyCodeLine{155   name = \textcolor{stringliteral}{"pseudo\_salt"}}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   \textcolor{keyword}{call }query\_vardesc(cs\%tr\_desc, name=name, caller=\textcolor{stringliteral}{"initialize\_pseudo\_salt\_tracer"})}
\DoxyCodeLine{158   \textcolor{keywordflow}{if} ((.not.restart) .or. (.not.query\_initialized(cs\%ps, name, cs\%restart\_CSp))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{159     \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=jsd,jed ; \textcolor{keywordflow}{do} i=isd,ied}
\DoxyCodeLine{160       cs\%ps(i,j,k) = tv\%S(i,j,k)}
\DoxyCodeLine{161 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{162 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{163 }
\DoxyCodeLine{164   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(obc)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{165   \textcolor{comment}{! Steal from updated DOME in the fullness of time.}}
\DoxyCodeLine{166 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{167 }
\DoxyCodeLine{168   cs\%id\_psd = register\_diag\_field(\textcolor{stringliteral}{"ocean\_model"}, \textcolor{stringliteral}{"pseudo\_salt\_diff"}, cs\%diag\%axesTL, \&}
\DoxyCodeLine{169         day, \textcolor{stringliteral}{"Difference between pseudo salt passive tracer and salt tracer"}, \textcolor{stringliteral}{"psu"})}
\DoxyCodeLine{170 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_a282f3c84b7e7ccdaa6d9344342705a6e}\label{namespacepseudo__salt__tracer_a282f3c84b7e7ccdaa6d9344342705a6e}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!pseudo\_salt\_stock@{pseudo\_salt\_stock}}
\index{pseudo\_salt\_stock@{pseudo\_salt\_stock}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{pseudo\_salt\_stock()}{pseudo\_salt\_stock()}}
{\footnotesize\ttfamily integer function, public pseudo\+\_\+salt\+\_\+tracer\+::pseudo\+\_\+salt\+\_\+stock (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h,  }\item[{real, dimension(\+:), intent(out)}]{stocks,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{character(len=$\ast$), dimension(\+:), intent(out)}]{names,  }\item[{character(len=$\ast$), dimension(\+:), intent(out)}]{units,  }\item[{integer, intent(in), optional}]{stock\+\_\+index }\end{DoxyParamCaption})}



Calculates the mass-\/weighted integral of all tracer stocks, returning the number of stocks it has calculated. If the stock\+\_\+index is present, only the stock corresponding to that coded index is returned. 


\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 stocks} & the mass-\/weighted integrated amount of each tracer, in kg times concentration units \mbox{[}kg conc\mbox{]}. \\
\hline
 & {\em cs} & The control structure returned by a previous call to register\+\_\+pseudo\+\_\+salt\+\_\+tracer. \\
\hline
\mbox{\texttt{ out}}  & {\em names} & The names of the stocks calculated. \\
\hline
\mbox{\texttt{ out}}  & {\em units} & The units of the stocks calculated. \\
\hline
\mbox{\texttt{ in}}  & {\em stock\+\_\+index} & The coded index of a specific stock being sought. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Return value\+: the number of stocks calculated here. 
\end{DoxyReturn}


Definition at line 254 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{254   \textcolor{keywordtype}{type}(ocean\_grid\_type),              \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{255   \textcolor{keywordtype}{type}(verticalGrid\_type),            \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{256 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{    !< Layer thicknesses [H ~> m or kg m-\/2]}}
\DoxyCodeLine{257 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},                 \textcolor{keywordtype}{intent(out)}   :: stocks\textcolor{comment}{ !< the mass-\/weighted integrated amount of each}}
\DoxyCodeLine{258 \textcolor{comment}{                                                              !! tracer, in kg times concentration units [kg conc].}}
\DoxyCodeLine{259   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS),        \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{260 \textcolor{comment}{                                                          !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{261   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)},     \textcolor{keywordtype}{intent(out)}   :: names\textcolor{comment}{  !< The names of the stocks calculated.}}
\DoxyCodeLine{262   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)},     \textcolor{keywordtype}{intent(out)}   :: units\textcolor{comment}{  !< The units of the stocks calculated.}}
\DoxyCodeLine{263   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},                  \textcolor{keywordtype}{intent(in)}    :: stock\_index\textcolor{comment}{ !< The coded index of a specific stock}}
\DoxyCodeLine{264 \textcolor{comment}{                                                              !! being sought.}}
\DoxyCodeLine{265   \textcolor{keywordtype}{integer}                                           :: pseudo\_salt\_stock\textcolor{comment}{ !< Return value: the number of}}
\DoxyCodeLine{266 \textcolor{comment}{                                                              !! stocks calculated here.}}
\DoxyCodeLine{267 }
\DoxyCodeLine{268 \textcolor{comment}{! This function calculates the mass-\/weighted integral of all tracer stocks,}}
\DoxyCodeLine{269 \textcolor{comment}{! returning the number of stocks it has calculated.  If the stock\_index}}
\DoxyCodeLine{270 \textcolor{comment}{! is present, only the stock corresponding to that coded index is returned.}}
\DoxyCodeLine{271 }
\DoxyCodeLine{272   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz}
\DoxyCodeLine{273   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = gv\%ke}
\DoxyCodeLine{274 }
\DoxyCodeLine{275   pseudo\_salt\_stock = 0}
\DoxyCodeLine{276   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{277   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs\%diff)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{278 }
\DoxyCodeLine{279   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_index)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (stock\_index > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{280     \textcolor{comment}{! Check whether this stock is available from this routine.}}
\DoxyCodeLine{281 }
\DoxyCodeLine{282     \textcolor{comment}{! No stocks from this routine are being checked yet.  Return 0.}}
\DoxyCodeLine{283     \textcolor{keywordflow}{return}}
\DoxyCodeLine{284 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{285 }
\DoxyCodeLine{286   \textcolor{keyword}{call }query\_vardesc(cs\%tr\_desc, name=names(1), units=units(1), caller=\textcolor{stringliteral}{"pseudo\_salt\_stock"})}
\DoxyCodeLine{287   units(1) = trim(units(1))//\textcolor{stringliteral}{" kg"}}
\DoxyCodeLine{288   stocks(1) = 0.0}
\DoxyCodeLine{289   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{290     stocks(1) = stocks(1) + cs\%diff(i,j,k) * \&}
\DoxyCodeLine{291                          (g\%mask2dT(i,j) * g\%US\%L\_to\_m**2*g\%areaT(i,j) * h(i,j,k))}
\DoxyCodeLine{292 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{293   stocks(1) = gv\%H\_to\_kg\_m2 * stocks(1)}
\DoxyCodeLine{294 }
\DoxyCodeLine{295   pseudo\_salt\_stock = 1}
\DoxyCodeLine{296 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_a7c534dce5f33ab195485552f63cff657}\label{namespacepseudo__salt__tracer_a7c534dce5f33ab195485552f63cff657}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!pseudo\_salt\_tracer\_column\_physics@{pseudo\_salt\_tracer\_column\_physics}}
\index{pseudo\_salt\_tracer\_column\_physics@{pseudo\_salt\_tracer\_column\_physics}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{pseudo\_salt\_tracer\_column\_physics()}{pseudo\_salt\_tracer\_column\_physics()}}
{\footnotesize\ttfamily subroutine, public pseudo\+\_\+salt\+\_\+tracer\+::pseudo\+\_\+salt\+\_\+tracer\+\_\+column\+\_\+physics (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h\+\_\+old,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h\+\_\+new,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{ea,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{eb,  }\item[{type(forcing), intent(in)}]{fluxes,  }\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(\mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv,  }\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})}



Apply sources, sinks and diapycnal diffusion to the tracers in this package. 


\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 \\
\hline
\mbox{\texttt{ in}}  & {\em eb} & an array to which the amount of fluid entrained \\
\hline
\mbox{\texttt{ in}}  & {\em fluxes} & A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have N\+U\+LL ptrs. \\
\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
 & {\em cs} & The control structure returned by a previous call to register\+\_\+pseudo\+\_\+salt\+\_\+tracer. \\
\hline
\mbox{\texttt{ in}}  & {\em tv} & A structure pointing to various thermodynamic variables \\
\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 176 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{176   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{177   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{178 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{179                            \textcolor{keywordtype}{intent(in)} :: h\_old\textcolor{comment}{ !< Layer thickness before entrainment [H ~> m or kg m-\/2].}}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{181                            \textcolor{keywordtype}{intent(in)} :: h\_new\textcolor{comment}{ !< Layer thickness after entrainment [H ~> m or kg m-\/2].}}
\DoxyCodeLine{182 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{183                            \textcolor{keywordtype}{intent(in)} :: ea\textcolor{comment}{   !< an array to which the amount of fluid entrained}}
\DoxyCodeLine{184 \textcolor{comment}{                                              !! from the layer above during this call will be}}
\DoxyCodeLine{185 \textcolor{comment}{                                              !! added [H ~> m or kg m-\/2].}}
\DoxyCodeLine{186 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{187                            \textcolor{keywordtype}{intent(in)} :: eb\textcolor{comment}{   !< an array to which the amount of fluid entrained}}
\DoxyCodeLine{188 \textcolor{comment}{                                              !! from the layer below during this call will be}}
\DoxyCodeLine{189 \textcolor{comment}{                                              !! added [H ~> m or kg m-\/2].}}
\DoxyCodeLine{190   \textcolor{keywordtype}{type}(forcing),           \textcolor{keywordtype}{intent(in)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to thermodynamic}}
\DoxyCodeLine{191 \textcolor{comment}{                                              !! and tracer forcing fields.  Unused fields have NULL ptrs.}}
\DoxyCodeLine{192 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)} :: dt\textcolor{comment}{   !< The amount of time covered by this call [T ~> s]}}
\DoxyCodeLine{193   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{194   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{  !< The control structure returned by a previous}}
\DoxyCodeLine{195 \textcolor{comment}{                                              !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{196   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),   \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{   !< A structure pointing to various thermodynamic variables}}
\DoxyCodeLine{197   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)} :: debug\textcolor{comment}{ !< If true calculate checksums}}
\DoxyCodeLine{198 \textcolor{keywordtype}{  real},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: evap\_CFL\_limit\textcolor{comment}{ !< Limit on the fraction of the water that can}}
\DoxyCodeLine{199 \textcolor{comment}{                                              !! be fluxed out of the top layer in a timestep [nondim]}}
\DoxyCodeLine{200 \textcolor{keywordtype}{  real},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: minimum\_forcing\_depth\textcolor{comment}{ !< The smallest depth over which}}
\DoxyCodeLine{201 \textcolor{comment}{                                              !! fluxes can be applied [H ~> m or kg m-\/2]}}
\DoxyCodeLine{202 }
\DoxyCodeLine{203 \textcolor{comment}{!   This subroutine applies diapycnal diffusion and any other column}}
\DoxyCodeLine{204 \textcolor{comment}{! tracer physics or chemistry to the tracers from this file.}}
\DoxyCodeLine{205 }
\DoxyCodeLine{206 \textcolor{comment}{! The arguments to this subroutine are redundant in that}}
\DoxyCodeLine{207 \textcolor{comment}{!     h\_new(k) = h\_old(k) + ea(k) -\/ eb(k-\/1) + eb(k) -\/ ea(k+1)}}
\DoxyCodeLine{208 }
\DoxyCodeLine{209   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{210 \textcolor{keywordtype}{  real} :: year, h\_total, scale, htot, Ih\_limit}
\DoxyCodeLine{211   \textcolor{keywordtype}{integer} :: secs, days}
\DoxyCodeLine{212   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz, k\_max}
\DoxyCodeLine{213 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))} :: h\_work \textcolor{comment}{! Used so that h can be modified}}
\DoxyCodeLine{214 }
\DoxyCodeLine{215   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = gv\%ke}
\DoxyCodeLine{216 }
\DoxyCodeLine{217   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{218   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs\%diff)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{219 }
\DoxyCodeLine{220   \textcolor{keywordflow}{if} (debug) \textcolor{keywordflow}{then}}
\DoxyCodeLine{221     \textcolor{keyword}{call }hchksum(tv\%S,\textcolor{stringliteral}{"salt pre pseudo-\/salt vertdiff"}, g\%HI)}
\DoxyCodeLine{222     \textcolor{keyword}{call }hchksum(cs\%ps,\textcolor{stringliteral}{"pseudo\_salt pre pseudo-\/salt vertdiff"}, g\%HI)}
\DoxyCodeLine{223 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{224 }
\DoxyCodeLine{225   \textcolor{comment}{! This uses applyTracerBoundaryFluxesInOut, usually in ALE mode}}
\DoxyCodeLine{226   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(evap\_cfl\_limit) .and. \textcolor{keyword}{present}(minimum\_forcing\_depth)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{227     \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{228       h\_work(i,j,k) = h\_old(i,j,k)}
\DoxyCodeLine{229 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{230     \textcolor{keyword}{call }applytracerboundaryfluxesinout(g, gv, cs\%ps, dt, fluxes, h\_work, \&}
\DoxyCodeLine{231                                         evap\_cfl\_limit, minimum\_forcing\_depth, out\_flux\_optional=fluxes\%netSalt)}
\DoxyCodeLine{232     \textcolor{keyword}{call }tracer\_vertdiff(h\_work, ea, eb, dt, cs\%ps, g, gv)}
\DoxyCodeLine{233   \textcolor{keywordflow}{else}}
\DoxyCodeLine{234     \textcolor{keyword}{call }tracer\_vertdiff(h\_old, ea, eb, dt, cs\%ps, g, gv)}
\DoxyCodeLine{235 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{236 }
\DoxyCodeLine{237   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{238     cs\%diff(i,j,k) = cs\%ps(i,j,k)-\/tv\%S(i,j,k)}
\DoxyCodeLine{239 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{240 }
\DoxyCodeLine{241   \textcolor{keywordflow}{if} (debug) \textcolor{keywordflow}{then}}
\DoxyCodeLine{242     \textcolor{keyword}{call }hchksum(tv\%S,\textcolor{stringliteral}{"salt post pseudo-\/salt vertdiff"}, g\%HI)}
\DoxyCodeLine{243     \textcolor{keyword}{call }hchksum(cs\%ps,\textcolor{stringliteral}{"pseudo\_salt post pseudo-\/salt vertdiff"}, g\%HI)}
\DoxyCodeLine{244 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{245 }
\DoxyCodeLine{246   \textcolor{keywordflow}{if} (cs\%id\_psd>0) \textcolor{keyword}{call }post\_data(cs\%id\_psd, cs\%diff, cs\%diag)}
\DoxyCodeLine{247 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_a97689343fce90aaa0a60f836b7dea9ad}\label{namespacepseudo__salt__tracer_a97689343fce90aaa0a60f836b7dea9ad}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!pseudo\_salt\_tracer\_end@{pseudo\_salt\_tracer\_end}}
\index{pseudo\_salt\_tracer\_end@{pseudo\_salt\_tracer\_end}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{pseudo\_salt\_tracer\_end()}{pseudo\_salt\_tracer\_end()}}
{\footnotesize\ttfamily subroutine, public pseudo\+\_\+salt\+\_\+tracer\+::pseudo\+\_\+salt\+\_\+tracer\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Deallocate memory associated with this tracer package. 


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


Definition at line 326 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{326   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{327 \textcolor{comment}{                                              !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{328   \textcolor{keywordtype}{integer} :: m}
\DoxyCodeLine{329 }
\DoxyCodeLine{330   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{331     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%ps)) \textcolor{keyword}{deallocate}(cs\%ps)}
\DoxyCodeLine{332     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%diff)) \textcolor{keyword}{deallocate}(cs\%diff)}
\DoxyCodeLine{333     \textcolor{keyword}{deallocate}(cs)}
\DoxyCodeLine{334 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_aae962f10f82225feec43dd4a11faca6a}\label{namespacepseudo__salt__tracer_aae962f10f82225feec43dd4a11faca6a}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!pseudo\_salt\_tracer\_surface\_state@{pseudo\_salt\_tracer\_surface\_state}}
\index{pseudo\_salt\_tracer\_surface\_state@{pseudo\_salt\_tracer\_surface\_state}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{pseudo\_salt\_tracer\_surface\_state()}{pseudo\_salt\_tracer\_surface\_state()}}
{\footnotesize\ttfamily subroutine, public pseudo\+\_\+salt\+\_\+tracer\+::pseudo\+\_\+salt\+\_\+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{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine extracts the surface fields from this tracer package that are to be shared with the atmosphere in coupled configurations. This particular tracer package does not report anything back to the coupler. 


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


Definition at line 303 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{303   \textcolor{keywordtype}{type}(ocean\_grid\_type),  \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{  !< The ocean's grid structure.}}
\DoxyCodeLine{304   \textcolor{keywordtype}{type}(surface),          \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}}
\DoxyCodeLine{305 \textcolor{comment}{                                              !! describe the surface state of the ocean.}}
\DoxyCodeLine{306 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{307                           \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{  !< Layer thickness [H ~> m or kg m-\/2].}}
\DoxyCodeLine{308   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS), \textcolor{keywordtype}{pointer}  :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{309 \textcolor{comment}{                                              !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{310 }
\DoxyCodeLine{311   \textcolor{comment}{! This particular tracer package does not report anything back to the coupler.}}
\DoxyCodeLine{312   \textcolor{comment}{! The code that is here is just a rough guide for packages that would.}}
\DoxyCodeLine{313 }
\DoxyCodeLine{314   \textcolor{keywordtype}{integer} :: m, is, ie, js, je, isd, ied, jsd, jed}
\DoxyCodeLine{315   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec}
\DoxyCodeLine{316   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{317 }
\DoxyCodeLine{318   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{319 }
\DoxyCodeLine{320   \textcolor{comment}{! By design, this tracer package does not return any surface states.}}
\DoxyCodeLine{321 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacepseudo__salt__tracer_a147eabcabc9a787c01310dd67a5bab08}\label{namespacepseudo__salt__tracer_a147eabcabc9a787c01310dd67a5bab08}} 
\index{pseudo\_salt\_tracer@{pseudo\_salt\_tracer}!register\_pseudo\_salt\_tracer@{register\_pseudo\_salt\_tracer}}
\index{register\_pseudo\_salt\_tracer@{register\_pseudo\_salt\_tracer}!pseudo\_salt\_tracer@{pseudo\_salt\_tracer}}
\doxysubsubsection{\texorpdfstring{register\_pseudo\_salt\_tracer()}{register\_pseudo\_salt\_tracer()}}
{\footnotesize\ttfamily logical function, public pseudo\+\_\+salt\+\_\+tracer\+::register\+\_\+pseudo\+\_\+salt\+\_\+tracer (\begin{DoxyParamCaption}\item[{type(hor\+\_\+index\+\_\+type), intent(in)}]{HI,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structpseudo__salt__tracer_1_1pseudo__salt__tracer__cs}{pseudo\+\_\+salt\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{type(tracer\+\_\+registry\+\_\+type), pointer}]{tr\+\_\+\+Reg,  }\item[{type(mom\+\_\+restart\+\_\+cs), pointer}]{restart\+\_\+\+CS }\end{DoxyParamCaption})}



Register the pseudo-\/salt tracer with M\+O\+M6. 


\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 param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
 & {\em cs} & The control structure returned by a previous call to register\+\_\+pseudo\+\_\+salt\+\_\+tracer. \\
\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 61 of file pseudo\+\_\+salt\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{61   \textcolor{keywordtype}{type}(hor\_index\_type),       \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{   !< A horizontal index type structure}}
\DoxyCodeLine{62   \textcolor{keywordtype}{type}(verticalGrid\_type),    \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{63   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-\/time parameters}}
\DoxyCodeLine{64   \textcolor{keywordtype}{type}(pseudo\_salt\_tracer\_CS),  \textcolor{keywordtype}{pointer}  :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{65 \textcolor{comment}{                                               !! call to register\_pseudo\_salt\_tracer.}}
\DoxyCodeLine{66   \textcolor{keywordtype}{type}(tracer\_registry\_type), \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{ !< A pointer that is set to point to the control}}
\DoxyCodeLine{67 \textcolor{comment}{                                                  !! structure for the tracer advection and}}
\DoxyCodeLine{68 \textcolor{comment}{                                                  !! diffusion module}}
\DoxyCodeLine{69   \textcolor{keywordtype}{type}(MOM\_restart\_CS),       \textcolor{keywordtype}{pointer}    :: restart\_CS\textcolor{comment}{ !< A pointer to the restart control structure}}
\DoxyCodeLine{70 \textcolor{comment}{! This subroutine is used to register tracer fields and subroutines}}
\DoxyCodeLine{71 \textcolor{comment}{! to be used with MOM.}}
\DoxyCodeLine{72 }
\DoxyCodeLine{73   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{74   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"pseudo\_salt\_tracer"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{75   \textcolor{keywordtype}{character(len=200)} :: inputdir \textcolor{comment}{! The directory where the input files are.}}
\DoxyCodeLine{76   \textcolor{keywordtype}{character(len=48)}  :: var\_name \textcolor{comment}{! The variable's name.}}
\DoxyCodeLine{77   \textcolor{keywordtype}{character(len=3)}   :: name\_tag \textcolor{comment}{! String for creating identifying pseudo\_salt}}
\DoxyCodeLine{78 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{79 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{80 \textcolor{preprocessor}{}\textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: tr\_ptr(:,:,:) => null()}
\DoxyCodeLine{81   \textcolor{keywordtype}{logical} :: register\_pseudo\_salt\_tracer}
\DoxyCodeLine{82   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed, nz, i, j}
\DoxyCodeLine{83   isd = hi\%isd ; ied = hi\%ied ; jsd = hi\%jsd ; jed = hi\%jed ; nz = gv\%ke}
\DoxyCodeLine{84 }
\DoxyCodeLine{85   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{86     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"register\_pseudo\_salt\_tracer called with an "}// \&}
\DoxyCodeLine{87                              \textcolor{stringliteral}{"associated control structure."})}
\DoxyCodeLine{88     \textcolor{keywordflow}{return}}
\DoxyCodeLine{89 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{90   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{91 }
\DoxyCodeLine{92   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{93   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{94 }
\DoxyCodeLine{95   \textcolor{keyword}{allocate}(cs\%ps(isd:ied,jsd:jed,nz)) ; cs\%ps(:,:,:) = 0.0}
\DoxyCodeLine{96   \textcolor{keyword}{allocate}(cs\%diff(isd:ied,jsd:jed,nz)) ; cs\%diff(:,:,:) = 0.0}
\DoxyCodeLine{97 }
\DoxyCodeLine{98   cs\%tr\_desc = var\_desc(trim(\textcolor{stringliteral}{"pseudo\_salt"}), \textcolor{stringliteral}{"psu"}, \&}
\DoxyCodeLine{99                      \textcolor{stringliteral}{"Pseudo salt passive tracer"}, caller=mdl)}
\DoxyCodeLine{100 }
\DoxyCodeLine{101   tr\_ptr => cs\%ps(:,:,:)}
\DoxyCodeLine{102   \textcolor{keyword}{call }query\_vardesc(cs\%tr\_desc, name=var\_name, caller=\textcolor{stringliteral}{"register\_pseudo\_salt\_tracer"})}
\DoxyCodeLine{103   \textcolor{comment}{! Register the tracer for horizontal advection, diffusion, and restarts.}}
\DoxyCodeLine{104   \textcolor{keyword}{call }register\_tracer(tr\_ptr, tr\_reg, param\_file, hi, gv, name=\textcolor{stringliteral}{"pseudo\_salt"}, \&}
\DoxyCodeLine{105                        longname=\textcolor{stringliteral}{"Pseudo salt passive tracer"}, units=\textcolor{stringliteral}{"psu"}, \&}
\DoxyCodeLine{106                        registry\_diags=.true., restart\_cs=restart\_cs, \&}
\DoxyCodeLine{107                        mandatory=.not.cs\%pseudo\_salt\_may\_reinit)}
\DoxyCodeLine{108 }
\DoxyCodeLine{109   cs\%tr\_Reg => tr\_reg}
\DoxyCodeLine{110   cs\%restart\_CSp => restart\_cs}
\DoxyCodeLine{111   register\_pseudo\_salt\_tracer = .true.}
\DoxyCodeLine{112 }

\end{DoxyCode}
