\hypertarget{namespacemom__ocmip2__cfc}{}\section{mom\+\_\+ocmip2\+\_\+cfc Module Reference}
\label{namespacemom__ocmip2__cfc}\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}


\subsection{Detailed Description}
Simulates C\+F\+Cs using the O\+C\+M\+I\+P2 protocols. 

By Robert Hallberg, 2007.

This module contains the code that is needed to set up and use C\+F\+C-\/11 and C\+F\+C-\/12 in a fully coupled or ice-\/ocean model context using the O\+C\+M\+I\+P2 protocols \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em The control structure for the O\+C\+M\+P\+I2\+\_\+\+C\+FC tracer package. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
logical function, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_ac04494ce35222c8583a7ee7589e1cf13}{register\+\_\+ocmip2\+\_\+cfc}} (HI, GV, param\+\_\+file, CS, tr\+\_\+\+Reg, restart\+\_\+\+CS)
\begin{DoxyCompactList}\small\item\em Register the O\+C\+M\+I\+P2 C\+FC tracers to be used with M\+OM and read the parameters that are used with this tracer package. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_aae389be73425290cf49ab861aadff91d}{flux\+\_\+init\+\_\+ocmip2\+\_\+cfc}} (CS, verbosity)
\begin{DoxyCompactList}\small\item\em This subroutine initializes the air-\/sea C\+FC fluxes, and optionally returns the indicies of these fluxes. It can safely be called multiple times. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_aaaa0b7695728d3761d5f25688838f5fc}{initialize\+\_\+ocmip2\+\_\+cfc}} (restart, day, G, GV, US, h, diag, O\+BC, CS, sponge\+\_\+\+C\+Sp)
\begin{DoxyCompactList}\small\item\em Initialize the O\+C\+M\+P2 C\+FC tracer fields and set up the tracer output. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__ocmip2__cfc_a293cd355bf164bfd6bbe2cda4b00ad12}{init\+\_\+tracer\+\_\+cfc}} (h, tr, name, land\+\_\+val, I\+C\+\_\+val, G, US, CS)
\begin{DoxyCompactList}\small\item\em This subroutine initializes a tracer array. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_aebc84df12994a1f74d181ab54e380878}{ocmip2\+\_\+cfc\+\_\+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, souces and sinks and any other column tracer physics or chemistry to the O\+C\+M\+I\+P2 C\+FC tracers. C\+F\+Cs are relatively simple, as they are passive tracers with only a surface flux as a source. \end{DoxyCompactList}\item 
integer function, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_ac3c9967ff09b37934eb5ef51535e7ee3}{ocmip2\+\_\+cfc\+\_\+stock}} (h, stocks, G, GV, CS, names, units, stock\+\_\+index)
\begin{DoxyCompactList}\small\item\em This function 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{namespacemom__ocmip2__cfc_a304869c78d725f37ed99d0b8069e4858}{ocmip2\+\_\+cfc\+\_\+surface\+\_\+state}} (sfc\+\_\+state, h, G, CS)
\begin{DoxyCompactList}\small\item\em This subroutine extracts the surface C\+FC concentrations and other fields that are shared with the atmosphere to calculate C\+FC fluxes. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__ocmip2__cfc_a225d2a7eacb485040fcac7f9b6766ee1}{ocmip2\+\_\+cfc\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Deallocate any memory associated with the O\+C\+M\+I\+P2 C\+FC tracer package. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_acfeb2ddc32eb2ea2b41a80226d729a88}\label{namespacemom__ocmip2__cfc_acfeb2ddc32eb2ea2b41a80226d729a88}} 
integer, parameter \mbox{\hyperlink{namespacemom__ocmip2__cfc_acfeb2ddc32eb2ea2b41a80226d729a88}{ntr}} = 2
\begin{DoxyCompactList}\small\item\em the number of tracers in this module. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_aae389be73425290cf49ab861aadff91d}\label{namespacemom__ocmip2__cfc_aae389be73425290cf49ab861aadff91d}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!flux\+\_\+init\+\_\+ocmip2\+\_\+cfc@{flux\+\_\+init\+\_\+ocmip2\+\_\+cfc}}
\index{flux\+\_\+init\+\_\+ocmip2\+\_\+cfc@{flux\+\_\+init\+\_\+ocmip2\+\_\+cfc}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{flux\+\_\+init\+\_\+ocmip2\+\_\+cfc()}{flux\_init\_ocmip2\_cfc()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ocmip2\+\_\+cfc\+::flux\+\_\+init\+\_\+ocmip2\+\_\+cfc (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), optional, pointer}]{CS,  }\item[{integer, intent(in), optional}]{verbosity }\end{DoxyParamCaption})}



This subroutine initializes the air-\/sea C\+FC fluxes, and optionally returns the indicies of these fluxes. It can safely be called multiple times. 


\begin{DoxyParams}[1]{Parameters}
 & {\em cs} & An optional pointer to the control structure for this module; if not present, the flux indicies are not stored.\\
\hline
\mbox{\tt in}  & {\em verbosity} & A 0-\/9 integer indicating a level of verbosity. \\
\hline
\end{DoxyParams}


