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


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


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


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


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


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