| 4 |
\bodytext{bgcolor="#FFFFFFFF"} |
\bodytext{bgcolor="#FFFFFFFF"} |
| 5 |
|
|
| 6 |
%\begin{center} |
%\begin{center} |
| 7 |
%{\Large \bf Using MITgcm to Simulate a Rotating Tank in Cylindrical |
%{\Large \bf Using MITgcm to Simulate a Rotating Tank in Cylindrical |
| 8 |
%Coordinates} |
%Coordinates} |
| 9 |
% |
% |
| 10 |
%\vspace*{4mm} |
%\vspace*{4mm} |
| 11 |
% |
% |
| 12 |
%\vspace*{3mm} |
%\vspace*{3mm} |
| 13 |
%{\large June 2004} |
%{\large May 2001} |
| 14 |
%\end{center} |
%\end{center} |
| 15 |
|
|
| 16 |
This is the first in a series of tutorials describing |
\section{A Rotating Tank in Cylindrical Coordinates} |
| 17 |
example MITgcm numerical experiments. The example experiments |
\label{sect:eg-tank} |
|
include both straightforward examples of idealized geophysical |
|
|
fluid simulations and more involved cases encompassing |
|
|
large scale modeling and |
|
|
automatic differentiation. Both hydrostatic and non-hydrostatic |
|
|
experiments are presented, as well as experiments employing |
|
|
Cartesian, spherical-polar and cube-sphere coordinate systems. |
|
|
These ``case study'' documents include information describing |
|
|
the experimental configuration and detailed information on how to |
|
|
configure the MITgcm code and input files for each experiment. |
|
|
|
|
|
\section{Barotropic Ocean Gyre In Cartesian Coordinates} |
|
|
\label{sect:eg-baro} |
|
| 18 |
\label{www:tutorials} |
\label{www:tutorials} |
| 19 |
|
\begin{rawhtml} |
| 20 |
|
<!-- CMIREDIR:eg-tank: --> |
| 21 |
|
\end{rawhtml} |
| 22 |
|
\begin{center} |
| 23 |
|
(in directory: {\it verification/rotating\_tank/}) |
| 24 |
|
\end{center} |
| 25 |
|
|
| 26 |
|
\subsection{Overview} |
| 27 |
|
\label{www:tutorials} |
| 28 |
|
|
| 29 |
|
This example configuration demonstrates using the MITgcm to simulate a |
| 30 |
|
laboratory demonstration using a differentially heated rotating |
| 31 |
|
annulus of water. The simulation is configured for a laboratory scale |
| 32 |
|
on a $3^{\circ}\times1\mathrm{cm}$ cyclindrical grid with twenty-nine |
| 33 |
|
vertical levels of 0.5cm each. This is a typical laboratory setup for |
| 34 |
|
illustration principles of GFD, as well as for a laboratory data |
| 35 |
|
assimilation project. The files for this experiment can be found in |
| 36 |
|
the verification directory under rotating\_tank. |
| 37 |
|
\\ |
| 38 |
|
|
| 39 |
|
example illustration from GFD lab here |
| 40 |
|
\\ |
| 41 |
|
|
| 42 |
|
|
|
\subsection{Equations Solved} |
|
|
\label{www:tutorials} |
|
|
The model is configured in hydrostatic form. The implicit free surface form of the |
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
\subsection{Discrete Numerical Configuration} |
\subsection{Equations Solved} |
| 47 |
\label{www:tutorials} |
\label{www:tutorials} |
| 48 |
|
|
|
The domain is discretised with |
|
|
a uniform grid spacing in the horizontal set to |
|
|
$\Delta x=\Delta y=20$~km, so |
|
|
that there are sixty grid cells in the $x$ and $y$ directions. Vertically the |
|
|
model is configured with a single layer with depth, $\Delta z$, of $5000$~m. |
|
| 49 |
|
|
| 50 |
\subsubsection{Numerical Stability Criteria} |
\subsection{Discrete Numerical Configuration} |
| 51 |
\label{www:tutorials} |
\label{www:tutorials} |
| 52 |
|
|
| 53 |
|
The domain is discretised with a uniform cylindrical grid spacing in |
| 54 |
|
the horizontal set to $\Delta a=1$~cm and $\Delta \phi=3^{\circ}$, so |
| 55 |
|
that there are 120 grid cells in the azimuthal direction and |
| 56 |
|
thirty-one grid cells in the radial, representing a tank 62cm in |
| 57 |
|
diameter. The bathymetry file sets the depth=0 in the nine lowest |
| 58 |
|
radial rows to represent the central of the annulus. Vertically the |
| 59 |
|
model is configured with twenty-nine layers of uniform 0.5cm |
| 60 |
|
thickness. |
| 61 |
|
\\ |
| 62 |
|
something about heat flux |
| 63 |
|
|
| 64 |
\subsection{Code Configuration} |
\subsection{Code Configuration} |
| 65 |
\label{www:tutorials} |
\label{www:tutorials} |
| 66 |
\label{SEC:eg-baro-code_config} |
\label{SEC:eg-baro-code_config} |
| 67 |
|
|
| 68 |
The model configuration for this experiment resides under the |
The model configuration for this experiment resides under the |
| 69 |
directory {\it verification/exp0/}. The experiment files |
directory {\it verification/rotatingi\_tank/}. The experiment files |
| 70 |
\begin{itemize} |
\begin{itemize} |
| 71 |
\item {\it input/data} |
\item {\it input/data} |
| 72 |
\item {\it input/data.pkg} |
\item {\it input/data.pkg} |
| 73 |
\item {\it input/eedata}, |
\item {\it input/eedata}, |
| 74 |
\item {\it input/windx.sin\_y}, |
\item {\it input/bathyPol.bin}, |
| 75 |
\item {\it input/topog.box}, |
\item {\it input/thetaPol.bin}, |
| 76 |
\item {\it code/CPP\_EEOPTIONS.h} |
\item {\it code/CPP\_EEOPTIONS.h} |
| 77 |
\item {\it code/CPP\_OPTIONS.h}, |
\item {\it code/CPP\_OPTIONS.h}, |
| 78 |
\item {\it code/SIZE.h}. |
\item {\it code/SIZE.h}. |
| 79 |
\end{itemize} |
\end{itemize} |
| 80 |
|
|
| 81 |
contain the code customizations and parameter settings for this |
contain the code customizations and parameter settings for this |
| 82 |
experiments. Below we describe the customizations |
experiments. Below we describe the customizations |
| 83 |
to these files associated with this experiment. |
to these files associated with this experiment. |
| 91 |
|
|
| 92 |
\begin{itemize} |
\begin{itemize} |
| 93 |
|
|
| 94 |
\item Line 7, \begin{verbatim} viscAh=4.E2, \end{verbatim} this line sets |
\item Lines 9-10, \begin{verbatim} |
| 95 |
the Laplacian friction coefficient to $400 m^2s^{-1}$ |
viscAh=5.0E-6, |
| 96 |
\item Line 10, \begin{verbatim} beta=1.E-11, \end{verbatim} this line sets |
viscAz=5.0E-6, |
| 97 |
$\beta$ (the gradient of the coriolis parameter, $f$) to $10^{-11} s^{-1}m^{-1}$ |
\end{verbatim} |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
These lines set the Laplacian friction coefficient in the horizontal |
| 101 |
|
and vertical, respectively. Note that they are several orders of |
| 102 |
|
magnitude smaller than the other examples due to the small scale of |
| 103 |
|
this example. |
| 104 |
|
|
| 105 |
|
\item Lines 13-16, \begin{verbatim} |
| 106 |
|
diffKhT=2.5E-6, |
| 107 |
|
diffKzT=2.5E-6, |
| 108 |
|
diffKhS=1.0E-6, |
| 109 |
|
diffKzS=1.0E-6, |
| 110 |
|
|
| 111 |
|
\end{verbatim} |
| 112 |
|
|
| 113 |
|
|
| 114 |
|
These lines set horizontal and vertical diffusion coefficients for |
| 115 |
|
temperature and salinity. Similarly to the friction coefficients, the |
| 116 |
|
values are a couple of orders of magnitude less than most |
| 117 |
|
configurations. |
| 118 |
|
|
| 119 |
|
|
| 120 |
\item Lines 15 and 16 |
\item Line 17, \begin{verbatim}f0=0.5 , \end{verbatim} this line sets the |
| 121 |
|
coriolis term, and represents a tank spinning at about 2.4 rpm. |
| 122 |
|
|
| 123 |
|
\item Lines 23 and 24 |
| 124 |
\begin{verbatim} |
\begin{verbatim} |
| 125 |
rigidLid=.FALSE., |
rigidLid=.TRUE., |
| 126 |
implicitFreeSurface=.TRUE., |
implicitFreeSurface=.FALSE., |
| 127 |
\end{verbatim} |
\end{verbatim} |
| 128 |
these lines suppress the rigid lid formulation of the surface |
|
| 129 |
pressure inverter and activate the implicit free surface form |
These lines activate the rigid lid formulation of the surface |
| 130 |
|
pressure inverter and suppress the implicit free surface form |
| 131 |
of the pressure inverter. |
of the pressure inverter. |
| 132 |
|
|
| 133 |
\item Line 27, |
\item Line 40, |
| 134 |
\begin{verbatim} |
\begin{verbatim} |
| 135 |
startTime=0, |
nIter=0, |
| 136 |
\end{verbatim} |
\end{verbatim} |
| 137 |
this line indicates that the experiment should start from $t=0$ |
This line indicates that the experiment should start from $t=0$ and |
| 138 |
and implicitly suppresses searching for checkpoint files associated |
implicitly suppresses searching for checkpoint files associated with |
| 139 |
with restarting an numerical integration from a previously saved state. |
restarting an numerical integration from a previously saved state. |
| 140 |
|
Instead, the file thetaPol.bin will be loaded to initialized the |
| 141 |
|
temperature fields as indicated below, and other variables will be |
| 142 |
|
initialized to their defaults. |
| 143 |
|
|
|
\item Line 29, |
|
|
\begin{verbatim} |
|
|
endTime=12000, |
|
|
\end{verbatim} |
|
|
this line indicates that the experiment should start finish at $t=12000s$. |
|
|
A restart file will be written at this time that will enable the |
|
|
simulation to be continued from this point. |
|
| 144 |
|
|
| 145 |
\item Line 30, |
\item Line 43, |
| 146 |
\begin{verbatim} |
\begin{verbatim} |
| 147 |
deltaTmom=1200, |
deltaT=0.1, |
| 148 |
\end{verbatim} |
\end{verbatim} |
| 149 |
This line sets the momentum equation timestep to $1200s$. |
This line sets the integration timestep to $0.1s$. This is an |
| 150 |
|
unsually small value among the examples due to the small physical |
| 151 |
|
scale of the experiment. Using the ensemble Kalman filter to produce |
| 152 |
|
input fields can necessitate even shorter timesteps. |
| 153 |
|
|
| 154 |
\item Line 39, |
\item Line 56, |
| 155 |
\begin{verbatim} |
\begin{verbatim} |
| 156 |
usingCartesianGrid=.TRUE., |
usingCylindricalGrid=.TRUE., |
| 157 |
\end{verbatim} |
\end{verbatim} |
| 158 |
This line requests that the simulation be performed in a |
This line requests that the simulation be performed in a |
| 159 |
Cartesian coordinate system. |
cylindrical coordinate system. |
| 160 |
|
|
| 161 |
\item Line 41, |
\item Line 57, |
| 162 |
\begin{verbatim} |
\begin{verbatim} |
| 163 |
delX=60*20E3, |
dXspacing=3, |
| 164 |
\end{verbatim} |
\end{verbatim} |
| 165 |
This line sets the horizontal grid spacing between each x-coordinate line |
This line sets the azimuthal grid spacing between each $x$-coordinate line |
| 166 |
in the discrete grid. The syntax indicates that the discrete grid |
in the discrete grid. The syntax indicates that the discrete grid |
| 167 |
should be comprise of $60$ grid lines each separated by $20 \times 10^{3}m$ |
should be comprised of $120$ grid lines each separated by $3^{\circ}$. |
| 168 |
($20$~km). |
|
| 169 |
|
|
| 170 |
\item Line 42, |
\item Line 58, |
| 171 |
\begin{verbatim} |
\begin{verbatim} |
| 172 |
delY=60*20E3, |
dYspacing=0.01, |
| 173 |
\end{verbatim} |
\end{verbatim} |
|
This line sets the horizontal grid spacing between each y-coordinate line |
|
|
in the discrete grid to $20 \times 10^{3}m$ ($20$~km). |
|
| 174 |
|
|
| 175 |
\item Line 43, |
This line sets the radial cylindrical grid spacing between each |
| 176 |
|
$a$-coordinate line in the discrete grid to $1cm$. |
| 177 |
|
|
| 178 |
|
\item Line 59, |
| 179 |
\begin{verbatim} |
\begin{verbatim} |
| 180 |
delZ=5000, |
delZ=29*0.005, |
| 181 |
\end{verbatim} |
\end{verbatim} |
|
This line sets the vertical grid spacing between each z-coordinate line |
|
|
in the discrete grid to $5000m$ ($5$~km). |
|
| 182 |
|
|
| 183 |
\item Line 46, |
This line sets the vertical grid spacing between each of 29 |
| 184 |
|
z-coordinate lines in the discrete grid to $0.005m$ ($5$~mm). |
| 185 |
|
|
| 186 |
|
\item Line 64, |
| 187 |
\begin{verbatim} |
\begin{verbatim} |
| 188 |
bathyFile='topog.box' |
bathyFile='bathyPol.bin', |
| 189 |
\end{verbatim} |
\end{verbatim} |
| 190 |
This line specifies the name of the file from which the domain |
This line specifies the name of the file from which the domain |
| 191 |
bathymetry is read. This file is a two-dimensional ($x,y$) map of |
``bathymetry'' (tank depth) is read. This file is a two-dimensional |
| 192 |
|
($a,\phi$) map of |
| 193 |
depths. This file is assumed to contain 64-bit binary numbers |
depths. This file is assumed to contain 64-bit binary numbers |
| 194 |
giving the depth of the model at each grid cell, ordered with the x |
giving the depth of the model at each grid cell, ordered with the $\phi$ |
| 195 |
coordinate varying fastest. The points are ordered from low coordinate |
coordinate varying fastest. The points are ordered from low coordinate |
| 196 |
to high coordinate for both axes. The units and orientation of the |
to high coordinate for both axes. The units and orientation of the |
| 197 |
depths in this file are the same as used in the MITgcm code. In this |
depths in this file are the same as used in the MITgcm code. In this |
| 198 |
experiment, a depth of $0m$ indicates a solid wall and a depth |
experiment, a depth of $0m$ indicates an area outside of the tank |
| 199 |
of $-5000m$ indicates open ocean. The matlab program |
and a depth |
| 200 |
{\it input/gendata.m} shows an example of how to generate a |
f $-0.145m$ indicates the tank itself. |
|
bathymetry file. |
|
| 201 |
|
|
| 202 |
|
\item Line 65, |
| 203 |
|
\begin{verbatim} |
| 204 |
|
hydrogThetaFile='thetaPol.bin', |
| 205 |
|
\end{verbatim} |
| 206 |
|
This line specifies the name of the file from which the initial values |
| 207 |
|
of temperature |
| 208 |
|
are read. This file is a three-dimensional |
| 209 |
|
($x,y,z$) map and is enumerated and formatted in the same manner as the |
| 210 |
|
bathymetry file. |
| 211 |
|
|
| 212 |
\item Line 49, |
\item Lines 66 and 67 |
| 213 |
\begin{verbatim} |
\begin{verbatim} |
| 214 |
zonalWindFile='windx.sin_y' |
tCylIn = 0 |
| 215 |
|
tCylOut = 20 |
| 216 |
\end{verbatim} |
\end{verbatim} |
| 217 |
This line specifies the name of the file from which the x-direction |
These line specify the temperatures in degrees Celsius of the interior |
| 218 |
surface wind stress is read. This file is also a two-dimensional |
and exterior walls of the tank -- typically taken to be icewater on |
| 219 |
($x,y$) map and is enumerated and formatted in the same manner as the |
the inside and room temperature on the outside. |
| 220 |
bathymetry file. The matlab program {\it input/gendata.m} includes example |
|
|
code to generate a valid {\bf zonalWindFile} file. |
|
| 221 |
|
|
| 222 |
\end{itemize} |
\end{itemize} |
| 223 |
|
|
| 224 |
\noindent other lines in the file {\it input/data} are standard values |
\noindent Other lines in the file {\it input/data} are standard values |
| 225 |
that are described in the MITgcm Getting Started and MITgcm Parameters |
that are described in the MITgcm Getting Started and MITgcm Parameters |
| 226 |
notes. |
notes. |
| 227 |
|
|
| 228 |
%%\begin{small} |
\begin{small} |
| 229 |
%%\input{part3/case_studies/barotropic_gyre/input/data} |
\input{s_examples/rotating_tank/input/data} |
| 230 |
%%\end{small} |
\end{small} |
| 231 |
|
|
| 232 |
\subsubsection{File {\it input/data.pkg}} |
\subsubsection{File {\it input/data.pkg}} |
| 233 |
\label{www:tutorials} |
\label{www:tutorials} |
| 241 |
This file uses standard default values and does not contain |
This file uses standard default values and does not contain |
| 242 |
customizations for this experiment. |
customizations for this experiment. |
| 243 |
|
|
| 244 |
\subsubsection{File {\it input/windx.sin\_y}} |
\subsubsection{File {\it input/thetaPol.bin}} |
| 245 |
\label{www:tutorials} |
\label{www:tutorials} |
| 246 |
|
|
| 247 |
The {\it input/windx.sin\_y} file specifies a two-dimensional ($x,y$) |
The {\it input/thetaPol.bin} file specifies a three-dimensional ($x,y,z$) |
| 248 |
map of wind stress ,$\tau_{x}$, values. The units used are $Nm^{-2}$. |
map of initial values of $\theta$ in degrees Celsius. This particular |
| 249 |
Although $\tau_{x}$ is only a function of $y$n in this experiment |
experiment is set to random values x around 20C to provide initial |
| 250 |
this file must still define a complete two-dimensional map in order |
perturbations. |
|
to be compatible with the standard code for loading forcing fields |
|
|
in MITgcm. The included matlab program {\it input/gendata.m} gives a complete |
|
|
code for creating the {\it input/windx.sin\_y} file. |
|
| 251 |
|
|
| 252 |
\subsubsection{File {\it input/topog.box}} |
\subsubsection{File {\it input/bathyPol.bin}} |
| 253 |
\label{www:tutorials} |
\label{www:tutorials} |
| 254 |
|
|
| 255 |
|
|
| 256 |
The {\it input/topog.box} file specifies a two-dimensional ($x,y$) |
The {\it input/bathyPol.bin} file specifies a two-dimensional ($x,y$) |
| 257 |
map of depth values. For this experiment values are either |
map of depth values. For this experiment values are either |
| 258 |
$0m$ or {\bf -delZ}m, corresponding respectively to a wall or to deep |
$0m$ or {\bf -delZ}m, corresponding respectively to outside or inside of |
| 259 |
ocean. The file contains a raw binary stream of data that is enumerated |
the tank. The file contains a raw binary stream of data that is enumerated |
| 260 |
in the same way as standard MITgcm two-dimensional, horizontal arrays. |
in the same way as standard MITgcm two-dimensional, horizontal arrays. |
|
The included matlab program {\it input/gendata.m} gives a complete |
|
|
code for creating the {\it input/topog.box} file. |
|
| 261 |
|
|
| 262 |
\subsubsection{File {\it code/SIZE.h}} |
\subsubsection{File {\it code/SIZE.h}} |
| 263 |
\label{www:tutorials} |
\label{www:tutorials} |
| 267 |
\begin{itemize} |
\begin{itemize} |
| 268 |
|
|
| 269 |
\item Line 39, |
\item Line 39, |
| 270 |
\begin{verbatim} sNx=60, \end{verbatim} this line sets |
\begin{verbatim} sNx=120, \end{verbatim} this line sets |
| 271 |
the lateral domain extent in grid points for the |
the lateral domain extent in grid points for the |
| 272 |
axis aligned with the x-coordinate. |
axis aligned with the x-coordinate. |
| 273 |
|
|
| 274 |
\item Line 40, |
\item Line 40, |
| 275 |
\begin{verbatim} sNy=60, \end{verbatim} this line sets |
\begin{verbatim} sNy=31, \end{verbatim} this line sets |
| 276 |
the lateral domain extent in grid points for the |
the lateral domain extent in grid points for the |
| 277 |
axis aligned with the y-coordinate. |
axis aligned with the y-coordinate. |
| 278 |
|
|
| 279 |
\end{itemize} |
\end{itemize} |
| 280 |
|
|
| 281 |
\begin{small} |
\begin{small} |
| 282 |
\input{part3/case_studies/barotropic_gyre/code/SIZE.h} |
\input{s_examples/rotating_tank/code/SIZE.h} |
| 283 |
\end{small} |
\end{small} |
| 284 |
|
|
| 285 |
\subsubsection{File {\it code/CPP\_OPTIONS.h}} |
\subsubsection{File {\it code/CPP\_OPTIONS.h}} |