\hypertarget{namespaceuser__initialization}{}\section{user\+\_\+initialization Module Reference}
\label{namespaceuser__initialization}\index{user\+\_\+initialization@{user\+\_\+initialization}}


\subsection{Detailed Description}
A template of a user to code up customized initial conditions. 

This subroutine initializes the fields for the simulations. The one argument passed to initialize, Time, is set to the current time of the simulation. The fields which might be initialized here are\+:


\begin{DoxyItemize}
\item u -\/ Zonal velocity \mbox{[}Z T-\/1 $\sim$$>$ m s-\/1\mbox{]}.
\item v -\/ Meridional velocity \mbox{[}Z T-\/1 $\sim$$>$ m s-\/1\mbox{]}.
\item h -\/ Layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. (Must be positive.)
\item GbathyT -\/ Basin depth \mbox{[}Z $\sim$$>$ m\mbox{]}. (Must be positive.)
\item GCoriolis\+Bu -\/ The Coriolis parameter \mbox{[}T-\/1 $\sim$$>$ s-\/1\mbox{]}.
\item GVg\+\_\+prime -\/ The reduced gravity at each interface \mbox{[}L2 Z-\/1 T-\/2 $\sim$$>$ m s-\/2\mbox{]}.
\item GVRlay -\/ Layer potential density (coordinate variable) \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}. If E\+N\+A\+B\+L\+E\+\_\+\+T\+H\+E\+R\+M\+O\+D\+Y\+N\+A\+M\+I\+CS is defined\+:
\item T -\/ Temperature \mbox{[}degC\mbox{]}.
\item S -\/ Salinity \mbox{[}psu\mbox{]}. If B\+U\+L\+K\+M\+I\+X\+E\+D\+L\+A\+Y\+ER is defined\+:
\item Rml -\/ Mixed layer and buffer layer potential densities \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}. If S\+P\+O\+N\+GE is defined\+:
\item A series of subroutine calls are made to set up the damping rates and reference profiles for all variables that are damped in the sponge.
\end{DoxyItemize}

Any user provided tracer code is also first linked through this subroutine.

These variables are all set in the set of subroutines (in this file) U\+S\+E\+R\+\_\+initialize\+\_\+bottom\+\_\+depth, U\+S\+E\+R\+\_\+initialize\+\_\+thickness, U\+S\+E\+R\+\_\+initialize\+\_\+velocity, U\+S\+E\+R\+\_\+initialize\+\_\+temperature\+\_\+salinity, U\+S\+E\+R\+\_\+initialize\+\_\+mixed\+\_\+layer\+\_\+density, U\+S\+E\+R\+\_\+initialize\+\_\+sponges, U\+S\+E\+R\+\_\+set\+\_\+coord, and U\+S\+E\+R\+\_\+set\+\_\+ref\+\_\+profile.

