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

  ViewVC Help
Powered by ViewVC 1.1.22