/[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.3 - (show annotations) (download) (as text)
Wed Oct 24 15:21:27 2001 UTC (23 years, 9 months ago) by cnh
Branch: MAIN
Changes since 1.2: +83 -33 lines
File MIME type: application/x-tex
Labels, symbols, equations etc...

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

  ViewVC Help
Powered by ViewVC 1.1.22