\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 \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\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 \mbox{\hyperlink{namespaceuser__initialization_a83f001dcb5625d866c1265120a248e3c}{user\+\_\+set\+\_\+rotation}} (G, param\+\_\+file)
\item 
subroutine \mbox{\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 \mbox{\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{\texttt{ in}}  & {\em g} & Ocean grid structure. \\
\hline
\mbox{\texttt{ out}}  & {\em t} & Potential temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em s} & Salinity \mbox{[}ppt\mbox{]}. \\
\hline
\mbox{\texttt{ 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{\texttt{ 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}{0}
\DoxyCodeLine{139   \textcolor{keywordtype}{type}(ocean\_grid\_type),                     \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< Ocean grid structure.}}
\DoxyCodeLine{140 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: T\textcolor{comment}{ !< Potential temperature [degC].}}
\DoxyCodeLine{141 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: S\textcolor{comment}{ !< Salinity [ppt].}}
\DoxyCodeLine{142   \textcolor{keywordtype}{type}(param\_file\_type),                     \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}}
\DoxyCodeLine{143 \textcolor{comment}{                                                            !! open file to parse for model}}
\DoxyCodeLine{144 \textcolor{comment}{                                                            !! parameter values.}}
\DoxyCodeLine{145   \textcolor{keywordtype}{type}(EOS\_type),                            \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}}
\DoxyCodeLine{146   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will only}}
\DoxyCodeLine{147 \textcolor{comment}{                                                           !! read parameters without changing T \& S.}}
\DoxyCodeLine{148 }
\DoxyCodeLine{149   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{150 }
\DoxyCodeLine{151   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{152     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_init\_temperature\_salinity: "} // \&}
\DoxyCodeLine{153     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{154 }
\DoxyCodeLine{155   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{158 }
\DoxyCodeLine{159   t(:,:,1) = 0.0}
\DoxyCodeLine{160   s(:,:,1) = 0.0}
\DoxyCodeLine{161 }
\DoxyCodeLine{162   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in}}  & {\em g} & Ocean grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em use\+\_\+temp} & If true, temperature and salinity are state variables. \\
\hline
\mbox{\texttt{ 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{\texttt{ 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{\texttt{ 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}{0}
\DoxyCodeLine{168   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{             !< Ocean grid structure.}}
\DoxyCodeLine{169   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)} :: GV\textcolor{comment}{            !< The ocean's vertical grid structure.}}
\DoxyCodeLine{170   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{intent(in)} :: use\_temp\textcolor{comment}{      !< If true, temperature and salinity are state variables.}}
\DoxyCodeLine{171   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),   \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{            !< A structure containing pointers}}
\DoxyCodeLine{172 \textcolor{comment}{                                                       !! to any available thermodynamic}}
\DoxyCodeLine{173 \textcolor{comment}{                                                       !! fields, potential temperature and}}
\DoxyCodeLine{174 \textcolor{comment}{                                                       !! salinity or mixed layer density.}}
\DoxyCodeLine{175 \textcolor{comment}{                                                       !! Absent fields have NULL ptrs.}}
\DoxyCodeLine{176   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{    !< A structure indicating the}}
\DoxyCodeLine{177 \textcolor{comment}{                                                       !! open file to parse for model}}
\DoxyCodeLine{178 \textcolor{comment}{                                                       !! parameter values.}}
\DoxyCodeLine{179   \textcolor{keywordtype}{type}(sponge\_CS),         \textcolor{keywordtype}{pointer}    :: CSp\textcolor{comment}{           !< A pointer to the sponge control structure.}}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \&}
\DoxyCodeLine{181                            \textcolor{keywordtype}{intent(in)} :: h\textcolor{comment}{             !< Layer thicknesses [H ~> m or kg m-2].}}
\DoxyCodeLine{182   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{183     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_sponges: "} // \&}
\DoxyCodeLine{184     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{185 }
\DoxyCodeLine{186   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ out}}  & {\em h} & The thicknesses being initialized \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{82   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{  !< The ocean's grid structure.}}
\DoxyCodeLine{83   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{ !< The ocean's vertical grid structure.}}
\DoxyCodeLine{84 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \&}
\DoxyCodeLine{85                            \textcolor{keywordtype}{intent(out)} :: h\textcolor{comment}{  !< The thicknesses being initialized [H ~> m or kg m-2].}}
\DoxyCodeLine{86   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the open}}
\DoxyCodeLine{87 \textcolor{comment}{                                             !! file to parse for model parameter values.}}
\DoxyCodeLine{88   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}}
\DoxyCodeLine{89 \textcolor{comment}{                                             !! only read parameters without changing h.}}
\DoxyCodeLine{90 }
\DoxyCodeLine{91   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{92 }
\DoxyCodeLine{93   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{94     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_thickness: "} // \&}
\DoxyCodeLine{95     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{96 }
\DoxyCodeLine{97   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{98 }
\DoxyCodeLine{99   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{100 }
\DoxyCodeLine{101   h(:,:,1) = 0.0 \textcolor{comment}{! h should be set [H ~> m or kg m-2].}}
\DoxyCodeLine{102 }
\DoxyCodeLine{103   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in}}  & {\em g} & The dynamic horizontal grid type \\
\hline
\mbox{\texttt{ out}}  & {\em d} & Ocean bottom depth in m or Z if US is present \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\hline
\mbox{\texttt{ in}}  & {\em max\+\_\+depth} & Maximum model depth in the units of D \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{63   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),          \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< The dynamic horizontal grid type}}
\DoxyCodeLine{64 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:G\%ied,G\%jsd:G\%jed)}, \&}
\DoxyCodeLine{65                                    \textcolor{keywordtype}{intent(out)} :: D\textcolor{comment}{ !< Ocean bottom depth in m or Z if US is present}}
\DoxyCodeLine{66   \textcolor{keywordtype}{type}(param\_file\_type),           \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{67 \textcolor{keywordtype}{  real},                            \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum model depth in the units of D}}
\DoxyCodeLine{68   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{69 }
\DoxyCodeLine{70   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{71     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_topography: "} // \&}
\DoxyCodeLine{72     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{73 }
\DoxyCodeLine{74   d(:,:) = 0.0}
\DoxyCodeLine{75 }
\DoxyCodeLine{76   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in}}  & {\em g} & Ocean grid structure. \\
\hline
\mbox{\texttt{ out}}  & {\em u} & i-\/component of velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em v} & j-\/component of velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure indicating the open file to parse for model parameter values. \\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{109   \textcolor{keywordtype}{type}(ocean\_grid\_type),                       \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< Ocean grid structure.}}
\DoxyCodeLine{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]}}
\DoxyCodeLine{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]}}
\DoxyCodeLine{112   \textcolor{keywordtype}{type}(unit\_scale\_type),                       \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{113   \textcolor{keywordtype}{type}(param\_file\_type),                       \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}}
\DoxyCodeLine{114 \textcolor{comment}{                                                            !! open file to parse for model}}
\DoxyCodeLine{115 \textcolor{comment}{                                                            !! parameter values.}}
\DoxyCodeLine{116   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}}
\DoxyCodeLine{117 \textcolor{comment}{                                                      !! only read parameters without changing h.}}
\DoxyCodeLine{118 }
\DoxyCodeLine{119   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{120 }
\DoxyCodeLine{121   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{122     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_initialize\_velocity: "} // \&}
\DoxyCodeLine{123     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{124 }
\DoxyCodeLine{125   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{126 }
\DoxyCodeLine{127   \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{128 }
\DoxyCodeLine{129   u(:,:,1) = 0.0}
\DoxyCodeLine{130   v(:,:,1) = 0.0}
\DoxyCodeLine{131 }
\DoxyCodeLine{132   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure \\
\hline
\mbox{\texttt{ out}}  & {\em rlay} & Layer potential density \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em g\+\_\+prime} & The reduced gravity at each interface \mbox{[}L2 Z-\/1 T-\/2 $\sim$$>$ m s-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{41   \textcolor{keywordtype}{type}(verticalGrid\_type),  \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{      !< The ocean's vertical grid structure}}
\DoxyCodeLine{42 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(GV\%ke)},   \textcolor{keywordtype}{intent(out)} :: Rlay\textcolor{comment}{    !< Layer potential density [R ~> kg m-3].}}
\DoxyCodeLine{43 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(GV\%ke+1)}, \textcolor{keywordtype}{intent(out)} :: g\_prime\textcolor{comment}{ !< The reduced gravity at each}}
\DoxyCodeLine{44 \textcolor{comment}{                                                   !! interface [L2 Z-1 T-2 ~> m s-2].}}
\DoxyCodeLine{45   \textcolor{keywordtype}{type}(unit\_scale\_type),    \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{      !< A dimensional unit scaling type}}
\DoxyCodeLine{46   \textcolor{keywordtype}{type}(param\_file\_type),    \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< A structure indicating the}}
\DoxyCodeLine{47 \textcolor{comment}{                                                   !! open file to parse for model}}
\DoxyCodeLine{48 \textcolor{comment}{                                                   !! parameter values.}}
\DoxyCodeLine{49   \textcolor{keywordtype}{type}(EOS\_type),           \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}}
\DoxyCodeLine{50 }
\DoxyCodeLine{51   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{52     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_set\_coord: "} // \&}
\DoxyCodeLine{53     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{54   rlay(:) = 0.0}
\DoxyCodeLine{55   g\_prime(:) = 0.0}
\DoxyCodeLine{56 }
\DoxyCodeLine{57   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ 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{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{192   \textcolor{keywordtype}{type}(ocean\_OBC\_type),       \textcolor{keywordtype}{pointer}    :: OBC\textcolor{comment}{   !< This open boundary condition type specifies}}
\DoxyCodeLine{193 \textcolor{comment}{                                                  !! whether, where, and what open boundary}}
\DoxyCodeLine{194 \textcolor{comment}{                                                  !! conditions are used.}}
\DoxyCodeLine{195   \textcolor{keywordtype}{type}(thermo\_var\_ptrs),      \textcolor{keywordtype}{intent(in)} :: tv\textcolor{comment}{    !< A structure containing pointers to any}}
\DoxyCodeLine{196 \textcolor{comment}{                                       !! available thermodynamic fields, including potential}}
\DoxyCodeLine{197 \textcolor{comment}{                                       !! temperature and salinity or mixed layer density. Absent}}
\DoxyCodeLine{198 \textcolor{comment}{                                       !! fields have NULL ptrs.}}
\DoxyCodeLine{199   \textcolor{keywordtype}{type}(ocean\_grid\_type),      \textcolor{keywordtype}{intent(in)} :: G\textcolor{comment}{     !< The ocean's grid structure.}}
\DoxyCodeLine{200   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the}}
\DoxyCodeLine{201 \textcolor{comment}{                                                  !! open file to parse for model}}
\DoxyCodeLine{202 \textcolor{comment}{                                                  !! parameter values.}}
\DoxyCodeLine{203   \textcolor{keywordtype}{type}(tracer\_registry\_type), \textcolor{keywordtype}{pointer}    :: tr\_Reg\textcolor{comment}{ !< Tracer registry.}}
\DoxyCodeLine{204 \textcolor{comment}{!  call MOM\_error(FATAL, \&}}
\DoxyCodeLine{205 \textcolor{comment}{!   "USER\_initialization.F90, USER\_set\_OBC\_data: " // \&}}
\DoxyCodeLine{206 \textcolor{comment}{!   "Unmodified user routine called - you must edit the routine to use it")}}
\DoxyCodeLine{207 }
\DoxyCodeLine{208   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{213   \textcolor{keywordtype}{type}(ocean\_grid\_type), \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{    !< The ocean's grid structure}}
\DoxyCodeLine{214   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}}
\DoxyCodeLine{215   \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{216     \textcolor{stringliteral}{"USER\_initialization.F90, USER\_set\_rotation: "} // \&}
\DoxyCodeLine{217     \textcolor{stringliteral}{"Unmodified user routine called - you must edit the routine to use it"})}
\DoxyCodeLine{218 }
\DoxyCodeLine{219   \textcolor{keywordflow}{if} (first\_call) \textcolor{keyword}{call }write\_user\_log(param\_file)}
\DoxyCodeLine{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{\texttt{ 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}{0}
\DoxyCodeLine{225   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: param\_file\textcolor{comment}{ !< A structure indicating the}}
\DoxyCodeLine{226 \textcolor{comment}{                                                  !! open file to parse for model}}
\DoxyCodeLine{227 \textcolor{comment}{                                                  !! parameter values.}}
\DoxyCodeLine{228 }
\DoxyCodeLine{229 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{230 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{231 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"user\_initialization"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{232 }
\DoxyCodeLine{233   \textcolor{keyword}{call }log\_version(param\_file, mdl, version)}
\DoxyCodeLine{234   first\_call = .false.}
\DoxyCodeLine{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[\mbox{\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}{0}
\DoxyCodeLine{35 \textcolor{keywordtype}{logical} :: first\_call = .true.}

\end{DoxyCode}
