/[MITgcm]/manual/s_examples/baroclinic_gyre/fourlayer.tex
ViewVC logotype

Contents of /manual/s_examples/baroclinic_gyre/fourlayer.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.20 - (show annotations) (download) (as text)
Sat Apr 8 01:50:50 2006 UTC (19 years, 3 months ago) by edhill
Branch: MAIN
Changes since 1.19: +2 -2 lines
File MIME type: application/x-tex
LaTeX syntax cleanups:
 - the degree symbols ("\circ") are now properly raised after latex2html
 - don't use $...$ when it should be \textit{...}

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

  ViewVC Help
Powered by ViewVC 1.1.22