1 |
cnh |
1.18 |
% $Header: /u/gcmpack/manual/part3/case_studies/fourlayer_gyre/fourlayer.tex,v 1.17 2004/01/29 17:36:26 edhill Exp $ |
2 |
cnh |
1.2 |
% $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
cnh |
1.18 |
\section[Baroclinic Gyre MITgcm Example]{Four Layer Baroclinic Ocean Gyre In Spherical Coordinates} |
5 |
adcroft |
1.13 |
\label{www:tutorials} |
6 |
adcroft |
1.11 |
\label{sect:eg-fourlayer} |
7 |
adcroft |
1.1 |
|
8 |
|
|
\bodytext{bgcolor="#FFFFFFFF"} |
9 |
|
|
|
10 |
|
|
%\begin{center} |
11 |
|
|
%{\Large \bf Using MITgcm to Simulate a Baroclinic Ocean Gyre In Spherical |
12 |
|
|
%Polar Coordinates} |
13 |
|
|
% |
14 |
|
|
%\vspace*{4mm} |
15 |
|
|
% |
16 |
|
|
%\vspace*{3mm} |
17 |
|
|
%{\large May 2001} |
18 |
|
|
%\end{center} |
19 |
|
|
|
20 |
cnh |
1.3 |
This document describes an example experiment using MITgcm |
21 |
|
|
to simulate a baroclinic ocean gyre in spherical |
22 |
|
|
polar coordinates. The barotropic |
23 |
adcroft |
1.11 |
example experiment in section \ref{sect:eg-baro} |
24 |
cnh |
1.9 |
illustrated how to configure the code for a single layer |
25 |
|
|
simulation in a Cartesian grid. In this example a similar physical problem |
26 |
adcroft |
1.1 |
is simulated, but the code is now configured |
27 |
|
|
for four layers and in a spherical polar coordinate system. |
28 |
|
|
|
29 |
|
|
\subsection{Overview} |
30 |
adcroft |
1.13 |
\label{www:tutorials} |
31 |
adcroft |
1.1 |
|
32 |
|
|
This example experiment demonstrates using the MITgcm to simulate |
33 |
|
|
a baroclinic, wind-forced, ocean gyre circulation. The experiment |
34 |
cnh |
1.9 |
is a numerical rendition of the gyre circulation problem similar |
35 |
adcroft |
1.1 |
to the problems described analytically by Stommel in 1966 |
36 |
|
|
\cite{Stommel66} and numerically in Holland et. al \cite{Holland75}. |
37 |
|
|
\\ |
38 |
|
|
|
39 |
|
|
In this experiment the model is configured to represent a mid-latitude |
40 |
|
|
enclosed sector of fluid on a sphere, $60^{\circ} \times 60^{\circ}$ in |
41 |
|
|
lateral extent. The fluid is $2$~km deep and is forced |
42 |
cnh |
1.5 |
by a constant in time zonal wind stress, $\tau_{\lambda}$, that varies |
43 |
|
|
sinusoidally in the north-south direction. Topologically the simulated |
44 |
adcroft |
1.1 |
domain is a sector on a sphere and the coriolis parameter, $f$, is defined |
45 |
cnh |
1.3 |
according to latitude, $\varphi$ |
46 |
adcroft |
1.1 |
|
47 |
|
|
\begin{equation} |
48 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-fcori} |
49 |
cnh |
1.3 |
f(\varphi) = 2 \Omega \sin( \varphi ) |
50 |
adcroft |
1.1 |
\end{equation} |
51 |
|
|
|
52 |
|
|
\noindent with the rotation rate, $\Omega$ set to $\frac{2 \pi}{86400s}$. |
53 |
|
|
\\ |
54 |
|
|
|
55 |
|
|
The sinusoidal wind-stress variations are defined according to |
56 |
|
|
|
57 |
|
|
\begin{equation} |
58 |
|
|
\label{EQ:taux} |
59 |
cnh |
1.5 |
\tau_{\lambda}(\varphi) = \tau_{0}\sin(\pi \frac{\varphi}{L_{\varphi}}) |
60 |
adcroft |
1.1 |
\end{equation} |
61 |
|
|
|
62 |
cnh |
1.3 |
\noindent where $L_{\varphi}$ is the lateral domain extent ($60^{\circ}$) and |
63 |
adcroft |
1.1 |
$\tau_0$ is set to $0.1N m^{-2}$. |
64 |
|
|
\\ |
65 |
|
|
|
66 |
cnh |
1.12 |
Figure \ref{FIG:eg-fourlayer-simulation_config} |
67 |
cnh |
1.9 |
summarizes the configuration simulated. |
68 |
adcroft |
1.11 |
In contrast to the example in section \ref{sect:eg-baro}, the |
69 |
cnh |
1.5 |
current experiment simulates a spherical polar domain. As indicated |
70 |
adcroft |
1.1 |
by the axes in the lower left of the figure the model code works internally |
71 |
cnh |
1.9 |
in a locally orthogonal coordinate $(x,y,z)$. For this experiment description |
72 |
|
|
the local orthogonal model coordinate $(x,y,z)$ is synonymous |
73 |
cnh |
1.8 |
with the coordinates $(\lambda,\varphi,r)$ shown in figure |
74 |
cnh |
1.3 |
\ref{fig:spherical-polar-coord} |
75 |
adcroft |
1.1 |
\\ |
76 |
|
|
|
77 |
|
|
The experiment has four levels in the vertical, each of equal thickness, |
78 |
|
|
$\Delta z = 500$~m. Initially the fluid is stratified with a reference |
79 |
|
|
potential temperature profile, |
80 |
|
|
$\theta_{250}=20^{\circ}$~C, |
81 |
|
|
$\theta_{750}=10^{\circ}$~C, |
82 |
|
|
$\theta_{1250}=8^{\circ}$~C, |
83 |
|
|
$\theta_{1750}=6^{\circ}$~C. The equation of state used in this experiment is |
84 |
|
|
linear |
85 |
|
|
|
86 |
|
|
\begin{equation} |
87 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-linear1_eos} |
88 |
adcroft |
1.1 |
\rho = \rho_{0} ( 1 - \alpha_{\theta}\theta^{'} ) |
89 |
|
|
\end{equation} |
90 |
|
|
|
91 |
|
|
\noindent which is implemented in the model as a density anomaly equation |
92 |
|
|
|
93 |
|
|
\begin{equation} |
94 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-linear1_eos_pert} |
95 |
adcroft |
1.1 |
\rho^{'} = -\rho_{0}\alpha_{\theta}\theta^{'} |
96 |
|
|
\end{equation} |
97 |
|
|
|
98 |
|
|
\noindent with $\rho_{0}=999.8\,{\rm kg\,m}^{-3}$ and |
99 |
|
|
$\alpha_{\theta}=2\times10^{-4}\,{\rm degrees}^{-1} $. Integrated forward in |
100 |
cnh |
1.5 |
this configuration the model state variable {\bf theta} is equivalent to |
101 |
adcroft |
1.1 |
either in-situ temperature, $T$, or potential temperature, $\theta$. For |
102 |
|
|
consistency with later examples, in which the equation of state is |
103 |
|
|
non-linear, we use $\theta$ to represent temperature here. This is |
104 |
|
|
the quantity that is carried in the model core equations. |
105 |
|
|
|
106 |
|
|
\begin{figure} |
107 |
edhill |
1.17 |
%% \begin{center} |
108 |
|
|
%% \resizebox{7.5in}{5.5in}{ |
109 |
|
|
%% \includegraphics*[0.2in,0.7in][10.5in,10.5in] |
110 |
|
|
%% {part3/case_studies/fourlayer_gyre/simulation_config.eps} } |
111 |
|
|
%% \end{center} |
112 |
|
|
\centerline{ |
113 |
|
|
\scalefig{.95} |
114 |
|
|
\epsfbox{part3/case_studies/fourlayer_gyre/simulation_config.eps} |
115 |
|
|
} |
116 |
adcroft |
1.1 |
\caption{Schematic of simulation domain and wind-stress forcing function |
117 |
|
|
for the four-layer gyre numerical experiment. The domain is enclosed by solid |
118 |
|
|
walls at $0^{\circ}$~E, $60^{\circ}$~E, $0^{\circ}$~N and $60^{\circ}$~N. |
119 |
cnh |
1.5 |
An initial stratification is |
120 |
adcroft |
1.1 |
imposed by setting the potential temperature, $\theta$, in each layer. |
121 |
|
|
The vertical spacing, $\Delta z$, is constant and equal to $500$m. |
122 |
|
|
} |
123 |
cnh |
1.12 |
\label{FIG:eg-fourlayer-simulation_config} |
124 |
adcroft |
1.1 |
\end{figure} |
125 |
|
|
|
126 |
cnh |
1.3 |
\subsection{Equations solved} |
127 |
adcroft |
1.13 |
\label{www:tutorials} |
128 |
cnh |
1.8 |
For this problem |
129 |
adcroft |
1.11 |
the implicit free surface, {\bf HPE} (see section \ref{sect:hydrostatic_and_quasi-hydrostatic_forms}) form of the |
130 |
adcroft |
1.10 |
equations described in Marshall et. al \cite{marshall:97a} are |
131 |
cnh |
1.5 |
employed. The flow is three-dimensional with just temperature, $\theta$, as |
132 |
|
|
an active tracer. The equation of state is linear. |
133 |
cnh |
1.9 |
A horizontal Laplacian operator $\nabla_{h}^2$ provides viscous |
134 |
cnh |
1.5 |
dissipation and provides a diffusive sub-grid scale closure for the |
135 |
|
|
temperature equation. A wind-stress momentum forcing is added to the momentum |
136 |
|
|
equation for the zonal flow, $u$. Other terms in the model |
137 |
cnh |
1.9 |
are explicitly switched off for this experiment configuration (see section |
138 |
cnh |
1.5 |
\ref{SEC:eg_fourl_code_config} ). This yields an active set of equations |
139 |
cnh |
1.3 |
solved in this configuration, written in spherical polar coordinates as |
140 |
|
|
follows |
141 |
adcroft |
1.1 |
|
142 |
|
|
\begin{eqnarray} |
143 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-model_equations} |
144 |
adcroft |
1.1 |
\frac{Du}{Dt} - fv + |
145 |
cnh |
1.4 |
\frac{1}{\rho}\frac{\partial p^{\prime}}{\partial \lambda} - |
146 |
adcroft |
1.1 |
A_{h}\nabla_{h}^2u - A_{z}\frac{\partial^{2}u}{\partial z^{2}} |
147 |
|
|
& = & |
148 |
cnh |
1.5 |
\cal{F}_{\lambda} |
149 |
adcroft |
1.1 |
\\ |
150 |
|
|
\frac{Dv}{Dt} + fu + |
151 |
cnh |
1.4 |
\frac{1}{\rho}\frac{\partial p^{\prime}}{\partial \varphi} - |
152 |
adcroft |
1.1 |
A_{h}\nabla_{h}^2v - A_{z}\frac{\partial^{2}v}{\partial z^{2}} |
153 |
|
|
& = & |
154 |
|
|
0 |
155 |
|
|
\\ |
156 |
cnh |
1.5 |
\frac{\partial \eta}{\partial t} + \frac{\partial H \widehat{u}}{\partial \lambda} + |
157 |
|
|
\frac{\partial H \widehat{v}}{\partial \varphi} |
158 |
adcroft |
1.1 |
&=& |
159 |
|
|
0 |
160 |
cnh |
1.5 |
\label{eq:fourl_example_continuity} |
161 |
adcroft |
1.1 |
\\ |
162 |
|
|
\frac{D\theta}{Dt} - |
163 |
|
|
K_{h}\nabla_{h}^2\theta - K_{z}\frac{\partial^{2}\theta}{\partial z^{2}} |
164 |
|
|
& = & |
165 |
|
|
0 |
166 |
cnh |
1.5 |
\label{eq:eg_fourl_theta} |
167 |
adcroft |
1.1 |
\\ |
168 |
cnh |
1.4 |
p^{\prime} & = & |
169 |
|
|
g\rho_{0} \eta + \int^{0}_{-z}\rho^{\prime} dz |
170 |
cnh |
1.3 |
\\ |
171 |
cnh |
1.4 |
\rho^{\prime} & = &- \alpha_{\theta}\rho_{0}\theta^{\prime} |
172 |
adcroft |
1.1 |
\\ |
173 |
cnh |
1.5 |
{\cal F}_{\lambda} |_{s} & = & \frac{\tau_{\lambda}}{\rho_{0}\Delta z_{s}} |
174 |
adcroft |
1.1 |
\\ |
175 |
cnh |
1.5 |
{\cal F}_{\lambda} |_{i} & = & 0 |
176 |
adcroft |
1.1 |
\end{eqnarray} |
177 |
|
|
|
178 |
cnh |
1.3 |
\noindent where $u$ and $v$ are the components of the horizontal |
179 |
|
|
flow vector $\vec{u}$ on the sphere ($u=\dot{\lambda},v=\dot{\varphi}$). |
180 |
cnh |
1.5 |
The terms $H\widehat{u}$ and $H\widehat{v}$ are the components of the vertical |
181 |
|
|
integral term given in equation \ref{eq:free-surface} and |
182 |
|
|
explained in more detail in section \ref{sect:pressure-method-linear-backward}. |
183 |
|
|
However, for the problem presented here, the continuity relation (equation |
184 |
|
|
\ref{eq:fourl_example_continuity}) differs from the general form given |
185 |
|
|
in section \ref{sect:pressure-method-linear-backward}, |
186 |
|
|
equation \ref{eq:linear-free-surface=P-E+R}, because the source terms |
187 |
|
|
${\cal P}-{\cal E}+{\cal R}$ |
188 |
|
|
are all $0$. |
189 |
cnh |
1.4 |
|
190 |
|
|
The pressure field, $p^{\prime}$, is separated into a barotropic part |
191 |
cnh |
1.3 |
due to variations in sea-surface height, $\eta$, and a hydrostatic |
192 |
cnh |
1.5 |
part due to variations in density, $\rho^{\prime}$, integrated |
193 |
|
|
through the water column. |
194 |
|
|
|
195 |
cnh |
1.8 |
The suffices ${s},{i}$ indicate surface layer and the interior of the domain. |
196 |
cnh |
1.5 |
The windstress forcing, ${\cal F}_{\lambda}$, is applied in the surface layer |
197 |
|
|
by a source term in the zonal momentum equation. In the ocean interior |
198 |
|
|
this term is zero. |
199 |
|
|
|
200 |
|
|
In the momentum equations |
201 |
|
|
lateral and vertical boundary conditions for the $\nabla_{h}^{2}$ |
202 |
|
|
and $\frac{\partial^{2}}{\partial z^{2}}$ operators are specified |
203 |
|
|
when the numerical simulation is run - see section |
204 |
|
|
\ref{SEC:eg_fourl_code_config}. For temperature |
205 |
|
|
the boundary condition is ``zero-flux'' |
206 |
|
|
e.g. $\frac{\partial \theta}{\partial \varphi}= |
207 |
|
|
\frac{\partial \theta}{\partial \lambda}=\frac{\partial \theta}{\partial z}=0$. |
208 |
|
|
|
209 |
|
|
|
210 |
cnh |
1.3 |
|
211 |
|
|
\subsection{Discrete Numerical Configuration} |
212 |
adcroft |
1.13 |
\label{www:tutorials} |
213 |
cnh |
1.3 |
|
214 |
cnh |
1.5 |
The domain is discretised with |
215 |
cnh |
1.3 |
a uniform grid spacing in latitude and longitude |
216 |
|
|
$\Delta \lambda=\Delta \varphi=1^{\circ}$, so |
217 |
|
|
that there are sixty grid cells in the zonal and meridional directions. |
218 |
|
|
Vertically the |
219 |
cnh |
1.4 |
model is configured with four layers with constant depth, |
220 |
cnh |
1.3 |
$\Delta z$, of $500$~m. The internal, locally orthogonal, model coordinate |
221 |
cnh |
1.9 |
variables $x$ and $y$ are initialized from the values of |
222 |
cnh |
1.3 |
$\lambda$, $\varphi$, $\Delta \lambda$ and $\Delta \varphi$ in |
223 |
|
|
radians according to |
224 |
|
|
|
225 |
|
|
\begin{eqnarray} |
226 |
|
|
x=r\cos(\varphi)\lambda,~\Delta x & = &r\cos(\varphi)\Delta \lambda \\ |
227 |
|
|
y=r\varphi,~\Delta y &= &r\Delta \varphi |
228 |
|
|
\end{eqnarray} |
229 |
|
|
|
230 |
|
|
The procedure for generating a set of internal grid variables from a |
231 |
|
|
spherical polar grid specification is discussed in section |
232 |
adcroft |
1.11 |
\ref{sect:spatial_discrete_horizontal_grid}. |
233 |
cnh |
1.3 |
|
234 |
|
|
\noindent\fbox{ \begin{minipage}{5.5in} |
235 |
|
|
{\em S/R INI\_SPHERICAL\_POLAR\_GRID} ({\em |
236 |
|
|
model/src/ini\_spherical\_polar\_grid.F}) |
237 |
|
|
|
238 |
|
|
$A_c$, $A_\zeta$, $A_w$, $A_s$: {\bf rAc}, {\bf rAz}, {\bf rAw}, {\bf rAs} |
239 |
|
|
({\em GRID.h}) |
240 |
|
|
|
241 |
|
|
$\Delta x_g$, $\Delta y_g$: {\bf DXg}, {\bf DYg} ({\em GRID.h}) |
242 |
|
|
|
243 |
|
|
$\Delta x_c$, $\Delta y_c$: {\bf DXc}, {\bf DYc} ({\em GRID.h}) |
244 |
|
|
|
245 |
|
|
$\Delta x_f$, $\Delta y_f$: {\bf DXf}, {\bf DYf} ({\em GRID.h}) |
246 |
|
|
|
247 |
|
|
$\Delta x_v$, $\Delta y_u$: {\bf DXv}, {\bf DYu} ({\em GRID.h}) |
248 |
|
|
|
249 |
|
|
\end{minipage} }\\ |
250 |
|
|
|
251 |
|
|
|
252 |
|
|
|
253 |
adcroft |
1.11 |
As described in \ref{sect:tracer_equations}, the time evolution of potential |
254 |
cnh |
1.3 |
temperature, |
255 |
cnh |
1.5 |
$\theta$, (equation \ref{eq:eg_fourl_theta}) |
256 |
|
|
is evaluated prognostically. The centered second-order scheme with |
257 |
|
|
Adams-Bashforth time stepping described in section |
258 |
adcroft |
1.11 |
\ref{sect:tracer_equations_abII} is used to step forward the temperature |
259 |
cnh |
1.8 |
equation. Prognostic terms in |
260 |
|
|
the momentum equations are solved using flux form as |
261 |
adcroft |
1.11 |
described in section \ref{sect:flux-form_momentum_eqautions}. |
262 |
cnh |
1.8 |
The pressure forces that drive the fluid motions, ( |
263 |
cnh |
1.3 |
$\frac{\partial p^{'}}{\partial \lambda}$ and $\frac{\partial p^{'}}{\partial \varphi}$), are found by summing pressure due to surface |
264 |
cnh |
1.5 |
elevation $\eta$ and the hydrostatic pressure. The hydrostatic part of the |
265 |
cnh |
1.8 |
pressure is diagnosed explicitly by integrating density. The sea-surface |
266 |
|
|
height, $\eta$, is diagnosed using an implicit scheme. The pressure |
267 |
|
|
field solution method is described in sections |
268 |
|
|
\ref{sect:pressure-method-linear-backward} and |
269 |
adcroft |
1.11 |
\ref{sect:finding_the_pressure_field}. |
270 |
adcroft |
1.1 |
|
271 |
|
|
\subsubsection{Numerical Stability Criteria} |
272 |
adcroft |
1.13 |
\label{www:tutorials} |
273 |
adcroft |
1.1 |
|
274 |
cnh |
1.9 |
The Laplacian viscosity coefficient, $A_{h}$, is set to $400 m s^{-1}$. |
275 |
cnh |
1.8 |
This value is chosen to yield a Munk layer width, |
276 |
adcroft |
1.1 |
|
277 |
|
|
\begin{eqnarray} |
278 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-munk_layer} |
279 |
adcroft |
1.1 |
M_{w} = \pi ( \frac { A_{h} }{ \beta } )^{\frac{1}{3}} |
280 |
|
|
\end{eqnarray} |
281 |
|
|
|
282 |
|
|
\noindent of $\approx 100$km. This is greater than the model |
283 |
cnh |
1.8 |
resolution in mid-latitudes |
284 |
|
|
$\Delta x=r \cos(\varphi) \Delta \lambda \approx 80~{\rm km}$ at |
285 |
|
|
$\varphi=45^{\circ}$, ensuring that the frictional |
286 |
adcroft |
1.1 |
boundary layer is well resolved. |
287 |
|
|
\\ |
288 |
|
|
|
289 |
|
|
\noindent The model is stepped forward with a |
290 |
|
|
time step $\delta t=1200$secs. With this time step the stability |
291 |
cnh |
1.9 |
parameter to the horizontal Laplacian friction |
292 |
adcroft |
1.1 |
|
293 |
|
|
\begin{eqnarray} |
294 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-laplacian_stability} |
295 |
adcroft |
1.1 |
S_{l} = 4 \frac{A_{h} \delta t}{{\Delta x}^2} |
296 |
|
|
\end{eqnarray} |
297 |
|
|
|
298 |
|
|
\noindent evaluates to 0.012, which is well below the 0.3 upper limit |
299 |
cnh |
1.8 |
for stability for this term under ABII time-stepping. |
300 |
adcroft |
1.1 |
\\ |
301 |
|
|
|
302 |
|
|
\noindent The vertical dissipation coefficient, $A_{z}$, is set to |
303 |
|
|
$1\times10^{-2} {\rm m}^2{\rm s}^{-1}$. The associated stability limit |
304 |
|
|
|
305 |
|
|
\begin{eqnarray} |
306 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-laplacian_stability_z} |
307 |
adcroft |
1.1 |
S_{l} = 4 \frac{A_{z} \delta t}{{\Delta z}^2} |
308 |
|
|
\end{eqnarray} |
309 |
|
|
|
310 |
|
|
\noindent evaluates to $4.8 \times 10^{-5}$ which is again well below |
311 |
|
|
the upper limit. |
312 |
|
|
The values of $A_{h}$ and $A_{z}$ are also used for the horizontal ($K_{h}$) |
313 |
|
|
and vertical ($K_{z}$) diffusion coefficients for temperature respectively. |
314 |
|
|
\\ |
315 |
|
|
|
316 |
|
|
\noindent The numerical stability for inertial oscillations |
317 |
|
|
|
318 |
|
|
\begin{eqnarray} |
319 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-inertial_stability} |
320 |
adcroft |
1.1 |
S_{i} = f^{2} {\delta t}^2 |
321 |
|
|
\end{eqnarray} |
322 |
|
|
|
323 |
|
|
\noindent evaluates to $0.0144$, which is well below the $0.5$ upper |
324 |
|
|
limit for stability. |
325 |
|
|
\\ |
326 |
|
|
|
327 |
cnh |
1.8 |
\noindent The advective CFL for a extreme maximum |
328 |
adcroft |
1.1 |
horizontal flow |
329 |
|
|
speed of $ | \vec{u} | = 2 ms^{-1}$ |
330 |
|
|
|
331 |
|
|
\begin{eqnarray} |
332 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-cfl_stability} |
333 |
cnh |
1.8 |
C_{a} = \frac{| \vec{u} | \delta t}{ \Delta x} |
334 |
adcroft |
1.1 |
\end{eqnarray} |
335 |
|
|
|
336 |
|
|
\noindent evaluates to $5 \times 10^{-2}$. This is well below the stability |
337 |
|
|
limit of 0.5. |
338 |
|
|
\\ |
339 |
|
|
|
340 |
cnh |
1.8 |
\noindent The stability parameter for internal gravity waves |
341 |
cnh |
1.9 |
propagating at $2~{\rm m}~{\rm s}^{-1}$ |
342 |
adcroft |
1.1 |
|
343 |
|
|
\begin{eqnarray} |
344 |
cnh |
1.12 |
\label{EQ:eg-fourlayer-igw_stability} |
345 |
adcroft |
1.1 |
S_{c} = \frac{c_{g} \delta t}{ \Delta x} |
346 |
|
|
\end{eqnarray} |
347 |
|
|
|
348 |
cnh |
1.8 |
\noindent evaluates to $\approx 5 \times 10^{-2}$. This is well below the linear |
349 |
adcroft |
1.1 |
stability limit of 0.25. |
350 |
|
|
|
351 |
|
|
\subsection{Code Configuration} |
352 |
adcroft |
1.13 |
\label{www:tutorials} |
353 |
cnh |
1.5 |
\label{SEC:eg_fourl_code_config} |
354 |
adcroft |
1.1 |
|
355 |
|
|
The model configuration for this experiment resides under the |
356 |
cnh |
1.8 |
directory {\it verification/exp2/}. The experiment files |
357 |
adcroft |
1.1 |
\begin{itemize} |
358 |
|
|
\item {\it input/data} |
359 |
|
|
\item {\it input/data.pkg} |
360 |
|
|
\item {\it input/eedata}, |
361 |
|
|
\item {\it input/windx.sin\_y}, |
362 |
|
|
\item {\it input/topog.box}, |
363 |
|
|
\item {\it code/CPP\_EEOPTIONS.h} |
364 |
|
|
\item {\it code/CPP\_OPTIONS.h}, |
365 |
|
|
\item {\it code/SIZE.h}. |
366 |
|
|
\end{itemize} |
367 |
edhill |
1.15 |
contain the code customisations and parameter settings for this |
368 |
|
|
experiment. Below we describe the customisations to these files |
369 |
|
|
associated with this experiment. |
370 |
adcroft |
1.1 |
|
371 |
|
|
\subsubsection{File {\it input/data}} |
372 |
adcroft |
1.13 |
\label{www:tutorials} |
373 |
adcroft |
1.1 |
|
374 |
|
|
This file, reproduced completely below, specifies the main parameters |
375 |
|
|
for the experiment. The parameters that are significant for this configuration |
376 |
|
|
are |
377 |
|
|
|
378 |
|
|
\begin{itemize} |
379 |
|
|
|
380 |
|
|
\item Line 4, |
381 |
|
|
\begin{verbatim} tRef=20.,10.,8.,6., \end{verbatim} |
382 |
edhill |
1.16 |
this line sets the initial and reference values of potential |
383 |
|
|
temperature at each model level in units of $^{\circ}$C. The entries |
384 |
|
|
are ordered from surface to depth. For each depth level the initial |
385 |
|
|
and reference profiles will be uniform in $x$ and $y$. The values |
386 |
|
|
specified here are read into the variable \varlink{tRef}{tRef} in the |
387 |
|
|
model code, by procedure \filelink{INI\_PARMS}{model-src-ini_parms.F} |
388 |
adcroft |
1.1 |
|
389 |
|
|
\fbox{ |
390 |
edhill |
1.16 |
\begin{minipage}{5.0in} |
391 |
|
|
{\it S/R INI\_THETA}({\it ini\_theta.F}) |
392 |
|
|
\end{minipage} |
393 |
adcroft |
1.1 |
} |
394 |
edhill |
1.15 |
\filelink{ini\_theta.F}{model-src-ini_theta.F} |
395 |
adcroft |
1.1 |
|
396 |
|
|
\item Line 6, |
397 |
|
|
\begin{verbatim} viscAz=1.E-2, \end{verbatim} |
398 |
edhill |
1.16 |
this line sets the vertical Laplacian dissipation coefficient to $1 |
399 |
|
|
\times 10^{-2} {\rm m^{2}s^{-1}}$. Boundary conditions for this |
400 |
|
|
operator are specified later. The variable \varlink{viscAz}{viscAz} |
401 |
|
|
is read in the routine \filelink{ini\_parms.F}{model-src-ini_parms.F} |
402 |
|
|
and is copied into model general vertical coordinate variable |
403 |
|
|
\varlink{viscAr}{viscAr} At each time step, the viscous term |
404 |
|
|
contribution to the momentum equations is calculated in routine |
405 |
edhill |
1.15 |
\varlink{CALC\_DIFFUSIVITY}{CALC_DIFFUSIVITY} |
406 |
adcroft |
1.1 |
|
407 |
|
|
\fbox{ |
408 |
|
|
\begin{minipage}{5.0in} |
409 |
|
|
{\it S/R CALC\_DIFFUSIVITY}({\it calc\_diffusivity.F}) |
410 |
|
|
\end{minipage} |
411 |
|
|
} |
412 |
|
|
|
413 |
|
|
\item Line 7, |
414 |
|
|
\begin{verbatim} |
415 |
|
|
viscAh=4.E2, |
416 |
|
|
\end{verbatim} |
417 |
edhill |
1.16 |
this line sets the horizontal laplacian frictional dissipation |
418 |
|
|
coefficient to $1 \times 10^{-2} {\rm m^{2}s^{-1}}$. Boundary |
419 |
|
|
conditions for this operator are specified later. The variable |
420 |
|
|
\varlink{viscAh}{viscAh} is read in the routine |
421 |
|
|
\varlink{INI\_PARMS}{INI_PARMS} and applied in routines |
422 |
|
|
\varlink{CALC\_MOM\_RHS}{CALC_MOM_RHS} and |
423 |
|
|
\varlink{CALC\_GW}{CALC_GW}. |
424 |
adcroft |
1.1 |
|
425 |
|
|
\fbox{ |
426 |
edhill |
1.16 |
\begin{minipage}{5.0in} |
427 |
|
|
{\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) |
428 |
|
|
\end{minipage} |
429 |
adcroft |
1.1 |
} |
430 |
|
|
\fbox{ |
431 |
edhill |
1.16 |
\begin{minipage}{5.0in} |
432 |
|
|
{\it S/R CALC\_GW}({\it calc\_gw.F}) |
433 |
|
|
\end{minipage} |
434 |
adcroft |
1.1 |
} |
435 |
|
|
|
436 |
edhill |
1.16 |
\item Line 8, |
437 |
adcroft |
1.1 |
\begin{verbatim} |
438 |
|
|
no_slip_sides=.FALSE. |
439 |
|
|
\end{verbatim} |
440 |
edhill |
1.16 |
this line selects a free-slip lateral boundary condition for the |
441 |
|
|
horizontal laplacian friction operator e.g. $\frac{\partial |
442 |
|
|
u}{\partial y}$=0 along boundaries in $y$ and $\frac{\partial |
443 |
|
|
v}{\partial x}$=0 along boundaries in $x$. The variable |
444 |
|
|
\varlink{no\_slip\_sides}{no_slip_sides} is read in the routine |
445 |
|
|
\varlink{INI\_PARMS}{INI_PARMS} and the boundary condition is |
446 |
|
|
evaluated in routine |
447 |
|
|
|
448 |
|
|
\fbox{ |
449 |
|
|
\begin{minipage}{5.0in} |
450 |
|
|
{\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) |
451 |
|
|
\end{minipage} |
452 |
|
|
} |
453 |
|
|
\filelink{calc\_mom\_rhs.F}{calc_mom_rhs.F} |
454 |
|
|
|
455 |
adcroft |
1.1 |
\item Lines 9, |
456 |
|
|
\begin{verbatim} |
457 |
|
|
no_slip_bottom=.TRUE. |
458 |
|
|
\end{verbatim} |
459 |
edhill |
1.16 |
this line selects a no-slip boundary condition for bottom boundary |
460 |
|
|
condition in the vertical laplacian friction operator e.g. $u=v=0$ |
461 |
|
|
at $z=-H$, where $H$ is the local depth of the domain. The variable |
462 |
|
|
\varlink{no\_slip\_bottom}{no\_slip\_bottom} is read in the routine |
463 |
|
|
\filelink{INI\_PARMS}{model-src-ini_parms.F} and is applied in the |
464 |
|
|
routine \varlink{CALC\_MOM\_RHS}{CALC_MOM_RHS}. |
465 |
|
|
|
466 |
|
|
\fbox{ |
467 |
|
|
\begin{minipage}{5.0in} |
468 |
|
|
{\it S/R CALC\_MOM\_RHS}({\it calc\_mom\_rhs.F}) |
469 |
|
|
\end{minipage} |
470 |
|
|
} |
471 |
|
|
\filelink{calc\_mom\_rhs.F}{calc_mom_rhs.F} |
472 |
adcroft |
1.1 |
|
473 |
|
|
\item Line 10, |
474 |
|
|
\begin{verbatim} |
475 |
|
|
diffKhT=4.E2, |
476 |
|
|
\end{verbatim} |
477 |
edhill |
1.16 |
this line sets the horizontal diffusion coefficient for temperature |
478 |
|
|
to $400\,{\rm m^{2}s^{-1}}$. The boundary condition on this operator |
479 |
|
|
is $\frac{\partial}{\partial x}=\frac{\partial}{\partial y}=0$ at |
480 |
|
|
all boundaries. The variable \varlink{diffKhT}{diffKhT} is read in |
481 |
|
|
the routine \varlink{INI\_PARMS}{INI_PARMS} and used in routine |
482 |
|
|
\varlink{CALC\_GT}{CALC_GT}. |
483 |
|
|
|
484 |
|
|
\fbox{ \begin{minipage}{5.0in} |
485 |
|
|
{\it S/R CALC\_GT}({\it calc\_gt.F}) |
486 |
|
|
\end{minipage} |
487 |
|
|
} |
488 |
|
|
\filelink{calc\_gt.F}{model-src-calc_gt.F} |
489 |
adcroft |
1.1 |
|
490 |
|
|
\item Line 11, |
491 |
|
|
\begin{verbatim} |
492 |
|
|
diffKzT=1.E-2, |
493 |
|
|
\end{verbatim} |
494 |
edhill |
1.16 |
this line sets the vertical diffusion coefficient for temperature to |
495 |
|
|
$10^{-2}\,{\rm m^{2}s^{-1}}$. The boundary condition on this |
496 |
|
|
operator is $\frac{\partial}{\partial z}$ = 0 on all boundaries. |
497 |
|
|
The variable \varlink{diffKzT}{diffKzT} is read in the routine |
498 |
|
|
\varlink{INI\_PARMS}{INI_PARMS}. It is copied into model general |
499 |
|
|
vertical coordinate variable \varlink{diffKrT}{diffKrT} which is |
500 |
|
|
used in routine \varlink{CALC\_DIFFUSIVITY}{CALC_DIFFUSIVITY}. |
501 |
|
|
|
502 |
|
|
\fbox{ \begin{minipage}{5.0in} |
503 |
|
|
{\it S/R CALC\_DIFFUSIVITY}({\it calc\_diffusivity.F}) |
504 |
|
|
\end{minipage} |
505 |
|
|
} |
506 |
|
|
\filelink{calc\_diffusivity.F}{model-src-calc_diffusivity.F} |
507 |
adcroft |
1.1 |
|
508 |
|
|
\item Line 13, |
509 |
|
|
\begin{verbatim} |
510 |
|
|
tAlpha=2.E-4, |
511 |
|
|
\end{verbatim} |
512 |
edhill |
1.16 |
This line sets the thermal expansion coefficient for the fluid to $2 |
513 |
|
|
\times 10^{-4}\,{\rm degrees}^{-1}$ The variable |
514 |
|
|
\varlink{tAlpha}{tAlpha} is read in the routine |
515 |
|
|
\varlink{INI\_PARMS}{INI_PARMS}. The routine |
516 |
|
|
\varlink{FIND\_RHO}{FIND\_RHO} makes use of {\bf tAlpha}. |
517 |
|
|
|
518 |
|
|
\fbox{ |
519 |
|
|
\begin{minipage}{5.0in} |
520 |
|
|
{\it S/R FIND\_RHO}({\it find\_rho.F}) |
521 |
|
|
\end{minipage} |
522 |
|
|
} |
523 |
|
|
\filelink{find\_rho.F}{model-src-find_rho.F} |
524 |
adcroft |
1.1 |
|
525 |
|
|
\item Line 18, |
526 |
|
|
\begin{verbatim} |
527 |
|
|
eosType='LINEAR' |
528 |
|
|
\end{verbatim} |
529 |
edhill |
1.16 |
This line selects the linear form of the equation of state. The |
530 |
|
|
variable \varlink{eosType}{eosType} is read in the routine |
531 |
|
|
\varlink{INI\_PARMS}{INI_PARMS}. The values of {\bf eosType} sets |
532 |
|
|
which formula in routine {\it FIND\_RHO} is used to calculate |
533 |
|
|
density. |
534 |
|
|
|
535 |
|
|
\fbox{ |
536 |
|
|
\begin{minipage}{5.0in} |
537 |
|
|
{\it S/R FIND\_RHO}({\it find\_rho.F}) |
538 |
|
|
\end{minipage} |
539 |
|
|
} |
540 |
|
|
\filelink{find\_rho.F}{model-src-find_rho.F} |
541 |
adcroft |
1.1 |
|
542 |
|
|
\item Line 40, |
543 |
|
|
\begin{verbatim} |
544 |
|
|
usingSphericalPolarGrid=.TRUE., |
545 |
|
|
\end{verbatim} |
546 |
edhill |
1.16 |
This line requests that the simulation be performed in a spherical |
547 |
|
|
polar coordinate system. It affects the interpretation of grid input |
548 |
|
|
parameters, for example {\bf delX} and {\bf delY} and causes the |
549 |
|
|
grid generation routines to initialize an internal grid based on |
550 |
|
|
spherical polar geometry. The variable |
551 |
|
|
\varlink{usingSphericalPolarGrid}{usingSphericalPolarGrid} is read |
552 |
|
|
in the routine \varlink{INI\_PARMS}{INI_PARMS}. When set to {\bf |
553 |
|
|
.TRUE.} the settings of {\bf delX} and {\bf delY} are taken to be |
554 |
|
|
in degrees. These values are used in the routine |
555 |
|
|
|
556 |
|
|
\fbox{ |
557 |
|
|
\begin{minipage}{5.0in} |
558 |
|
|
{\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) |
559 |
|
|
\end{minipage} |
560 |
|
|
} |
561 |
|
|
\filelink{ini\_spherical\_polar\_grid.F}{model-src-ini_spherical_polar_grid.F} |
562 |
adcroft |
1.1 |
|
563 |
|
|
\item Line 41, |
564 |
|
|
\begin{verbatim} |
565 |
|
|
phiMin=0., |
566 |
|
|
\end{verbatim} |
567 |
edhill |
1.16 |
This line sets the southern boundary of the modeled domain to |
568 |
|
|
$0^{\circ}$ latitude. This value affects both the generation of the |
569 |
|
|
locally orthogonal grid that the model uses internally and affects |
570 |
|
|
the initialization of the coriolis force. Note - it is not required |
571 |
|
|
to set a longitude boundary, since the absolute longitude does not |
572 |
|
|
alter the kernel equation discretisation. The variable |
573 |
|
|
\varlink{phiMin}{phiMin} is read in the |
574 |
|
|
routine \varlink{INI\_PARMS}{INI_PARMS} and is used in routine |
575 |
|
|
|
576 |
|
|
\fbox{ |
577 |
|
|
\begin{minipage}{5.0in} |
578 |
|
|
{\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) |
579 |
|
|
\end{minipage} |
580 |
|
|
} |
581 |
|
|
\filelink{ini\_spherical\_polar\_grid.F}{model-src-ini_spherical_polar_grid.F} |
582 |
adcroft |
1.1 |
|
583 |
|
|
\item Line 42, |
584 |
|
|
\begin{verbatim} |
585 |
|
|
delX=60*1., |
586 |
|
|
\end{verbatim} |
587 |
edhill |
1.16 |
This line sets the horizontal grid spacing between each y-coordinate |
588 |
|
|
line in the discrete grid to $1^{\circ}$ in longitude. The variable |
589 |
|
|
\varlink{delX}{delX} is read in the routine |
590 |
|
|
\varlink{INI\_PARMS}{INI_PARMS} and is used in routine |
591 |
|
|
|
592 |
|
|
\fbox{ |
593 |
|
|
\begin{minipage}{5.0in} |
594 |
|
|
{\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) |
595 |
|
|
\end{minipage} |
596 |
|
|
} |
597 |
|
|
\filelink{ini\_spherical\_polar\_grid.F}{model-src-ini_spherical_polar_grid.F} |
598 |
adcroft |
1.1 |
|
599 |
|
|
\item Line 43, |
600 |
|
|
\begin{verbatim} |
601 |
|
|
delY=60*1., |
602 |
|
|
\end{verbatim} |
603 |
edhill |
1.16 |
This line sets the horizontal grid spacing between each y-coordinate |
604 |
|
|
line in the discrete grid to $1^{\circ}$ in latitude. The variable |
605 |
|
|
\varlink{delY}{delY} is read in the routine |
606 |
|
|
\varlink{INI\_PARMS}{INI_PARMS} and is used in routine |
607 |
|
|
|
608 |
|
|
\fbox{ |
609 |
|
|
\begin{minipage}{5.0in} |
610 |
|
|
{\it S/R INI\_SPEHRICAL\_POLAR\_GRID}({\it ini\_spherical\_polar\_grid.F}) |
611 |
|
|
\end{minipage} |
612 |
|
|
} |
613 |
|
|
\filelink{ini\_spherical\_polar\_grid.F}{model-src-ini_spherical_polar_grid.F} |
614 |
adcroft |
1.1 |
|
615 |
|
|
\item Line 44, |
616 |
|
|
\begin{verbatim} |
617 |
|
|
delZ=500.,500.,500.,500., |
618 |
|
|
\end{verbatim} |
619 |
edhill |
1.16 |
This line sets the vertical grid spacing between each z-coordinate |
620 |
|
|
line in the discrete grid to $500\,{\rm m}$, so that the total model |
621 |
|
|
depth is $2\,{\rm km}$. The variable \varlink{delZ}{delZ} is read |
622 |
|
|
in the routine \varlink{INI\_PARMS}{INI_PARMS}. It is copied into |
623 |
|
|
the internal model coordinate variable \varlink{delR}{delR} which is |
624 |
|
|
used in routine |
625 |
|
|
|
626 |
|
|
\fbox{ |
627 |
|
|
\begin{minipage}{5.0in} |
628 |
|
|
{\it S/R INI\_VERTICAL\_GRID}({\it ini\_vertical\_grid.F}) |
629 |
|
|
\end{minipage} |
630 |
|
|
} |
631 |
|
|
\filelink{ini\_vertical\_grid.F}{model-src-ini_vertical_grid.F} |
632 |
adcroft |
1.1 |
|
633 |
|
|
\item Line 47, |
634 |
|
|
\begin{verbatim} |
635 |
|
|
bathyFile='topog.box' |
636 |
|
|
\end{verbatim} |
637 |
edhill |
1.16 |
This line specifies the name of the file from which the domain |
638 |
|
|
bathymetry is read. This file is a two-dimensional ($x,y$) map of |
639 |
|
|
depths. This file is assumed to contain 64-bit binary numbers giving |
640 |
|
|
the depth of the model at each grid cell, ordered with the x |
641 |
|
|
coordinate varying fastest. The points are ordered from low |
642 |
|
|
coordinate to high coordinate for both axes. The units and |
643 |
|
|
orientation of the depths in this file are the same as used in the |
644 |
|
|
MITgcm code. In this experiment, a depth of $0m$ indicates a solid |
645 |
|
|
wall and a depth of $-2000m$ indicates open ocean. The matlab |
646 |
|
|
program {\it input/gendata.m} shows an example of how to generate a |
647 |
|
|
bathymetry file. The variable \varlink{bathyFile}{bathyFile} is |
648 |
|
|
read in the routine \varlink{INI\_PARMS}{INI_PARMS}. The bathymetry |
649 |
|
|
file is read in the routine |
650 |
|
|
|
651 |
|
|
\fbox{ |
652 |
|
|
\begin{minipage}{5.0in} |
653 |
|
|
{\it S/R INI\_DEPTHS}({\it ini\_depths.F}) |
654 |
|
|
\end{minipage} |
655 |
|
|
} |
656 |
|
|
\filelink{ini\_depths.F}{model-src-ini_depths.F} |
657 |
adcroft |
1.1 |
|
658 |
|
|
\item Line 50, |
659 |
|
|
\begin{verbatim} |
660 |
|
|
zonalWindFile='windx.sin_y' |
661 |
|
|
\end{verbatim} |
662 |
edhill |
1.16 |
This line specifies the name of the file from which the x-direction |
663 |
|
|
(zonal) surface wind stress is read. This file is also a |
664 |
|
|
two-dimensional ($x,y$) map and is enumerated and formatted in the |
665 |
|
|
same manner as the bathymetry file. The matlab program {\it |
666 |
|
|
input/gendata.m} includes example code to generate a valid {\bf |
667 |
|
|
zonalWindFile} file. The variable |
668 |
|
|
\varlink{zonalWindFile}{zonalWindFile} is read in the routine |
669 |
|
|
\varlink{INI\_PARMS}{INI_PARMS}. The wind-stress file is read in |
670 |
|
|
the routine |
671 |
|
|
|
672 |
|
|
\fbox{ |
673 |
|
|
\begin{minipage}{5.0in} |
674 |
|
|
{\it S/R EXTERNAL\_FIELDS\_LOAD}({\it external\_fields\_load.F}) |
675 |
|
|
\end{minipage} |
676 |
|
|
} |
677 |
|
|
\filelink{external\_fields\_load.F}{model-src-external_fields_load.F} |
678 |
adcroft |
1.1 |
|
679 |
|
|
\end{itemize} |
680 |
|
|
|
681 |
cnh |
1.8 |
\noindent other lines in the file {\it input/data} are standard values. |
682 |
adcroft |
1.1 |
|
683 |
|
|
\begin{rawhtml}<PRE>\end{rawhtml} |
684 |
|
|
\begin{small} |
685 |
|
|
\input{part3/case_studies/fourlayer_gyre/input/data} |
686 |
|
|
\end{small} |
687 |
|
|
\begin{rawhtml}</PRE>\end{rawhtml} |
688 |
|
|
|
689 |
|
|
\subsubsection{File {\it input/data.pkg}} |
690 |
adcroft |
1.13 |
\label{www:tutorials} |
691 |
adcroft |
1.1 |
|
692 |
|
|
This file uses standard default values and does not contain |
693 |
|
|
customisations for this experiment. |
694 |
|
|
|
695 |
|
|
\subsubsection{File {\it input/eedata}} |
696 |
adcroft |
1.13 |
\label{www:tutorials} |
697 |
adcroft |
1.1 |
|
698 |
|
|
This file uses standard default values and does not contain |
699 |
|
|
customisations for this experiment. |
700 |
|
|
|
701 |
|
|
\subsubsection{File {\it input/windx.sin\_y}} |
702 |
adcroft |
1.13 |
\label{www:tutorials} |
703 |
adcroft |
1.1 |
|
704 |
edhill |
1.16 |
The {\it input/windx.sin\_y} file specifies a two-dimensional ($x,y$) |
705 |
|
|
map of wind stress ,$\tau_{x}$, values. The units used are $Nm^{-2}$ |
706 |
|
|
(the default for MITgcm). Although $\tau_{x}$ is only a function of |
707 |
|
|
latitude, $y$, in this experiment this file must still define a |
708 |
|
|
complete two-dimensional map in order to be compatible with the |
709 |
|
|
standard code for loading forcing fields in MITgcm (routine {\it |
710 |
|
|
EXTERNAL\_FIELDS\_LOAD}. The included matlab program {\it |
711 |
|
|
input/gendata.m} gives a complete code for creating the {\it |
712 |
|
|
input/windx.sin\_y} file. |
713 |
adcroft |
1.1 |
|
714 |
|
|
\subsubsection{File {\it input/topog.box}} |
715 |
adcroft |
1.13 |
\label{www:tutorials} |
716 |
adcroft |
1.1 |
|
717 |
|
|
|
718 |
|
|
The {\it input/topog.box} file specifies a two-dimensional ($x,y$) |
719 |
|
|
map of depth values. For this experiment values are either |
720 |
cnh |
1.8 |
$0~{\rm m}$ or $-2000\,{\rm m}$, corresponding respectively to a wall or to deep |
721 |
adcroft |
1.1 |
ocean. The file contains a raw binary stream of data that is enumerated |
722 |
|
|
in the same way as standard MITgcm two-dimensional, horizontal arrays. |
723 |
|
|
The included matlab program {\it input/gendata.m} gives a complete |
724 |
|
|
code for creating the {\it input/topog.box} file. |
725 |
|
|
|
726 |
|
|
\subsubsection{File {\it code/SIZE.h}} |
727 |
adcroft |
1.13 |
\label{www:tutorials} |
728 |
adcroft |
1.1 |
|
729 |
|
|
Two lines are customized in this file for the current experiment |
730 |
|
|
|
731 |
|
|
\begin{itemize} |
732 |
|
|
|
733 |
|
|
\item Line 39, |
734 |
|
|
\begin{verbatim} sNx=60, \end{verbatim} this line sets |
735 |
|
|
the lateral domain extent in grid points for the |
736 |
|
|
axis aligned with the x-coordinate. |
737 |
|
|
|
738 |
|
|
\item Line 40, |
739 |
|
|
\begin{verbatim} sNy=60, \end{verbatim} this line sets |
740 |
|
|
the lateral domain extent in grid points for the |
741 |
|
|
axis aligned with the y-coordinate. |
742 |
|
|
|
743 |
|
|
\item Line 49, |
744 |
|
|
\begin{verbatim} Nr=4, \end{verbatim} this line sets |
745 |
|
|
the vertical domain extent in grid points. |
746 |
|
|
|
747 |
|
|
\end{itemize} |
748 |
|
|
|
749 |
|
|
\begin{small} |
750 |
|
|
\include{part3/case_studies/fourlayer_gyre/code/SIZE.h} |
751 |
|
|
\end{small} |
752 |
|
|
|
753 |
|
|
\subsubsection{File {\it code/CPP\_OPTIONS.h}} |
754 |
adcroft |
1.13 |
\label{www:tutorials} |
755 |
adcroft |
1.1 |
|
756 |
|
|
This file uses standard default values and does not contain |
757 |
|
|
customisations for this experiment. |
758 |
|
|
|
759 |
|
|
|
760 |
|
|
\subsubsection{File {\it code/CPP\_EEOPTIONS.h}} |
761 |
adcroft |
1.13 |
\label{www:tutorials} |
762 |
adcroft |
1.1 |
|
763 |
|
|
This file uses standard default values and does not contain |
764 |
|
|
customisations for this experiment. |
765 |
|
|
|
766 |
|
|
\subsubsection{Other Files } |
767 |
adcroft |
1.13 |
\label{www:tutorials} |
768 |
adcroft |
1.1 |
|
769 |
|
|
Other files relevant to this experiment are |
770 |
|
|
\begin{itemize} |
771 |
|
|
\item {\it model/src/ini\_cori.F}. This file initializes the model |
772 |
|
|
coriolis variables {\bf fCorU} and {\bf fCorV}. |
773 |
|
|
\item {\it model/src/ini\_spherical\_polar\_grid.F} This file |
774 |
|
|
initializes the model grid discretisation variables {\bf |
775 |
|
|
dxF, dyF, dxG, dyG, dxC, dyC}. |
776 |
|
|
\item {\it model/src/ini\_parms.F}. |
777 |
|
|
\end{itemize} |
778 |
|
|
|
779 |
|
|
\subsection{Running The Example} |
780 |
adcroft |
1.13 |
\label{www:tutorials} |
781 |
adcroft |
1.1 |
\label{SEC:running_the_example} |
782 |
|
|
|
783 |
|
|
\subsubsection{Code Download} |
784 |
adcroft |
1.13 |
\label{www:tutorials} |
785 |
adcroft |
1.1 |
|
786 |
|
|
In order to run the examples you must first download the code distribution. |
787 |
cnh |
1.8 |
Instructions for downloading the code can be found in section |
788 |
|
|
\ref{sect:obtainingCode}. |
789 |
adcroft |
1.1 |
|
790 |
|
|
\subsubsection{Experiment Location} |
791 |
adcroft |
1.13 |
\label{www:tutorials} |
792 |
adcroft |
1.1 |
|
793 |
|
|
This example experiments is located under the release sub-directory |
794 |
|
|
|
795 |
|
|
\vspace{5mm} |
796 |
cnh |
1.8 |
{\it verification/exp2/ } |
797 |
adcroft |
1.1 |
|
798 |
|
|
\subsubsection{Running the Experiment} |
799 |
adcroft |
1.13 |
\label{www:tutorials} |
800 |
adcroft |
1.1 |
|
801 |
|
|
To run the experiment |
802 |
|
|
|
803 |
|
|
\begin{enumerate} |
804 |
|
|
\item Set the current directory to {\it input/ } |
805 |
|
|
|
806 |
|
|
\begin{verbatim} |
807 |
|
|
% cd input |
808 |
|
|
\end{verbatim} |
809 |
|
|
|
810 |
|
|
\item Verify that current directory is now correct |
811 |
|
|
|
812 |
|
|
\begin{verbatim} |
813 |
|
|
% pwd |
814 |
|
|
\end{verbatim} |
815 |
|
|
|
816 |
cnh |
1.9 |
You should see a response on the screen ending in |
817 |
adcroft |
1.1 |
|
818 |
cnh |
1.8 |
{\it verification/exp2/input } |
819 |
adcroft |
1.1 |
|
820 |
|
|
|
821 |
|
|
\item Run the genmake script to create the experiment {\it Makefile} |
822 |
|
|
|
823 |
|
|
\begin{verbatim} |
824 |
|
|
% ../../../tools/genmake -mods=../code |
825 |
|
|
\end{verbatim} |
826 |
|
|
|
827 |
|
|
\item Create a list of header file dependencies in {\it Makefile} |
828 |
|
|
|
829 |
|
|
\begin{verbatim} |
830 |
|
|
% make depend |
831 |
|
|
\end{verbatim} |
832 |
|
|
|
833 |
|
|
\item Build the executable file. |
834 |
|
|
|
835 |
|
|
\begin{verbatim} |
836 |
|
|
% make |
837 |
|
|
\end{verbatim} |
838 |
|
|
|
839 |
|
|
\item Run the {\it mitgcmuv} executable |
840 |
|
|
|
841 |
|
|
\begin{verbatim} |
842 |
|
|
% ./mitgcmuv |
843 |
|
|
\end{verbatim} |
844 |
|
|
|
845 |
|
|
\end{enumerate} |
846 |
|
|
|
847 |
|
|
|