\hypertarget{namespaceseamount__initialization}{}\section{seamount\+\_\+initialization Module Reference}
\label{namespaceseamount__initialization}\index{seamount\_initialization@{seamount\_initialization}}


\subsection{Detailed Description}
Configures the model for the idealized seamount test case. \subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespaceseamount__initialization_ad0d12dd03f77e4a827fcd925805b92c9}{seamount\+\_\+initialize\+\_\+topography}} (D, G, param\+\_\+file, max\+\_\+depth)
\begin{DoxyCompactList}\small\item\em Initialization of topography. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceseamount__initialization_ad5f7f13908f6034e5bbf441102504f10}{seamount\+\_\+initialize\+\_\+thickness}} (h, G, GV, US, param\+\_\+file, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em Initialization of thicknesses. This subroutine initializes the layer thicknesses to be uniform. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespaceseamount__initialization_a93a0127708fa1ff76da93c2acf1af20c}{seamount\+\_\+initialize\+\_\+temperature\+\_\+salinity}} (T, S, h, G, GV, param\+\_\+file, eqn\+\_\+of\+\_\+state, just\+\_\+read\+\_\+params)
\begin{DoxyCompactList}\small\item\em Initial values for temperature and salinity. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespaceseamount__initialization_a0d8657a6fb1677d3f6b08b8923eb23f2}\label{namespaceseamount__initialization_a0d8657a6fb1677d3f6b08b8923eb23f2}} 
character(len=40) \mbox{\hyperlink{namespaceseamount__initialization_a0d8657a6fb1677d3f6b08b8923eb23f2}{mdl}} = \char`\"{}seamount\+\_\+initialization\char`\"{}
\begin{DoxyCompactList}\small\item\em This module\textquotesingle{}s name. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespaceseamount__initialization_a93a0127708fa1ff76da93c2acf1af20c}\label{namespaceseamount__initialization_a93a0127708fa1ff76da93c2acf1af20c}} 
\index{seamount\_initialization@{seamount\_initialization}!seamount\_initialize\_temperature\_salinity@{seamount\_initialize\_temperature\_salinity}}
\index{seamount\_initialize\_temperature\_salinity@{seamount\_initialize\_temperature\_salinity}!seamount\_initialization@{seamount\_initialization}}
\subsubsection{\texorpdfstring{seamount\_initialize\_temperature\_salinity()}{seamount\_initialize\_temperature\_salinity()}}
{\footnotesize\ttfamily subroutine, public seamount\+\_\+initialization\+::seamount\+\_\+initialize\+\_\+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[{real, dimension(szi\+\_\+(g),szj\+\_\+(g), szk\+\_\+(g)), intent(in)}]{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[{type(eos\+\_\+type), pointer}]{eqn\+\_\+of\+\_\+state,  }\item[{logical, intent(in), optional}]{just\+\_\+read\+\_\+params }\end{DoxyParamCaption})}



Initial values for temperature and salinity. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & Ocean grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical 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 h} & Layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\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 h. \\
\hline
\end{DoxyParams}