Definition at line 282 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
282   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< An optional pointer to the control structure}
283 \textcolor{comment}{                                               !! for this module; if not present, the flux indicies}
284 \textcolor{comment}{                                               !! are not stored.}
285   \textcolor{keywordtype}{integer},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: verbosity\textcolor{comment}{ !< A 0-9 integer indicating a level of verbosity.}
286 
287   \textcolor{comment}{! These can be overridden later in via the field manager?}
288   \textcolor{keywordtype}{character(len=128)} :: default\_ice\_restart\_file = \textcolor{stringliteral}{'ice\_ocmip2\_cfc.res.nc'}
289   \textcolor{keywordtype}{character(len=128)} :: default\_ocean\_restart\_file = \textcolor{stringliteral}{'ocmip2\_cfc.res.nc'}
290   \textcolor{keywordtype}{integer} :: ind\_flux(2) \textcolor{comment}{! Integer indices of the fluxes}
291 
292   \textcolor{comment}{! These calls obtain the indices for the CFC11 and CFC12 flux coupling.  They}
293   \textcolor{comment}{! can safely be called multiple times.}
294   ind\_flux(1) = aof\_set\_coupler\_flux(\textcolor{stringliteral}{'cfc\_11\_flux'}, &
295        flux\_type = \textcolor{stringliteral}{'air\_sea\_gas\_flux'}, implementation = \textcolor{stringliteral}{'ocmip2'}, &
296        param = (/ 9.36e-07, 9.7561e-06 /), &
297        ice\_restart\_file = default\_ice\_restart\_file, &
298        ocean\_restart\_file = default\_ocean\_restart\_file, &
299        caller = \textcolor{stringliteral}{"register\_OCMIP2\_CFC"}, verbosity=verbosity)
300   ind\_flux(2) = aof\_set\_coupler\_flux(\textcolor{stringliteral}{'cfc\_12\_flux'}, &
301        flux\_type = \textcolor{stringliteral}{'air\_sea\_gas\_flux'}, implementation = \textcolor{stringliteral}{'ocmip2'}, &
302        param = (/ 9.36e-07, 9.7561e-06 /), &
303        ice\_restart\_file = default\_ice\_restart\_file, &
304        ocean\_restart\_file = default\_ocean\_restart\_file, &
305        caller = \textcolor{stringliteral}{"register\_OCMIP2\_CFC"}, verbosity=verbosity)
306 
307   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(cs)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}
308     cs%ind\_cfc\_11\_flux = ind\_flux(1)
309     cs%ind\_cfc\_12\_flux = ind\_flux(2)
310 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
311 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_a293cd355bf164bfd6bbe2cda4b00ad12}\label{namespacemom__ocmip2__cfc_a293cd355bf164bfd6bbe2cda4b00ad12}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!init\+\_\+tracer\+\_\+cfc@{init\+\_\+tracer\+\_\+cfc}}
\index{init\+\_\+tracer\+\_\+cfc@{init\+\_\+tracer\+\_\+cfc}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{init\+\_\+tracer\+\_\+cfc()}{init\_tracer\_cfc()}}
{\footnotesize\ttfamily subroutine mom\+\_\+ocmip2\+\_\+cfc\+::init\+\_\+tracer\+\_\+cfc (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(out)}]{tr,  }\item[{character(len=$\ast$), intent(in)}]{name,  }\item[{real, intent(in)}]{land\+\_\+val,  }\item[{real, intent(in)}]{I\+C\+\_\+val,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine initializes a tracer array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s 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 out}  & {\em tr} & The tracer concentration array\\
\hline
\mbox{\tt in}  & {\em name} & The tracer name\\
\hline
\mbox{\tt in}  & {\em land\+\_\+val} & A value the tracer takes over land\\
\hline
\mbox{\tt in}  & {\em ic\+\_\+val} & The initial condition value for the tracer\\
\hline
 & {\em cs} & The control structure returned by a previous call to register\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+FC. \\
\hline
\end{DoxyParams}


Definition at line 363 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
363   \textcolor{keywordtype}{type}(ocean\_grid\_type),                    \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{    !< The ocean's grid structure}
364   \textcolor{keywordtype}{type}(unit\_scale\_type),                    \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{   !< A dimensional unit scaling type}
365   \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]}
366   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: tr\textcolor{comment}{   !< The tracer concentration array}
367   \textcolor{keywordtype}{character(len=*)},                         \textcolor{keywordtype}{intent(in)}  :: name\textcolor{comment}{ !< The tracer name}
368   \textcolor{keywordtype}{real},                                     \textcolor{keywordtype}{intent(in)}  :: land\_val\textcolor{comment}{ !< A value the tracer takes over land}
369   \textcolor{keywordtype}{real},                                     \textcolor{keywordtype}{intent(in)}  :: IC\_val\textcolor{comment}{ !< The initial condition value for the
       tracer}