The names of these subroutines should be self-\/explanatory. They start with \char`\"{}\+U\+S\+E\+R\+\_\+\char`\"{} to indicate that they will likely have to be modified for each simulation to set the initial conditions and boundary conditions. Most of these take two arguments\+: an integer argument specifying whether the fields are to be calculated internally or read from a Net\+C\+DF file; and a string giving the path to that file. If the field is initialized internally, the path is ignored. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespaceuser__initialization_afb05f538d59bbae7856b965ae16f6000}{user\+\_\+set\+\_\+coord} (Rlay, g\+\_\+prime, GV, US, param\+\_\+file, eqn\+\_\+of\+\_\+state)
\begin{DoxyCompactList}\small\item\em Set vertical coordinates. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_ad48bbaeae8df60afdaffe34590d835ab}{user\+\_\+initialize\+\_\+topography} (D, G, param\+\_\+file, max\+\_\+depth, US)
\begin{DoxyCompactList}\small\item\em Initialize topography. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_a3ee75fd9d1d059afb7f07ff13561a565}{user\+\_\+initialize\+\_\+thickness} (h, G, GV, param\+\_\+file, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em initialize thicknesses. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_a757c666f3e23714d9ec76912c4aba048}{user\+\_\+initialize\+\_\+velocity} (u, v, G, US, param\+\_\+file, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em initialize velocities. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_aa6db7133a474bd7832e85ad5bd9df0ca}{user\+\_\+init\+\_\+temperature\+\_\+salinity} (T, S, G, param\+\_\+file, eqn\+\_\+of\+\_\+state, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em This function puts the initial layer temperatures and salinities into T(\+:,\+:,\+:) and S(\+:,\+:,\+:). \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_a6ec70f2ab81af41619df4db0f7da098f}{user\+\_\+initialize\+\_\+sponges} (G, GV, use\+\_\+temp, tv, param\+\_\+file, C\+Sp, h)
\begin{DoxyCompactList}\small\item\em Set up the sponges. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_a257e5194c434ba287d296f7a228c6a0c}{user\+\_\+set\+\_\+obc\+\_\+data} (O\+BC, tv, G, param\+\_\+file, tr\+\_\+\+Reg)
\begin{DoxyCompactList}\small\item\em This subroutine sets the properties of flow at open boundary conditions. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespaceuser__initialization_a83f001dcb5625d866c1265120a248e3c}{user\+\_\+set\+\_\+rotation} (G, param\+\_\+file)
\item 
subroutine \hyperlink{namespaceuser__initialization_aebfc0db710e83bae83f08e1a774256dd}{write\+\_\+user\+\_\+log} (param\+\_\+file)
\begin{DoxyCompactList}\small\item\em Write output about the parameter values being used. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
logical \hyperlink{namespaceuser__initialization_a91c73478b39de720dde435a23d96c2bb}{first\+\_\+call} = .true.
\begin{DoxyCompactList}\small\item\em A module variable that should not be used. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespaceuser__initialization_aa6db7133a474bd7832e85ad5bd9df0ca}\label{namespaceuser__initialization_aa6db7133a474bd7832e85ad5bd9df0ca}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+init\+\_\+temperature\+\_\+salinity@{user\+\_\+init\+\_\+temperature\+\_\+salinity}}
\index{user\+\_\+init\+\_\+temperature\+\_\+salinity@{user\+\_\+init\+\_\+temperature\+\_\+salinity}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+init\+\_\+temperature\+\_\+salinity()}{user\_init\_temperature\_salinity()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+init\+\_\+temperature\+\_\+salinity (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(out)}]{T,  }\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(out)}]{S,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(eos\+\_\+type), pointer}]{eqn\+\_\+of\+\_\+state,  }\item[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



This function puts the initial layer temperatures and salinities into T(\+:,\+:,\+:) and S(\+:,\+:,\+:). 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & Ocean grid structure.\\
\hline
\mbox{\tt out}  & {\em t} & Potential temperature \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em s} & Salinity \mbox{[}ppt\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure\\
\hline
\mbox{\tt in}  & {\em just\+\_\+read\+\_\+params} & If present and true, this call will only read parameters without changing T \& S. \\
\hline
\end{DoxyParams}


Definition at line 139 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
139   \textcolor{keywordtype}{type}(ocean\_grid\_type),                     \textcolor{keywordtype}{intent(in)}  :: g\textcolor{comment}{ !< Ocean grid structure.}
140   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: t\textcolor{comment}{ !< Potential temperature [degC].}
141   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: s\textcolor{comment}{ !< Salinity [ppt].}
142   \textcolor{keywordtype}{type}(param\_file\_type),                     \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}
143 \textcolor{comment}{                                                            !! open file to parse for model}
144 \textcolor{comment}{                                                            !! parameter values.}
145   \textcolor{keywordtype}{type}(eos\_type),                            \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}
146   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will only}
147 \textcolor{comment}{                                                           !! read parameters without changing T & S.}
148 
149   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}
150 
151   \textcolor{keyword}{call }mom\_error(fatal, &
152     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_init\_temperature\_salinity: "} // &
153     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
154 
155   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params
156 
157   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}
158 
159   t(:,:,1) = 0.0
160   s(:,:,1) = 0.0
161 
162   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
163 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_a6ec70f2ab81af41619df4db0f7da098f}\label{namespaceuser__initialization_a6ec70f2ab81af41619df4db0f7da098f}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+initialize\+\_\+sponges@{user\+\_\+initialize\+\_\+sponges}}
\index{user\+\_\+initialize\+\_\+sponges@{user\+\_\+initialize\+\_\+sponges}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+initialize\+\_\+sponges()}{user\_initialize\_sponges()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+initialize\+\_\+sponges (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{logical, intent(in)}]{use\+\_\+temp,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(sponge\+\_\+cs), pointer}]{C\+Sp,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, gv \%ke), intent(in)}]{h }\end{DoxyParamCaption})}