Definition at line 196 of file seamount\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{196   \textcolor{keywordtype}{type}(ocean\_grid\_type),                     \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< Ocean grid structure}}
\DoxyCodeLine{197   \textcolor{keywordtype}{type}(verticalGrid\_type),                   \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{ !< Vertical grid structure}}
\DoxyCodeLine{198 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: T\textcolor{comment}{ !< Potential temperature [degC]}}
\DoxyCodeLine{199 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(out)} :: S\textcolor{comment}{ !< Salinity [ppt]}}
\DoxyCodeLine{200 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G), SZK\_(G))}, \textcolor{keywordtype}{intent(in)}  :: h\textcolor{comment}{ !< Layer thickness [H ~> m or kg m-2]}}
\DoxyCodeLine{201   \textcolor{keywordtype}{type}(param\_file\_type),                     \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{202   \textcolor{keywordtype}{type}(EOS\_type),                            \textcolor{keywordtype}{pointer}     :: eqn\_of\_state\textcolor{comment}{ !< Equation of state structure}}
\DoxyCodeLine{203   \textcolor{keywordtype}{logical},       \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: just\_read\_params\textcolor{comment}{ !< If present and true, this call will}}
\DoxyCodeLine{204 \textcolor{comment}{                                                      !! only read parameters without changing h.}}
\DoxyCodeLine{205 }
\DoxyCodeLine{206   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{207   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz, k\_light}
\DoxyCodeLine{208 \textcolor{keywordtype}{  real}    :: xi0, xi1, dxi, r, S\_surf, T\_surf, S\_range, T\_range}
\DoxyCodeLine{209 \textcolor{keywordtype}{  real}    :: T\_ref, T\_Light, T\_Dense, S\_ref, S\_Light, S\_Dense, a1, frac\_dense, k\_frac, res\_rat}
\DoxyCodeLine{210   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{211   \textcolor{keywordtype}{character(len=20)} :: verticalCoordinate, density\_profile}
\DoxyCodeLine{212 }
\DoxyCodeLine{213   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{214 }
\DoxyCodeLine{215   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{216 }
\DoxyCodeLine{217   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REGRIDDING\_COORDINATE\_MODE"}, verticalcoordinate, \&}
\DoxyCodeLine{218                  default=default\_coordinate\_mode, do\_not\_log=just\_read)}
\DoxyCodeLine{219   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_DENSITY\_PROFILE"}, density\_profile, \&}
\DoxyCodeLine{220                  \textcolor{stringliteral}{'Initial profile shape. Valid values are "linear", "parabolic" '}//\&}
\DoxyCodeLine{221                  \textcolor{stringliteral}{'and "exponential".'}, default=\textcolor{stringliteral}{'linear'}, do\_not\_log=just\_read)}
\DoxyCodeLine{222   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_SSS"}, s\_surf, \&}
\DoxyCodeLine{223                  \textcolor{stringliteral}{'Initial surface salinity'}, units=\textcolor{stringliteral}{'1e-3'}, default=34., do\_not\_log=just\_read)}
\DoxyCodeLine{224   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_SST"}, t\_surf, \&}
\DoxyCodeLine{225                  \textcolor{stringliteral}{'Initial surface temperature'}, units=\textcolor{stringliteral}{'C'}, default=0., do\_not\_log=just\_read)}
\DoxyCodeLine{226   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_S\_RANGE"}, s\_range, \&}
\DoxyCodeLine{227                  \textcolor{stringliteral}{'Initial salinity range (bottom - surface)'}, units=\textcolor{stringliteral}{'1e-3'}, \&}
\DoxyCodeLine{228                  default=2., do\_not\_log=just\_read)}
\DoxyCodeLine{229   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_T\_RANGE"}, t\_range, \&}
\DoxyCodeLine{230                  \textcolor{stringliteral}{'Initial temperature range (bottom - surface)'}, units=\textcolor{stringliteral}{'C'}, \&}
\DoxyCodeLine{231                  default=0., do\_not\_log=just\_read)}
\DoxyCodeLine{232 }
\DoxyCodeLine{233   \textcolor{keywordflow}{select case} ( coordinatemode(verticalcoordinate) )}
\DoxyCodeLine{234     \textcolor{keywordflow}{case} ( regridding\_layer ) \textcolor{comment}{! Initial thicknesses for layer isopycnal coordinates}}
\DoxyCodeLine{235       \textcolor{comment}{! These parameters are used in MOM\_fixed\_initialization.F90 when CONFIG\_COORD="ts\_range"}}
\DoxyCodeLine{236       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"T\_REF"}, t\_ref, default=10.0, do\_not\_log=.true.)}
\DoxyCodeLine{237       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_T\_LIGHT"}, t\_light, default=t\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{238       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_T\_DENSE"}, t\_dense, default=t\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{239       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"S\_REF"}, s\_ref, default=35.0, do\_not\_log=.true.)}
\DoxyCodeLine{240       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_LIGHT"}, s\_light, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{241       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_DENSE"}, s\_dense, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{242       \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_RESOLN\_RATIO"}, res\_rat, default=1.0, do\_not\_log=.true.)}
\DoxyCodeLine{243       \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{244 }
\DoxyCodeLine{245       \textcolor{comment}{! Emulate the T,S used in the "ts\_range" coordinate configuration code}}
\DoxyCodeLine{246       k\_light = gv\%nk\_rho\_varies + 1}
\DoxyCodeLine{247       \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{248         t(i,j,k\_light) = t\_light ; s(i,j,k\_light) = s\_light}
\DoxyCodeLine{249 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{250       a1 = 2.0 * res\_rat / (1.0 + res\_rat)}
\DoxyCodeLine{251       \textcolor{keywordflow}{do} k=k\_light+1,nz}
\DoxyCodeLine{252         k\_frac = real(k-k\_light)/real(nz-k\_light)}
\DoxyCodeLine{253         frac\_dense = a1 * k\_frac + (1.0 - a1) * k\_frac**2}
\DoxyCodeLine{254         \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{255           t(i,j,k) = frac\_dense * (t\_dense - t\_light) + t\_light}
\DoxyCodeLine{256           s(i,j,k) = frac\_dense * (s\_dense - s\_light) + s\_light}
\DoxyCodeLine{257 \textcolor{keywordflow}{        enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{258 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{259     \textcolor{keywordflow}{case} ( regridding\_sigma, regridding\_zstar, regridding\_rho ) \textcolor{comment}{! All other coordinate use FV initialization}}
\DoxyCodeLine{260       \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{261       \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{262         xi0 = 0.0}
\DoxyCodeLine{263         \textcolor{keywordflow}{do} k = 1,nz}
\DoxyCodeLine{264           xi1 = xi0 + gv\%H\_to\_Z * h(i,j,k) / g\%max\_depth}
\DoxyCodeLine{265           \textcolor{keywordflow}{select case} ( trim(density\_profile) )}
\DoxyCodeLine{266             \textcolor{keywordflow}{case} (\textcolor{stringliteral}{'linear'})}
\DoxyCodeLine{267              \textcolor{comment}{!S(i,j,k) = S\_surf + S\_range * 0.5 * (xi0 + xi1)}}
\DoxyCodeLine{268               s(i,j,k) = s\_surf + ( 0.5 * s\_range ) * (xi0 + xi1) \textcolor{comment}{! Coded this way to reproduce old hard-coded answers}}
\DoxyCodeLine{269               t(i,j,k) = t\_surf + t\_range * 0.5 * (xi0 + xi1)}
\DoxyCodeLine{270             \textcolor{keywordflow}{case} (\textcolor{stringliteral}{'parabolic'})}
\DoxyCodeLine{271               s(i,j,k) = s\_surf + s\_range * (2.0 / 3.0) * (xi1**3 - xi0**3) / (xi1 - xi0)}
\DoxyCodeLine{272               t(i,j,k) = t\_surf + t\_range * (2.0 / 3.0) * (xi1**3 - xi0**3) / (xi1 - xi0)}
\DoxyCodeLine{273             \textcolor{keywordflow}{case} (\textcolor{stringliteral}{'exponential'})}
\DoxyCodeLine{274               r = 0.8 \textcolor{comment}{! small values give sharp profiles}}
\DoxyCodeLine{275               s(i,j,k) = s\_surf + s\_range * (exp(xi1/r)-exp(xi0/r)) / (xi1 - xi0)}
\DoxyCodeLine{276               t(i,j,k) = t\_surf + t\_range * (exp(xi1/r)-exp(xi0/r)) / (xi1 - xi0)}
\DoxyCodeLine{277 \textcolor{keywordflow}{            case default}}
\DoxyCodeLine{278               \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'Unknown value for "INITIAL\_DENSITY\_PROFILE"'})}
\DoxyCodeLine{279 \textcolor{keywordflow}{          end select}}
\DoxyCodeLine{280           xi0 = xi1}
\DoxyCodeLine{281 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{282 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{283 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{284 }

\end{DoxyCode}
\mbox{\Hypertarget{namespaceseamount__initialization_ad5f7f13908f6034e5bbf441102504f10}\label{namespaceseamount__initialization_ad5f7f13908f6034e5bbf441102504f10}} 
\index{seamount\_initialization@{seamount\_initialization}!seamount\_initialize\_thickness@{seamount\_initialize\_thickness}}
\index{seamount\_initialize\_thickness@{seamount\_initialize\_thickness}!seamount\_initialization@{seamount\_initialization}}
\subsubsection{\texorpdfstring{seamount\_initialize\_thickness()}{seamount\_initialize\_thickness()}}
{\footnotesize\ttfamily subroutine, public seamount\+\_\+initialization\+::seamount\+\_\+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(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})}



Initialization of thicknesses. This subroutine initializes the layer thicknesses to be uniform. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g} & The ocean\textquotesingle{}s grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & The ocean\textquotesingle{}s vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ out}}  & {\em h} & The thickness that is 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 81 of file seamount\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{81   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{           !< The ocean's grid structure.}}
\DoxyCodeLine{82   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}  :: GV\textcolor{comment}{          !< The ocean's vertical grid structure.}}
\DoxyCodeLine{83   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}  :: US\textcolor{comment}{          !< A dimensional unit scaling type}}
\DoxyCodeLine{84 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(GV))}, \&}
\DoxyCodeLine{85                            \textcolor{keywordtype}{intent(out)} :: h\textcolor{comment}{           !< The thickness that is 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 file}}
\DoxyCodeLine{87 \textcolor{comment}{                                                      !! 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}{  real} :: e0(SZK\_(G)+1)   \textcolor{comment}{! The resting interface heights [Z ~> m], usually}}
\DoxyCodeLine{92                           \textcolor{comment}{! negative because it is positive upward.}}
\DoxyCodeLine{93 \textcolor{keywordtype}{  real} :: eta1D(SZK\_(G)+1)\textcolor{comment}{! Interface height relative to the sea surface}}
\DoxyCodeLine{94                           \textcolor{comment}{! positive upward [Z ~> m].}}
\DoxyCodeLine{95 \textcolor{keywordtype}{  real} :: min\_thickness   \textcolor{comment}{! The minimum layer thicknesses [Z ~> m].}}
\DoxyCodeLine{96 \textcolor{keywordtype}{  real} :: S\_surf, S\_range, S\_ref, S\_light, S\_dense \textcolor{comment}{! Various salinities [ppt].}}
\DoxyCodeLine{97 \textcolor{keywordtype}{  real} :: eta\_IC\_quanta   \textcolor{comment}{! The granularity of quantization of intial interface heights [Z-1 ~> m-1].}}
\DoxyCodeLine{98   \textcolor{keywordtype}{character(len=20)} :: verticalCoordinate}
\DoxyCodeLine{99   \textcolor{keywordtype}{logical} :: just\_read    \textcolor{comment}{! If true, just read parameters but set nothing.}}
\DoxyCodeLine{100   \textcolor{keywordtype}{integer} :: i, j, k, is, ie, js, je, nz}
\DoxyCodeLine{101 }
\DoxyCodeLine{102   is = g\%isc ; ie = g\%iec ; js = g\%jsc ; je = g\%jec ; nz = g\%ke}
\DoxyCodeLine{103 }
\DoxyCodeLine{104   just\_read = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(just\_read\_params)) just\_read = just\_read\_params}
\DoxyCodeLine{105 }
\DoxyCodeLine{106   \textcolor{keywordflow}{if} (.not.just\_read) \&}
\DoxyCodeLine{107     \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"MOM\_initialization.F90, initialize\_thickness\_uniform: setting thickness"})}
\DoxyCodeLine{108 }
\DoxyCodeLine{109   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"MIN\_THICKNESS"},min\_thickness, \&}
\DoxyCodeLine{110                 \textcolor{stringliteral}{'Minimum thickness for layer'}, \&}
\DoxyCodeLine{111                  units=\textcolor{stringliteral}{'m'}, default=1.0e-3, do\_not\_log=just\_read, scale=us\%m\_to\_Z)}
\DoxyCodeLine{112   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"REGRIDDING\_COORDINATE\_MODE"},verticalcoordinate, \&}
\DoxyCodeLine{113                  default=default\_coordinate\_mode, do\_not\_log=just\_read)}
\DoxyCodeLine{114 }
\DoxyCodeLine{115   \textcolor{comment}{! WARNING: this routine specifies the interface heights so that the last layer}}
\DoxyCodeLine{116   \textcolor{comment}{!          is vanished, even at maximum depth. In order to have a uniform}}
\DoxyCodeLine{117   \textcolor{comment}{!          layer distribution, use this line of code within the loop:}}
\DoxyCodeLine{118   \textcolor{comment}{!          e0(k) = -G\%max\_depth * real(k-1) / real(nz)}}
\DoxyCodeLine{119   \textcolor{comment}{!          To obtain a thickness distribution where the last layer is}}
\DoxyCodeLine{120   \textcolor{comment}{!          vanished and the other thicknesses uniformly distributed, use:}}
\DoxyCodeLine{121   \textcolor{comment}{!          e0(k) = -G\%max\_depth * real(k-1) / real(nz-1)}}
\DoxyCodeLine{122   \textcolor{comment}{!do k=1,nz+1}}
\DoxyCodeLine{123   \textcolor{comment}{!  e0(k) = -G\%max\_depth * real(k-1) / real(nz)}}
\DoxyCodeLine{124   \textcolor{comment}{!enddo}}
\DoxyCodeLine{125 }
\DoxyCodeLine{126   \textcolor{keywordflow}{select case} ( coordinatemode(verticalcoordinate) )}
\DoxyCodeLine{127 }
\DoxyCodeLine{128   \textcolor{keywordflow}{case} ( regridding\_layer, regridding\_rho ) \textcolor{comment}{! Initial thicknesses for isopycnal coordinates}}
\DoxyCodeLine{129     \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_SSS"}, s\_surf, default=34., do\_not\_log=.true.)}
\DoxyCodeLine{130     \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"INITIAL\_S\_RANGE"}, s\_range, default=2., do\_not\_log=.true.)}
\DoxyCodeLine{131     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"S\_REF"}, s\_ref, default=35.0, do\_not\_log=.true.)}
\DoxyCodeLine{132     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_LIGHT"}, s\_light, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{133     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TS\_RANGE\_S\_DENSE"}, s\_dense, default = s\_ref, do\_not\_log=.true.)}
\DoxyCodeLine{134     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"INTERFACE\_IC\_QUANTA"}, eta\_ic\_quanta, \&}
\DoxyCodeLine{135                    \textcolor{stringliteral}{"The granularity of initial interface height values "}//\&}
\DoxyCodeLine{136                    \textcolor{stringliteral}{"per meter, to avoid sensivity to order-of-arithmetic changes."}, \&}
\DoxyCodeLine{137                    default=2048.0, units=\textcolor{stringliteral}{"m-1"}, scale=us\%Z\_to\_m, do\_not\_log=just\_read)}
\DoxyCodeLine{138     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{139 }
\DoxyCodeLine{140     \textcolor{keywordflow}{do} k=1,nz+1}
\DoxyCodeLine{141       \textcolor{comment}{! Salinity of layer k is S\_light + (k-1)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{142       \textcolor{comment}{! Salinity of interface K is S\_light + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{143       \textcolor{comment}{! Salinity at depth z should be S(z) = S\_surf - S\_range * z/max\_depth}}
\DoxyCodeLine{144       \textcolor{comment}{! Equating: S\_surf - S\_range * z/max\_depth = S\_light + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{145       \textcolor{comment}{! Equating: - S\_range * z/max\_depth = S\_light - S\_surf + (K-3/2)/(nz-1) * (S\_dense - S\_light)}}
\DoxyCodeLine{146       \textcolor{comment}{! Equating: z/max\_depth = - ( S\_light - S\_surf + (K-3/2)/(nz-1) * (S\_dense - S\_light) ) / S\_range}}
\DoxyCodeLine{147       e0(k) = - g\%max\_depth * ( ( s\_light  - s\_surf ) + ( s\_dense - s\_light ) * \&}
\DoxyCodeLine{148                               ( (real(k)-1.5) / real(nz-1) ) ) / s\_range}
\DoxyCodeLine{149       \textcolor{comment}{! Force round numbers ... the above expression has irrational factors ...}}
\DoxyCodeLine{150       \textcolor{keywordflow}{if} (eta\_ic\_quanta > 0.0) \&}
\DoxyCodeLine{151         e0(k) = nint(eta\_ic\_quanta*e0(k)) / eta\_ic\_quanta}
\DoxyCodeLine{152       e0(k) = min(real(1-k)*gv\%Angstrom\_Z, e0(k)) \textcolor{comment}{! Bound by surface}}
\DoxyCodeLine{153       e0(k) = max(-g\%max\_depth, e0(k)) \textcolor{comment}{! Bound by bottom}}
\DoxyCodeLine{154 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{155     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{156       eta1d(nz+1) = -g\%bathyT(i,j)}
\DoxyCodeLine{157       \textcolor{keywordflow}{do} k=nz,1,-1}
\DoxyCodeLine{158         eta1d(k) = e0(k)}
\DoxyCodeLine{159         \textcolor{keywordflow}{if} (eta1d(k) < (eta1d(k+1) + gv\%Angstrom\_Z)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{160           eta1d(k) = eta1d(k+1) + gv\%Angstrom\_Z}
\DoxyCodeLine{161           h(i,j,k) = gv\%Angstrom\_H}
\DoxyCodeLine{162         \textcolor{keywordflow}{else}}
\DoxyCodeLine{163           h(i,j,k) = gv\%Z\_to\_H * (eta1d(k) - eta1d(k+1))}
\DoxyCodeLine{164 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{165 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{166 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{167 }
\DoxyCodeLine{168   \textcolor{keywordflow}{case} ( regridding\_zstar )                       \textcolor{comment}{! Initial thicknesses for z coordinates}}
\DoxyCodeLine{169     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{170     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{171       eta1d(nz+1) = -g\%bathyT(i,j)}
\DoxyCodeLine{172       \textcolor{keywordflow}{do} k=nz,1,-1}
\DoxyCodeLine{173         eta1d(k) =  -g\%max\_depth * real(k-1) / real(nz)}
\DoxyCodeLine{174         \textcolor{keywordflow}{if} (eta1d(k) < (eta1d(k+1) + min\_thickness)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{175           eta1d(k) = eta1d(k+1) + min\_thickness}
\DoxyCodeLine{176           h(i,j,k) = gv\%Z\_to\_H * min\_thickness}
\DoxyCodeLine{177         \textcolor{keywordflow}{else}}
\DoxyCodeLine{178           h(i,j,k) = gv\%Z\_to\_H * (eta1d(k) - eta1d(k+1))}
\DoxyCodeLine{179 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{180 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{181 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{182 }
\DoxyCodeLine{183   \textcolor{keywordflow}{case} ( regridding\_sigma )             \textcolor{comment}{! Initial thicknesses for sigma coordinates}}
\DoxyCodeLine{184     \textcolor{keywordflow}{if} (just\_read) \textcolor{keywordflow}{return} \textcolor{comment}{! All run-time parameters have been read, so return.}}
\DoxyCodeLine{185     \textcolor{keywordflow}{do} j=js,je ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{186       h(i,j,:) = gv\%Z\_to\_H * g\%bathyT(i,j) / dfloat(nz)}
\DoxyCodeLine{187 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{188 }
\DoxyCodeLine{189 \textcolor{keywordflow}{end select}}
\DoxyCodeLine{190 }

\end{DoxyCode}
\mbox{\Hypertarget{namespaceseamount__initialization_ad0d12dd03f77e4a827fcd925805b92c9}\label{namespaceseamount__initialization_ad0d12dd03f77e4a827fcd925805b92c9}} 
\index{seamount\_initialization@{seamount\_initialization}!seamount\_initialize\_topography@{seamount\_initialize\_topography}}
\index{seamount\_initialize\_topography@{seamount\_initialize\_topography}!seamount\_initialization@{seamount\_initialization}}
\subsubsection{\texorpdfstring{seamount\_initialize\_topography()}{seamount\_initialize\_topography()}}
{\footnotesize\ttfamily subroutine, public seamount\+\_\+initialization\+::seamount\+\_\+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 }\end{DoxyParamCaption})}



Initialization of 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 the units of depth\+\_\+max \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file structure \\
\hline
\mbox{\texttt{ in}}  & {\em max\+\_\+depth} & Maximum ocean depth in arbitrary units \\
\hline
\end{DoxyParams}


Definition at line 42 of file seamount\+\_\+initialization.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{42   \textcolor{keywordtype}{type}(dyn\_horgrid\_type),  \textcolor{keywordtype}{intent(in)}  :: G\textcolor{comment}{ !< The dynamic horizontal grid type}}
\DoxyCodeLine{43 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:G\%ied,G\%jsd:G\%jed)}, \&}
\DoxyCodeLine{44                            \textcolor{keywordtype}{intent(out)} :: D\textcolor{comment}{ !< Ocean bottom depth in the units of depth\_max}}
\DoxyCodeLine{45   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}  :: param\_file\textcolor{comment}{ !< Parameter file structure}}
\DoxyCodeLine{46 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)}  :: max\_depth\textcolor{comment}{ !< Maximum ocean depth in arbitrary units}}
\DoxyCodeLine{47 }
\DoxyCodeLine{48   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{49   \textcolor{keywordtype}{integer}   :: i, j}
\DoxyCodeLine{50 \textcolor{keywordtype}{  real}      :: x, y, delta, Lx, rLx, Ly, rLy}
\DoxyCodeLine{51 }
\DoxyCodeLine{52   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"SEAMOUNT\_DELTA"},delta, \&}
\DoxyCodeLine{53                  \textcolor{stringliteral}{"Non-dimensional height of seamount."}, \&}
\DoxyCodeLine{54                  units=\textcolor{stringliteral}{"non-dim"}, default=0.5)}
\DoxyCodeLine{55   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"SEAMOUNT\_X\_LENGTH\_SCALE"},lx, \&}
\DoxyCodeLine{56                  \textcolor{stringliteral}{"Length scale of seamount in x-direction. "}//\&}
\DoxyCodeLine{57                  \textcolor{stringliteral}{"Set to zero make topography uniform in the x-direction."}, \&}
\DoxyCodeLine{58                  units=\textcolor{stringliteral}{"Same as x,y"}, default=20.)}
\DoxyCodeLine{59   \textcolor{keyword}{call }get\_param(param\_file, mdl,\textcolor{stringliteral}{"SEAMOUNT\_Y\_LENGTH\_SCALE"},ly, \&}
\DoxyCodeLine{60                  \textcolor{stringliteral}{"Length scale of seamount in y-direction. "}//\&}
\DoxyCodeLine{61                  \textcolor{stringliteral}{"Set to zero make topography uniform in the y-direction."}, \&}
\DoxyCodeLine{62                  units=\textcolor{stringliteral}{"Same as x,y"}, default=0.)}
\DoxyCodeLine{63 }
\DoxyCodeLine{64   lx = lx / g\%len\_lon}
\DoxyCodeLine{65   ly = ly / g\%len\_lat}
\DoxyCodeLine{66   rlx = 0. ; \textcolor{keywordflow}{if} (lx>0.) rlx = 1. / lx}
\DoxyCodeLine{67   rly = 0. ; \textcolor{keywordflow}{if} (ly>0.) rly = 1. / ly}
\DoxyCodeLine{68 }
\DoxyCodeLine{69   \textcolor{keywordflow}{do} j=g\%jsc,g\%jec ; \textcolor{keywordflow}{do} i=g\%isc,g\%iec}
\DoxyCodeLine{70     \textcolor{comment}{! Compute normalized zonal coordinates (x,y=0 at center of domain)}}
\DoxyCodeLine{71     x = ( g\%geoLonT(i,j) - g\%west\_lon ) / g\%len\_lon - 0.5}
\DoxyCodeLine{72     y = ( g\%geoLatT(i,j) - g\%south\_lat ) / g\%len\_lat - 0.5}
\DoxyCodeLine{73     d(i,j) = g\%max\_depth * ( 1.0 - delta * exp(-(rlx*x)**2 -(rly*y)**2) )}
\DoxyCodeLine{74 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{75 }

\end{DoxyCode}