370   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),                      \textcolor{keywordtype}{pointer}     :: CS\textcolor{comment}{   !< The control structure returned by a}
371 \textcolor{comment}{                                                                !! previous call to register\_OCMIP2\_CFC.}
372 
373   \textcolor{comment}{! This subroutine initializes a tracer array.}
374 
375   \textcolor{keywordtype}{logical} :: OK
376   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz
377   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
378 
379   \textcolor{keywordflow}{if} (len\_trim(cs%IC\_file) > 0) \textcolor{keywordflow}{then}
380     \textcolor{comment}{!  Read the tracer concentrations from a netcdf file.}
381     \textcolor{keywordflow}{if} (.not.file\_exists(cs%IC\_file, g%Domain)) &
382       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"initialize\_OCMIP2\_CFC: Unable to open "}//cs%IC\_file)
383     \textcolor{keywordflow}{if} (cs%Z\_IC\_file) \textcolor{keywordflow}{then}
384       ok = tracer\_z\_init(tr, h, cs%IC\_file, name, g, us)
385       \textcolor{keywordflow}{if} (.not.ok) \textcolor{keywordflow}{then}
386         ok = tracer\_z\_init(tr, h, cs%IC\_file, trim(name), g, us)
387         \textcolor{keywordflow}{if} (.not.ok) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"initialize\_OCMIP2\_CFC: "}//&
388                 \textcolor{stringliteral}{"Unable to read "}//trim(name)//\textcolor{stringliteral}{" from "}//&
389                 trim(cs%IC\_file)//\textcolor{stringliteral}{"."})
390 \textcolor{keywordflow}{      endif}
391     \textcolor{keywordflow}{else}
392       \textcolor{keyword}{call }mom\_read\_data(cs%IC\_file, trim(name), tr, g%Domain)
393 \textcolor{keywordflow}{    endif}
394   \textcolor{keywordflow}{else}
395     \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
396       \textcolor{keywordflow}{if} (g%mask2dT(i,j) < 0.5) \textcolor{keywordflow}{then}
397         tr(i,j,k) = land\_val
398       \textcolor{keywordflow}{else}
399         tr(i,j,k) = ic\_val
400 \textcolor{keywordflow}{      endif}
401 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
402 \textcolor{keywordflow}{  endif}
403 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_aaaa0b7695728d3761d5f25688838f5fc}\label{namespacemom__ocmip2__cfc_aaaa0b7695728d3761d5f25688838f5fc}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!initialize\+\_\+ocmip2\+\_\+cfc@{initialize\+\_\+ocmip2\+\_\+cfc}}
\index{initialize\+\_\+ocmip2\+\_\+cfc@{initialize\+\_\+ocmip2\+\_\+cfc}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{initialize\+\_\+ocmip2\+\_\+cfc()}{initialize\_ocmip2\_cfc()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ocmip2\+\_\+cfc\+::initialize\+\_\+ocmip2\+\_\+cfc (\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[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h,  }\item[{type(diag\+\_\+ctrl), intent(in), target}]{diag,  }\item[{type(ocean\+\_\+obc\+\_\+type), pointer}]{O\+BC,  }\item[{type(\mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), pointer}]{CS,  }\item[{type(sponge\+\_\+cs), pointer}]{sponge\+\_\+\+C\+Sp }\end{DoxyParamCaption})}



Initialize the O\+C\+M\+P2 C\+FC tracer fields and set up the tracer output. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em restart} & .true. 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}  & {\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 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\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+FC.\\
\hline
 & {\em 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 317 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
317   \textcolor{keywordtype}{logical},                        \textcolor{keywordtype}{intent(in)} :: restart\textcolor{comment}{    !< .true. if the fields have already been}
318 \textcolor{comment}{                                                           !! read from a restart file.}
319   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target},        \textcolor{keywordtype}{intent(in)} :: day\textcolor{comment}{        !< Time of the start of the run.}
320   \textcolor{keywordtype}{type}(ocean\_grid\_type),          \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{          !< The ocean's grid structure.}
321   \textcolor{keywordtype}{type}(verticalGrid\_type),        \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{         !< The ocean's vertical grid structure.}
322   \textcolor{keywordtype}{type}(unit\_scale\_type),          \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{         !< A dimensional unit scaling type}
323   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
324                                   \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{          !< Layer thicknesses [H ~> m or kg m-2].}
325   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target},        \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{       !< A structure that is used to regulate}
326 \textcolor{comment}{                                                           !! diagnostic output.}
327   \textcolor{keywordtype}{type}(ocean\_OBC\_type),           \textcolor{keywordtype}{pointer}    :: OBC\textcolor{comment}{        !< This open boundary condition type}
328 \textcolor{comment}{                                                           !! specifies whether, where, and what}
329 \textcolor{comment}{                                                           !! open boundary conditions are used.}
330   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),            \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{         !< The control structure returned by a}
331 \textcolor{comment}{                                                           !! previous call to register\_OCMIP2\_CFC.}
332   \textcolor{keywordtype}{type}(sponge\_CS),                \textcolor{keywordtype}{pointer}    :: sponge\_CSp\textcolor{comment}{ !< A pointer to the control structure for}
333 \textcolor{comment}{                                                           !! the sponges, if they are in use.}
334 \textcolor{comment}{                                                           !! Otherwise this may be unassociated.}
335 \textcolor{comment}{!   This subroutine initializes the NTR tracer fields in tr(:,:,:,:)}
336 \textcolor{comment}{! and it sets up the tracer output.}
337 
338   \textcolor{keywordtype}{logical} :: from\_file = .false.
339 
340   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}
341 
342   cs%Time => day
343   cs%diag => diag
344 
345   \textcolor{keywordflow}{if} (.not.restart .or. (cs%tracers\_may\_reinit .and. &
346       .not.query\_initialized(cs%CFC11, cs%CFC11\_name, cs%restart\_CSp))) &
347     \textcolor{keyword}{call }init\_tracer\_cfc(h, cs%CFC11, cs%CFC11\_name, cs%CFC11\_land\_val, &
348                          cs%CFC11\_IC\_val, g, us, cs)
349 
350   \textcolor{keywordflow}{if} (.not.restart .or. (cs%tracers\_may\_reinit .and. &
351       .not.query\_initialized(cs%CFC12, cs%CFC12\_name, cs%restart\_CSp))) &
352     \textcolor{keyword}{call }init\_tracer\_cfc(h, cs%CFC12, cs%CFC12\_name, cs%CFC12\_land\_val, &
353                          cs%CFC12\_IC\_val, g, us, cs)
354 
355   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(obc)) \textcolor{keywordflow}{then}
356   \textcolor{comment}{! Steal from updated DOME in the fullness of time.}
357 \textcolor{keywordflow}{  endif}
358 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_aebc84df12994a1f74d181ab54e380878}\label{namespacemom__ocmip2__cfc_aebc84df12994a1f74d181ab54e380878}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!ocmip2\+\_\+cfc\+\_\+column\+\_\+physics@{ocmip2\+\_\+cfc\+\_\+column\+\_\+physics}}
\index{ocmip2\+\_\+cfc\+\_\+column\+\_\+physics@{ocmip2\+\_\+cfc\+\_\+column\+\_\+physics}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{ocmip2\+\_\+cfc\+\_\+column\+\_\+physics()}{ocmip2\_cfc\_column\_physics()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ocmip2\+\_\+cfc\+::ocmip2\+\_\+cfc\+\_\+column\+\_\+physics (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h\+\_\+old,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{h\+\_\+new,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{ea,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), 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{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+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, souces and sinks and any other column tracer physics or chemistry to the O\+C\+M\+I\+P2 C\+FC tracers. C\+F\+Cs are relatively simple, as they are passive tracers with only a surface flux as a source. 


\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\\
\hline
\mbox{\tt in}  & {\em eb} & an array to which the amount of fluid entrained\\
\hline
\mbox{\tt in}  & {\em fluxes} & A structure containing pointers to thermodynamic and tracer forcing fields. Unused fields have N\+U\+LL ptrs.\\
\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
 & {\em cs} & The control structure returned by a previous call to register\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+FC.\\
\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 411 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
411   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{    !< The ocean's grid structure}
412   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{   !< The ocean's vertical grid structure}
413   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
414                            \textcolor{keywordtype}{intent(in)} :: h\_old\textcolor{comment}{ !< Layer thickness before entrainment [H ~> m or kg m-2].}
415   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
416                            \textcolor{keywordtype}{intent(in)} :: h\_new\textcolor{comment}{ !< Layer thickness after entrainment [H ~> m or kg m-2].}
417   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
418                            \textcolor{keywordtype}{intent(in)} :: ea\textcolor{comment}{   !< an array to which the amount of fluid entrained}
419 \textcolor{comment}{                                              !! from the layer above during this call will be}
420 \textcolor{comment}{                                              !! added [H ~> m or kg m-2].}
421   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
422                            \textcolor{keywordtype}{intent(in)} :: eb\textcolor{comment}{   !< an array to which the amount of fluid entrained}
423 \textcolor{comment}{                                              !! from the layer below during this call will be}
424 \textcolor{comment}{                                              !! added [H ~> m or kg m-2].}
425   \textcolor{keywordtype}{type}(forcing),           \textcolor{keywordtype}{intent(in)} :: fluxes\textcolor{comment}{ !< A structure containing pointers to thermodynamic}
426 \textcolor{comment}{                                              !! and tracer forcing fields.  Unused fields have NULL ptrs.}
427   \textcolor{keywordtype}{real},                    \textcolor{keywordtype}{intent(in)} :: dt\textcolor{comment}{   !< The amount of time covered by this call [T ~> s]}
428   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{   !< A dimensional unit scaling type}
429   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),     \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{   !< The control structure returned by a}
430 \textcolor{comment}{                                              !! previous call to register\_OCMIP2\_CFC.}
431   \textcolor{keywordtype}{real},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: evap\_CFL\_limit\textcolor{comment}{ !< Limit on the fraction of the water that can}
432 \textcolor{comment}{                                              !! be fluxed out of the top layer in a timestep [nondim]}
433   \textcolor{keywordtype}{real},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: minimum\_forcing\_depth\textcolor{comment}{ !< The smallest depth over which}
434 \textcolor{comment}{                                              !! fluxes can be applied [H ~> m or kg m-2]}
435 \textcolor{comment}{!   This subroutine applies diapycnal diffusion and any other column}
436 \textcolor{comment}{! tracer physics or chemistry to the tracers from this file.}
437 \textcolor{comment}{! CFCs are relatively simple, as they are passive tracers. with only a surface}
438 \textcolor{comment}{! flux as a source.}
439 
440 \textcolor{comment}{! The arguments to this subroutine are redundant in that}
441 \textcolor{comment}{!     h\_new(k) = h\_old(k) + ea(k) - eb(k-1) + eb(k) - ea(k+1)}
442 
443   \textcolor{comment}{! Local variables}
444   \textcolor{keywordtype}{real} :: b1(SZI\_(G))          \textcolor{comment}{! b1 and c1 are variables used by the}
445   \textcolor{keywordtype}{real} :: c1(SZI\_(G),SZK\_(G))  \textcolor{comment}{! tridiagonal solver.}
446   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))} :: &
447     CFC11\_flux, &    \textcolor{comment}{! The fluxes of CFC11 and CFC12 into the ocean, in the}
448     CFC12\_flux       \textcolor{comment}{! units of CFC concentrations times meters per second.}
449   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}, \textcolor{keywordtype}{dimension(:,:,:)} :: CFC11 => null(), cfc12 => null()
450   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))} :: h\_work \textcolor{comment}{! Used so that h can be modified}
451   \textcolor{keywordtype}{integer} :: i, j, k, m, is, ie, js, je, nz, idim(4), jdim(4)
452 
453   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = gv%ke
454   idim(:) = (/g%isd, is, ie, g%ied/) ; jdim(:) = (/g%jsd, js, je, g%jed/)
455 
456   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}
457 
458   cfc11 => cs%CFC11 ; cfc12 => cs%CFC12
459 
460   \textcolor{comment}{! These two calls unpack the fluxes from the input arrays.}
461   \textcolor{comment}{!   The -GV%Rho0 changes the sign convention of the flux and changes the units}
462   \textcolor{comment}{! of the flux from [Conc. m s-1] to [Conc. kg m-2 T-1].}
463   \textcolor{keyword}{call }coupler\_type\_extract\_data(fluxes%tr\_fluxes, cs%ind\_cfc\_11\_flux, ind\_flux, cfc11\_flux, &
464                                  scale\_factor=-g%US%R\_to\_kg\_m3*gv%Rho0*us%T\_to\_s, idim=idim, jdim=jdim)
465   \textcolor{keyword}{call }coupler\_type\_extract\_data(fluxes%tr\_fluxes, cs%ind\_cfc\_12\_flux, ind\_flux, cfc12\_flux, &
466                                  scale\_factor=-g%US%R\_to\_kg\_m3*gv%Rho0*us%T\_to\_s, idim=idim, jdim=jdim)
467 
468   \textcolor{comment}{! Use a tridiagonal solver to determine the concentrations after the}
469   \textcolor{comment}{! surface source is applied and diapycnal advection and diffusion occurs.}
470   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(evap\_cfl\_limit) .and. \textcolor{keyword}{present}(minimum\_forcing\_depth)) \textcolor{keywordflow}{then}
471     \textcolor{keywordflow}{do} k=1,nz ;\textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
472       h\_work(i,j,k) = h\_old(i,j,k)
473 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
474     \textcolor{keyword}{call }applytracerboundaryfluxesinout(g, gv, cfc11, dt, fluxes, h\_work, &
475                                         evap\_cfl\_limit, minimum\_forcing\_depth)
476     \textcolor{keyword}{call }tracer\_vertdiff(h\_work, ea, eb, dt, cfc11, g, gv, sfc\_flux=cfc11\_flux)
477 
478     \textcolor{keywordflow}{do} k=1,nz ;\textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
479       h\_work(i,j,k) = h\_old(i,j,k)
480 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
481     \textcolor{keyword}{call }applytracerboundaryfluxesinout(g, gv, cfc12, dt, fluxes, h\_work, &
482                                         evap\_cfl\_limit, minimum\_forcing\_depth)
483     \textcolor{keyword}{call }tracer\_vertdiff(h\_work, ea, eb, dt, cfc12, g, gv, sfc\_flux=cfc12\_flux)
484   \textcolor{keywordflow}{else}
485     \textcolor{keyword}{call }tracer\_vertdiff(h\_old, ea, eb, dt, cfc11, g, gv, sfc\_flux=cfc11\_flux)
486     \textcolor{keyword}{call }tracer\_vertdiff(h\_old, ea, eb, dt, cfc12, g, gv, sfc\_flux=cfc12\_flux)
487 \textcolor{keywordflow}{  endif}
488 
489   \textcolor{comment}{! Write out any desired diagnostics from tracer sources & sinks here.}
490 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_a225d2a7eacb485040fcac7f9b6766ee1}\label{namespacemom__ocmip2__cfc_a225d2a7eacb485040fcac7f9b6766ee1}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!ocmip2\+\_\+cfc\+\_\+end@{ocmip2\+\_\+cfc\+\_\+end}}
\index{ocmip2\+\_\+cfc\+\_\+end@{ocmip2\+\_\+cfc\+\_\+end}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{ocmip2\+\_\+cfc\+\_\+end()}{ocmip2\_cfc\_end()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ocmip2\+\_\+cfc\+::ocmip2\+\_\+cfc\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Deallocate any memory associated with the O\+C\+M\+I\+P2 C\+FC tracer package. 


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


Definition at line 618 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
618   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{   !< The control structure returned by a}
619 \textcolor{comment}{                                       !! previous call to register\_OCMIP2\_CFC.}
620 \textcolor{comment}{!   This subroutine deallocates the memory owned by this module.}
621 \textcolor{comment}{! Argument: CS - The control structure returned by a previous call to}
622 \textcolor{comment}{!                register\_OCMIP2\_CFC.}
623   \textcolor{keywordtype}{integer} :: m
624 
625   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}
626     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs%CFC11)) \textcolor{keyword}{deallocate}(cs%CFC11)
627     \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs%CFC12)) \textcolor{keyword}{deallocate}(cs%CFC12)
628 
629     \textcolor{keyword}{deallocate}(cs)
630 \textcolor{keywordflow}{  endif}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_ac3c9967ff09b37934eb5ef51535e7ee3}\label{namespacemom__ocmip2__cfc_ac3c9967ff09b37934eb5ef51535e7ee3}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!ocmip2\+\_\+cfc\+\_\+stock@{ocmip2\+\_\+cfc\+\_\+stock}}
\index{ocmip2\+\_\+cfc\+\_\+stock@{ocmip2\+\_\+cfc\+\_\+stock}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{ocmip2\+\_\+cfc\+\_\+stock()}{ocmip2\_cfc\_stock()}}
{\footnotesize\ttfamily integer function, public mom\+\_\+ocmip2\+\_\+cfc\+::ocmip2\+\_\+cfc\+\_\+stock (\begin{DoxyParamCaption}\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), 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{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+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})}



