\hypertarget{namespaceisomip__tracer}{}\doxysection{isomip\+\_\+tracer Module Reference}
\label{namespaceisomip__tracer}\index{isomip\_tracer@{isomip\_tracer}}


\doxysubsection{Detailed Description}
Routines used to set up and use a set of (one for now) dynamically passive tracers in the I\+S\+O\+M\+IP configuration. 

For now, just one passive tracer is injected in the sponge layer. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structisomip__tracer_1_1isomip__tracer__cs}{isomip\+\_\+tracer\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em I\+S\+O\+M\+IP tracer package control structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
logical function, public \mbox{\hyperlink{namespaceisomip__tracer_a7d66fe5ba12076654324a7e7d8ab2e4f}{register\+\_\+isomip\+\_\+tracer}} (HI, GV, param\+\_\+file, CS, tr\+\_\+\+Reg, restart\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em This subroutine is used to register tracer fields. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceisomip__tracer_aa268e488bb883f99ebc9cb321d442696}{initialize\+\_\+isomip\+\_\+tracer}} (restart, day, G, GV, h, diag, O\+BC, CS, A\+L\+E\+\_\+sponge\+\_\+\+C\+Sp)
\begin{DoxyCompactList}\small\item\em Initializes the N\+TR tracer fields in tr(\+:,\+:,\+:,\+:) \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceisomip__tracer_a7f06ffe89c033074c6b9bd7f375f6dd5}{isomip\+\_\+tracer\+\_\+column\+\_\+physics}} (h\+\_\+old, h\+\_\+new, ea, eb, fluxes, dt, G, GV, US, CS, evap\+\_\+\+C\+F\+L\+\_\+limit, minimum\+\_\+forcing\+\_\+depth)
\begin{DoxyCompactList}\small\item\em This subroutine applies diapycnal diffusion, including the surface boundary conditions and any other column tracer physics or chemistry to the tracers from this file. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceisomip__tracer_ac2571b7b6e4dce0d5936a483159ec379}{isomip\+\_\+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{namespaceisomip__tracer_a104a1c0d2098aa48a52684bd1509bbc4}{isomip\+\_\+tracer\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Deallocate any memory used by the I\+S\+O\+M\+IP tracer package. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespaceisomip__tracer_a45a3a4465d55afd6310d5a3412b2c9c5}\label{namespaceisomip__tracer_a45a3a4465d55afd6310d5a3412b2c9c5}} 
integer, parameter \mbox{\hyperlink{namespaceisomip__tracer_a45a3a4465d55afd6310d5a3412b2c9c5}{ntr}} = 1
\begin{DoxyCompactList}\small\item\em ntr is the number of tracers in this module. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespaceisomip__tracer_aa268e488bb883f99ebc9cb321d442696}\label{namespaceisomip__tracer_aa268e488bb883f99ebc9cb321d442696}} 
\index{isomip\_tracer@{isomip\_tracer}!initialize\_isomip\_tracer@{initialize\_isomip\_tracer}}
\index{initialize\_isomip\_tracer@{initialize\_isomip\_tracer}!isomip\_tracer@{isomip\_tracer}}
\doxysubsubsection{\texorpdfstring{initialize\_isomip\_tracer()}{initialize\_isomip\_tracer()}}
{\footnotesize\ttfamily subroutine, public isomip\+\_\+tracer\+::initialize\+\_\+isomip\+\_\+tracer (\begin{DoxyParamCaption}\item[{logical, intent(in)}]{restart,  }\item[{type(time\+\_\+type), intent(in), target}]{day,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{type(\mbox{\hyperlink{structmom__diag__mediator_1_1diag__ctrl}{diag\+\_\+ctrl}}), intent(in), target}]{diag,  }\item[{type(\mbox{\hyperlink{structmom__open__boundary_1_1ocean__obc__type}{ocean\+\_\+obc\+\_\+type}}), pointer}]{O\+BC,  }\item[{type(\mbox{\hyperlink{structisomip__tracer_1_1isomip__tracer__cs}{isomip\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{type(\mbox{\hyperlink{structmom__ale__sponge_1_1ale__sponge__cs}{ale\+\_\+sponge\+\_\+cs}}), pointer}]{A\+L\+E\+\_\+sponge\+\_\+\+C\+Sp }\end{DoxyParamCaption})}



Initializes the N\+TR tracer fields in tr(\+:,\+:,\+:,\+:) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\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 h} & Layer thickness \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. This is not being used for now. \\
\hline
 & {\em cs} & The control structure returned by a previous call to I\+S\+O\+M\+I\+P\+\_\+register\+\_\+tracer. \\
\hline
 & {\em ale\+\_\+sponge\+\_\+csp} & A pointer to the control structure for the sponges, if they are in use. Otherwise this may be unassociated. \\
\hline
\end{DoxyParams}


Definition at line 148 of file I\+S\+O\+M\+I\+P\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{150 }
\DoxyCodeLine{151   \textcolor{keywordtype}{type}(ocean\_grid\_type),                 \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{ !< Grid structure.}}
\DoxyCodeLine{152   \textcolor{keywordtype}{type}(verticalGrid\_type),               \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{ !< The ocean's vertical grid structure.}}
\DoxyCodeLine{153   \textcolor{keywordtype}{logical},                               \textcolor{keywordtype}{intent(in)} :: restart\textcolor{comment}{ !< .true. if the fields have already}}
\DoxyCodeLine{154 \textcolor{comment}{                                                       !! been read from a restart file.}}
\DoxyCodeLine{155   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target},               \textcolor{keywordtype}{intent(in)} :: day\textcolor{comment}{ !< Time of the start of the run.}}
\DoxyCodeLine{156 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{ !< Layer thickness [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{157   \textcolor{keywordtype}{type}(diag\_ctrl),               \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{ !< A structure that is used to regulate}}
\DoxyCodeLine{158 \textcolor{comment}{                                                       !! diagnostic output.}}
\DoxyCodeLine{159   \textcolor{keywordtype}{type}(ocean\_OBC\_type),                  \textcolor{keywordtype}{pointer}    :: OBC\textcolor{comment}{ !< This open boundary condition type specifies}}
\DoxyCodeLine{160 \textcolor{comment}{                                                       !! whether, where, and what open boundary conditions}}
\DoxyCodeLine{161 \textcolor{comment}{                                                       !! are used. This is not being used for now.}}
\DoxyCodeLine{162   \textcolor{keywordtype}{type}(ISOMIP\_tracer\_CS),                \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !< The control structure returned by a previous call}}
\DoxyCodeLine{163 \textcolor{comment}{                                                       !! to ISOMIP\_register\_tracer.}}
\DoxyCodeLine{164   \textcolor{keywordtype}{type}(ALE\_sponge\_CS),                   \textcolor{keywordtype}{pointer}    :: ALE\_sponge\_CSp\textcolor{comment}{ !< A pointer to the control structure for}}
\DoxyCodeLine{165 \textcolor{comment}{                                                       !! the sponges, if they are in use.  Otherwise this}}
\DoxyCodeLine{166 \textcolor{comment}{                                                       !! may be unassociated.}}
\DoxyCodeLine{167 }
\DoxyCodeLine{168 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable} :: temp(:,:,:)}
\DoxyCodeLine{169 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer}, \textcolor{keywordtype}{dimension(:,:,:)} :: \&}
\DoxyCodeLine{170     OBC\_tr1\_u => null(), \& \textcolor{comment}{! These arrays should be allocated and set to}}
\DoxyCodeLine{171     obc\_tr1\_v => null()    \textcolor{comment}{! specify the values of tracer 1 that should come}}
\DoxyCodeLine{172                            \textcolor{comment}{! in through u-\/ and v-\/ points through the open}}
\DoxyCodeLine{173                            \textcolor{comment}{! boundary conditions, in the same units as tr.}}
\DoxyCodeLine{174   \textcolor{keywordtype}{character(len=16)} :: name     \textcolor{comment}{! A variable's name in a NetCDF file.}}
\DoxyCodeLine{175   \textcolor{keywordtype}{character(len=72)} :: longname \textcolor{comment}{! The long name of that variable.}}
\DoxyCodeLine{176   \textcolor{keywordtype}{character(len=48)} :: units    \textcolor{comment}{! The dimensions of the variable.}}
\DoxyCodeLine{177   \textcolor{keywordtype}{character(len=48)} :: flux\_units \textcolor{comment}{! The units for tracer fluxes, usually}}
\DoxyCodeLine{178                             \textcolor{comment}{! kg(tracer) kg(water)-\/1 m3 s-\/1 or kg(tracer) s-\/1.}}
\DoxyCodeLine{179 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: tr\_ptr(:,:,:) => null()}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real} :: h\_neglect         \textcolor{comment}{! A thickness that is so small it is usually lost}}
\DoxyCodeLine{181                             \textcolor{comment}{! in roundoff and can be neglected [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{182 \textcolor{keywordtype}{  real} :: e(SZK\_(G)+1), e\_top, e\_bot, d\_tr}
\DoxyCodeLine{183   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz, m}
\DoxyCodeLine{184   \textcolor{keywordtype}{integer} :: IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{185 }
\DoxyCodeLine{186   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{187   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{188   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{189   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{190   h\_neglect = gv\%H\_subroundoff}
\DoxyCodeLine{191 }
\DoxyCodeLine{192   cs\%Time => day}
\DoxyCodeLine{193   cs\%diag => diag}
\DoxyCodeLine{194 }
\DoxyCodeLine{195   \textcolor{keywordflow}{if} (.not.restart) \textcolor{keywordflow}{then}}
\DoxyCodeLine{196     \textcolor{keywordflow}{if} (len\_trim(cs\%tracer\_IC\_file) >= 1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{197       \textcolor{comment}{!  Read the tracer concentrations from a netcdf file.}}
\DoxyCodeLine{198       \textcolor{keywordflow}{if} (.not.file\_exists(cs\%tracer\_IC\_file, g\%Domain)) \&}
\DoxyCodeLine{199         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"{}ISOMIP\_initialize\_tracer: Unable to open "{}}// \&}
\DoxyCodeLine{200                         cs\%tracer\_IC\_file)}
\DoxyCodeLine{201       \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{202         \textcolor{keyword}{call }query\_vardesc(cs\%tr\_desc(m), name, caller=\textcolor{stringliteral}{"{}initialize\_ISOMIP\_tracer"{}})}
\DoxyCodeLine{203         \textcolor{keyword}{call }mom\_read\_data(cs\%tracer\_IC\_file, trim(name), cs\%tr(:,:,:,m), g\%Domain)}
\DoxyCodeLine{204 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{205     \textcolor{keywordflow}{else}}
\DoxyCodeLine{206       \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{207         \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{208           cs\%tr(i,j,k,m) = 0.0}
\DoxyCodeLine{209 \textcolor{keywordflow}{        enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{210 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{211 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{212 \textcolor{keywordflow}{  endif} \textcolor{comment}{! restart}}
\DoxyCodeLine{213 }
\DoxyCodeLine{214 \textcolor{comment}{! the following does not work in layer mode yet}}
\DoxyCodeLine{215 \textcolor{comment}{!!  if ( CS\%use\_sponge ) then}}
\DoxyCodeLine{216   \textcolor{comment}{!   If sponges are used, this example damps tracers in sponges in the}}
\DoxyCodeLine{217   \textcolor{comment}{! northern half of the domain to 1 and tracers in the southern half}}
\DoxyCodeLine{218   \textcolor{comment}{! to 0.  For any tracers that are not damped in the sponge, the call}}
\DoxyCodeLine{219   \textcolor{comment}{! to set\_up\_sponge\_field can simply be omitted.}}
\DoxyCodeLine{220 \textcolor{comment}{!    if (.not.associated(ALE\_sponge\_CSp)) \&}}
\DoxyCodeLine{221 \textcolor{comment}{!      call MOM\_error(FATAL, "{}ISOMIP\_initialize\_tracer: "{}// \&}}
\DoxyCodeLine{222 \textcolor{comment}{!        "{}The pointer to ALEsponge\_CSp must be associated if SPONGE is defined."{})}}
\DoxyCodeLine{223 }
\DoxyCodeLine{224 \textcolor{comment}{!    allocate(temp(G\%isd:G\%ied,G\%jsd:G\%jed,nz))}}
\DoxyCodeLine{225 }
\DoxyCodeLine{226 \textcolor{comment}{!    do j=js,je ; do i=is,ie}}
\DoxyCodeLine{227 \textcolor{comment}{!      if (G\%geoLonT(i,j) >= 790.0 .AND. G\%geoLonT(i,j) <= 800.0) then}}
\DoxyCodeLine{228 \textcolor{comment}{!        temp(i,j,:) = 1.0}}
\DoxyCodeLine{229 \textcolor{comment}{!      else}}
\DoxyCodeLine{230 \textcolor{comment}{!        temp(i,j,:) = 0.0}}
\DoxyCodeLine{231 \textcolor{comment}{!      endif}}
\DoxyCodeLine{232 \textcolor{comment}{!    enddo ; enddo}}
\DoxyCodeLine{233 }
\DoxyCodeLine{234       \textcolor{comment}{!   do m=1,NTR}}
\DoxyCodeLine{235 \textcolor{comment}{!    do m=1,1}}
\DoxyCodeLine{236       \textcolor{comment}{! This is needed to force the compiler not to do a copy in the sponge}}
\DoxyCodeLine{237       \textcolor{comment}{! calls.  Curses on the designers and implementers of Fortran90.}}
\DoxyCodeLine{238 \textcolor{comment}{!      tr\_ptr => CS\%tr(:,:,:,m)}}
\DoxyCodeLine{239 \textcolor{comment}{!      call set\_up\_ALE\_sponge\_field(temp, G, tr\_ptr, ALE\_sponge\_CSp)}}
\DoxyCodeLine{240 \textcolor{comment}{!    enddo}}
\DoxyCodeLine{241 \textcolor{comment}{!    deallocate(temp)}}
\DoxyCodeLine{242 \textcolor{comment}{!  endif}}
\DoxyCodeLine{243 }

\end{DoxyCode}
\mbox{\Hypertarget{namespaceisomip__tracer_a7f06ffe89c033074c6b9bd7f375f6dd5}\label{namespaceisomip__tracer_a7f06ffe89c033074c6b9bd7f375f6dd5}} 
\index{isomip\_tracer@{isomip\_tracer}!isomip\_tracer\_column\_physics@{isomip\_tracer\_column\_physics}}
\index{isomip\_tracer\_column\_physics@{isomip\_tracer\_column\_physics}!isomip\_tracer@{isomip\_tracer}}
\doxysubsubsection{\texorpdfstring{isomip\_tracer\_column\_physics()}{isomip\_tracer\_column\_physics()}}
{\footnotesize\ttfamily subroutine, public isomip\+\_\+tracer\+::isomip\+\_\+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(\mbox{\hyperlink{structmom__forcing__type_1_1forcing}{forcing}}), intent(in)}]{fluxes,  }\item[{real, intent(in)}]{dt,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structmom__unit__scaling_1_1unit__scale__type}{unit\+\_\+scale\+\_\+type}}), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structisomip__tracer_1_1isomip__tracer__cs}{isomip\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{real, intent(in), optional}]{evap\+\_\+\+C\+F\+L\+\_\+limit,  }\item[{real, intent(in), optional}]{minimum\+\_\+forcing\+\_\+depth }\end{DoxyParamCaption})}



This subroutine applies diapycnal diffusion, including the surface boundary conditions and any other column tracer physics or chemistry to the tracers from this file. 


\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 I\+S\+O\+M\+I\+P\+\_\+register\+\_\+tracer. \\
\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 248 of file I\+S\+O\+M\+I\+P\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{250   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{251   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}}
\DoxyCodeLine{252 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{253                            \textcolor{keywordtype}{intent(in)} :: h\_old\textcolor{comment}{ !< Layer thickness before entrainment [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{254 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{255                            \textcolor{keywordtype}{intent(in)} :: h\_new\textcolor{comment}{ !< Layer thickness after entrainment [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{256 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{257                            \textcolor{keywordtype}{intent(in)} :: ea\textcolor{comment}{   !< an array to which the amount of fluid entrained}}
\DoxyCodeLine{258 \textcolor{comment}{                                              !! from the layer above during this call will be}}
\DoxyCodeLine{259 \textcolor{comment}{                                              !! added [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{260 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{261                            \textcolor{keywordtype}{intent(in)} :: eb\textcolor{comment}{   !< an array to which the amount of fluid entrained}}
\DoxyCodeLine{262 \textcolor{comment}{                                              !! from the layer below during this call will be}}
\DoxyCodeLine{263 \textcolor{comment}{                                              !! added [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{264   \textcolor{keywordtype}{type}(forcing),           \textcolor{keywordtype}{intent(in)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to thermodynamic}}
\DoxyCodeLine{265 \textcolor{comment}{                                              !! and tracer forcing fields.  Unused fields have NULL ptrs.}}
\DoxyCodeLine{266 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)} :: dt\textcolor{comment}{   !< The amount of time covered by this call [T \string~> s]}}
\DoxyCodeLine{267   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{   !< A dimensional unit scaling type}}
\DoxyCodeLine{268   \textcolor{keywordtype}{type}(ISOMIP\_tracer\_CS),  \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{269 \textcolor{comment}{                                              !! call to ISOMIP\_register\_tracer.}}
\DoxyCodeLine{270 \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{271 \textcolor{comment}{                                              !! be fluxed out of the top layer in a timestep [nondim]}}
\DoxyCodeLine{272 \textcolor{keywordtype}{  real},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: minimum\_forcing\_depth\textcolor{comment}{ !< The smallest depth over which}}
\DoxyCodeLine{273 \textcolor{comment}{                                              !! fluxes can be applied [H \string~> m or kg m-\/2]}}
\DoxyCodeLine{274 }
\DoxyCodeLine{275 \textcolor{comment}{! The arguments to this subroutine are redundant in that}}
\DoxyCodeLine{276 \textcolor{comment}{!     h\_new(k) = h\_old(k) + ea(k) -\/ eb(k-\/1) + eb(k) -\/ ea(k+1)}}
\DoxyCodeLine{277 }
\DoxyCodeLine{278   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{279 \textcolor{keywordtype}{  real} :: b1(SZI\_(G))          \textcolor{comment}{! b1 and c1 are variables used by the}}
\DoxyCodeLine{280 \textcolor{keywordtype}{  real} :: c1(SZI\_(G),SZK\_(G))  \textcolor{comment}{! tridiagonal solver.}}
\DoxyCodeLine{281 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))} :: h\_work \textcolor{comment}{! Used so that h can be modified}}
\DoxyCodeLine{282 \textcolor{keywordtype}{  real} :: melt(SZI\_(G),SZJ\_(G)) \textcolor{comment}{! melt water (positive for melting, negative for freezing) [R Z T-\/1 \string~> kg m-\/2 s-\/1]}}
\DoxyCodeLine{283 \textcolor{keywordtype}{  real} :: mmax                \textcolor{comment}{! The global maximum melting rate [R Z T-\/1 \string~> kg m-\/2 s-\/1]}}
\DoxyCodeLine{284   \textcolor{keywordtype}{character(len=256)} :: mesg  \textcolor{comment}{! The text of an error message}}
\DoxyCodeLine{285   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz, m}
\DoxyCodeLine{286   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{287 }
\DoxyCodeLine{288   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{289 }
\DoxyCodeLine{290   melt(:,:) = fluxes\%iceshelf\_melt(:,:)}
\DoxyCodeLine{291 }
\DoxyCodeLine{292   \textcolor{comment}{! max. melt}}
\DoxyCodeLine{293   mmax = maxval(melt(is:ie,js:je))}
\DoxyCodeLine{294   \textcolor{keyword}{call }max\_across\_pes(mmax)}
\DoxyCodeLine{295   \textcolor{comment}{! write(mesg,*) 'max melt = ', mmax}}
\DoxyCodeLine{296   \textcolor{comment}{! call MOM\_mesg(mesg, 5)}}
\DoxyCodeLine{297   \textcolor{comment}{! dye melt water (m=1), dye = 1 if melt=max(melt)}}
\DoxyCodeLine{298   \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{299     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{300       \textcolor{keywordflow}{if} (melt(i,j) > 0.0) \textcolor{keywordflow}{then} \textcolor{comment}{! melting}}
\DoxyCodeLine{301         cs\%tr(i,j,1:2,m) = melt(i,j)/mmax \textcolor{comment}{! inject dye in the ML}}
\DoxyCodeLine{302       \textcolor{keywordflow}{else} \textcolor{comment}{! freezing}}
\DoxyCodeLine{303         cs\%tr(i,j,1:2,m) = 0.0}
\DoxyCodeLine{304 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{305 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{306 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{307 }
\DoxyCodeLine{308   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(evap\_cfl\_limit) .and. \textcolor{keyword}{present}(minimum\_forcing\_depth)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{309     \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{310       \textcolor{keywordflow}{do} k=1,nz ;\textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{311         h\_work(i,j,k) = h\_old(i,j,k)}
\DoxyCodeLine{312 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{313       \textcolor{keyword}{call }applytracerboundaryfluxesinout(g, gv, cs\%tr(:,:,:,m), dt, fluxes, h\_work, \&}
\DoxyCodeLine{314                                           evap\_cfl\_limit, minimum\_forcing\_depth)}
\DoxyCodeLine{315       \textcolor{keyword}{call }tracer\_vertdiff(h\_work, ea, eb, dt, cs\%tr(:,:,:,m), g, gv)}
\DoxyCodeLine{316 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{317   \textcolor{keywordflow}{else}}
\DoxyCodeLine{318     \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{319       \textcolor{keyword}{call }tracer\_vertdiff(h\_old, ea, eb, dt, cs\%tr(:,:,:,m), g, gv)}
\DoxyCodeLine{320 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{321 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{322 }

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



Deallocate any memory used by the I\+S\+O\+M\+IP tracer package. 


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


Definition at line 359 of file I\+S\+O\+M\+I\+P\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{360   \textcolor{keywordtype}{type}(ISOMIP\_tracer\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{361 \textcolor{comment}{                                        !! call to ISOMIP\_register\_tracer.}}
\DoxyCodeLine{362   \textcolor{keywordtype}{integer} :: m}
\DoxyCodeLine{363 }
\DoxyCodeLine{364   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{365     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%tr)) \textcolor{keyword}{deallocate}(cs\%tr)}
\DoxyCodeLine{366     \textcolor{keyword}{deallocate}(cs)}
\DoxyCodeLine{367 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespaceisomip__tracer_ac2571b7b6e4dce0d5936a483159ec379}\label{namespaceisomip__tracer_ac2571b7b6e4dce0d5936a483159ec379}} 
\index{isomip\_tracer@{isomip\_tracer}!isomip\_tracer\_surface\_state@{isomip\_tracer\_surface\_state}}
\index{isomip\_tracer\_surface\_state@{isomip\_tracer\_surface\_state}!isomip\_tracer@{isomip\_tracer}}
\doxysubsubsection{\texorpdfstring{isomip\_tracer\_surface\_state()}{isomip\_tracer\_surface\_state()}}
{\footnotesize\ttfamily subroutine, public isomip\+\_\+tracer\+::isomip\+\_\+tracer\+\_\+surface\+\_\+state (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__variables_1_1surface}{surface}}), intent(inout)}]{sfc\+\_\+state,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{type(\mbox{\hyperlink{structmom__grid_1_1ocean__grid__type}{ocean\+\_\+grid\+\_\+type}}), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structisomip__tracer_1_1isomip__tracer__cs}{isomip\+\_\+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 I\+S\+O\+M\+I\+P\+\_\+register\+\_\+tracer. \\
\hline
\end{DoxyParams}


Definition at line 328 of file I\+S\+O\+M\+I\+P\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{329   \textcolor{keywordtype}{type}(ocean\_grid\_type),  \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{  !< The ocean's grid structure.}}
\DoxyCodeLine{330   \textcolor{keywordtype}{type}(surface),          \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}}
\DoxyCodeLine{331 \textcolor{comment}{                                              !! describe the surface state of the ocean.}}
\DoxyCodeLine{332 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{333                           \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{  !< Layer thickness [H \string~> m or kg m-\/2].}}
\DoxyCodeLine{334   \textcolor{keywordtype}{type}(ISOMIP\_tracer\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{ !< The control structure returned by a previous}}
\DoxyCodeLine{335 \textcolor{comment}{                                              !! call to ISOMIP\_register\_tracer.}}
\DoxyCodeLine{336 }
\DoxyCodeLine{337   \textcolor{comment}{! This particular tracer package does not report anything back to the coupler.}}
\DoxyCodeLine{338   \textcolor{comment}{! The code that is here is just a rough guide for packages that would.}}
\DoxyCodeLine{339 }
\DoxyCodeLine{340   \textcolor{keywordtype}{integer} :: m, is, ie, js, je, isd, ied, jsd, jed}
\DoxyCodeLine{341   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec}
\DoxyCodeLine{342   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{343 }
\DoxyCodeLine{344   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{345 }
\DoxyCodeLine{346   \textcolor{keywordflow}{if} (cs\%coupled\_tracers) \textcolor{keywordflow}{then}}
\DoxyCodeLine{347     \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{348       \textcolor{comment}{!   This call loads the surface values into the appropriate array in the}}
\DoxyCodeLine{349       \textcolor{comment}{! coupler-\/type structure.}}
\DoxyCodeLine{350       \textcolor{keyword}{call }coupler\_type\_set\_data(cs\%tr(:,:,1,m), cs\%ind\_tr(m), ind\_csurf, \&}
\DoxyCodeLine{351                    sfc\_state\%tr\_fields, idim=(/isd, is, ie, ied/), \&}
\DoxyCodeLine{352                    jdim=(/jsd, js, je, jed/) )}
\DoxyCodeLine{353 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{354 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{355 }

\end{DoxyCode}
\mbox{\Hypertarget{namespaceisomip__tracer_a7d66fe5ba12076654324a7e7d8ab2e4f}\label{namespaceisomip__tracer_a7d66fe5ba12076654324a7e7d8ab2e4f}} 
\index{isomip\_tracer@{isomip\_tracer}!register\_isomip\_tracer@{register\_isomip\_tracer}}
\index{register\_isomip\_tracer@{register\_isomip\_tracer}!isomip\_tracer@{isomip\_tracer}}
\doxysubsubsection{\texorpdfstring{register\_isomip\_tracer()}{register\_isomip\_tracer()}}
{\footnotesize\ttfamily logical function, public isomip\+\_\+tracer\+::register\+\_\+isomip\+\_\+tracer (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__hor__index_1_1hor__index__type}{hor\+\_\+index\+\_\+type}}), intent(in)}]{HI,  }\item[{type(\mbox{\hyperlink{structmom__verticalgrid_1_1verticalgrid__type}{verticalgrid\+\_\+type}}), intent(in)}]{GV,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{param\+\_\+file,  }\item[{type(\mbox{\hyperlink{structisomip__tracer_1_1isomip__tracer__cs}{isomip\+\_\+tracer\+\_\+cs}}), pointer}]{CS,  }\item[{type(\mbox{\hyperlink{structmom__tracer__registry_1_1tracer__registry__type}{tracer\+\_\+registry\+\_\+type}}), pointer}]{tr\+\_\+\+Reg,  }\item[{type(\mbox{\hyperlink{structmom__restart_1_1mom__restart__cs}{mom\+\_\+restart\+\_\+cs}}), pointer}]{restart\+\_\+\+CS }\end{DoxyParamCaption})}



This subroutine is used to register tracer fields. 


\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 indicating the open file to parse for model parameter values. \\
\hline
 & {\em cs} & A pointer that is set to point to the control structure for this module (in/out). \\
\hline
 & {\em tr\+\_\+reg} & A pointer to the tracer registry. \\
\hline
 & {\em restart\+\_\+cs} & A pointer to the restart control structure. \\
\hline
\end{DoxyParams}


Definition at line 68 of file I\+S\+O\+M\+I\+P\+\_\+tracer.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{69   \textcolor{keywordtype}{type}(hor\_index\_type),      \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{    !<A horizontal index type structure.}}
\DoxyCodeLine{70   \textcolor{keywordtype}{type}(verticalGrid\_type),    \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure.}}
\DoxyCodeLine{71   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the open file}}
\DoxyCodeLine{72 \textcolor{comment}{                                                       !! to parse for model parameter values.}}
\DoxyCodeLine{73   \textcolor{keywordtype}{type}(ISOMIP\_tracer\_CS),     \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{ !<A pointer that is set to point to the control}}
\DoxyCodeLine{74 \textcolor{comment}{                                                       !! structure for this module (in/out).}}
\DoxyCodeLine{75   \textcolor{keywordtype}{type}(tracer\_registry\_type), \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{ !<A pointer to the tracer registry.}}
\DoxyCodeLine{76   \textcolor{keywordtype}{type}(MOM\_restart\_CS),       \textcolor{keywordtype}{pointer}    :: restart\_CS\textcolor{comment}{ !<A pointer to the restart control structure.}}
\DoxyCodeLine{77 }
\DoxyCodeLine{78   \textcolor{keywordtype}{character(len=80)}  :: name, longname}
\DoxyCodeLine{79 \textcolor{comment}{! This include declares and sets the variable "{}version"{}.}}
\DoxyCodeLine{80 \textcolor{preprocessor}{\#include "{}version\_variable.h"{}}}
\DoxyCodeLine{81 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"{}ISOMIP\_tracer"{}} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{82   \textcolor{keywordtype}{character(len=200)} :: inputdir}
\DoxyCodeLine{83   \textcolor{keywordtype}{character(len=48)}  :: flux\_units \textcolor{comment}{! The units for tracer fluxes, usually}}
\DoxyCodeLine{84                             \textcolor{comment}{! kg(tracer) kg(water)-\/1 m3 s-\/1 or kg(tracer) s-\/1.}}
\DoxyCodeLine{85 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: tr\_ptr(:,:,:) => null()}
\DoxyCodeLine{86   \textcolor{keywordtype}{logical} :: register\_ISOMIP\_tracer}
\DoxyCodeLine{87   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed, nz, m}
\DoxyCodeLine{88   isd = hi\%isd ; ied = hi\%ied ; jsd = hi\%jsd ; jed = hi\%jed ; nz = gv\%ke}
\DoxyCodeLine{89 }
\DoxyCodeLine{90   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{91     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"{}ISOMIP\_register\_tracer called with an "{}}// \&}
\DoxyCodeLine{92                             \textcolor{stringliteral}{"{}associated control structure."{}})}
\DoxyCodeLine{93     \textcolor{keywordflow}{return}}
\DoxyCodeLine{94 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{95   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{96 }
\DoxyCodeLine{97   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{98   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{"{}"{}})}
\DoxyCodeLine{99   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}ISOMIP\_TRACER\_IC\_FILE"{}}, cs\%tracer\_IC\_file, \&}
\DoxyCodeLine{100                  \textcolor{stringliteral}{"{}The name of a file from which to read the initial "{}}//\&}
\DoxyCodeLine{101                  \textcolor{stringliteral}{"{}conditions for the ISOMIP tracers, or blank to initialize "{}}//\&}
\DoxyCodeLine{102                  \textcolor{stringliteral}{"{}them internally."{}}, default=\textcolor{stringliteral}{"{} "{}})}
\DoxyCodeLine{103   \textcolor{keywordflow}{if} (len\_trim(cs\%tracer\_IC\_file) >= 1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{104     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}INPUTDIR"{}}, inputdir, default=\textcolor{stringliteral}{"{}."{}})}
\DoxyCodeLine{105     inputdir = slasher(inputdir)}
\DoxyCodeLine{106     cs\%tracer\_IC\_file = trim(inputdir)//trim(cs\%tracer\_IC\_file)}
\DoxyCodeLine{107     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"{}INPUTDIR/ISOMIP\_TRACER\_IC\_FILE"{}}, \&}
\DoxyCodeLine{108                    cs\%tracer\_IC\_file)}
\DoxyCodeLine{109 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{110   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"{}SPONGE"{}}, cs\%use\_sponge, \&}
\DoxyCodeLine{111                  \textcolor{stringliteral}{"{}If true, sponges may be applied anywhere in the domain. "{}}//\&}
\DoxyCodeLine{112                  \textcolor{stringliteral}{"{}The exact location and properties of those sponges are "{}}//\&}
\DoxyCodeLine{113                  \textcolor{stringliteral}{"{}specified from MOM\_initialization.F90."{}}, default=.false.)}
\DoxyCodeLine{114 }
\DoxyCodeLine{115   \textcolor{keyword}{allocate}(cs\%tr(isd:ied,jsd:jed,nz,ntr)) ; cs\%tr(:,:,:,:) = 0.0}
\DoxyCodeLine{116 }
\DoxyCodeLine{117   \textcolor{keywordflow}{do} m=1,ntr}
\DoxyCodeLine{118     \textcolor{keywordflow}{if} (m < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(name,\textcolor{stringliteral}{'("{}tr\_D"{},I1.1)'}) m}
\DoxyCodeLine{119     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(name,\textcolor{stringliteral}{'("{}tr\_D"{},I2.2)'}) m ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{120     \textcolor{keyword}{write}(longname,\textcolor{stringliteral}{'("{}Concentration of ISOMIP Tracer "{},I2.2)'}) m}
\DoxyCodeLine{121     cs\%tr\_desc(m) = var\_desc(name, units=\textcolor{stringliteral}{"{}kg kg-\/1"{}}, longname=longname, caller=mdl)}
\DoxyCodeLine{122     \textcolor{keywordflow}{if} (gv\%Boussinesq) \textcolor{keywordflow}{then} ; flux\_units = \textcolor{stringliteral}{"{}kg kg-\/1 m3 s-\/1"{}}}
\DoxyCodeLine{123     \textcolor{keywordflow}{else} ; flux\_units = \textcolor{stringliteral}{"{}kg s-\/1"{}} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{124 }
\DoxyCodeLine{125     \textcolor{comment}{! This is needed to force the compiler not to do a copy in the registration}}
\DoxyCodeLine{126     \textcolor{comment}{! calls.  Curses on the designers and implementers of Fortran90.}}
\DoxyCodeLine{127     tr\_ptr => cs\%tr(:,:,:,m)}
\DoxyCodeLine{128     \textcolor{comment}{! Register the tracer for horizontal advection, diffusion, and restarts.}}
\DoxyCodeLine{129     \textcolor{keyword}{call }register\_tracer(tr\_ptr, tr\_reg, param\_file, hi, gv, \&}
\DoxyCodeLine{130                          name=name, longname=longname, units=\textcolor{stringliteral}{"{}kg kg-\/1"{}}, \&}
\DoxyCodeLine{131                          registry\_diags=.true., flux\_units=flux\_units, \&}
\DoxyCodeLine{132                          restart\_cs=restart\_cs)}
\DoxyCodeLine{133 }
\DoxyCodeLine{134     \textcolor{comment}{!   Set coupled\_tracers to be true (hard-\/coded above) to provide the surface}}
\DoxyCodeLine{135     \textcolor{comment}{! values to the coupler (if any).  This is meta-\/code and its arguments will}}
\DoxyCodeLine{136     \textcolor{comment}{! currently (deliberately) give fatal errors if it is used.}}
\DoxyCodeLine{137     \textcolor{keywordflow}{if} (cs\%coupled\_tracers) \&}
\DoxyCodeLine{138       cs\%ind\_tr(m) = aof\_set\_coupler\_flux(trim(name)//\textcolor{stringliteral}{'\_flux'}, \&}
\DoxyCodeLine{139           flux\_type=\textcolor{stringliteral}{' '}, implementation=\textcolor{stringliteral}{' '}, caller=\textcolor{stringliteral}{"{}register\_ISOMIP\_tracer"{}})}
\DoxyCodeLine{140 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{141 }
\DoxyCodeLine{142   cs\%tr\_Reg => tr\_reg}
\DoxyCodeLine{143   register\_isomip\_tracer = .true.}

\end{DoxyCode}