Set up the sponges. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & Ocean grid structure.\\
\hline
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure.\\
\hline
\mbox{\tt in}  & {\em use\+\_\+temp} & If true, temperature and salinity are state variables.\\
\hline
\mbox{\tt in}  & {\em tv} & A structure containing pointers to any available thermodynamic fields, potential temperature and salinity or mixed layer density. Absent fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
 & {\em csp} & A pointer to the sponge control structure.\\
\hline
\mbox{\tt in}  & {\em h} & Layer thicknesses \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 168 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
168   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: g\textcolor{comment}{             !< Ocean grid structure.}
169   \textcolor{keywordtype}{type}(verticalgrid\_type), \textcolor{keywordtype}{intent(in)} :: gv\textcolor{comment}{            !< The ocean's vertical grid structure.}
170   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)} :: use\_temp\textcolor{comment}{      !< If true, temperature and salinity are state
       variables.}
171   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),   \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{            !< A structure containing pointers}
172 \textcolor{comment}{                                                       !! to any available thermodynamic}
173 \textcolor{comment}{                                                       !! fields, potential temperature and}
174 \textcolor{comment}{                                                       !! salinity or mixed layer density.}
175 \textcolor{comment}{                                                       !! Absent fields have NULL ptrs.}
176   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{    !< A structure indicating the}
177 \textcolor{comment}{                                                       !! open file to parse for model}
178 \textcolor{comment}{                                                       !! parameter values.}
179   \textcolor{keywordtype}{type}(sponge\_cs),         \textcolor{keywordtype}{pointer}    :: csp\textcolor{comment}{           !< A pointer to the sponge control structure.}
180   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, &
181                            \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{             !< Layer thicknesses [H ~> m or kg m-2].}
182   \textcolor{keyword}{call }mom\_error(fatal, &
183     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_sponges: "} // &
184     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
185 
186   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
187 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_a3ee75fd9d1d059afb7f07ff13561a565}\label{namespaceuser__initialization_a3ee75fd9d1d059afb7f07ff13561a565}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+initialize\+\_\+thickness@{user\+\_\+initialize\+\_\+thickness}}
\index{user\+\_\+initialize\+\_\+thickness@{user\+\_\+initialize\+\_\+thickness}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+initialize\+\_\+thickness()}{user\_initialize\_thickness()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+initialize\+\_\+thickness (\begin{DoxyParamCaption}\item[{real, dimension(szi\+\_\+(g),szj\+\_\+(g),szk\+\_\+(gv)), intent(out)}]{h,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



initialize thicknesses. 


\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 out}  & {\em h} & The thicknesses being initialized \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
\mbox{\tt in}  & {\em just\+\_\+read\+\_\+params} & If present and true, this call will only read parameters without changing h. \\
\hline
\end{DoxyParams}


Definition at line 82 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
82   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: g\textcolor{comment}{  !< The ocean's grid structure.}
83   \textcolor{keywordtype}{type}(verticalgrid\_type), \textcolor{keywordtype}{intent(in)}  :: gv\textcolor{comment}{ !< The ocean's vertical grid structure.}
84   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, &
85                            \textcolor{keywordtype}{intent(out)} :: h\textcolor{comment}{  !< The thicknesses being initialized [H ~> m or kg m-2].}
86   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the open}
87 \textcolor{comment}{                                             !! file to parse for model parameter values.}
88   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}
89 \textcolor{comment}{                                             !! only read parameters without changing h.}
90 
91   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}
92 
93   \textcolor{keyword}{call }mom\_error(fatal, &
94     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_thickness: "} // &
95     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
96 
97   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params
98 
99   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}
100 
101   h(:,:,1) = 0.0 \textcolor{comment}{! h should be set [H ~> m or kg m-2].}
102 
103   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
104 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_ad48bbaeae8df60afdaffe34590d835ab}\label{namespaceuser__initialization_ad48bbaeae8df60afdaffe34590d835ab}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+initialize\+\_\+topography@{user\+\_\+initialize\+\_\+topography}}
\index{user\+\_\+initialize\+\_\+topography@{user\+\_\+initialize\+\_\+topography}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+initialize\+\_\+topography()}{user\_initialize\_topography()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+initialize\+\_\+topography (\begin{DoxyParamCaption}\item[{real, dimension(g\%isd\+:g\%ied,g\%jsd\+:g\%jed), intent(out)}]{D,  }\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{real, intent(in)}]{max\+\_\+depth,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in), optional}]{US }\end{DoxyParamCaption})}



