/[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.21 - (hide annotations) (download) (as text)
Tue Jun 27 19:08:22 2006 UTC (19 years ago) by molod
Branch: MAIN
Changes since 1.20: +4 -8 lines
File MIME type: application/x-tex
Add cross references between tutorials and verification file system directories

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

  ViewVC Help
Powered by ViewVC 1.1.22