This function 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{\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 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\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+FC.\\
\hline
\mbox{\tt out}  & {\em names} & The names of the stocks calculated.\\
\hline
\mbox{\tt out}  & {\em units} & The units of the stocks calculated.\\
\hline
\mbox{\tt in}  & {\em stock\+\_\+index} & The coded index of a specific stock being sought.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of stocks calculated here. 
\end{DoxyReturn}


Definition at line 497 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
497   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{      !< The ocean's grid structure.}
498   \textcolor{keywordtype}{type}(verticalGrid\_type),         \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{     !< The ocean's vertical grid structure.}
499   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
500                                    \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{      !< Layer thicknesses [H ~> m or kg m-2].}
501   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},              \textcolor{keywordtype}{intent(out)}   :: stocks\textcolor{comment}{ !< the mass-weighted integrated amount of each}
502 \textcolor{comment}{                                                           !! tracer, in kg times concentration units [kg
       conc].}
503   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),             \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{     !< The control structure returned by a}
504 \textcolor{comment}{                                                           !! previous call to register\_OCMIP2\_CFC.}
505   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)},  \textcolor{keywordtype}{intent(out)}   :: names\textcolor{comment}{  !< The names of the stocks calculated.}
506   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)},  \textcolor{keywordtype}{intent(out)}   :: units\textcolor{comment}{  !< The units of the stocks calculated.}
507   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: stock\_index\textcolor{comment}{ !< The coded index of a specific}
508 \textcolor{comment}{                                                                !! stock being sought.}
509   \textcolor{keywordtype}{integer}                                        :: OCMIP2\_CFC\_stock\textcolor{comment}{ !< The number of stocks calculated
       here.}