Initialize topography. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & The dynamic horizontal grid type\\
\hline
\mbox{\tt out}  & {\em d} & Ocean bottom depth in m or Z if US is present\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & Parameter file structure\\
\hline
\mbox{\tt in}  & {\em max\+\_\+depth} & Maximum model depth in the units of D\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 63 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
63   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),          \textcolor{keywordtype}{intent(in)}  :: g\textcolor{comment}{ !< The dynamic horizontal grid type}
64   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(G%isd:G%ied,G%jsd:G%jed)}, &
65                                    \textcolor{keywordtype}{intent(out)} :: d\textcolor{comment}{ !< Ocean bottom depth in m or Z if US is present}
66   \textcolor{keywordtype}{type}(param\_file\_type),           \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}
67   \textcolor{keywordtype}{real},                            \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum model depth in the units of D}
68   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: us\textcolor{comment}{ !< A dimensional unit scaling type}
69 
70   \textcolor{keyword}{call }mom\_error(fatal, &
71     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_topography: "} // &
72     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
73 
74   d(:,:) = 0.0
75 
76   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
77 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_a757c666f3e23714d9ec76912c4aba048}\label{namespaceuser__initialization_a757c666f3e23714d9ec76912c4aba048}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+initialize\+\_\+velocity@{user\+\_\+initialize\+\_\+velocity}}
\index{user\+\_\+initialize\+\_\+velocity@{user\+\_\+initialize\+\_\+velocity}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+initialize\+\_\+velocity()}{user\_initialize\_velocity()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+initialize\+\_\+velocity (\begin{DoxyParamCaption}\item[{real, dimension(szib\+\_\+(g), szj\+\_\+(g), szk\+\_\+(g)), intent(out)}]{u,  }\item[{real, dimension(szi\+\_\+(g), szjb\+\_\+(g), szk\+\_\+(g)), intent(out)}]{v,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



initialize velocities. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em g} & Ocean grid structure.\\
\hline
\mbox{\tt out}  & {\em u} & i-\/component of velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]}\\
\hline
\mbox{\tt out}  & {\em v} & j-\/component of velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]}\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
\mbox{\tt in}  & {\em just\+\_\+read\+\_\+params} & If present and true, this call will only read parameters without changing h. \\
\hline
\end{DoxyParams}


Definition at line 109 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
109   \textcolor{keywordtype}{type}(ocean\_grid\_type),                       \textcolor{keywordtype}{intent(in)}  :: g\textcolor{comment}{ !< Ocean grid structure.}
110   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZIB\_(G), SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: u\textcolor{comment}{ !< i-component of velocity [L T-1 ~> m s-1]}
111   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(SZI\_(G), SZJB\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: v\textcolor{comment}{ !< j-component of velocity [L T-1 ~> m s-1]}
112   \textcolor{keywordtype}{type}(unit\_scale\_type),                       \textcolor{keywordtype}{intent(in)}  :: us\textcolor{comment}{ !< A dimensional unit scaling type}
113   \textcolor{keywordtype}{type}(param\_file\_type),                       \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}
114 \textcolor{comment}{                                                            !! open file to parse for model}
115 \textcolor{comment}{                                                            !! parameter values.}
116   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}
117 \textcolor{comment}{                                                      !! only read parameters without changing h.}
118 
119   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}
120 
121   \textcolor{keyword}{call }mom\_error(fatal, &
122     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_velocity: "} // &
123     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
124 
125   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params
126 
127   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}
128 
129   u(:,:,1) = 0.0
130   v(:,:,1) = 0.0
131 
132   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
133 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_afb05f538d59bbae7856b965ae16f6000}\label{namespaceuser__initialization_afb05f538d59bbae7856b965ae16f6000}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+set\+\_\+coord@{user\+\_\+set\+\_\+coord}}
\index{user\+\_\+set\+\_\+coord@{user\+\_\+set\+\_\+coord}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+set\+\_\+coord()}{user\_set\_coord()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+set\+\_\+coord (\begin{DoxyParamCaption}\item[{real, dimension(gv\%ke), intent(out)}]{Rlay,  }\item[{real, dimension(gv\%ke+1), intent(out)}]{g\+\_\+prime,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(eos\+\_\+type), pointer}]{eqn\+\_\+of\+\_\+state }\end{DoxyParamCaption})}



