| 1 | cnh | 1.2 | % $Header: /u/gcmpack/mitgcmdoc/part3/case_studies/fourlayer_gyre/fourlayer.tex,v 1.1.1.1 2001/08/08 16:15:41 adcroft Exp $ | 
| 2 |  |  | % $Name:  $ | 
| 3 | adcroft | 1.1 |  | 
| 4 |  |  | \section{Example: Four layer Baroclinic Ocean Gyre In Spherical Coordinates} | 
| 5 |  |  |  | 
| 6 |  |  | \bodytext{bgcolor="#FFFFFFFF"} | 
| 7 |  |  |  | 
| 8 |  |  | %\begin{center} | 
| 9 |  |  | %{\Large \bf Using MITgcm to Simulate a Baroclinic Ocean Gyre In Spherical | 
| 10 |  |  | %Polar Coordinates} | 
| 11 |  |  | % | 
| 12 |  |  | %\vspace*{4mm} | 
| 13 |  |  | % | 
| 14 |  |  | %\vspace*{3mm} | 
| 15 |  |  | %{\large May 2001} | 
| 16 |  |  | %\end{center} | 
| 17 |  |  |  | 
| 18 |  |  | \subsection{Introduction} | 
| 19 |  |  |  | 
| 20 |  |  | This document describes the second example MITgcm experiment. The first | 
| 21 |  |  | example experiment ilustrated how to configure the code for a single layer | 
| 22 |  |  | simulation in a cartesian grid. In this example a similar physical problem | 
| 23 |  |  | is simulated, but the code is now configured | 
| 24 |  |  | for four layers and in a spherical polar coordinate system. | 
| 25 |  |  |  | 
| 26 |  |  | \subsection{Overview} | 
| 27 |  |  |  | 
| 28 |  |  | This example experiment demonstrates using the MITgcm to simulate | 
| 29 |  |  | a baroclinic, wind-forced, ocean gyre circulation. The experiment | 
| 30 |  |  | is a numerical rendition of the gyre circulation problem simliar | 
| 31 |  |  | to the problems described analytically by Stommel in 1966 | 
| 32 |  |  | \cite{Stommel66} and numerically in Holland et. al \cite{Holland75}. | 
| 33 |  |  | \\ | 
| 34 |  |  |  | 
| 35 |  |  | In this experiment the model is configured to represent a mid-latitude | 
| 36 |  |  | enclosed sector of fluid on a sphere, $60^{\circ} \times 60^{\circ}$ in | 
| 37 |  |  | lateral extent. The fluid is $2$~km deep and is forced | 
| 38 |  |  | by a constant in time zonal wind stress, $\tau_x$, that varies sinusoidally | 
| 39 |  |  | in the north-south direction. Topologically the simulated | 
| 40 |  |  | domain is a sector on a sphere and the coriolis parameter, $f$, is defined | 
| 41 |  |  | according to latitude, $\phi$ | 
| 42 |  |  |  | 
| 43 |  |  | \begin{equation} | 
| 44 |  |  | \label{EQ:fcori} | 
| 45 |  |  | f(\phi) = 2 \Omega \sin( \phi ) | 
| 46 |  |  | \end{equation} | 
| 47 |  |  |  | 
| 48 |  |  | \noindent with the rotation rate, $\Omega$ set to $\frac{2 \pi}{86400s}$. | 
| 49 |  |  | \\ | 
| 50 |  |  |  | 
| 51 |  |  | The sinusoidal wind-stress variations are defined according to | 
| 52 |  |  |  | 
| 53 |  |  | \begin{equation} | 
| 54 |  |  | \label{EQ:taux} | 
| 55 |  |  | \tau_x(\phi) = \tau_{0}\sin(\pi \frac{\phi}{L_{\phi}}) | 
| 56 |  |  | \end{equation} | 
| 57 |  |  |  | 
| 58 |  |  | \noindent where $L_{\phi}$ is the lateral domain extent ($60^{\circ}$) and | 
| 59 |  |  | $\tau_0$ is set to $0.1N m^{-2}$. | 
| 60 |  |  | \\ | 
| 61 |  |  |  | 
| 62 |  |  | Figure \ref{FIG:simulation_config} | 
| 63 |  |  | summarises the configuration simulated. | 
| 64 |  |  | In contrast to example (1) \cite{baro_gyre_case_study}, the current | 
| 65 |  |  | experiment simulates a spherical polar domain. However, as indicated | 
| 66 |  |  | by the axes in the lower left of the figure the model code works internally | 
| 67 |  |  | in a locally orthoganal coordinate $(x,y,z)$. In the remainder of this | 
| 68 |  |  | document the local coordinate $(x,y,z)$ will be adopted. | 
| 69 |  |  | \\ | 
| 70 |  |  |  | 
| 71 |  |  | The experiment has four levels in the vertical, each of equal thickness, | 
| 72 |  |  | $\Delta z = 500$~m. Initially the fluid is stratified with a reference | 
| 73 |  |  | potential temperature profile, | 
| 74 |  |  | $\theta_{250}=20^{\circ}$~C, | 
| 75 |  |  | $\theta_{750}=10^{\circ}$~C, | 
| 76 |  |  | $\theta_{1250}=8^{\circ}$~C, | 
| 77 |  |  | $\theta_{1750}=6^{\circ}$~C. The equation of state used in this experiment is | 
| 78 |  |  | linear | 
| 79 |  |  |  | 
| 80 |  |  | \begin{equation} | 
| 81 |  |  | \label{EQ:linear1_eos} | 
| 82 |  |  | \rho = \rho_{0} ( 1 - \alpha_{\theta}\theta^{'} ) | 
| 83 |  |  | \end{equation} | 
| 84 |  |  |  | 
| 85 |  |  | \noindent which is implemented in the model as a density anomaly equation | 
| 86 |  |  |  | 
| 87 |  |  | \begin{equation} | 
| 88 |  |  | \label{EQ:linear1_eos_pert} | 
| 89 |  |  | \rho^{'} = -\rho_{0}\alpha_{\theta}\theta^{'} | 
| 90 |  |  | \end{equation} | 
| 91 |  |  |  | 
| 92 |  |  | \noindent with $\rho_{0}=999.8\,{\rm kg\,m}^{-3}$ and | 
| 93 |  |  | $\alpha_{\theta}=2\times10^{-4}\,{\rm degrees}^{-1} $. Integrated forward in | 
| 94 |  |  | this configuration the model state variable {\bf theta} is synonomous with | 
| 95 |  |  | either in-situ temperature, $T$, or potential temperature, $\theta$. For | 
| 96 |  |  | consistency with later examples, in which the equation of state is | 
| 97 |  |  | non-linear, we use $\theta$ to represent temperature here. This is | 
| 98 |  |  | the quantity that is carried in the model core equations. | 
| 99 |  |  |  | 
| 100 |  |  | \begin{figure} | 
| 101 | cnh | 1.2 | \begin{center} | 
| 102 | adcroft | 1.1 | \resizebox{7.5in}{5.5in}{ | 
| 103 |  |  | \includegraphics*[0.2in,0.7in][10.5in,10.5in] | 
| 104 |  |  | {part3/case_studies/fourlayer_gyre/simulation_config.eps} } | 
| 105 | cnh | 1.2 | \end{center} | 
| 106 | adcroft | 1.1 | \caption{Schematic of simulation domain and wind-stress forcing function | 
| 107 |  |  | for the four-layer gyre numerical experiment. The domain is enclosed by solid | 
| 108 |  |  | walls at $0^{\circ}$~E, $60^{\circ}$~E, $0^{\circ}$~N and $60^{\circ}$~N. | 
| 109 |  |  | In the four-layer case an initial temperature stratification is | 
| 110 |  |  | imposed by setting the potential temperature, $\theta$, in each layer. | 
| 111 |  |  | The vertical spacing, $\Delta z$, is constant and equal to $500$m. | 
| 112 |  |  | } | 
| 113 |  |  | \label{FIG:simulation_config} | 
| 114 |  |  | \end{figure} | 
| 115 |  |  |  | 
| 116 |  |  | \subsection{Discrete Numerical Configuration} | 
| 117 |  |  |  | 
| 118 |  |  | The model is configured in hydrostatic form.  The domain is discretised with | 
| 119 |  |  | a uniform grid spacing in latitude and longitude | 
| 120 |  |  | $\Delta x=\Delta y=1^{\circ}$, so | 
| 121 |  |  | that there are sixty grid cells in the $x$ and $y$ directions. Vertically the | 
| 122 |  |  | model is configured with a four layers with constant depth, | 
| 123 |  |  | $\Delta z$, of $500$~m. | 
| 124 |  |  | The implicit free surface form of the | 
| 125 |  |  | pressure equation described in Marshall et. al \cite{Marshall97a} is | 
| 126 |  |  | employed. | 
| 127 |  |  | A horizontal laplacian operator $\nabla_{h}^2$ provides viscous | 
| 128 |  |  | dissipation. The wind-stress momentum input is added to the momentum equation | 
| 129 |  |  | for the ``zonal flow'', $u$. Other terms in the model | 
| 130 |  |  | are explicitly switched off for this experiement configuration (see section | 
| 131 |  |  | \ref{SEC:code_config} ), yielding an active set of equations solved in this | 
| 132 |  |  | configuration as follows | 
| 133 |  |  |  | 
| 134 |  |  | \begin{eqnarray} | 
| 135 |  |  | \label{EQ:model_equations} | 
| 136 |  |  | \frac{Du}{Dt} - fv + | 
| 137 |  |  | \frac{1}{\rho}\frac{\partial p^{'}}{\partial x} - | 
| 138 |  |  | A_{h}\nabla_{h}^2u - A_{z}\frac{\partial^{2}u}{\partial z^{2}} | 
| 139 |  |  | & = & | 
| 140 |  |  | \cal{F} | 
| 141 |  |  | \\ | 
| 142 |  |  | \frac{Dv}{Dt} + fu + | 
| 143 |  |  | \frac{1}{\rho}\frac{\partial p^{'}}{\partial y} - | 
| 144 |  |  | A_{h}\nabla_{h}^2v - A_{z}\frac{\partial^{2}v}{\partial z^{2}} | 
| 145 |  |  | & = & | 
| 146 |  |  | 0 | 
| 147 |  |  | \\ | 
| 148 |  |  | \frac{\partial \eta}{\partial t} + \nabla_{h}\cdot \vec{u} | 
| 149 |  |  | &=& | 
| 150 |  |  | 0 | 
| 151 |  |  | \\ | 
| 152 |  |  | \frac{D\theta}{Dt} - | 
| 153 |  |  | K_{h}\nabla_{h}^2\theta  - K_{z}\frac{\partial^{2}\theta}{\partial z^{2}} | 
| 154 |  |  | & = & | 
| 155 |  |  | 0 | 
| 156 |  |  | \\ | 
| 157 |  |  | g\rho_{0} \eta + \int^{0}_{-z}\rho^{'} dz & = & p^{'} | 
| 158 |  |  | \\ | 
| 159 |  |  | {\cal F} |_{s} & = & \frac{\tau_{x}}{\rho_{0}\Delta z_{s}} | 
| 160 |  |  | \\ | 
| 161 |  |  | {\cal F} |_{i} & = & 0 | 
| 162 |  |  | \end{eqnarray} | 
| 163 |  |  |  | 
| 164 |  |  | \noindent where $u$ and $v$ are the $x$ and $y$ components of the | 
| 165 |  |  | flow vector $\vec{u}$. The suffices ${s},{i}$ indicate surface and | 
| 166 |  |  | interior model levels respectively. As described in | 
| 167 |  |  | MITgcm Numerical Solution Procedure \cite{MITgcm_Numerical_Scheme}, the time | 
| 168 |  |  | evolution of potential temperature, $\theta$, equation is solved prognostically. | 
| 169 |  |  | The total pressure, $p$, is diagnosed by summing pressure due to surface | 
| 170 |  |  | elevation $\eta$ and the hydrostatic pressure. | 
| 171 |  |  | \\ | 
| 172 |  |  |  | 
| 173 |  |  | \subsubsection{Numerical Stability Criteria} | 
| 174 |  |  |  | 
| 175 |  |  | The laplacian dissipation coefficient, $A_{h}$, is set to $400 m s^{-1}$. | 
| 176 |  |  | This value is chosen to yield a Munk layer width \cite{Adcroft_thesis}, | 
| 177 |  |  |  | 
| 178 |  |  | \begin{eqnarray} | 
| 179 |  |  | \label{EQ:munk_layer} | 
| 180 |  |  | M_{w} = \pi ( \frac { A_{h} }{ \beta } )^{\frac{1}{3}} | 
| 181 |  |  | \end{eqnarray} | 
| 182 |  |  |  | 
| 183 |  |  | \noindent  of $\approx 100$km. This is greater than the model | 
| 184 |  |  | resolution in mid-latitudes $\Delta x$, ensuring that the frictional | 
| 185 |  |  | boundary layer is well resolved. | 
| 186 |  |  | \\ | 
| 187 |  |  |  | 
| 188 |  |  | \noindent The model is stepped forward with a | 
| 189 |  |  | time step $\delta t=1200$secs. With this time step the stability | 
| 190 |  |  | parameter to the horizontal laplacian friction \cite{Adcroft_thesis} | 
| 191 |  |  |  | 
| 192 |  |  | \begin{eqnarray} | 
| 193 |  |  | \label{EQ:laplacian_stability} | 
| 194 |  |  | S_{l} = 4 \frac{A_{h} \delta t}{{\Delta x}^2} | 
| 195 |  |  | \end{eqnarray} | 
| 196 |  |  |  | 
| 197 |  |  | \noindent evaluates to 0.012, which is well below the 0.3 upper limit | 
| 198 |  |  | for stability. | 
| 199 |  |  | \\ | 
| 200 |  |  |  | 
| 201 |  |  | \noindent The vertical dissipation coefficient, $A_{z}$, is set to | 
| 202 |  |  | $1\times10^{-2} {\rm m}^2{\rm s}^{-1}$. The associated stability limit | 
| 203 |  |  |  | 
| 204 |  |  | \begin{eqnarray} | 
| 205 |  |  | \label{EQ:laplacian_stability_z} | 
| 206 |  |  | S_{l} = 4 \frac{A_{z} \delta t}{{\Delta z}^2} | 
| 207 |  |  | \end{eqnarray} | 
| 208 |  |  |  | 
| 209 |  |  | \noindent evaluates to $4.8 \times 10^{-5}$ which is again well below | 
| 210 |  |  | the upper limit. | 
| 211 |  |  | The values of $A_{h}$ and $A_{z}$ are also used for the horizontal ($K_{h}$) | 
| 212 |  |  | and vertical ($K_{z}$) diffusion coefficients for temperature respectively. | 
| 213 |  |  | \\ | 
| 214 |  |  |  | 
| 215 |  |  | \noindent The numerical stability for inertial oscillations | 
| 216 |  |  | \cite{Adcroft_thesis} | 
| 217 |  |  |  | 
| 218 |  |  | \begin{eqnarray} | 
| 219 |  |  | \label{EQ:inertial_stability} | 
| 220 |  |  | S_{i} = f^{2} {\delta t}^2 | 
| 221 |  |  | \end{eqnarray} | 
| 222 |  |  |  | 
| 223 |  |  | \noindent evaluates to $0.0144$, which is well below the $0.5$ upper | 
| 224 |  |  | limit for stability. | 
| 225 |  |  | \\ | 
| 226 |  |  |  | 
| 227 |  |  | \noindent The advective CFL \cite{Adcroft_thesis} for a extreme maximum | 
| 228 |  |  | horizontal flow | 
| 229 |  |  | speed of $ | \vec{u} | = 2 ms^{-1}$ | 
| 230 |  |  |  | 
| 231 |  |  | \begin{eqnarray} | 
| 232 |  |  | \label{EQ:cfl_stability} | 
| 233 |  |  | S_{a} = \frac{| \vec{u} | \delta t}{ \Delta x} | 
| 234 |  |  | \end{eqnarray} | 
| 235 |  |  |  | 
| 236 |  |  | \noindent evaluates to $5 \times 10^{-2}$. This is well below the stability | 
| 237 |  |  | limit of 0.5. | 
| 238 |  |  | \\ | 
| 239 |  |  |  | 
| 240 |  |  | \noindent The stability parameter for internal gravity waves | 
| 241 |  |  | \cite{Adcroft_thesis} | 
| 242 |  |  |  | 
| 243 |  |  | \begin{eqnarray} | 
| 244 |  |  | \label{EQ:igw_stability} | 
| 245 |  |  | S_{c} = \frac{c_{g} \delta t}{ \Delta x} | 
| 246 |  |  | \end{eqnarray} | 
| 247 |  |  |  | 
| 248 |  |  | \noindent evaluates to $5 \times 10^{-2}$. This is well below the linear | 
| 249 |  |  | stability limit of 0.25. | 
| 250 |  |  |  | 
| 251 |  |  | \subsection{Code Configuration} | 
| 252 |  |  | \label{SEC:code_config} | 
| 253 |  |  |  | 
| 254 |  |  | The model configuration for this experiment resides under the | 
| 255 |  |  | directory {\it verification/exp1/}.  The experiment files | 
| 256 |  |  | \begin{itemize} | 
| 257 |  |  | \item {\it input/data} | 
| 258 |  |  | \item {\it input/data.pkg} | 
| 259 |  |  | \item {\it input/eedata}, | 
| 260 |  |  | \item {\it input/windx.sin\_y}, | 
| 261 |  |  | \item {\it input/topog.box}, | 
| 262 |  |  | \item {\it code/CPP\_EEOPTIONS.h} | 
| 263 |  |  | \item {\it code/CPP\_OPTIONS.h}, | 
| 264 |  |  | \item {\it code/SIZE.h}. | 
| 265 |  |  | \end{itemize} | 
| 266 |  |  | contain the code customisations and parameter settings for this | 
| 267 |  |  | experiements. Below we describe the customisations | 
| 268 |  |  | to these files associated with this experiment. | 
| 269 |  |  |  | 
| 270 |  |  | \subsubsection{File {\it input/data}} | 
| 271 |  |  |  | 
| 272 |  |  | This file, reproduced completely below, specifies the main parameters | 
| 273 |  |  | for the experiment. The parameters that are significant for this configuration | 
| 274 |  |  | are | 
| 275 |  |  |  | 
| 276 |  |  | \begin{itemize} | 
| 277 |  |  |  | 
| 278 |  |  | \item Line 4, | 
| 279 |  |  | \begin{verbatim} tRef=20.,10.,8.,6., \end{verbatim} | 
| 280 |  |  | this line sets | 
| 281 |  |  | the initial and reference values of potential temperature at each model | 
| 282 |  |  | level in units of $^{\circ}$C. | 
| 283 |  |  | The entries are ordered from surface to depth. For each | 
| 284 |  |  | depth level the inital and reference profiles will be uniform in | 
| 285 |  |  | $x$ and $y$. The values specified here are read into the | 
| 286 |  |  | variable | 
| 287 |  |  | {\bf | 
| 288 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/OK.htm> \end{rawhtml} | 
| 289 |  |  | tRef | 
| 290 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 291 |  |  | } | 
| 292 |  |  | in the model code, by procedure | 
| 293 |  |  | {\it | 
| 294 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 295 |  |  | INI\_PARMS | 
| 296 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 297 |  |  | }. | 
| 298 |  |  |  | 
| 299 |  |  | %% \codelink{var:tref} tRef \endlink | 
| 300 |  |  | %% \codelink{file:ini_parms} {\it INI\_PARMS } \endlink | 
| 301 |  |  | %% \codelink{proc:ini_parms} {\it INI\_PARMS } \endlink | 
| 302 |  |  | %% \var{tref} | 
| 303 |  |  | %% \proc{ini_parms} | 
| 304 |  |  | %% \file{ini_parms} | 
| 305 |  |  | \newcommand{\VARtref}{ | 
| 306 |  |  | {\bf | 
| 307 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/OK.htm> \end{rawhtml} | 
| 308 |  |  | tRef | 
| 309 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 310 |  |  | } | 
| 311 |  |  | } | 
| 312 |  |  |  | 
| 313 |  |  |  | 
| 314 |  |  |  | 
| 315 |  |  | \fbox{ | 
| 316 |  |  | \begin{minipage}{5.0in} | 
| 317 |  |  | {\it S/R INI\_THETA} | 
| 318 |  |  | ({\it ini\_theta.F}) | 
| 319 |  |  | \end{minipage} | 
| 320 |  |  | } | 
| 321 |  |  | {\bf | 
| 322 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/98.htm> \end{rawhtml} | 
| 323 |  |  | goto code | 
| 324 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 325 |  |  | } | 
| 326 |  |  |  | 
| 327 |  |  |  | 
| 328 |  |  | \item Line 6, | 
| 329 |  |  | \begin{verbatim} viscAz=1.E-2, \end{verbatim} | 
| 330 |  |  | this line sets the vertical laplacian dissipation coefficient to | 
| 331 |  |  | $1 \times 10^{-2} {\rm m^{2}s^{-1}}$. Boundary conditions | 
| 332 |  |  | for this operator are specified later. | 
| 333 |  |  | The variable | 
| 334 |  |  | {\bf | 
| 335 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/ZQ.htm> \end{rawhtml} | 
| 336 |  |  | viscAz | 
| 337 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 338 |  |  | } | 
| 339 |  |  | is read in the routine | 
| 340 |  |  | {\it | 
| 341 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 342 |  |  | INI\_PARMS | 
| 343 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 344 |  |  | } | 
| 345 |  |  | and is copied into model general vertical coordinate variable | 
| 346 |  |  | {\bf | 
| 347 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/PF.htm> \end{rawhtml} | 
| 348 |  |  | viscAr | 
| 349 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 350 |  |  | }. | 
| 351 |  |  |  | 
| 352 |  |  | \fbox{ | 
| 353 |  |  | \begin{minipage}{5.0in} | 
| 354 |  |  | {\it S/R CALC\_DIFFUSIVITY}({\it calc\_diffusivity.F}) | 
| 355 |  |  | \end{minipage} | 
| 356 |  |  | } | 
| 357 |  |  | {\bf | 
| 358 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/53.htm> \end{rawhtml} | 
| 359 |  |  | goto code | 
| 360 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 361 |  |  | } | 
| 362 |  |  |  | 
| 363 |  |  | \item Line 7, | 
| 364 |  |  | \begin{verbatim} | 
| 365 |  |  | viscAh=4.E2, | 
| 366 |  |  | \end{verbatim} | 
| 367 |  |  | this line sets the horizontal laplacian frictional dissipation coefficient to | 
| 368 |  |  | $1 \times 10^{-2} {\rm m^{2}s^{-1}}$. Boundary conditions | 
| 369 |  |  | for this operator are specified later. | 
| 370 |  |  | The variable | 
| 371 |  |  | {\bf | 
| 372 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/SI.htm> \end{rawhtml} | 
| 373 |  |  | viscAh | 
| 374 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 375 |  |  | } | 
| 376 |  |  | is read in the routine | 
| 377 |  |  | {\it | 
| 378 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 379 |  |  | INI\_PARMS | 
| 380 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 381 |  |  | }. | 
| 382 |  |  |  | 
| 383 |  |  | \fbox{ | 
| 384 |  |  | \begin{minipage}{5.0in} | 
| 385 |  |  | {\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) | 
| 386 |  |  | \end{minipage} | 
| 387 |  |  | } | 
| 388 |  |  | {\bf | 
| 389 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/60.htm> \end{rawhtml} | 
| 390 |  |  | goto code | 
| 391 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 392 |  |  | } | 
| 393 |  |  |  | 
| 394 |  |  | \fbox{ | 
| 395 |  |  | \begin{minipage}{5.0in} | 
| 396 |  |  | {\it S/R CALC\_GW}({\it calc\_gw.F}) | 
| 397 |  |  | \end{minipage} | 
| 398 |  |  | } | 
| 399 |  |  | {\bf | 
| 400 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/58.htm> \end{rawhtml} | 
| 401 |  |  | goto code | 
| 402 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 403 |  |  | } | 
| 404 |  |  |  | 
| 405 |  |  | \item Lines 8, | 
| 406 |  |  | \begin{verbatim} | 
| 407 |  |  | no_slip_sides=.FALSE. | 
| 408 |  |  | \end{verbatim} | 
| 409 |  |  | this line selects a free-slip lateral boundary condition for | 
| 410 |  |  | the horizontal laplacian friction operator | 
| 411 |  |  | e.g. $\frac{\partial u}{\partial y}$=0 along boundaries in $y$ and | 
| 412 |  |  | $\frac{\partial v}{\partial x}$=0 along boundaries in $x$. | 
| 413 |  |  | The variable | 
| 414 |  |  | {\bf | 
| 415 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/UT.htm> \end{rawhtml} | 
| 416 |  |  | no\_slip\_sides | 
| 417 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 418 |  |  | } | 
| 419 |  |  | is read in the routine | 
| 420 |  |  | {\it | 
| 421 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 422 |  |  | INI\_PARMS | 
| 423 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 424 |  |  | }. | 
| 425 |  |  |  | 
| 426 |  |  |  | 
| 427 |  |  | \fbox{ | 
| 428 |  |  | \begin{minipage}{5.0in} | 
| 429 |  |  | {\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) | 
| 430 |  |  | \end{minipage} | 
| 431 |  |  | } | 
| 432 |  |  | {\bf | 
| 433 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/60.htm> \end{rawhtml} | 
| 434 |  |  | goto code | 
| 435 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 436 |  |  | } | 
| 437 |  |  |  | 
| 438 |  |  | \item Lines 9, | 
| 439 |  |  | \begin{verbatim} | 
| 440 |  |  | no_slip_bottom=.TRUE. | 
| 441 |  |  | \end{verbatim} | 
| 442 |  |  | this line selects a no-slip boundary condition for bottom | 
| 443 |  |  | boundary condition in the vertical laplacian friction operator | 
| 444 |  |  | e.g. $u=v=0$ at $z=-H$, where $H$ is the local depth of the domain. | 
| 445 |  |  | The variable | 
| 446 |  |  | {\bf | 
| 447 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/UK.htm> \end{rawhtml} | 
| 448 |  |  | no\_slip\_bottom | 
| 449 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 450 |  |  | } | 
| 451 |  |  | is read in the routine | 
| 452 |  |  | {\it | 
| 453 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 454 |  |  | INI\_PARMS | 
| 455 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 456 |  |  | }. | 
| 457 |  |  |  | 
| 458 |  |  | \fbox{ | 
| 459 |  |  | \begin{minipage}{5.0in} | 
| 460 |  |  | {\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) | 
| 461 |  |  | \end{minipage} | 
| 462 |  |  | } | 
| 463 |  |  | {\bf | 
| 464 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/60.htm> \end{rawhtml} | 
| 465 |  |  | goto code | 
| 466 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 467 |  |  | } | 
| 468 |  |  |  | 
| 469 |  |  | \item Line 10, | 
| 470 |  |  | \begin{verbatim} | 
| 471 |  |  | diffKhT=4.E2, | 
| 472 |  |  | \end{verbatim} | 
| 473 |  |  | this line sets the horizontal diffusion coefficient for temperature | 
| 474 |  |  | to $400\,{\rm m^{2}s^{-1}}$. The boundary condition on this | 
| 475 |  |  | operator is $\frac{\partial}{\partial x}=\frac{\partial}{\partial y}=0$ at | 
| 476 |  |  | all boundaries. | 
| 477 |  |  | The variable | 
| 478 |  |  | {\bf | 
| 479 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/RC.htm> \end{rawhtml} | 
| 480 |  |  | diffKhT | 
| 481 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 482 |  |  | } | 
| 483 |  |  | is read in the routine | 
| 484 |  |  | {\it | 
| 485 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 486 |  |  | INI\_PARMS | 
| 487 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 488 |  |  | }. | 
| 489 |  |  |  | 
| 490 |  |  | \fbox{ \begin{minipage}{5.0in} | 
| 491 |  |  | {\it S/R CALC\_GT}({\it calc\_gt.F}) | 
| 492 |  |  | \end{minipage} | 
| 493 |  |  | } | 
| 494 |  |  | {\bf | 
| 495 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/57.htm> \end{rawhtml} | 
| 496 |  |  | goto code | 
| 497 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 498 |  |  | } | 
| 499 |  |  |  | 
| 500 |  |  | \item Line 11, | 
| 501 |  |  | \begin{verbatim} | 
| 502 |  |  | diffKzT=1.E-2, | 
| 503 |  |  | \end{verbatim} | 
| 504 |  |  | this line sets the vertical diffusion coefficient for temperature | 
| 505 |  |  | to $10^{-2}\,{\rm m^{2}s^{-1}}$. The boundary condition on this | 
| 506 |  |  | operator is $\frac{\partial}{\partial z}$ = 0 on all boundaries. | 
| 507 |  |  | The variable | 
| 508 |  |  | {\bf | 
| 509 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/ZT.htm> \end{rawhtml} | 
| 510 |  |  | diffKzT | 
| 511 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 512 |  |  | } | 
| 513 |  |  | is read in the routine | 
| 514 |  |  | {\it | 
| 515 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 516 |  |  | INI\_PARMS | 
| 517 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 518 |  |  | }. | 
| 519 |  |  | It is copied into model general vertical coordinate variable | 
| 520 |  |  | {\bf | 
| 521 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/PD.htm> \end{rawhtml} | 
| 522 |  |  | diffKrT | 
| 523 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 524 |  |  | }. | 
| 525 |  |  |  | 
| 526 |  |  | \fbox{ \begin{minipage}{5.0in} | 
| 527 |  |  | {\it S/R CALC\_DIFFUSIVITY}({\it calc\_diffusivity.F}) | 
| 528 |  |  | \end{minipage} | 
| 529 |  |  | } | 
| 530 |  |  | {\bf | 
| 531 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/53.htm> \end{rawhtml} | 
| 532 |  |  | goto code | 
| 533 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 534 |  |  | } | 
| 535 |  |  |  | 
| 536 |  |  |  | 
| 537 |  |  |  | 
| 538 |  |  | \item Line 13, | 
| 539 |  |  | \begin{verbatim} | 
| 540 |  |  | tAlpha=2.E-4, | 
| 541 |  |  | \end{verbatim} | 
| 542 |  |  | This line sets the thermal expansion coefficient for the fluid | 
| 543 |  |  | to $2 \times 10^{-4}\,{\rm degrees}^{-1}$ | 
| 544 |  |  | The variable | 
| 545 |  |  | {\bf | 
| 546 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/ZV.htm> \end{rawhtml} | 
| 547 |  |  | tAlpha | 
| 548 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 549 |  |  | } | 
| 550 |  |  | is read in the routine | 
| 551 |  |  | {\it | 
| 552 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 553 |  |  | INI\_PARMS | 
| 554 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 555 |  |  | }. | 
| 556 |  |  |  | 
| 557 |  |  | \fbox{ | 
| 558 |  |  | \begin{minipage}{5.0in} | 
| 559 |  |  | {\it S/R FIND\_RHO}({\it find\_rho.F}) | 
| 560 |  |  | \end{minipage} | 
| 561 |  |  | } | 
| 562 |  |  | {\bf | 
| 563 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/79.htm> \end{rawhtml} | 
| 564 |  |  | goto code | 
| 565 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 566 |  |  | } | 
| 567 |  |  |  | 
| 568 |  |  | \item Line 18, | 
| 569 |  |  | \begin{verbatim} | 
| 570 |  |  | eosType='LINEAR' | 
| 571 |  |  | \end{verbatim} | 
| 572 |  |  | This line selects the linear form of the equation of state. | 
| 573 |  |  | The variable | 
| 574 |  |  | {\bf | 
| 575 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/WV.htm> \end{rawhtml} | 
| 576 |  |  | eosType | 
| 577 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 578 |  |  | } | 
| 579 |  |  | is read in the routine | 
| 580 |  |  | {\it | 
| 581 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 582 |  |  | INI\_PARMS | 
| 583 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 584 |  |  | }. | 
| 585 |  |  |  | 
| 586 |  |  | \fbox{ | 
| 587 |  |  | \begin{minipage}{5.0in} | 
| 588 |  |  | {\it S/R FIND\_RHO}({\it find\_rho.F}) | 
| 589 |  |  | \end{minipage} | 
| 590 |  |  | } | 
| 591 |  |  | {\bf | 
| 592 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/79.htm> \end{rawhtml} | 
| 593 |  |  | goto code | 
| 594 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 595 |  |  | } | 
| 596 |  |  |  | 
| 597 |  |  |  | 
| 598 |  |  |  | 
| 599 |  |  | \item Line 40, | 
| 600 |  |  | \begin{verbatim} | 
| 601 |  |  | usingSphericalPolarGrid=.TRUE., | 
| 602 |  |  | \end{verbatim} | 
| 603 |  |  | This line requests that the simulation be performed in a | 
| 604 |  |  | spherical polar coordinate system. It affects the interpretation of | 
| 605 |  |  | grid inoput parameters, for exampl {\bf delX} and {\bf delY} and | 
| 606 |  |  | causes the grid generation routines to initialise an internal grid based | 
| 607 |  |  | on spherical polar geometry. | 
| 608 |  |  | The variable | 
| 609 |  |  | {\bf | 
| 610 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/10T.htm> \end{rawhtml} | 
| 611 |  |  | usingSphericalPolarGrid | 
| 612 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 613 |  |  | } | 
| 614 |  |  | is read in the routine | 
| 615 |  |  | {\it | 
| 616 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 617 |  |  | INI\_PARMS | 
| 618 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 619 |  |  | }. | 
| 620 |  |  |  | 
| 621 |  |  | \fbox{ | 
| 622 |  |  | \begin{minipage}{5.0in} | 
| 623 |  |  | {\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) | 
| 624 |  |  | \end{minipage} | 
| 625 |  |  | } | 
| 626 |  |  | {\bf | 
| 627 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/97.htm> \end{rawhtml} | 
| 628 |  |  | goto code | 
| 629 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 630 |  |  | } | 
| 631 |  |  |  | 
| 632 |  |  | \item Line 41, | 
| 633 |  |  | \begin{verbatim} | 
| 634 |  |  | phiMin=0., | 
| 635 |  |  | \end{verbatim} | 
| 636 |  |  | This line sets the southern boundary of the modeled | 
| 637 |  |  | domain to $0^{\circ}$ latitude. This value affects both the | 
| 638 |  |  | generation of the locally orthogonal grid that the model | 
| 639 |  |  | uses internally and affects the initialisation of the coriolis force. | 
| 640 |  |  | Note - it is not required to set | 
| 641 |  |  | a longitude boundary, since the absolute longitude does | 
| 642 |  |  | not alter the kernel equation discretisation. | 
| 643 |  |  | The variable | 
| 644 |  |  | {\bf | 
| 645 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/110.htm> \end{rawhtml} | 
| 646 |  |  | phiMin | 
| 647 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 648 |  |  | } | 
| 649 |  |  | is read in the routine | 
| 650 |  |  | {\it | 
| 651 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 652 |  |  | INI\_PARMS | 
| 653 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 654 |  |  | }. | 
| 655 |  |  |  | 
| 656 |  |  | \fbox{ | 
| 657 |  |  | \begin{minipage}{5.0in} | 
| 658 |  |  | {\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) | 
| 659 |  |  | \end{minipage} | 
| 660 |  |  | } | 
| 661 |  |  | {\bf | 
| 662 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/97.htm> \end{rawhtml} | 
| 663 |  |  | goto code | 
| 664 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 665 |  |  | } | 
| 666 |  |  |  | 
| 667 |  |  | \item Line 42, | 
| 668 |  |  | \begin{verbatim} | 
| 669 |  |  | delX=60*1., | 
| 670 |  |  | \end{verbatim} | 
| 671 |  |  | This line sets the horizontal grid spacing between each y-coordinate line | 
| 672 |  |  | in the discrete grid to $1^{\circ}$ in longitude. | 
| 673 |  |  | The variable | 
| 674 |  |  | {\bf | 
| 675 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/10Z.htm> \end{rawhtml} | 
| 676 |  |  | delX | 
| 677 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 678 |  |  | } | 
| 679 |  |  | is read in the routine | 
| 680 |  |  | {\it | 
| 681 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 682 |  |  | INI\_PARMS | 
| 683 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 684 |  |  | }. | 
| 685 |  |  |  | 
| 686 |  |  | \fbox{ | 
| 687 |  |  | \begin{minipage}{5.0in} | 
| 688 |  |  | {\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) | 
| 689 |  |  | \end{minipage} | 
| 690 |  |  | } | 
| 691 |  |  | {\bf | 
| 692 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/97.htm> \end{rawhtml} | 
| 693 |  |  | goto code | 
| 694 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 695 |  |  | } | 
| 696 |  |  |  | 
| 697 |  |  | \item Line 43, | 
| 698 |  |  | \begin{verbatim} | 
| 699 |  |  | delY=60*1., | 
| 700 |  |  | \end{verbatim} | 
| 701 |  |  | This line sets the horizontal grid spacing between each y-coordinate line | 
| 702 |  |  | in the discrete grid to $1^{\circ}$ in latitude. | 
| 703 |  |  | The variable | 
| 704 |  |  | {\bf | 
| 705 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/UB.htm> \end{rawhtml} | 
| 706 |  |  | delY | 
| 707 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 708 |  |  | } | 
| 709 |  |  | is read in the routine | 
| 710 |  |  | {\it | 
| 711 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 712 |  |  | INI\_PARMS | 
| 713 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 714 |  |  | }. | 
| 715 |  |  |  | 
| 716 |  |  | \fbox{ | 
| 717 |  |  | \begin{minipage}{5.0in} | 
| 718 |  |  | {\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) | 
| 719 |  |  | \end{minipage} | 
| 720 |  |  | } | 
| 721 |  |  | {\bf | 
| 722 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/97.htm> \end{rawhtml} | 
| 723 |  |  | goto code | 
| 724 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 725 |  |  | } | 
| 726 |  |  |  | 
| 727 |  |  | \item Line 44, | 
| 728 |  |  | \begin{verbatim} | 
| 729 |  |  | delZ=500.,500.,500.,500., | 
| 730 |  |  | \end{verbatim} | 
| 731 |  |  | This line sets the vertical grid spacing between each z-coordinate line | 
| 732 |  |  | in the discrete grid to $500\,{\rm m}$, so that the total model depth | 
| 733 |  |  | is $2\,{\rm km}$. | 
| 734 |  |  | The variable | 
| 735 |  |  | {\bf | 
| 736 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/10W.htm> \end{rawhtml} | 
| 737 |  |  | delZ | 
| 738 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 739 |  |  | } | 
| 740 |  |  | is read in the routine | 
| 741 |  |  | {\it | 
| 742 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 743 |  |  | INI\_PARMS | 
| 744 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 745 |  |  | }. | 
| 746 |  |  | It is copied into the internal | 
| 747 |  |  | model coordinate variable | 
| 748 |  |  | {\bf | 
| 749 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/10Y.htm> \end{rawhtml} | 
| 750 |  |  | delR | 
| 751 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 752 |  |  | }. | 
| 753 |  |  |  | 
| 754 |  |  | \fbox{ | 
| 755 |  |  | \begin{minipage}{5.0in} | 
| 756 |  |  | {\it S/R INI\_VERTICAL\_GRID}({\it ini\_vertical\_grid.F}) | 
| 757 |  |  | \end{minipage} | 
| 758 |  |  | } | 
| 759 |  |  | {\bf | 
| 760 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/100.htm> \end{rawhtml} | 
| 761 |  |  | goto code | 
| 762 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 763 |  |  | } | 
| 764 |  |  |  | 
| 765 |  |  | \item Line 47, | 
| 766 |  |  | \begin{verbatim} | 
| 767 |  |  | bathyFile='topog.box' | 
| 768 |  |  | \end{verbatim} | 
| 769 |  |  | This line specifies the name of the file from which the domain | 
| 770 |  |  | bathymetry is read. This file is a two-dimensional ($x,y$) map of | 
| 771 |  |  | depths. This file is assumed to contain 64-bit binary numbers | 
| 772 |  |  | giving the depth of the model at each grid cell, ordered with the x | 
| 773 |  |  | coordinate varying fastest. The points are ordered from low coordinate | 
| 774 |  |  | to high coordinate for both axes. The units and orientation of the | 
| 775 |  |  | depths in this file are the same as used in the MITgcm code. In this | 
| 776 |  |  | experiment, a depth of $0m$ indicates a solid wall and a depth | 
| 777 |  |  | of $-2000m$ indicates open ocean. The matlab program | 
| 778 |  |  | {\it input/gendata.m} shows an example of how to generate a | 
| 779 |  |  | bathymetry file. | 
| 780 |  |  | The variable | 
| 781 |  |  | {\bf | 
| 782 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/179.htm> \end{rawhtml} | 
| 783 |  |  | bathyFile | 
| 784 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 785 |  |  | } | 
| 786 |  |  | is read in the routine | 
| 787 |  |  | {\it | 
| 788 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 789 |  |  | INI\_PARMS | 
| 790 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 791 |  |  | }. | 
| 792 |  |  |  | 
| 793 |  |  | \fbox{ | 
| 794 |  |  | \begin{minipage}{5.0in} | 
| 795 |  |  | {\it S/R INI\_DEPTHS}({\it ini\_depths.F}) | 
| 796 |  |  | \end{minipage} | 
| 797 |  |  | } | 
| 798 |  |  | {\bf | 
| 799 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/88.htm> \end{rawhtml} | 
| 800 |  |  | goto code | 
| 801 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 802 |  |  | } | 
| 803 |  |  |  | 
| 804 |  |  |  | 
| 805 |  |  | \item Line 50, | 
| 806 |  |  | \begin{verbatim} | 
| 807 |  |  | zonalWindFile='windx.sin_y' | 
| 808 |  |  | \end{verbatim} | 
| 809 |  |  | This line specifies the name of the file from which the x-direction | 
| 810 |  |  | surface wind stress is read. This file is also a two-dimensional | 
| 811 |  |  | ($x,y$) map and is enumerated and formatted in the same manner as the | 
| 812 |  |  | bathymetry file. The matlab program {\it input/gendata.m} includes example | 
| 813 |  |  | code to generate a valid | 
| 814 |  |  | {\bf zonalWindFile} | 
| 815 |  |  | file. | 
| 816 |  |  | The variable | 
| 817 |  |  | {\bf | 
| 818 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/names/13W.htm> \end{rawhtml} | 
| 819 |  |  | zonalWindFile | 
| 820 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 821 |  |  | } | 
| 822 |  |  | is read in the routine | 
| 823 |  |  | {\it | 
| 824 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/94.htm> \end{rawhtml} | 
| 825 |  |  | INI\_PARMS | 
| 826 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 827 |  |  | }. | 
| 828 |  |  |  | 
| 829 |  |  | \fbox{ | 
| 830 |  |  | \begin{minipage}{5.0in} | 
| 831 |  |  | {\it S/R EXTERNAL\_FIELDS\_LOAD}({\it external\_fields\_load.F}) | 
| 832 |  |  | \end{minipage} | 
| 833 |  |  | } | 
| 834 |  |  | {\bf | 
| 835 |  |  | \begin{rawhtml} <A href=../../../code_reference/vdb/code/75.htm> \end{rawhtml} | 
| 836 |  |  | goto code | 
| 837 |  |  | \begin{rawhtml} </A>\end{rawhtml} | 
| 838 |  |  | } | 
| 839 |  |  |  | 
| 840 |  |  | \end{itemize} | 
| 841 |  |  |  | 
| 842 |  |  | \noindent other lines in the file {\it input/data} are standard values | 
| 843 |  |  | that are described in the MITgcm Getting Started and MITgcm Parameters | 
| 844 |  |  | notes. | 
| 845 |  |  |  | 
| 846 |  |  | \begin{rawhtml}<PRE>\end{rawhtml} | 
| 847 |  |  | \begin{small} | 
| 848 |  |  | \input{part3/case_studies/fourlayer_gyre/input/data} | 
| 849 |  |  | \end{small} | 
| 850 |  |  | \begin{rawhtml}</PRE>\end{rawhtml} | 
| 851 |  |  |  | 
| 852 |  |  | \subsubsection{File {\it input/data.pkg}} | 
| 853 |  |  |  | 
| 854 |  |  | This file uses standard default values and does not contain | 
| 855 |  |  | customisations for this experiment. | 
| 856 |  |  |  | 
| 857 |  |  | \subsubsection{File {\it input/eedata}} | 
| 858 |  |  |  | 
| 859 |  |  | This file uses standard default values and does not contain | 
| 860 |  |  | customisations for this experiment. | 
| 861 |  |  |  | 
| 862 |  |  | \subsubsection{File {\it input/windx.sin\_y}} | 
| 863 |  |  |  | 
| 864 |  |  | The {\it input/windx.sin\_y} file specifies a two-dimensional ($x,y$) | 
| 865 |  |  | map of wind stress ,$\tau_{x}$, values. The units used are $Nm^{-2}$. | 
| 866 |  |  | Although $\tau_{x}$ is only a function of $y$n in this experiment | 
| 867 |  |  | this file must still define a complete two-dimensional map in order | 
| 868 |  |  | to be compatible with the standard code for loading forcing fields | 
| 869 |  |  | in MITgcm. The included matlab program {\it input/gendata.m} gives a complete | 
| 870 |  |  | code for creating the {\it input/windx.sin\_y} file. | 
| 871 |  |  |  | 
| 872 |  |  | \subsubsection{File {\it input/topog.box}} | 
| 873 |  |  |  | 
| 874 |  |  |  | 
| 875 |  |  | The {\it input/topog.box} file specifies a two-dimensional ($x,y$) | 
| 876 |  |  | map of depth values. For this experiment values are either | 
| 877 |  |  | $0m$ or $-2000\,{\rm m}$, corresponding respectively to a wall or to deep | 
| 878 |  |  | ocean. The file contains a raw binary stream of data that is enumerated | 
| 879 |  |  | in the same way as standard MITgcm two-dimensional, horizontal arrays. | 
| 880 |  |  | The included matlab program {\it input/gendata.m} gives a complete | 
| 881 |  |  | code for creating the {\it input/topog.box} file. | 
| 882 |  |  |  | 
| 883 |  |  | \subsubsection{File {\it code/SIZE.h}} | 
| 884 |  |  |  | 
| 885 |  |  | Two lines are customized in this file for the current experiment | 
| 886 |  |  |  | 
| 887 |  |  | \begin{itemize} | 
| 888 |  |  |  | 
| 889 |  |  | \item Line 39, | 
| 890 |  |  | \begin{verbatim} sNx=60, \end{verbatim} this line sets | 
| 891 |  |  | the lateral domain extent in grid points for the | 
| 892 |  |  | axis aligned with the x-coordinate. | 
| 893 |  |  |  | 
| 894 |  |  | \item Line 40, | 
| 895 |  |  | \begin{verbatim} sNy=60, \end{verbatim} this line sets | 
| 896 |  |  | the lateral domain extent in grid points for the | 
| 897 |  |  | axis aligned with the y-coordinate. | 
| 898 |  |  |  | 
| 899 |  |  | \item Line 49, | 
| 900 |  |  | \begin{verbatim} Nr=4,   \end{verbatim} this line sets | 
| 901 |  |  | the vertical domain extent in grid points. | 
| 902 |  |  |  | 
| 903 |  |  | \end{itemize} | 
| 904 |  |  |  | 
| 905 |  |  | \begin{small} | 
| 906 |  |  | \include{part3/case_studies/fourlayer_gyre/code/SIZE.h} | 
| 907 |  |  | \end{small} | 
| 908 |  |  |  | 
| 909 |  |  | \subsubsection{File {\it code/CPP\_OPTIONS.h}} | 
| 910 |  |  |  | 
| 911 |  |  | This file uses standard default values and does not contain | 
| 912 |  |  | customisations for this experiment. | 
| 913 |  |  |  | 
| 914 |  |  |  | 
| 915 |  |  | \subsubsection{File {\it code/CPP\_EEOPTIONS.h}} | 
| 916 |  |  |  | 
| 917 |  |  | This file uses standard default values and does not contain | 
| 918 |  |  | customisations for this experiment. | 
| 919 |  |  |  | 
| 920 |  |  | \subsubsection{Other Files } | 
| 921 |  |  |  | 
| 922 |  |  | Other files relevant to this experiment are | 
| 923 |  |  | \begin{itemize} | 
| 924 |  |  | \item {\it model/src/ini\_cori.F}. This file initializes the model | 
| 925 |  |  | coriolis variables {\bf fCorU} and {\bf fCorV}. | 
| 926 |  |  | \item {\it model/src/ini\_spherical\_polar\_grid.F} This file | 
| 927 |  |  | initializes the model grid discretisation variables {\bf | 
| 928 |  |  | dxF, dyF, dxG, dyG, dxC, dyC}. | 
| 929 |  |  | \item {\it model/src/ini\_parms.F}. | 
| 930 |  |  | \end{itemize} | 
| 931 |  |  |  | 
| 932 |  |  | \subsection{Running The Example} | 
| 933 |  |  | \label{SEC:running_the_example} | 
| 934 |  |  |  | 
| 935 |  |  | \subsubsection{Code Download} | 
| 936 |  |  |  | 
| 937 |  |  | In order to run the examples you must first download the code distribution. | 
| 938 |  |  | Instructions for downloading the code can be found in the Getting Started | 
| 939 |  |  | Guide \cite{MITgcm_Getting_Started}. | 
| 940 |  |  |  | 
| 941 |  |  | \subsubsection{Experiment Location} | 
| 942 |  |  |  | 
| 943 |  |  | This example experiments is located under the release sub-directory | 
| 944 |  |  |  | 
| 945 |  |  | \vspace{5mm} | 
| 946 |  |  | {\it verification/exp1/ } | 
| 947 |  |  |  | 
| 948 |  |  | \subsubsection{Running the Experiment} | 
| 949 |  |  |  | 
| 950 |  |  | To run the experiment | 
| 951 |  |  |  | 
| 952 |  |  | \begin{enumerate} | 
| 953 |  |  | \item Set the current directory to {\it input/ } | 
| 954 |  |  |  | 
| 955 |  |  | \begin{verbatim} | 
| 956 |  |  | % cd input | 
| 957 |  |  | \end{verbatim} | 
| 958 |  |  |  | 
| 959 |  |  | \item Verify that current directory is now correct | 
| 960 |  |  |  | 
| 961 |  |  | \begin{verbatim} | 
| 962 |  |  | % pwd | 
| 963 |  |  | \end{verbatim} | 
| 964 |  |  |  | 
| 965 |  |  | You shold see a response on the screen ending in | 
| 966 |  |  |  | 
| 967 |  |  | {\it verification/exp1/input } | 
| 968 |  |  |  | 
| 969 |  |  |  | 
| 970 |  |  | \item Run the genmake script to create the experiment {\it Makefile} | 
| 971 |  |  |  | 
| 972 |  |  | \begin{verbatim} | 
| 973 |  |  | % ../../../tools/genmake -mods=../code | 
| 974 |  |  | \end{verbatim} | 
| 975 |  |  |  | 
| 976 |  |  | \item Create a list of header file dependencies in {\it Makefile} | 
| 977 |  |  |  | 
| 978 |  |  | \begin{verbatim} | 
| 979 |  |  | % make depend | 
| 980 |  |  | \end{verbatim} | 
| 981 |  |  |  | 
| 982 |  |  | \item Build the executable file. | 
| 983 |  |  |  | 
| 984 |  |  | \begin{verbatim} | 
| 985 |  |  | % make | 
| 986 |  |  | \end{verbatim} | 
| 987 |  |  |  | 
| 988 |  |  | \item Run the {\it mitgcmuv} executable | 
| 989 |  |  |  | 
| 990 |  |  | \begin{verbatim} | 
| 991 |  |  | % ./mitgcmuv | 
| 992 |  |  | \end{verbatim} | 
| 993 |  |  |  | 
| 994 |  |  | \end{enumerate} | 
| 995 |  |  |  | 
| 996 |  |  |  |