510 
511   \textcolor{comment}{! Local variables}
512   \textcolor{keywordtype}{real} :: mass
513   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz
514   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = gv%ke
515 
516   ocmip2\_cfc\_stock = 0
517   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}
518 
519   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stock\_index)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (stock\_index > 0) \textcolor{keywordflow}{then}
520     \textcolor{comment}{! Check whether this stock is available from this routine.}
521 
522     \textcolor{comment}{! No stocks from this routine are being checked yet.  Return 0.}
523     \textcolor{keywordflow}{return}
524 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
525 
526   \textcolor{keyword}{call }query\_vardesc(cs%CFC11\_desc, name=names(1), units=units(1), caller=\textcolor{stringliteral}{"OCMIP2\_CFC\_stock"})
527   \textcolor{keyword}{call }query\_vardesc(cs%CFC12\_desc, name=names(2), units=units(2), caller=\textcolor{stringliteral}{"OCMIP2\_CFC\_stock"})
528   units(1) = trim(units(1))//\textcolor{stringliteral}{" kg"} ; units(2) = trim(units(2))//\textcolor{stringliteral}{" kg"}
529 
530   stocks(1) = 0.0 ; stocks(2) = 0.0
531   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
532     mass = g%mask2dT(i,j) * g%US%L\_to\_m**2*g%areaT(i,j) * h(i,j,k)
533     stocks(1) = stocks(1) + cs%CFC11(i,j,k) * mass
534     stocks(2) = stocks(2) + cs%CFC12(i,j,k) * mass
535 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
536   stocks(1) = gv%H\_to\_kg\_m2 * stocks(1)
537   stocks(2) = gv%H\_to\_kg\_m2 * stocks(2)
538 
539   ocmip2\_cfc\_stock = 2
540 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_a304869c78d725f37ed99d0b8069e4858}\label{namespacemom__ocmip2__cfc_a304869c78d725f37ed99d0b8069e4858}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!ocmip2\+\_\+cfc\+\_\+surface\+\_\+state@{ocmip2\+\_\+cfc\+\_\+surface\+\_\+state}}
\index{ocmip2\+\_\+cfc\+\_\+surface\+\_\+state@{ocmip2\+\_\+cfc\+\_\+surface\+\_\+state}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{ocmip2\+\_\+cfc\+\_\+surface\+\_\+state()}{ocmip2\_cfc\_surface\_state()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+ocmip2\+\_\+cfc\+::ocmip2\+\_\+cfc\+\_\+surface\+\_\+state (\begin{DoxyParamCaption}\item[{type(surface), intent(inout)}]{sfc\+\_\+state,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(g)), intent(in)}]{h,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(\mbox{\hyperlink{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



This subroutine extracts the surface C\+FC concentrations and other fields that are shared with the atmosphere to calculate C\+FC fluxes. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in,out}  & {\em sfc\+\_\+state} & A structure containing fields that describe the surface state of the ocean.\\
\hline
\mbox{\tt 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\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+FC. \\
\hline
\end{DoxyParams}


Definition at line 546 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
546   \textcolor{keywordtype}{type}(ocean\_grid\_type),  \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{  !< The ocean's grid structure.}
547   \textcolor{keywordtype}{type}(surface),          \textcolor{keywordtype}{intent(inout)} :: sfc\_state\textcolor{comment}{ !< A structure containing fields that}
548 \textcolor{comment}{                                              !! describe the surface state of the ocean.}
549   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))}, &
550                           \textcolor{keywordtype}{intent(in)}    :: h\textcolor{comment}{  !< Layer thickness [H ~> m or kg m-2].}
551   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),    \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{ !< The control structure returned by a previous}
552 \textcolor{comment}{                                              !! call to register\_OCMIP2\_CFC.}
553 
554   \textcolor{comment}{! Local variables}
555   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G))} :: &
556     CFC11\_Csurf, &  \textcolor{comment}{! The CFC-11 surface concentrations times the Schmidt number term [mol m-3].}
557     CFC12\_Csurf, &  \textcolor{comment}{! The CFC-12 surface concentrations times the Schmidt number term [mol m-3].}
558     CFC11\_alpha, &  \textcolor{comment}{! The CFC-11 solubility [mol m-3 pptv-1].}
559     CFC12\_alpha     \textcolor{comment}{! The CFC-12 solubility [mol m-3 pptv-1].}
560   \textcolor{keywordtype}{real} :: ta        \textcolor{comment}{! Absolute sea surface temperature [hectoKelvin] (Why use such bizzare units?)}
561   \textcolor{keywordtype}{real} :: sal       \textcolor{comment}{! Surface salinity [PSU].}
562   \textcolor{keywordtype}{real} :: SST       \textcolor{comment}{! Sea surface temperature [degC].}
563   \textcolor{keywordtype}{real} :: alpha\_11  \textcolor{comment}{! The solubility of CFC 11 [mol m-3 pptv-1].}
564   \textcolor{keywordtype}{real} :: alpha\_12  \textcolor{comment}{! The solubility of CFC 12 [mol m-3 pptv-1].}
565   \textcolor{keywordtype}{real} :: sc\_11, sc\_12 \textcolor{comment}{! The Schmidt numbers of CFC 11 and CFC 12.}
566   \textcolor{keywordtype}{real} :: sc\_no\_term   \textcolor{comment}{! A term related to the Schmidt number.}
567   \textcolor{keywordtype}{integer} :: i, j, m, is, ie, js, je, idim(4), jdim(4)
568 
569   is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
570   idim(:) = (/g%isd, is, ie, g%ied/) ; jdim(:) = (/g%jsd, js, je, g%jed/)
571 
572   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{return}
573 
574   \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie
575     ta = max(0.01, (sfc\_state%SST(i,j) + 273.15) * 0.01) \textcolor{comment}{! Why is this in hectoKelvin?}
576     sal = sfc\_state%SSS(i,j) ; sst = sfc\_state%SST(i,j)
577     \textcolor{comment}{!    Calculate solubilities using Warner and Weiss (1985) DSR, vol 32.}
578     \textcolor{comment}{! The final result is in mol/cm3/pptv (1 part per trillion 1e-12)}
579     \textcolor{comment}{! Use Bullister and Wisegavger for CCl4.}
580     \textcolor{comment}{! The factor 1.e-09 converts from mol/(l * atm) to mol/(m3 * pptv).}
581     alpha\_11 = exp(cs%d1\_11 + cs%d2\_11/ta + cs%d3\_11*log(ta) + cs%d4\_11*ta**2 +&
582                    sal * ((cs%e3\_11 * ta + cs%e2\_11) * ta + cs%e1\_11)) * &
583                1.0e-09 * g%mask2dT(i,j)
584     alpha\_12 = exp(cs%d1\_12 + cs%d2\_12/ta + cs%d3\_12*log(ta) + cs%d4\_12*ta**2 +&
585                    sal * ((cs%e3\_12 * ta + cs%e2\_12) * ta + cs%e1\_12)) * &
586                1.0e-09 * g%mask2dT(i,j)
587     \textcolor{comment}{!   Calculate Schmidt numbers using coefficients given by}
588     \textcolor{comment}{! Zheng et al (1998), JGR vol 103, C1.}
589     sc\_11 = cs%a1\_11 + sst * (cs%a2\_11 + sst * (cs%a3\_11 + sst * cs%a4\_11)) * &
590             g%mask2dT(i,j)
591     sc\_12 = cs%a1\_12 + sst * (cs%a2\_12 + sst * (cs%a3\_12 + sst * cs%a4\_12)) * &
592             g%mask2dT(i,j)
593     \textcolor{comment}{! The abs here is to avoid NaNs. The model should be failing at this point.}
594     sc\_no\_term = sqrt(660.0 / (abs(sc\_11) + 1.0e-30))
595     cfc11\_alpha(i,j) = alpha\_11 * sc\_no\_term
596     cfc11\_csurf(i,j) = cs%CFC11(i,j,1) * sc\_no\_term
597 
598     sc\_no\_term = sqrt(660.0 / (abs(sc\_12) + 1.0e-30))
599     cfc12\_alpha(i,j) = alpha\_12 * sc\_no\_term
600     cfc12\_csurf(i,j) = cs%CFC12(i,j,1) * sc\_no\_term
601 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
602 
603   \textcolor{comment}{!   These calls load these values into the appropriate arrays in the}
604   \textcolor{comment}{! coupler-type structure.}
605   \textcolor{keyword}{call }coupler\_type\_set\_data(cfc11\_alpha, cs%ind\_cfc\_11\_flux, ind\_alpha, &
606                              sfc\_state%tr\_fields, idim=idim, jdim=jdim)
607   \textcolor{keyword}{call }coupler\_type\_set\_data(cfc11\_csurf, cs%ind\_cfc\_11\_flux, ind\_csurf, &
608                              sfc\_state%tr\_fields, idim=idim, jdim=jdim)
609   \textcolor{keyword}{call }coupler\_type\_set\_data(cfc12\_alpha, cs%ind\_cfc\_12\_flux, ind\_alpha, &
610                              sfc\_state%tr\_fields, idim=idim, jdim=jdim)
611   \textcolor{keyword}{call }coupler\_type\_set\_data(cfc12\_csurf, cs%ind\_cfc\_12\_flux, ind\_csurf, &
612                              sfc\_state%tr\_fields, idim=idim, jdim=jdim)
613 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__ocmip2__cfc_ac04494ce35222c8583a7ee7589e1cf13}\label{namespacemom__ocmip2__cfc_ac04494ce35222c8583a7ee7589e1cf13}} 
\index{mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}!register\+\_\+ocmip2\+\_\+cfc@{register\+\_\+ocmip2\+\_\+cfc}}
\index{register\+\_\+ocmip2\+\_\+cfc@{register\+\_\+ocmip2\+\_\+cfc}!mom\+\_\+ocmip2\+\_\+cfc@{mom\+\_\+ocmip2\+\_\+cfc}}
\subsubsection{\texorpdfstring{register\+\_\+ocmip2\+\_\+cfc()}{register\_ocmip2\_cfc()}}
{\footnotesize\ttfamily logical function, public mom\+\_\+ocmip2\+\_\+cfc\+::register\+\_\+ocmip2\+\_\+cfc (\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{structmom__ocmip2__cfc_1_1ocmip2__cfc__cs}{ocmip2\+\_\+cfc\+\_\+cs}}), pointer}]{CS,  }\item[{type(tracer\+\_\+registry\+\_\+type), pointer}]{tr\+\_\+\+Reg,  }\item[{type(mom\+\_\+restart\+\_\+cs), pointer}]{restart\+\_\+\+CS }\end{DoxyParamCaption})}



