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

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

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


Revision 1.16 - (hide annotations) (download) (as text)
Mon Sep 15 19:39:04 2003 UTC (21 years, 10 months ago) by edhill
Branch: MAIN
Changes since 1.15: +219 -509 lines
File MIME type: application/x-tex
many source code link fixes (more needed)

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

  ViewVC Help
Powered by ViewVC 1.1.22