Set vertical coordinates. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure\\
\hline
\mbox{\tt out}  & {\em rlay} & Layer potential density \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em g\+\_\+prime} & The reduced gravity at each interface \mbox{[}L2 Z-\/1 T-\/2 $\sim$$>$ m s-\/2\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
 & {\em eqn\+\_\+of\+\_\+state} & Equation of state structure \\
\hline
\end{DoxyParams}


Definition at line 41 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
41   \textcolor{keywordtype}{type}(verticalgrid\_type),  \textcolor{keywordtype}{intent(in)}  :: gv\textcolor{comment}{      !< The ocean's vertical grid structure}
42   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(GV%ke)},   \textcolor{keywordtype}{intent(out)} :: rlay\textcolor{comment}{    !< Layer potential density [R ~> kg m-3].}
43   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(GV%ke+1)}, \textcolor{keywordtype}{intent(out)} :: g\_prime\textcolor{comment}{ !< The reduced gravity at each}
44 \textcolor{comment}{                                                   !! interface [L2 Z-1 T-2 ~> m s-2].}
45   \textcolor{keywordtype}{type}(unit\_scale\_type),    \textcolor{keywordtype}{intent(in)}  :: us\textcolor{comment}{      !< A dimensional unit scaling type}
46   \textcolor{keywordtype}{type}(param\_file\_type),    \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}
47 \textcolor{comment}{                                                   !! open file to parse for model}
48 \textcolor{comment}{                                                   !! parameter values.}
49   \textcolor{keywordtype}{type}(eos\_type),           \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}
50 
51   \textcolor{keyword}{call }mom\_error(fatal, &
52     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_set\_coord: "} // &
53     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
54   rlay(:) = 0.0
55   g\_prime(:) = 0.0
56 
57   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
58 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_a257e5194c434ba287d296f7a228c6a0c}\label{namespaceuser__initialization_a257e5194c434ba287d296f7a228c6a0c}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+set\+\_\+obc\+\_\+data@{user\+\_\+set\+\_\+obc\+\_\+data}}
\index{user\+\_\+set\+\_\+obc\+\_\+data@{user\+\_\+set\+\_\+obc\+\_\+data}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+set\+\_\+obc\+\_\+data()}{user\_set\_obc\_data()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+set\+\_\+obc\+\_\+data (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+obc\+\_\+type), pointer}]{O\+BC,  }\item[{type(thermo\+\_\+var\+\_\+ptrs), intent(in)}]{tv,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(tracer\+\_\+registry\+\_\+type), pointer}]{tr\+\_\+\+Reg }\end{DoxyParamCaption})}



This subroutine sets the properties of flow at open boundary conditions. 


\begin{DoxyParams}[1]{Parameters}
 & {\em obc} & This open boundary condition type specifies whether, where, and what open boundary conditions are used.\\
\hline
\mbox{\tt in}  & {\em tv} & A structure containing pointers to any available thermodynamic fields, including potential temperature and salinity or mixed layer density. Absent fields have N\+U\+LL ptrs.\\
\hline
\mbox{\tt in}  & {\em g} & The ocean\textquotesingle{}s grid structure.\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values.\\
\hline
 & {\em tr\+\_\+reg} & Tracer registry. \\
\hline
\end{DoxyParams}


