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

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

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

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

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.22