Register the O\+C\+M\+I\+P2 C\+FC tracers to be used with M\+OM and read the parameters that are used with this tracer package. 


\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 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 to the tracer registry.\\
\hline
 & {\em restart\+\_\+cs} & A pointer to the restart control structure. \\
\hline
\end{DoxyParams}


Definition at line 93 of file M\+O\+M\+\_\+\+O\+C\+M\+I\+P2\+\_\+\+C\+F\+C.\+F90.


\begin{DoxyCode}
93   \textcolor{keywordtype}{type}(hor\_index\_type),    \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{         !< A horizontal index type structure.}
94   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{         !< The ocean's vertical grid structure.}
95   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters.}
96   \textcolor{keywordtype}{type}(OCMIP2\_CFC\_CS),     \textcolor{keywordtype}{pointer}    :: CS\textcolor{comment}{         !< A pointer that is set to point to the control}
97 \textcolor{comment}{                                                    !! structure for this module.}
98   \textcolor{keywordtype}{type}(tracer\_registry\_type), &
99                            \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{     !< A pointer to the tracer registry.}
100   \textcolor{keywordtype}{type}(MOM\_restart\_CS),    \textcolor{keywordtype}{pointer}    :: restart\_CS\textcolor{comment}{ !< A pointer to the restart control structure.}
101 \textcolor{comment}{! This subroutine is used to register tracer fields and subroutines}
102 \textcolor{comment}{! to be used with MOM.}
103 
104   \textcolor{comment}{! Local variables}
105   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_OCMIP2\_CFC"} \textcolor{comment}{! This module's name.}
106   \textcolor{keywordtype}{character(len=200)} :: inputdir \textcolor{comment}{! The directory where NetCDF input files are.}
107   \textcolor{comment}{! This include declares and sets the variable "version".}
108 \textcolor{preprocessor}{#include "version\_variable.h"}
109 \textcolor{preprocessor}{}  \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{pointer} :: tr\_ptr => null()
110   \textcolor{keywordtype}{real} :: a11\_dflt(4), a12\_dflt(4) \textcolor{comment}{! Default values of the various coefficients}
111   \textcolor{keywordtype}{real} :: d11\_dflt(4), d12\_dflt(4) \textcolor{comment}{! In the expressions for the solubility and}
112   \textcolor{keywordtype}{real} :: e11\_dflt(3), e12\_dflt(3) \textcolor{comment}{! Schmidt numbers.}
113   \textcolor{keywordtype}{character(len=48)} :: flux\_units \textcolor{comment}{! The units for tracer fluxes.}
114   \textcolor{keywordtype}{logical} :: register\_OCMIP2\_CFC
115   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed, nz, m
116 
117   isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
118 
119   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}
120     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"register\_OCMIP2\_CFC called with an "}// &
121                             \textcolor{stringliteral}{"associated control structure."})
122     \textcolor{keywordflow}{return}
123 \textcolor{keywordflow}{  endif}
124   \textcolor{keyword}{allocate}(cs)
125 
126   \textcolor{comment}{! This call sets default properties for the air-sea CFC fluxes and obtains the}
127   \textcolor{comment}{! indicies for the CFC11 and CFC12 flux coupling.}
128   \textcolor{keyword}{call }flux\_init\_ocmip2\_cfc(cs, verbosity=3)
129   \textcolor{keywordflow}{if} ((cs%ind\_cfc\_11\_flux < 0) .or. (cs%ind\_cfc\_11\_flux < 0)) \textcolor{keywordflow}{then}
130     \textcolor{comment}{! This is most likely to happen with the dummy version of aof\_set\_coupler\_flux}
131     \textcolor{comment}{! used in ocean-only runs.}
132     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"CFCs are currently only set up to be run in "} // &
133                    \textcolor{stringliteral}{" coupled model configurations, and will be disabled."})
134     \textcolor{keyword}{deallocate}(cs)
135     register\_ocmip2\_cfc = .false.
136     \textcolor{keywordflow}{return}
137 \textcolor{keywordflow}{  endif}
138 
139   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}
140   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})
141   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC\_IC\_FILE"}, cs%IC\_file, &
142                  \textcolor{stringliteral}{"The file in which the CFC initial values can be "}//&
143                  \textcolor{stringliteral}{"found, or an empty string for internal initialization."}, &
144                  default=\textcolor{stringliteral}{" "})
145   \textcolor{keywordflow}{if} ((len\_trim(cs%IC\_file) > 0) .and. (scan(cs%IC\_file,\textcolor{stringliteral}{'/'}) == 0)) \textcolor{keywordflow}{then}
146     \textcolor{comment}{! Add the directory if CS%IC\_file is not already a complete path.}
147     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"INPUTDIR"}, inputdir, default=\textcolor{stringliteral}{"."})
148     cs%IC\_file = trim(slasher(inputdir))//trim(cs%IC\_file)
149     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"INPUTDIR/CFC\_IC\_FILE"}, cs%IC\_file)
150 \textcolor{keywordflow}{  endif}
151   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC\_IC\_FILE\_IS\_Z"}, cs%Z\_IC\_file, &
152                  \textcolor{stringliteral}{"If true, CFC\_IC\_FILE is in depth space, not layer space"}, &
153                  default=.false.)
154   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TRACERS\_MAY\_REINIT"}, cs%tracers\_may\_reinit, &
155                  \textcolor{stringliteral}{"If true, tracers may go through the initialization code "}//&
156                  \textcolor{stringliteral}{"if they are not found in the restart files.  Otherwise "}//&
157                  \textcolor{stringliteral}{"it is a fatal error if tracers are not found in the "}//&
158                  \textcolor{stringliteral}{"restart files of a restarted run."}, default=.false.)
159 
160   \textcolor{comment}{!   The following vardesc types contain a package of metadata about each tracer,}
161   \textcolor{comment}{! including, the name; units; longname; and grid information.}
162   cs%CFC11\_name = \textcolor{stringliteral}{"CFC11"} ; cs%CFC12\_name = \textcolor{stringliteral}{"CFC12"}
163   cs%CFC11\_desc = var\_desc(cs%CFC11\_name,\textcolor{stringliteral}{"mol m-3"},\textcolor{stringliteral}{"CFC-11 Concentration"}, caller=mdl)
164   cs%CFC12\_desc = var\_desc(cs%CFC12\_name,\textcolor{stringliteral}{"mol m-3"},\textcolor{stringliteral}{"CFC-12 Concentration"}, caller=mdl)
165   \textcolor{keywordflow}{if} (gv%Boussinesq) \textcolor{keywordflow}{then} ; flux\_units = \textcolor{stringliteral}{"mol s-1"}
166   \textcolor{keywordflow}{else} ; flux\_units = \textcolor{stringliteral}{"mol m-3 kg s-1"} ;\textcolor{keywordflow}{ endif}
167 
168   \textcolor{keyword}{allocate}(cs%CFC11(isd:ied,jsd:jed,nz)) ; cs%CFC11(:,:,:) = 0.0
169   \textcolor{keyword}{allocate}(cs%CFC12(isd:ied,jsd:jed,nz)) ; cs%CFC12(:,:,:) = 0.0
170 
171   \textcolor{comment}{! This pointer assignment is needed to force the compiler not to do a copy in}
172   \textcolor{comment}{! the registration calls.  Curses on the designers and implementers of F90.}
173   tr\_ptr => cs%CFC11
174   \textcolor{comment}{! Register CFC11 for horizontal advection, diffusion, and restarts.}
175   \textcolor{keyword}{call }register\_tracer(tr\_ptr, tr\_reg, param\_file, hi, gv, &
176                        tr\_desc=cs%CFC11\_desc, registry\_diags=.true., &
177                        flux\_units=flux\_units, &
178                        restart\_cs=restart\_cs, mandatory=.not.cs%tracers\_may\_reinit)
179   \textcolor{comment}{! Do the same for CFC12}
180   tr\_ptr => cs%CFC12
181   \textcolor{keyword}{call }register\_tracer(tr\_ptr, tr\_reg, param\_file, hi, gv, &
182                        tr\_desc=cs%CFC12\_desc, registry\_diags=.true., &
183                        flux\_units=flux\_units, &
184                        restart\_cs=restart\_cs, mandatory=.not.cs%tracers\_may\_reinit)
185 
186   \textcolor{comment}{! Set and read the various empirical coefficients.}
187 
188 \textcolor{comment}{!-----------------------------------------------------------------------}
189 \textcolor{comment}{! Default Schmidt number coefficients for CFC11 (\_11) and CFC12 (\_12) are given}
190 \textcolor{comment}{! by Zheng et al (1998), JGR vol 103, C1.}
191 \textcolor{comment}{!-----------------------------------------------------------------------}
192   a11\_dflt(:) = (/ 3501.8, -210.31,  6.1851, -0.07513 /)
193   a12\_dflt(:) = (/ 3845.4, -228.95,  6.1908, -0.06743 /)
194   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_A1"}, cs%a1\_11, &
195                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC11."}, &
196                  units=\textcolor{stringliteral}{"nondim"}, default=a11\_dflt(1))
197   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_A2"}, cs%a2\_11, &
198                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC11."}, &
199                  units=\textcolor{stringliteral}{"degC-1"}, default=a11\_dflt(2))
200   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_A3"}, cs%a3\_11, &
201                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC11."}, &
202                  units=\textcolor{stringliteral}{"degC-2"}, default=a11\_dflt(3))
203   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_A4"}, cs%a4\_11, &
204                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC11."}, &
205                  units=\textcolor{stringliteral}{"degC-3"}, default=a11\_dflt(4))
206 
207   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_A1"}, cs%a1\_12, &
208                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC12."}, &
209                  units=\textcolor{stringliteral}{"nondim"}, default=a12\_dflt(1))
210   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_A2"}, cs%a2\_12, &
211                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC12."}, &
212                  units=\textcolor{stringliteral}{"degC-1"}, default=a12\_dflt(2))
213   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_A3"}, cs%a3\_12, &
214                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC12."}, &
215                  units=\textcolor{stringliteral}{"degC-2"}, default=a12\_dflt(3))
216   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_A4"}, cs%a4\_12, &
217                  \textcolor{stringliteral}{"A coefficient in the Schmidt number of CFC12."}, &
218                  units=\textcolor{stringliteral}{"degC-3"}, default=a12\_dflt(4))
219 
220 \textcolor{comment}{!-----------------------------------------------------------------------}
221 \textcolor{comment}{! Solubility coefficients for alpha in mol/l/atm for CFC11 (\_11) and CFC12 (\_12)}
222 \textcolor{comment}{! after Warner and Weiss (1985) DSR, vol 32.}
223 \textcolor{comment}{!-----------------------------------------------------------------------}
224   d11\_dflt(:) = (/ -229.9261, 319.6552, 119.4471, -1.39165 /)
225   e11\_dflt(:) = (/ -0.142382, 0.091459, -0.0157274 /)
226   d12\_dflt(:) = (/ -218.0971, 298.9702, 113.8049, -1.39165 /)
227   e12\_dflt(:) = (/ -0.143566, 0.091015, -0.0153924 /)
228 
229   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_D1"}, cs%d1\_11, &
230                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
231                  units=\textcolor{stringliteral}{"none"}, default=d11\_dflt(1))
232   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_D2"}, cs%d2\_11, &
233                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
234                  units=\textcolor{stringliteral}{"hK"}, default=d11\_dflt(2))
235   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_D3"}, cs%d3\_11, &
236                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
237                  units=\textcolor{stringliteral}{"none"}, default=d11\_dflt(3))
238   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_D4"}, cs%d4\_11, &
239                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
240                  units=\textcolor{stringliteral}{"hK-2"}, default=d11\_dflt(4))
241   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_E1"}, cs%e1\_11, &
242                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
243                  units=\textcolor{stringliteral}{"PSU-1"}, default=e11\_dflt(1))
244   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_E2"}, cs%e2\_11, &
245                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
246                  units=\textcolor{stringliteral}{"PSU-1 hK-1"}, default=e11\_dflt(2))
247   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC11\_E3"}, cs%e3\_11, &
248                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC11."}, &
249                  units=\textcolor{stringliteral}{"PSU-1 hK-2"}, default=e11\_dflt(3))
250 
251   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_D1"}, cs%d1\_12, &
252                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
253                  units=\textcolor{stringliteral}{"none"}, default=d12\_dflt(1))
254   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_D2"}, cs%d2\_12, &
255                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
256                  units=\textcolor{stringliteral}{"hK"}, default=d12\_dflt(2))
257   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_D3"}, cs%d3\_12, &
258                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
259                  units=\textcolor{stringliteral}{"none"}, default=d12\_dflt(3))
260   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_D4"}, cs%d4\_12, &
261                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
262                  units=\textcolor{stringliteral}{"hK-2"}, default=d12\_dflt(4))
263   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_E1"}, cs%e1\_12, &
264                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
265                  units=\textcolor{stringliteral}{"PSU-1"}, default=e12\_dflt(1))
266   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_E2"}, cs%e2\_12, &
267                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
268                  units=\textcolor{stringliteral}{"PSU-1 hK-1"}, default=e12\_dflt(2))
269   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CFC12\_E3"}, cs%e3\_12, &
270                  \textcolor{stringliteral}{"A coefficient in the solubility of CFC12."}, &
271                  units=\textcolor{stringliteral}{"PSU-1 hK-2"}, default=e12\_dflt(3))
272 
273   cs%tr\_Reg => tr\_reg
274   cs%restart\_CSp => restart\_cs
275 
276   register\_ocmip2\_cfc = .true.
\end{DoxyCode}