Definition at line 192 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
192   \textcolor{keywordtype}{type}(ocean\_obc\_type),       \textcolor{keywordtype}{pointer}    :: obc\textcolor{comment}{   !< This open boundary condition type specifies}
193 \textcolor{comment}{                                                  !! whether, where, and what open boundary}
194 \textcolor{comment}{                                                  !! conditions are used.}
195   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),      \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{    !< A structure containing pointers to any}
196 \textcolor{comment}{                                       !! available thermodynamic fields, including potential}
197 \textcolor{comment}{                                       !! temperature and salinity or mixed layer density. Absent}
198 \textcolor{comment}{                                       !! fields have NULL ptrs.}
199   \textcolor{keywordtype}{type}(ocean\_grid\_type),      \textcolor{keywordtype}{intent(in)} :: g\textcolor{comment}{     !< The ocean's grid structure.}
200   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the}
201 \textcolor{comment}{                                                  !! open file to parse for model}
202 \textcolor{comment}{                                                  !! parameter values.}
203   \textcolor{keywordtype}{type}(tracer\_registry\_type), \textcolor{keywordtype}{pointer}    :: tr\_reg\textcolor{comment}{ !< Tracer registry.}
204 \textcolor{comment}{!  call MOM\_error(FATAL, &}
205 \textcolor{comment}{!   "USER\_initialization.F90, USER\_set\_OBC\_data: " // &}
206 \textcolor{comment}{!   "Unmodified user routine called - you must edit the routine to use it")}
207 
208   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
209 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_a83f001dcb5625d866c1265120a248e3c}\label{namespaceuser__initialization_a83f001dcb5625d866c1265120a248e3c}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!user\+\_\+set\+\_\+rotation@{user\+\_\+set\+\_\+rotation}}
\index{user\+\_\+set\+\_\+rotation@{user\+\_\+set\+\_\+rotation}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{user\+\_\+set\+\_\+rotation()}{user\_set\_rotation()}}
{\footnotesize\ttfamily subroutine, public user\+\_\+initialization\+::user\+\_\+set\+\_\+rotation (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})}


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 213 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
213   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{    !< The ocean's grid structure}
214   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
215   \textcolor{keyword}{call }mom\_error(fatal, &
216     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_set\_rotation: "} // &
217     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})
218 
219   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)
220 
\end{DoxyCode}
\mbox{\Hypertarget{namespaceuser__initialization_aebfc0db710e83bae83f08e1a774256dd}\label{namespaceuser__initialization_aebfc0db710e83bae83f08e1a774256dd}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!write\+\_\+user\+\_\+log@{write\+\_\+user\+\_\+log}}
\index{write\+\_\+user\+\_\+log@{write\+\_\+user\+\_\+log}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{write\+\_\+user\+\_\+log()}{write\_user\_log()}}
{\footnotesize\ttfamily subroutine user\+\_\+initialization\+::write\+\_\+user\+\_\+log (\begin{DoxyParamCaption}\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Write output about the parameter values being used. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
\end{DoxyParams}


Definition at line 225 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
225   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the}
226 \textcolor{comment}{                                                  !! open file to parse for model}
227 \textcolor{comment}{                                                  !! parameter values.}
228 
229 \textcolor{comment}{! This include declares and sets the variable "version".}
230 \textcolor{preprocessor}{#include "version\_variable.h"}
231 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"user\_initialization"} \textcolor{comment}{! This module's name.}
232 
233   \textcolor{keyword}{call }log\_version(param\_file, mdl, version)
234   first\_call = .false.
235 
\end{DoxyCode}


\subsection{Variable Documentation}
\mbox{\Hypertarget{namespaceuser__initialization_a91c73478b39de720dde435a23d96c2bb}\label{namespaceuser__initialization_a91c73478b39de720dde435a23d96c2bb}} 
\index{user\+\_\+initialization@{user\+\_\+initialization}!first\+\_\+call@{first\+\_\+call}}
\index{first\+\_\+call@{first\+\_\+call}!user\+\_\+initialization@{user\+\_\+initialization}}
\subsubsection{\texorpdfstring{first\+\_\+call}{first\_call}}
{\footnotesize\ttfamily logical user\+\_\+initialization\+::first\+\_\+call = .true.\hspace{0.3cm}{\ttfamily [private]}}



A module variable that should not be used. 

\begin{DoxyRefDesc}{Todo}
\item[\hyperlink{todo__todo000022}{Todo}]Move this module variable into a control structure. \end{DoxyRefDesc}


Definition at line 35 of file user\+\_\+initialization.\+F90.


\begin{DoxyCode}
35 \textcolor{keywordtype}{logical} :: first\_call = .true.
\end{DoxyCode}
