| 1 |
% $Header$ |
% $Header$ |
| 2 |
% $Name$ |
% $Name$ |
| 3 |
|
|
| 4 |
|
%\section{Getting started} |
| 5 |
|
|
| 6 |
\begin{center} |
In this section, we describe how to use the model. In the first |
| 7 |
{\Large \textbf{Using the model}} |
section, we provide enough information to help you get started with |
| 8 |
|
the model. We believe the best way to familiarize yourself with the |
| 9 |
|
model is to run the case study examples provided with the base |
| 10 |
|
version. Information on how to obtain, compile, and run the code is |
| 11 |
|
found there as well as a brief description of the model structure |
| 12 |
|
directory and the case study examples. The latter and the code |
| 13 |
|
structure are described more fully in chapters |
| 14 |
|
\ref{chap:discretization} and \ref{chap:sarch}, respectively. Here, in |
| 15 |
|
this section, we provide information on how to customize the code when |
| 16 |
|
you are ready to try implementing the configuration you have in mind. |
| 17 |
|
|
| 18 |
\vspace*{4mm} |
\section{Where to find information} |
| 19 |
|
\label{sect:whereToFindInfo} |
| 20 |
|
|
| 21 |
\vspace*{3mm} {\large July 2001} |
A web site is maintained for release 2 (``Pelican'') of MITgcm: |
| 22 |
\end{center} |
\begin{rawhtml} <A href=http://mitgcm.org/pelican/ target="idontexist"> \end{rawhtml} |
| 23 |
|
\begin{verbatim} |
| 24 |
|
http://mitgcm.org/pelican |
| 25 |
|
\end{verbatim} |
| 26 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 27 |
|
Here you will find an on-line version of this document, a |
| 28 |
|
``browsable'' copy of the code and a searchable database of the model |
| 29 |
|
and site, as well as links for downloading the model and |
| 30 |
|
documentation, to data-sources, and other related sites. |
| 31 |
|
|
| 32 |
|
There is also a web-archived support mailing list for the model that |
| 33 |
|
you can email at \texttt{MITgcm-support@mitgcm.org} or browse at: |
| 34 |
|
\begin{rawhtml} <A href=http://mitgcm.org/mailman/listinfo/mitgcm-support/ target="idontexist"> \end{rawhtml} |
| 35 |
|
\begin{verbatim} |
| 36 |
|
http://mitgcm.org/mailman/listinfo/mitgcm-support/ |
| 37 |
|
http://mitgcm.org/pipermail/mitgcm-support/ |
| 38 |
|
\end{verbatim} |
| 39 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 40 |
|
Essentially all of the MITgcm web pages can be searched using a |
| 41 |
|
popular web crawler such as Google or through our own search facility: |
| 42 |
|
\begin{rawhtml} <A href=http://mitgcm.org/mailman/htdig/ target="idontexist"> \end{rawhtml} |
| 43 |
|
\begin{verbatim} |
| 44 |
|
http://mitgcm.org/htdig/ |
| 45 |
|
\end{verbatim} |
| 46 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 47 |
|
%%% http://www.google.com/search?q=hydrostatic+site%3Amitgcm.org |
| 48 |
|
|
|
In this part, we describe how to use the model. In the first section, we |
|
|
provide enough information to help you get started with the model. We |
|
|
believe the best way to familiarize yourself with the model is to run the |
|
|
case study examples provided with the base version. Information on how to |
|
|
obtain, compile, and run the code is found there as well as a brief |
|
|
description of the model structure directory and the case study examples. |
|
|
The latter and the code structure are described more fully in sections 2 and |
|
|
3, respectively. In section 4, we provide information on how to customize |
|
|
the code when you are ready to try implementing the configuration you have |
|
|
in mind. |
|
| 49 |
|
|
|
\section{Getting started} |
|
| 50 |
|
|
| 51 |
\subsection{Obtaining the code} |
\section{Obtaining the code} |
| 52 |
|
\label{sect:obtainingCode} |
| 53 |
|
|
| 54 |
The reference web site for the model is: |
MITgcm can be downloaded from our system by following |
| 55 |
\begin{verbatim} |
the instructions below. As a courtesy we ask that you send e-mail to us at |
| 56 |
http://mitgcm.org |
\begin{rawhtml} <A href=mailto:MITgcm-support@mitgcm.org> \end{rawhtml} |
| 57 |
\end{verbatim} |
MITgcm-support@mitgcm.org |
| 58 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 59 |
|
to enable us to keep track of who's using the model and in what application. |
| 60 |
|
You can download the model two ways: |
| 61 |
|
|
| 62 |
|
\begin{enumerate} |
| 63 |
|
\item Using CVS software. CVS is a freely available source code management |
| 64 |
|
tool. To use CVS you need to have the software installed. Many systems |
| 65 |
|
come with CVS pre-installed, otherwise good places to look for |
| 66 |
|
the software for a particular platform are |
| 67 |
|
\begin{rawhtml} <A href=http://www.cvshome.org/ target="idontexist"> \end{rawhtml} |
| 68 |
|
cvshome.org |
| 69 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 70 |
|
and |
| 71 |
|
\begin{rawhtml} <A href=http://www.wincvs.org/ target="idontexist"> \end{rawhtml} |
| 72 |
|
wincvs.org |
| 73 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 74 |
|
. |
| 75 |
|
|
| 76 |
|
\item Using a tar file. This method is simple and does not |
| 77 |
|
require any special software. However, this method does not |
| 78 |
|
provide easy support for maintenance updates. |
| 79 |
|
|
| 80 |
On this site, you can download the model as well as find useful information, |
\end{enumerate} |
|
some of which might overlap with what is written here. There is also a |
|
|
support news group for the model located at (send your message to \texttt{% |
|
|
support@mitgcm.org}): |
|
|
\begin{verbatim} |
|
|
news://mitgcm.org/mitgcm.support |
|
|
\end{verbatim} |
|
| 81 |
|
|
| 82 |
If CVS is available on your system, we strongly encourage you to use it. CVS |
If CVS is available on your system, we strongly encourage you to use it. CVS |
| 83 |
provides an efficient and elegant way of organizing your code and keeping |
provides an efficient and elegant way of organizing your code and keeping |
| 84 |
track of your changes. If CVS is not available on your machine, you can also |
track of your changes. If CVS is not available on your machine, you can also |
| 85 |
download a tar file. |
download a tar file. |
| 86 |
|
|
| 87 |
\subsubsection{using CVS} |
Before you can use CVS, the following environment variable(s) should |
| 88 |
|
be set within your shell. For a csh or tcsh shell, put the following |
| 89 |
|
\begin{verbatim} |
| 90 |
|
% setenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/gcmpack |
| 91 |
|
\end{verbatim} |
| 92 |
|
in your .cshrc or .tcshrc file. For bash or sh shells, put: |
| 93 |
|
\begin{verbatim} |
| 94 |
|
% export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
| 95 |
|
\end{verbatim} |
| 96 |
|
in your .profile or .bashrc file. |
| 97 |
|
|
| 98 |
|
|
| 99 |
Before you can use CVS, the following environment variable has to be set in |
To get MITgcm through CVS, first register with the MITgcm CVS server |
| 100 |
your .cshrc or .tcshrc: |
using command: |
| 101 |
\begin{verbatim} |
\begin{verbatim} |
|
% setenv CVSROOT :pserver:cvsanon@mitgcm.org:/u/u0/gcmpack |
|
| 102 |
% cvs login ( CVS password: cvsanon ) |
% cvs login ( CVS password: cvsanon ) |
| 103 |
\end{verbatim} |
\end{verbatim} |
| 104 |
|
You only need to do a ``cvs login'' once. |
| 105 |
|
|
| 106 |
You only need to do ``cvs login'' once. To obtain the latest source: |
To obtain the latest sources type: |
| 107 |
\begin{verbatim} |
\begin{verbatim} |
| 108 |
% cvs co -d directory models/MITgcmUV |
% cvs co MITgcm |
| 109 |
\end{verbatim} |
\end{verbatim} |
| 110 |
|
or to get a specific release type: |
| 111 |
This creates a directory called \textit{directory}. If \textit{directory} |
\begin{verbatim} |
| 112 |
exists this command updates your code based on the repository. Each |
% cvs co -P -r checkpoint52i_post MITgcm |
| 113 |
directory in the source tree contains a directory \textit{CVS}. This |
\end{verbatim} |
| 114 |
information is required by CVS to keep track of your file versions with |
The MITgcm web site contains further directions concerning the source |
| 115 |
respect to the repository. Don't edit the files in \textit{CVS}! To obtain a |
code and CVS. It also contains a web interface to our CVS archive so |
| 116 |
specific \textit{version} that is not the latest source: |
that one may easily view the state of files, revisions, and other |
| 117 |
|
development milestones: |
| 118 |
|
\begin{rawhtml} <A href=http://mitgcm.org/download target="idontexist"> \end{rawhtml} |
| 119 |
\begin{verbatim} |
\begin{verbatim} |
| 120 |
% cvs co -d directory -r version models/MITgcmUV |
http://mitgcm.org/source\_code.html |
| 121 |
\end{verbatim} |
\end{verbatim} |
| 122 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 123 |
|
|
|
\subsubsection{other methods} |
|
| 124 |
|
|
| 125 |
You can download the model as a tar file from the reference web site at: |
The checkout process creates a directory called \textit{MITgcm}. If |
| 126 |
|
the directory \textit{MITgcm} exists this command updates your code |
| 127 |
|
based on the repository. Each directory in the source tree contains a |
| 128 |
|
directory \textit{CVS}. This information is required by CVS to keep |
| 129 |
|
track of your file versions with respect to the repository. Don't edit |
| 130 |
|
the files in \textit{CVS}! You can also use CVS to download code |
| 131 |
|
updates. More extensive information on using CVS for maintaining |
| 132 |
|
MITgcm code can be found |
| 133 |
|
\begin{rawhtml} <A href=http://mitgcm.org/usingcvstoget.html target="idontexist"> \end{rawhtml} |
| 134 |
|
here |
| 135 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 136 |
|
. |
| 137 |
|
|
| 138 |
|
|
| 139 |
|
\paragraph*{Conventional download method} |
| 140 |
|
\label{sect:conventionalDownload} |
| 141 |
|
|
| 142 |
|
If you do not have CVS on your system, you can download the model as a |
| 143 |
|
tar file from the web site at: |
| 144 |
|
\begin{rawhtml} <A href=http://mitgcm.org/download target="idontexist"> \end{rawhtml} |
| 145 |
\begin{verbatim} |
\begin{verbatim} |
| 146 |
http://mitgcm.org/download/ |
http://mitgcm.org/download/ |
| 147 |
\end{verbatim} |
\end{verbatim} |
| 148 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 149 |
\subsection{Model and directory structure} |
The tar file still contains CVS information which we urge you not to |
| 150 |
|
delete; even if you do not use CVS yourself the information can help |
| 151 |
The ``numerical'' model is contained within a execution environment support |
us if you should need to send us your copy of the code. If a recent |
| 152 |
wrapper. This wrapper is designed to provide a general framework for |
tar file does not exist, then please contact the developers through |
| 153 |
grid-point models. MITgcmUV is a specific numerical model that uses the |
the MITgcm-support list. |
| 154 |
framework. Under this structure the model is split into execution |
|
| 155 |
environment support code and conventional numerical model code. The |
\paragraph*{Upgrading from an earlier version} |
| 156 |
execution environment support code is held under the \textit{eesupp} |
|
| 157 |
directory. The grid point model code is held under the \textit{model} |
If you already have an earlier version of the code you can ``upgrade'' |
| 158 |
directory. Code execution actually starts in the \textit{eesupp} routines |
your copy instead of downloading the entire repository again. First, |
| 159 |
and not in the \textit{model} routines. For this reason the top-level |
``cd'' (change directory) to the top of your working copy: |
| 160 |
|
\begin{verbatim} |
| 161 |
|
% cd MITgcm |
| 162 |
|
\end{verbatim} |
| 163 |
|
and then issue the cvs update command such as: |
| 164 |
|
\begin{verbatim} |
| 165 |
|
% cvs -q update -r checkpoint52i_post -d -P |
| 166 |
|
\end{verbatim} |
| 167 |
|
This will update the ``tag'' to ``checkpoint52i\_post'', add any new |
| 168 |
|
directories (-d) and remove any empty directories (-P). The -q option |
| 169 |
|
means be quiet which will reduce the number of messages you'll see in |
| 170 |
|
the terminal. If you have modified the code prior to upgrading, CVS |
| 171 |
|
will try to merge your changes with the upgrades. If there is a |
| 172 |
|
conflict between your modifications and the upgrade, it will report |
| 173 |
|
that file with a ``C'' in front, e.g.: |
| 174 |
|
\begin{verbatim} |
| 175 |
|
C model/src/ini_parms.F |
| 176 |
|
\end{verbatim} |
| 177 |
|
If the list of conflicts scrolled off the screen, you can re-issue the |
| 178 |
|
cvs update command and it will report the conflicts. Conflicts are |
| 179 |
|
indicated in the code by the delimites ``$<<<<<<<$'', ``======='' and |
| 180 |
|
``$>>>>>>>$''. For example, |
| 181 |
|
\begin{verbatim} |
| 182 |
|
<<<<<<< ini_parms.F |
| 183 |
|
& bottomDragLinear,myOwnBottomDragCoefficient, |
| 184 |
|
======= |
| 185 |
|
& bottomDragLinear,bottomDragQuadratic, |
| 186 |
|
>>>>>>> 1.18 |
| 187 |
|
\end{verbatim} |
| 188 |
|
means that you added ``myOwnBottomDragCoefficient'' to a namelist at |
| 189 |
|
the same time and place that we added ``bottomDragQuadratic''. You |
| 190 |
|
need to resolve this conflict and in this case the line should be |
| 191 |
|
changed to: |
| 192 |
|
\begin{verbatim} |
| 193 |
|
& bottomDragLinear,bottomDragQuadratic,myOwnBottomDragCoefficient, |
| 194 |
|
\end{verbatim} |
| 195 |
|
and the lines with the delimiters ($<<<<<<$,======,$>>>>>>$) be deleted. |
| 196 |
|
Unless you are making modifications which exactly parallel |
| 197 |
|
developments we make, these types of conflicts should be rare. |
| 198 |
|
|
| 199 |
|
\paragraph*{Upgrading to the current pre-release version} |
| 200 |
|
|
| 201 |
|
We don't make a ``release'' for every little patch and bug fix in |
| 202 |
|
order to keep the frequency of upgrades to a minimum. However, if you |
| 203 |
|
have run into a problem for which ``we have already fixed in the |
| 204 |
|
latest code'' and we haven't made a ``tag'' or ``release'' since that |
| 205 |
|
patch then you'll need to get the latest code: |
| 206 |
|
\begin{verbatim} |
| 207 |
|
% cvs -q update -A -d -P |
| 208 |
|
\end{verbatim} |
| 209 |
|
Unlike, the ``check-out'' and ``update'' procedures above, there is no |
| 210 |
|
``tag'' or release name. The -A tells CVS to upgrade to the |
| 211 |
|
very latest version. As a rule, we don't recommend this since you |
| 212 |
|
might upgrade while we are in the processes of checking in the code so |
| 213 |
|
that you may only have part of a patch. Using this method of updating |
| 214 |
|
also means we can't tell what version of the code you are working |
| 215 |
|
with. So please be sure you understand what you're doing. |
| 216 |
|
|
| 217 |
|
\section{Model and directory structure} |
| 218 |
|
|
| 219 |
|
The ``numerical'' model is contained within a execution environment |
| 220 |
|
support wrapper. This wrapper is designed to provide a general |
| 221 |
|
framework for grid-point models. MITgcmUV is a specific numerical |
| 222 |
|
model that uses the framework. Under this structure the model is split |
| 223 |
|
into execution environment support code and conventional numerical |
| 224 |
|
model code. The execution environment support code is held under the |
| 225 |
|
\textit{eesupp} directory. The grid point model code is held under the |
| 226 |
|
\textit{model} directory. Code execution actually starts in the |
| 227 |
|
\textit{eesupp} routines and not in the \textit{model} routines. For |
| 228 |
|
this reason the top-level |
| 229 |
\textit{MAIN.F} is in the \textit{eesupp/src} directory. In general, |
\textit{MAIN.F} is in the \textit{eesupp/src} directory. In general, |
| 230 |
end-users should not need to worry about this level. The top-level routine |
end-users should not need to worry about this level. The top-level routine |
| 231 |
for the numerical part of the code is in \textit{model/src/THE\_MODEL\_MAIN.F% |
for the numerical part of the code is in \textit{model/src/THE\_MODEL\_MAIN.F% |
| 238 |
|
|
| 239 |
\item \textit{diags}: contains the code relative to time-averaged |
\item \textit{diags}: contains the code relative to time-averaged |
| 240 |
diagnostics. It is subdivided into two subdirectories \textit{inc} and |
diagnostics. It is subdivided into two subdirectories \textit{inc} and |
| 241 |
\textit{src} that contain include files (*.\textit{h} files) and fortran |
\textit{src} that contain include files (*.\textit{h} files) and Fortran |
| 242 |
subroutines (*.\textit{F} files), respectively. |
subroutines (*.\textit{F} files), respectively. |
| 243 |
|
|
| 244 |
\item \textit{doc}: contains brief documentation notes. |
\item \textit{doc}: contains brief documentation notes. |
| 259 |
in detail in section 3. |
in detail in section 3. |
| 260 |
|
|
| 261 |
\item \textit{tools}: this directory contains various useful tools. For |
\item \textit{tools}: this directory contains various useful tools. For |
| 262 |
example, \textit{genmake} is a script written in csh (C-shell) that should |
example, \textit{genmake2} is a script written in csh (C-shell) that should |
| 263 |
be used to generate your makefile. The directory \textit{adjoint} contains |
be used to generate your makefile. The directory \textit{adjoint} contains |
| 264 |
the makefile specific to the Tangent linear and Adjoint Compiler (TAMC) that |
the makefile specific to the Tangent linear and Adjoint Compiler (TAMC) that |
| 265 |
generates the adjoint code. The latter is described in details in part V. |
generates the adjoint code. The latter is described in details in part V. |
| 266 |
|
|
| 267 |
\item \textit{utils}: this directory contains various utilities. The |
\item \textit{utils}: this directory contains various utilities. The |
| 268 |
subdirectory \textit{knudsen2} contains code and a makefile that compute |
subdirectory \textit{knudsen2} contains code and a makefile that |
| 269 |
coefficients of the polynomial approximation to the knudsen formula for an |
compute coefficients of the polynomial approximation to the knudsen |
| 270 |
ocean nonlinear equation of state. The \textit{matlab} subdirectory contains |
formula for an ocean nonlinear equation of state. The \textit{matlab} |
| 271 |
matlab scripts for reading model output directly into matlab. \textit{scripts% |
subdirectory contains matlab scripts for reading model output directly |
| 272 |
} contains C-shell post-processing scripts for joining processor-based and |
into matlab. \textit{scripts} contains C-shell post-processing |
| 273 |
tiled-based model output. |
scripts for joining processor-based and tiled-based model output. |
| 274 |
|
|
| 275 |
\item \textit{verification}: this directory contains the model examples. See |
\item \textit{verification}: this directory contains the model examples. See |
| 276 |
below. |
section \ref{sect:modelExamples}. |
| 277 |
\end{itemize} |
\end{itemize} |
| 278 |
|
|
| 279 |
\subsection{Model examples} |
\section{Example experiments} |
| 280 |
|
\label{sect:modelExamples} |
| 281 |
|
|
| 282 |
|
%% a set of twenty-four pre-configured numerical experiments |
| 283 |
|
|
| 284 |
Now that you have successfully downloaded the model code we recommend that |
The MITgcm distribution comes with more than a dozen pre-configured |
| 285 |
you first try to run the examples provided with the base version. You will |
numerical experiments. Some of these example experiments are tests of |
| 286 |
probably want to run the example that is the closest to the configuration |
individual parts of the model code, but many are fully fledged |
| 287 |
you will use eventually. The examples are located in subdirectories under |
numerical simulations. A few of the examples are used for tutorial |
| 288 |
the directory \textit{verification} and are briefly described below (a full |
documentation in sections \ref{sect:eg-baro} - \ref{sect:eg-global}. |
| 289 |
description is given in section 2): |
The other examples follow the same general structure as the tutorial |
| 290 |
|
examples. However, they only include brief instructions in a text file |
| 291 |
|
called {\it README}. The examples are located in subdirectories under |
| 292 |
|
the directory \textit{verification}. Each example is briefly described |
| 293 |
|
below. |
| 294 |
|
|
| 295 |
\subsubsection{List of model examples} |
\subsection{Full list of model examples} |
| 296 |
|
|
| 297 |
\begin{itemize} |
\begin{enumerate} |
| 298 |
\item \textit{exp0} - single layer, ocean double gyre (barotropic with |
\item \textit{exp0} - single layer, ocean double gyre (barotropic with |
| 299 |
free-surface). |
free-surface). This experiment is described in detail in section |
| 300 |
|
\ref{sect:eg-baro}. |
|
\item \textit{exp1} - 4 layers, ocean double gyre. |
|
| 301 |
|
|
| 302 |
|
\item \textit{exp1} - Four layer, ocean double gyre. This experiment |
| 303 |
|
is described in detail in section \ref{sect:eg-baroc}. |
| 304 |
|
|
| 305 |
\item \textit{exp2} - 4x4 degree global ocean simulation with steady |
\item \textit{exp2} - 4x4 degree global ocean simulation with steady |
| 306 |
climatological forcing. |
climatological forcing. This experiment is described in detail in |
| 307 |
|
section \ref{sect:eg-global}. |
| 308 |
\item \textit{exp4} - flow over a Gaussian bump in open-water or channel |
|
| 309 |
with open boundaries. |
\item \textit{exp4} - Flow over a Gaussian bump in open-water or |
| 310 |
|
channel with open boundaries. |
| 311 |
|
|
| 312 |
|
\item \textit{exp5} - Inhomogenously forced ocean convection in a |
| 313 |
|
doubly periodic box. |
| 314 |
|
|
| 315 |
\item \textit{exp5} - inhomogenously forced ocean convection in a doubly |
\item \textit{front\_relax} - Relaxation of an ocean thermal front (test for |
|
periodic box. |
|
|
|
|
|
\item \textit{front\_relax} - relaxation of an ocean thermal front (test for |
|
| 316 |
Gent/McWilliams scheme). 2D (Y-Z). |
Gent/McWilliams scheme). 2D (Y-Z). |
| 317 |
|
|
| 318 |
\item \textit{internal wave} - ocean internal wave forced by open boundary |
\item \textit{internal wave} - Ocean internal wave forced by open |
| 319 |
conditions. |
boundary conditions. |
| 320 |
|
|
| 321 |
\item \textit{natl\_box} - eastern subtropical North Atlantic with KPP |
\item \textit{natl\_box} - Eastern subtropical North Atlantic with KPP |
| 322 |
scheme; 1 month integration |
scheme; 1 month integration |
| 323 |
|
|
| 324 |
\item \textit{hs94.1x64x5} - zonal averaged atmosphere using Held and Suarez |
\item \textit{hs94.1x64x5} - Zonal averaged atmosphere using Held and |
| 325 |
'94 forcing. |
Suarez '94 forcing. |
| 326 |
|
|
| 327 |
\item \textit{hs94.128x64x5} - 3D atmosphere dynamics using Held and Suarez |
\item \textit{hs94.128x64x5} - 3D atmosphere dynamics using Held and |
| 328 |
'94 forcing. |
Suarez '94 forcing. |
| 329 |
|
|
| 330 |
\item \textit{hs94.cs-32x32x5} - 3D atmosphere dynamics using Held and |
\item \textit{hs94.cs-32x32x5} - 3D atmosphere dynamics using Held and |
| 331 |
Suarez '94 forcing on the cubed sphere. |
Suarez '94 forcing on the cubed sphere. |
| 332 |
|
|
| 333 |
\item \textit{aim.5l\_zon-ave} - Intermediate Atmospheric physics, 5 layers |
\item \textit{aim.5l\_zon-ave} - Intermediate Atmospheric physics. |
| 334 |
Molteni physics package. Global Zonal Mean configuration, 1x64x5 resolution. |
Global Zonal Mean configuration, 1x64x5 resolution. |
| 335 |
|
|
| 336 |
\item \textit{aim.5l\_XZ\_Equatorial\_Slice} - Intermediate Atmospheric |
\item \textit{aim.5l\_XZ\_Equatorial\_Slice} - Intermediate |
| 337 |
physics, 5 layers Molteni physics package. Equatorial Slice configuration. |
Atmospheric physics, equatorial Slice configuration. 2D (X-Z). |
| 338 |
2D (X-Z). |
|
|
|
|
| 339 |
\item \textit{aim.5l\_Equatorial\_Channel} - Intermediate Atmospheric |
\item \textit{aim.5l\_Equatorial\_Channel} - Intermediate Atmospheric |
| 340 |
physics, 5 layers Molteni physics package. 3D Equatorial Channel |
physics. 3D Equatorial Channel configuration. |
| 341 |
configuration (not completely tested). |
|
| 342 |
|
\item \textit{aim.5l\_LatLon} - Intermediate Atmospheric physics. |
| 343 |
|
Global configuration, on latitude longitude grid with 128x64x5 grid |
| 344 |
|
points ($2.8^\circ{\rm degree}$ resolution). |
| 345 |
|
|
| 346 |
|
\item \textit{adjustment.128x64x1} Barotropic adjustment problem on |
| 347 |
|
latitude longitude grid with 128x64 grid points ($2.8^\circ{\rm |
| 348 |
|
degree}$ resolution). |
| 349 |
|
|
| 350 |
|
\item \textit{adjustment.cs-32x32x1} Barotropic adjustment problem on |
| 351 |
|
cube sphere grid with 32x32 points per face ( roughly $2.8^\circ{\rm |
| 352 |
|
degree}$ resolution). |
| 353 |
|
|
| 354 |
|
\item \textit{advect\_cs} Two-dimensional passive advection test on |
| 355 |
|
cube sphere grid. |
| 356 |
|
|
| 357 |
|
\item \textit{advect\_xy} Two-dimensional (horizontal plane) passive |
| 358 |
|
advection test on Cartesian grid. |
| 359 |
|
|
| 360 |
|
\item \textit{advect\_yz} Two-dimensional (vertical plane) passive |
| 361 |
|
advection test on Cartesian grid. |
| 362 |
|
|
| 363 |
|
\item \textit{carbon} Simple passive tracer experiment. Includes |
| 364 |
|
derivative calculation. Described in detail in section |
| 365 |
|
\ref{sect:eg-carbon-ad}. |
| 366 |
|
|
| 367 |
|
\item \textit{flt\_example} Example of using float package. |
| 368 |
|
|
| 369 |
|
\item \textit{global\_ocean.90x40x15} Global circulation with GM, flux |
| 370 |
|
boundary conditions and poles. |
| 371 |
|
|
| 372 |
|
\item \textit{global\_ocean\_pressure} Global circulation in pressure |
| 373 |
|
coordinate (non-Boussinesq ocean model). Described in detail in |
| 374 |
|
section \ref{sect:eg-globalpressure}. |
| 375 |
|
|
| 376 |
|
\item \textit{solid-body.cs-32x32x1} Solid body rotation test for cube |
| 377 |
|
sphere grid. |
| 378 |
|
|
| 379 |
\item \textit{aim.5l\_LatLon} - Intermediate Atmospheric physics, 5 layers |
\end{enumerate} |
|
Molteni physics package. Global configuration, 128x64x5 resolution. |
|
| 380 |
|
|
| 381 |
\item \textit{adjustment.128x64x1} |
\subsection{Directory structure of model examples} |
|
|
|
|
\item \textit{adjustment.cs-32x32x1} |
|
|
\end{itemize} |
|
|
|
|
|
\subsubsection{Directory structure of model examples} |
|
| 382 |
|
|
| 383 |
Each example directory has the following subdirectories: |
Each example directory has the following subdirectories: |
| 384 |
|
|
| 385 |
\begin{itemize} |
\begin{itemize} |
| 386 |
\item \textit{code}: contains the code particular to the example. At a |
\item \textit{code}: contains the code particular to the example. At a |
| 387 |
minimum, this directory includes the following files: |
minimum, this directory includes the following files: |
| 388 |
|
|
| 389 |
\begin{itemize} |
\begin{itemize} |
| 390 |
\item \textit{code/CPP\_EEOPTIONS.h}: declares CPP keys relative to the |
\item \textit{code/CPP\_EEOPTIONS.h}: declares CPP keys relative to |
| 391 |
``execution environment'' part of the code. The default version is located |
the ``execution environment'' part of the code. The default |
| 392 |
in \textit{eesupp/inc}. |
version is located in \textit{eesupp/inc}. |
| 393 |
|
|
| 394 |
|
\item \textit{code/CPP\_OPTIONS.h}: declares CPP keys relative to |
| 395 |
|
the ``numerical model'' part of the code. The default version is |
| 396 |
|
located in \textit{model/inc}. |
| 397 |
|
|
| 398 |
|
\item \textit{code/SIZE.h}: declares size of underlying |
| 399 |
|
computational grid. The default version is located in |
| 400 |
|
\textit{model/inc}. |
| 401 |
|
\end{itemize} |
| 402 |
|
|
| 403 |
|
In addition, other include files and subroutines might be present in |
| 404 |
|
\textit{code} depending on the particular experiment. See Section 2 |
| 405 |
|
for more details. |
| 406 |
|
|
| 407 |
|
\item \textit{input}: contains the input data files required to run |
| 408 |
|
the example. At a minimum, the \textit{input} directory contains the |
| 409 |
|
following files: |
| 410 |
|
|
| 411 |
|
\begin{itemize} |
| 412 |
|
\item \textit{input/data}: this file, written as a namelist, |
| 413 |
|
specifies the main parameters for the experiment. |
| 414 |
|
|
| 415 |
|
\item \textit{input/data.pkg}: contains parameters relative to the |
| 416 |
|
packages used in the experiment. |
| 417 |
|
|
| 418 |
|
\item \textit{input/eedata}: this file contains ``execution |
| 419 |
|
environment'' data. At present, this consists of a specification |
| 420 |
|
of the number of threads to use in $X$ and $Y$ under multithreaded |
| 421 |
|
execution. |
| 422 |
|
\end{itemize} |
| 423 |
|
|
| 424 |
|
In addition, you will also find in this directory the forcing and |
| 425 |
|
topography files as well as the files describing the initial state of |
| 426 |
|
the experiment. This varies from experiment to experiment. See |
| 427 |
|
section 2 for more details. |
| 428 |
|
|
| 429 |
|
\item \textit{results}: this directory contains the output file |
| 430 |
|
\textit{output.txt} produced by the simulation example. This file is |
| 431 |
|
useful for comparison with your own output when you run the |
| 432 |
|
experiment. |
| 433 |
|
\end{itemize} |
| 434 |
|
|
| 435 |
\item \textit{code/CPP\_OPTIONS.h}: declares CPP keys relative to the |
Once you have chosen the example you want to run, you are ready to compile |
| 436 |
``numerical model'' part of the code. The default version is located in |
the code. |
|
\textit{model/inc}. |
|
| 437 |
|
|
| 438 |
\item \textit{code/SIZE.h}: declares size of underlying computational grid. |
\section{Building the code} |
| 439 |
The default version is located in \textit{model/inc}. |
\label{sect:buildingCode} |
|
\end{itemize} |
|
| 440 |
|
|
| 441 |
In addition, other include files and subroutines might be present in \textit{% |
To compile the code, we use the {\em make} program. This uses a file |
| 442 |
code} depending on the particular experiment. See section 2 for more details. |
({\em Makefile}) that allows us to pre-process source files, specify |
| 443 |
|
compiler and optimization options and also figures out any file |
| 444 |
|
dependencies. We supply a script ({\em genmake2}), described in |
| 445 |
|
section \ref{sect:genmake}, that automatically creates the {\em |
| 446 |
|
Makefile} for you. You then need to build the dependencies and |
| 447 |
|
compile the code. |
| 448 |
|
|
| 449 |
|
As an example, let's assume that you want to build and run experiment |
| 450 |
|
\textit{verification/exp2}. The are multiple ways and places to |
| 451 |
|
actually do this but here let's build the code in |
| 452 |
|
\textit{verification/exp2/input}: |
| 453 |
|
\begin{verbatim} |
| 454 |
|
% cd verification/exp2/input |
| 455 |
|
\end{verbatim} |
| 456 |
|
First, build the {\em Makefile}: |
| 457 |
|
\begin{verbatim} |
| 458 |
|
% ../../../tools/genmake2 -mods=../code |
| 459 |
|
\end{verbatim} |
| 460 |
|
The command line option tells {\em genmake} to override model source |
| 461 |
|
code with any files in the directory {\em ./code/}. |
| 462 |
|
|
| 463 |
\item \textit{input}: contains the input data files required to run the |
On many systems, the {\em genmake2} program will be able to |
| 464 |
example. At a mimimum, the \textit{input} directory contains the following |
automatically recognize the hardware, find compilers and other tools |
| 465 |
files: |
within the user's path (``echo \$PATH''), and then choose an |
| 466 |
|
appropriate set of options from the files contained in the {\em |
| 467 |
|
tools/build\_options} directory. Under some circumstances, a user |
| 468 |
|
may have to create a new ``optfile'' in order to specify the exact |
| 469 |
|
combination of compiler, compiler flags, libraries, and other options |
| 470 |
|
necessary to build a particular configuration of MITgcm. In such |
| 471 |
|
cases, it is generally helpful to read the existing ``optfiles'' and |
| 472 |
|
mimic their syntax. |
| 473 |
|
|
| 474 |
|
Through the MITgcm-support list, the MITgcm developers are willing to |
| 475 |
|
provide help writing or modifing ``optfiles''. And we encourage users |
| 476 |
|
to post new ``optfiles'' (particularly ones for new machines or |
| 477 |
|
architectures) to the MITgcm-support list. |
| 478 |
|
|
| 479 |
\begin{itemize} |
To specify an optfile to {\em genmake2}, the syntax is: |
| 480 |
\item \textit{input/data}: this file, written as a namelist, specifies the |
\begin{verbatim} |
| 481 |
main parameters for the experiment. |
% ../../../tools/genmake2 -mods=../code -of /path/to/optfile |
| 482 |
|
\end{verbatim} |
| 483 |
|
|
| 484 |
\item \textit{input/data.pkg}: contains parameters relative to the packages |
Once a {\em Makefile} has been generated, we create the dependencies: |
| 485 |
used in the experiment. |
\begin{verbatim} |
| 486 |
|
% make depend |
| 487 |
|
\end{verbatim} |
| 488 |
|
This modifies the {\em Makefile} by attaching a [long] list of files |
| 489 |
|
upon which other files depend. The purpose of this is to reduce |
| 490 |
|
re-compilation if and when you start to modify the code. The {\tt make |
| 491 |
|
depend} command also creates links from the model source to this |
| 492 |
|
directory. |
| 493 |
|
|
| 494 |
\item \textit{input/eedata}: this file contains ``execution environment'' |
Next compile the code: |
| 495 |
data. At present, this consists of a specification of the number of threads |
\begin{verbatim} |
| 496 |
to use in $X$ and $Y$ under multithreaded execution. |
% make |
| 497 |
\end{itemize} |
\end{verbatim} |
| 498 |
|
The {\tt make} command creates an executable called \textit{mitgcmuv}. |
| 499 |
|
Additional make ``targets'' are defined within the makefile to aid in |
| 500 |
|
the production of adjoint and other versions of MITgcm. |
| 501 |
|
|
| 502 |
In addition, you will also find in this directory the forcing and topography |
Now you are ready to run the model. General instructions for doing so are |
| 503 |
files as well as the files describing the initial state of the experiment. |
given in section \ref{sect:runModel}. Here, we can run the model with: |
| 504 |
This varies from experiment to experiment. See section 2 for more details. |
\begin{verbatim} |
| 505 |
|
./mitgcmuv > output.txt |
| 506 |
|
\end{verbatim} |
| 507 |
|
where we are re-directing the stream of text output to the file {\em |
| 508 |
|
output.txt}. |
| 509 |
|
|
|
\item \textit{results}: this directory contains the output file \textit{% |
|
|
output.txt} produced by the simulation example. This file is useful for |
|
|
comparison with your own output when you run the experiment. |
|
|
\end{itemize} |
|
| 510 |
|
|
| 511 |
Once you have chosen the example you want to run, you are ready to compile |
\subsection{Building/compiling the code elsewhere} |
| 512 |
the code. |
|
| 513 |
|
In the example above (section \ref{sect:buildingCode}) we built the |
| 514 |
|
executable in the {\em input} directory of the experiment for |
| 515 |
|
convenience. You can also configure and compile the code in other |
| 516 |
|
locations, for example on a scratch disk with out having to copy the |
| 517 |
|
entire source tree. The only requirement to do so is you have {\tt |
| 518 |
|
genmake2} in your path or you know the absolute path to {\tt |
| 519 |
|
genmake2}. |
| 520 |
|
|
| 521 |
\subsection{Compiling the code} |
The following sections outline some possible methods of organizing |
| 522 |
|
your source and data. |
| 523 |
|
|
| 524 |
\subsubsection{The script \textit{genmake}} |
\subsubsection{Building from the {\em ../code directory}} |
| 525 |
|
|
| 526 |
To compile the code, use the script \textit{genmake} located in the \textit{% |
This is just as simple as building in the {\em input/} directory: |
|
tools} directory. \textit{genmake} is a script that generates the makefile. |
|
|
It has been written so that the code can be compiled on a wide diversity of |
|
|
machines and systems. However, if it doesn't work the first time on your |
|
|
platform, you might need to edit certain lines of \textit{genmake} in the |
|
|
section containing the setups for the different machines. The file is |
|
|
structured like this: |
|
|
\begin{verbatim} |
|
|
. |
|
|
. |
|
|
. |
|
|
general instructions (machine independent) |
|
|
. |
|
|
. |
|
|
. |
|
|
- setup machine 1 |
|
|
- setup machine 2 |
|
|
- setup machine 3 |
|
|
- setup machine 4 |
|
|
etc |
|
|
. |
|
|
. |
|
|
. |
|
|
\end{verbatim} |
|
|
|
|
|
For example, the setup corresponding to a DEC alpha machine is reproduced |
|
|
here: |
|
|
\begin{verbatim} |
|
|
case OSF1+mpi: |
|
|
echo "Configuring for DEC Alpha" |
|
|
set CPP = ( '/usr/bin/cpp -P' ) |
|
|
set DEFINES = ( ${DEFINES} '-DTARGET_DEC -DWORDLENGTH=1' ) |
|
|
set KPP = ( 'kapf' ) |
|
|
set KPPFILES = ( 'main.F' ) |
|
|
set KFLAGS1 = ( '-scan=132 -noconc -cmp=' ) |
|
|
set FC = ( 'f77' ) |
|
|
set FFLAGS = ( '-convert big_endian -r8 -extend_source -automatic -call_shared -notransform_loops -align dcommons' ) |
|
|
set FOPTIM = ( '-O5 -fast -tune host -inline all' ) |
|
|
set NOOPTFLAGS = ( '-O0' ) |
|
|
set LIBS = ( '-lfmpi -lmpi -lkmp_osfp10 -pthread' ) |
|
|
set NOOPTFILES = ( 'barrier.F different_multiple.F external_fields_load.F') |
|
|
set RMFILES = ( '*.p.out' ) |
|
|
breaksw |
|
|
\end{verbatim} |
|
|
|
|
|
Typically, these are the lines that you might need to edit to make \textit{% |
|
|
genmake} work on your platform if it doesn't work the first time. \textit{% |
|
|
genmake} understands several options that are described here: |
|
|
|
|
|
\begin{itemize} |
|
|
\item -rootdir=dir |
|
|
|
|
|
indicates where the model root directory is relative to the directory where |
|
|
you are compiling. This option is not needed if you compile in the \textit{% |
|
|
bin} directory (which is the default compilation directory) or within the |
|
|
\textit{verification} tree. |
|
|
|
|
|
\item -mods=dir1,dir2,... |
|
|
|
|
|
indicates the relative or absolute paths directories where the sources |
|
|
should take precedence over the default versions (located in \textit{model}, |
|
|
\textit{eesupp},...). Typically, this option is used when running the |
|
|
examples, see below. |
|
|
|
|
|
\item -enable=pkg1,pkg2,... |
|
|
|
|
|
enables packages source code \textit{pkg1}, \textit{pkg2},... when creating |
|
|
the makefile. |
|
|
|
|
|
\item -disable=pkg1,pkg2,... |
|
|
|
|
|
disables packages source code \textit{pkg1}, \textit{pkg2},... when creating |
|
|
the makefile. |
|
|
|
|
|
\item -platform=machine |
|
|
|
|
|
specifies the platform for which you want the makefile. In general, you |
|
|
won't need this option. \textit{genmake} will select the right machine for |
|
|
you (the one you're working on!). However, this option is useful if you have |
|
|
a choice of several compilers on one machine and you want to use the one |
|
|
that is not the default (ex: \texttt{pgf77} instead of \texttt{f77} under |
|
|
Linux). |
|
|
|
|
|
\item -mpi |
|
|
|
|
|
this is used when you want to run the model in parallel processing mode |
|
|
under mpi (see section on parallel computation for more details). |
|
|
|
|
|
\item -jam |
|
|
|
|
|
this is used when you want to run the model in parallel processing mode |
|
|
under jam (see section on parallel computation for more details). |
|
|
\end{itemize} |
|
|
|
|
|
For some of the examples, there is a file called \textit{.genmakerc} in the |
|
|
\textit{input} directory that has the relevant \textit{genmake} options for |
|
|
that particular example. In this way you don't need to type the options when |
|
|
invoking \textit{genmake}. |
|
|
|
|
|
\subsubsection{Compiling} |
|
|
|
|
|
Let's assume that you want to run, say, example \textit{exp2} in the \textit{% |
|
|
input} directory. To compile the code, type the following commands from the |
|
|
model root tree: |
|
| 527 |
\begin{verbatim} |
\begin{verbatim} |
| 528 |
% cd verification/exp2/input |
% cd verification/exp2/code |
| 529 |
% ../../../tools/genmake |
% ../../../tools/genmake2 |
| 530 |
% make depend |
% make depend |
| 531 |
% make |
% make |
| 532 |
\end{verbatim} |
\end{verbatim} |
| 533 |
|
However, to run the model the executable ({\em mitgcmuv}) and input |
| 534 |
If there is no \textit{.genmakerc} in the \textit{input} directory, you have |
files must be in the same place. If you only have one calculation to make: |
| 535 |
to use the following options when invoking \textit{genmake}: |
\begin{verbatim} |
| 536 |
|
% cd ../input |
| 537 |
|
% cp ../code/mitgcmuv ./ |
| 538 |
|
% ./mitgcmuv > output.txt |
| 539 |
|
\end{verbatim} |
| 540 |
|
or if you will be making multiple runs with the same executable: |
| 541 |
\begin{verbatim} |
\begin{verbatim} |
| 542 |
% ../../../tools/genmake -mods=../code |
% cd ../ |
| 543 |
|
% cp -r input run1 |
| 544 |
|
% cp code/mitgcmuv run1 |
| 545 |
|
% cd run1 |
| 546 |
|
% ./mitgcmuv > output.txt |
| 547 |
\end{verbatim} |
\end{verbatim} |
| 548 |
|
|
| 549 |
In addition, you will probably want to disable some of the packages. Taking |
\subsubsection{Building from a new directory} |
| 550 |
again the case of \textit{exp2}, the full \textit{genmake} command will |
|
| 551 |
probably look like this: |
Since the {\em input} directory contains input files it is often more |
| 552 |
|
useful to keep {\em input} pristine and build in a new directory |
| 553 |
|
within {\em verification/exp2/}: |
| 554 |
|
\begin{verbatim} |
| 555 |
|
% cd verification/exp2 |
| 556 |
|
% mkdir build |
| 557 |
|
% cd build |
| 558 |
|
% ../../../tools/genmake2 -mods=../code |
| 559 |
|
% make depend |
| 560 |
|
% make |
| 561 |
|
\end{verbatim} |
| 562 |
|
This builds the code exactly as before but this time you need to copy |
| 563 |
|
either the executable or the input files or both in order to run the |
| 564 |
|
model. For example, |
| 565 |
\begin{verbatim} |
\begin{verbatim} |
| 566 |
% ../../../tools/genmake -mods=../code -disable=kpp,gmredi,aim,... |
% cp ../input/* ./ |
| 567 |
|
% ./mitgcmuv > output.txt |
| 568 |
|
\end{verbatim} |
| 569 |
|
or if you tend to make multiple runs with the same executable then |
| 570 |
|
running in a new directory each time might be more appropriate: |
| 571 |
|
\begin{verbatim} |
| 572 |
|
% cd ../ |
| 573 |
|
% mkdir run1 |
| 574 |
|
% cp build/mitgcmuv run1/ |
| 575 |
|
% cp input/* run1/ |
| 576 |
|
% cd run1 |
| 577 |
|
% ./mitgcmuv > output.txt |
| 578 |
\end{verbatim} |
\end{verbatim} |
| 579 |
|
|
| 580 |
The make command creates an executable called \textit{mitgcmuv}. |
\subsubsection{Building on a scratch disk} |
| 581 |
|
|
| 582 |
Note that you can compile and run the code in another directory than \textit{% |
Model object files and output data can use up large amounts of disk |
| 583 |
input}. You just need to make sure that you copy the input data files into |
space so it is often the case that you will be operating on a large |
| 584 |
the directory where you want to run the model. For example to compile from |
scratch disk. Assuming the model source is in {\em ~/MITgcm} then the |
| 585 |
\textit{code}: |
following commands will build the model in {\em /scratch/exp2-run1}: |
| 586 |
\begin{verbatim} |
\begin{verbatim} |
| 587 |
% cd verification/exp2/code |
% cd /scratch/exp2-run1 |
| 588 |
% ../../../tools/genmake |
% ~/MITgcm/tools/genmake2 -rootdir=~/MITgcm \ |
| 589 |
|
-mods=~/MITgcm/verification/exp2/code |
| 590 |
|
% make depend |
| 591 |
|
% make |
| 592 |
|
\end{verbatim} |
| 593 |
|
To run the model here, you'll need the input files: |
| 594 |
|
\begin{verbatim} |
| 595 |
|
% cp ~/MITgcm/verification/exp2/input/* ./ |
| 596 |
|
% ./mitgcmuv > output.txt |
| 597 |
|
\end{verbatim} |
| 598 |
|
|
| 599 |
|
As before, you could build in one directory and make multiple runs of |
| 600 |
|
the one experiment: |
| 601 |
|
\begin{verbatim} |
| 602 |
|
% cd /scratch/exp2 |
| 603 |
|
% mkdir build |
| 604 |
|
% cd build |
| 605 |
|
% ~/MITgcm/tools/genmake2 -rootdir=~/MITgcm \ |
| 606 |
|
-mods=~/MITgcm/verification/exp2/code |
| 607 |
% make depend |
% make depend |
| 608 |
% make |
% make |
| 609 |
|
% cd ../ |
| 610 |
|
% cp -r ~/MITgcm/verification/exp2/input run2 |
| 611 |
|
% cd run2 |
| 612 |
|
% ./mitgcmuv > output.txt |
| 613 |
|
\end{verbatim} |
| 614 |
|
|
| 615 |
|
|
| 616 |
|
|
| 617 |
|
\subsection{Using \textit{genmake2}} |
| 618 |
|
\label{sect:genmake} |
| 619 |
|
|
| 620 |
|
To compile the code, first use the program \texttt{genmake2} (located |
| 621 |
|
in the \textit{tools} directory) to generate a Makefile. |
| 622 |
|
\texttt{genmake2} is a shell script written to work with all |
| 623 |
|
``sh''--compatible shells including bash v1, bash v2, and Bourne. |
| 624 |
|
Internally, \texttt{genmake2} determines the locations of needed |
| 625 |
|
files, the compiler, compiler options, libraries, and Unix tools. It |
| 626 |
|
relies upon a number of ``optfiles'' located in the {\em |
| 627 |
|
tools/build\_options} directory. |
| 628 |
|
|
| 629 |
|
The purpose of the optfiles is to provide all the compilation options |
| 630 |
|
for particular ``platforms'' (where ``platform'' roughly means the |
| 631 |
|
combination of the hardware and the compiler) and code configurations. |
| 632 |
|
Given the combinations of possible compilers and library dependencies |
| 633 |
|
({\it eg.} MPI and NetCDF) there may be numerous optfiles available |
| 634 |
|
for a single machine. The naming scheme for the majority of the |
| 635 |
|
optfiles shipped with the code is |
| 636 |
|
\begin{center} |
| 637 |
|
{\bf OS\_HARDWARE\_COMPILER } |
| 638 |
|
\end{center} |
| 639 |
|
where |
| 640 |
|
\begin{description} |
| 641 |
|
\item[OS] is the name of the operating system (generally the |
| 642 |
|
lower-case output of the {\tt 'uname'} command) |
| 643 |
|
\item[HARDWARE] is a string that describes the CPU type and |
| 644 |
|
corresponds to output from the {\tt 'uname -m'} command: |
| 645 |
|
\begin{description} |
| 646 |
|
\item[ia32] is for ``x86'' machines such as i386, i486, i586, i686, |
| 647 |
|
and athlon |
| 648 |
|
\item[ia64] is for Intel IA64 systems (eg. Itanium, Itanium2) |
| 649 |
|
\item[amd64] is AMD x86\_64 systems |
| 650 |
|
\item[ppc] is for Mac PowerPC systems |
| 651 |
|
\end{description} |
| 652 |
|
\item[COMPILER] is the compiler name (generally, the name of the |
| 653 |
|
FORTRAN executable) |
| 654 |
|
\end{description} |
| 655 |
|
|
| 656 |
|
In many cases, the default optfiles are sufficient and will result in |
| 657 |
|
usable Makefiles. However, for some machines or code configurations, |
| 658 |
|
new ``optfiles'' must be written. To create a new optfile, it is |
| 659 |
|
generally best to start with one of the defaults and modify it to suit |
| 660 |
|
your needs. Like \texttt{genmake2}, the optfiles are all written |
| 661 |
|
using a simple ``sh''--compatible syntax. While nearly all variables |
| 662 |
|
used within \texttt{genmake2} may be specified in the optfiles, the |
| 663 |
|
critical ones that should be defined are: |
| 664 |
|
|
| 665 |
|
\begin{description} |
| 666 |
|
\item[FC] the FORTRAN compiler (executable) to use |
| 667 |
|
\item[DEFINES] the command-line DEFINE options passed to the compiler |
| 668 |
|
\item[CPP] the C pre-processor to use |
| 669 |
|
\item[NOOPTFLAGS] options flags for special files that should not be |
| 670 |
|
optimized |
| 671 |
|
\end{description} |
| 672 |
|
|
| 673 |
|
For example, the optfile for a typical Red Hat Linux machine (``ia32'' |
| 674 |
|
architecture) using the GCC (g77) compiler is |
| 675 |
|
\begin{verbatim} |
| 676 |
|
FC=g77 |
| 677 |
|
DEFINES='-D_BYTESWAPIO -DWORDLENGTH=4' |
| 678 |
|
CPP='cpp -traditional -P' |
| 679 |
|
NOOPTFLAGS='-O0' |
| 680 |
|
# For IEEE, use the "-ffloat-store" option |
| 681 |
|
if test "x$IEEE" = x ; then |
| 682 |
|
FFLAGS='-Wimplicit -Wunused -Wuninitialized' |
| 683 |
|
FOPTIM='-O3 -malign-double -funroll-loops' |
| 684 |
|
else |
| 685 |
|
FFLAGS='-Wimplicit -Wunused -ffloat-store' |
| 686 |
|
FOPTIM='-O0 -malign-double' |
| 687 |
|
fi |
| 688 |
\end{verbatim} |
\end{verbatim} |
| 689 |
|
|
| 690 |
\subsection{Running the model} |
If you write an optfile for an unrepresented machine or compiler, you |
| 691 |
|
are strongly encouraged to submit the optfile to the MITgcm project |
| 692 |
|
for inclusion. Please send the file to the |
| 693 |
|
\begin{rawhtml} <A href="mail-to:MITgcm-support@mitgcm.org"> \end{rawhtml} |
| 694 |
|
\begin{center} |
| 695 |
|
MITgcm-support@mitgcm.org |
| 696 |
|
\end{center} |
| 697 |
|
\begin{rawhtml} </A> \end{rawhtml} |
| 698 |
|
mailing list. |
| 699 |
|
|
| 700 |
The first thing to do is to run the code by typing \textit{mitgcmuv} and see |
In addition to the optfiles, \texttt{genmake2} supports a number of |
| 701 |
what happens. You can compare what you get with what is in the \textit{% |
helpful command-line options. A complete list of these options can be |
| 702 |
results} directory. Unless noted otherwise, most examples are set up to run |
obtained from: |
| 703 |
for a few time steps only so that you can quickly figure out whether the |
\begin{verbatim} |
| 704 |
model is working or not. |
% genmake2 -h |
| 705 |
|
\end{verbatim} |
| 706 |
|
|
| 707 |
\subsubsection{Output files} |
The most important command-line options are: |
| 708 |
|
\begin{description} |
| 709 |
|
|
| 710 |
|
\item[--optfile=/PATH/FILENAME] specifies the optfile that should be |
| 711 |
|
used for a particular build. |
| 712 |
|
|
| 713 |
|
If no "optfile" is specified (either through the command line or the |
| 714 |
|
MITGCM\_OPTFILE environment variable), genmake2 will try to make a |
| 715 |
|
reasonable guess from the list provided in {\em |
| 716 |
|
tools/build\_options}. The method used for making this guess is |
| 717 |
|
to first determine the combination of operating system and hardware |
| 718 |
|
(eg. "linux\_ia32") and then find a working FORTRAN compiler within |
| 719 |
|
the user's path. When these three items have been identified, |
| 720 |
|
genmake2 will try to find an optfile that has a matching name. |
| 721 |
|
|
| 722 |
|
\item[--pdepend=/PATH/FILENAME] specifies the dependency file used for |
| 723 |
|
packages. |
| 724 |
|
|
| 725 |
|
If not specified, the default dependency file {\em pkg/pkg\_depend} |
| 726 |
|
is used. The syntax for this file is parsed on a line-by-line basis |
| 727 |
|
where each line containes either a comment ("\#") or a simple |
| 728 |
|
"PKGNAME1 (+|-)PKGNAME2" pairwise rule where the "+" or "-" symbol |
| 729 |
|
specifies a "must be used with" or a "must not be used with" |
| 730 |
|
relationship, respectively. If no rule is specified, then it is |
| 731 |
|
assumed that the two packages are compatible and will function |
| 732 |
|
either with or without each other. |
| 733 |
|
|
| 734 |
|
\item[--pdefault='PKG1 PKG2 PKG3 ...'] specifies the default set of |
| 735 |
|
packages to be used. |
| 736 |
|
|
| 737 |
|
If not set, the default package list will be read from {\em |
| 738 |
|
pkg/pkg\_default} |
| 739 |
|
|
| 740 |
|
\item[--adof=/path/to/file] specifies the "adjoint" or automatic |
| 741 |
|
differentiation options file to be used. The file is analogous to |
| 742 |
|
the ``optfile'' defined above but it specifies information for the |
| 743 |
|
AD build process. |
| 744 |
|
|
| 745 |
|
The default file is located in {\em |
| 746 |
|
tools/adjoint\_options/adjoint\_default} and it defines the "TAF" |
| 747 |
|
and "TAMC" compilers. An alternate version is also available at |
| 748 |
|
{\em tools/adjoint\_options/adjoint\_staf} that selects the newer |
| 749 |
|
"STAF" compiler. As with any compilers, it is helpful to have their |
| 750 |
|
directories listed in your {\tt \$PATH} environment variable. |
| 751 |
|
|
| 752 |
|
\item[--mods='DIR1 DIR2 DIR3 ...'] specifies a list of directories |
| 753 |
|
containing ``modifications''. These directories contain files with |
| 754 |
|
names that may (or may not) exist in the main MITgcm source tree but |
| 755 |
|
will be overridden by any identically-named sources within the |
| 756 |
|
``MODS'' directories. |
| 757 |
|
|
| 758 |
|
The order of precedence for this "name-hiding" is as follows: |
| 759 |
|
\begin{itemize} |
| 760 |
|
\item ``MODS'' directories (in the order given) |
| 761 |
|
\item Packages either explicitly specified or provided by default |
| 762 |
|
(in the order given) |
| 763 |
|
\item Packages included due to package dependencies (in the order |
| 764 |
|
that that package dependencies are parsed) |
| 765 |
|
\item The "standard dirs" (which may have been specified by the |
| 766 |
|
``-standarddirs'' option) |
| 767 |
|
\end{itemize} |
| 768 |
|
|
| 769 |
|
\item[--make=/path/to/gmake] Due to the poor handling of soft-links and |
| 770 |
|
other bugs common with the \texttt{make} versions provided by |
| 771 |
|
commercial Unix vendors, GNU \texttt{make} (sometimes called |
| 772 |
|
\texttt{gmake}) should be preferred. This option provides a means |
| 773 |
|
for specifying the make executable to be used. |
| 774 |
|
|
| 775 |
|
\end{description} |
| 776 |
|
|
| 777 |
|
|
| 778 |
|
|
| 779 |
|
\section{Running the model} |
| 780 |
|
\label{sect:runModel} |
| 781 |
|
|
| 782 |
|
If compilation finished succesfuully (section \ref{sect:buildModel}) |
| 783 |
|
then an executable called {\em mitgcmuv} will now exist in the local |
| 784 |
|
directory. |
| 785 |
|
|
| 786 |
|
To run the model as a single process (ie. not in parallel) simply |
| 787 |
|
type: |
| 788 |
|
\begin{verbatim} |
| 789 |
|
% ./mitgcmuv |
| 790 |
|
\end{verbatim} |
| 791 |
|
The ``./'' is a safe-guard to make sure you use the local executable |
| 792 |
|
in case you have others that exist in your path (surely odd if you |
| 793 |
|
do!). The above command will spew out many lines of text output to |
| 794 |
|
your screen. This output contains details such as parameter values as |
| 795 |
|
well as diagnostics such as mean Kinetic energy, largest CFL number, |
| 796 |
|
etc. It is worth keeping this text output with the binary output so we |
| 797 |
|
normally re-direct the {\em stdout} stream as follows: |
| 798 |
|
\begin{verbatim} |
| 799 |
|
% ./mitgcmuv > output.txt |
| 800 |
|
\end{verbatim} |
| 801 |
|
|
| 802 |
|
For the example experiments in {\em vericication}, an example of the |
| 803 |
|
output is kept in {\em results/output.txt} for comparison. You can compare |
| 804 |
|
your {\em output.txt} with this one to check that the set-up works. |
| 805 |
|
|
| 806 |
|
|
| 807 |
|
|
| 808 |
|
\subsection{Output files} |
| 809 |
|
|
| 810 |
The model produces various output files. At a minimum, the instantaneous |
The model produces various output files. At a minimum, the instantaneous |
| 811 |
``state'' of the model is written out, which is made of the following files: |
``state'' of the model is written out, which is made of the following files: |
| 856 |
used to restart the model but are overwritten every other time they are |
used to restart the model but are overwritten every other time they are |
| 857 |
output to save disk space during long integrations. |
output to save disk space during long integrations. |
| 858 |
|
|
| 859 |
\subsubsection{Looking at the output} |
\subsection{Looking at the output} |
| 860 |
|
|
| 861 |
All the model data are written according to a ``meta/data'' file format. |
All the model data are written according to a ``meta/data'' file format. |
| 862 |
Each variable is associated with two files with suffix names \textit{.data} |
Each variable is associated with two files with suffix names \textit{.data} |
| 870 |
\textit{utils/matlab} under the root tree. The script \textit{rdmds.m} reads |
\textit{utils/matlab} under the root tree. The script \textit{rdmds.m} reads |
| 871 |
the data. Look at the comments inside the script to see how to use it. |
the data. Look at the comments inside the script to see how to use it. |
| 872 |
|
|
| 873 |
\section{Code structure} |
Some examples of reading and visualizing some output in {\em Matlab}: |
| 874 |
|
\begin{verbatim} |
| 875 |
|
% matlab |
| 876 |
|
>> H=rdmds('Depth'); |
| 877 |
|
>> contourf(H');colorbar; |
| 878 |
|
>> title('Depth of fluid as used by model'); |
| 879 |
|
|
| 880 |
|
>> eta=rdmds('Eta',10); |
| 881 |
|
>> imagesc(eta');axis ij;colorbar; |
| 882 |
|
>> title('Surface height at iter=10'); |
| 883 |
|
|
| 884 |
\section{Doing it yourself: customizing the code} |
>> eta=rdmds('Eta',[0:10:100]); |
| 885 |
|
>> for n=1:11; imagesc(eta(:,:,n)');axis ij;colorbar;pause(.5);end |
| 886 |
|
\end{verbatim} |
| 887 |
|
|
| 888 |
\subsection{\protect\bigskip Configuration and setup} |
\section{Doing it yourself: customizing the code} |
| 889 |
|
|
| 890 |
When you are ready to run the model in the configuration you want, the |
When you are ready to run the model in the configuration you want, the |
| 891 |
easiest thing is to use and adapt the setup of the case studies experiment |
easiest thing is to use and adapt the setup of the case studies experiment |
| 895 |
the ''execution environment'' part is covered in the parallel implementation |
the ''execution environment'' part is covered in the parallel implementation |
| 896 |
section) and on the variables and parameters that you are likely to change. |
section) and on the variables and parameters that you are likely to change. |
| 897 |
|
|
| 898 |
|
\subsection{Configuration and setup} |
| 899 |
|
|
| 900 |
The CPP keys relative to the ''numerical model'' part of the code are all |
The CPP keys relative to the ''numerical model'' part of the code are all |
| 901 |
defined and set in the file \textit{CPP\_OPTIONS.h }in the directory \textit{% |
defined and set in the file \textit{CPP\_OPTIONS.h }in the directory \textit{% |
| 902 |
model/inc }or in one of the \textit{code }directories of the case study |
model/inc }or in one of the \textit{code }directories of the case study |
| 913 |
computational domain, the equations solved in the model, and the simulation |
computational domain, the equations solved in the model, and the simulation |
| 914 |
controls. |
controls. |
| 915 |
|
|
| 916 |
\subsubsection{Computational domain, geometry and time-discretization} |
\subsection{Computational domain, geometry and time-discretization} |
| 917 |
|
|
| 918 |
\begin{itemize} |
\begin{itemize} |
| 919 |
\item dimensions |
\item dimensions |
| 996 |
\item time-discretization |
\item time-discretization |
| 997 |
\end{itemize} |
\end{itemize} |
| 998 |
|
|
| 999 |
The time steps are set through the real variables \textbf{deltaTMom }and |
The time steps are set through the real variables \textbf{deltaTMom} |
| 1000 |
\textbf{deltaTtracer }(in s) which represent the time step for the momentum |
and \textbf{deltaTtracer} (in s) which represent the time step for the |
| 1001 |
and tracer equations, respectively. For synchronous integrations, simply set |
momentum and tracer equations, respectively. For synchronous |
| 1002 |
the two variables to the same value (or you can prescribe one time step only |
integrations, simply set the two variables to the same value (or you |
| 1003 |
through the variable \textbf{deltaT}). The Adams-Bashforth stabilizing |
can prescribe one time step only through the variable |
| 1004 |
parameter is set through the variable \textbf{abEps }(dimensionless). The |
\textbf{deltaT}). The Adams-Bashforth stabilizing parameter is set |
| 1005 |
stagger baroclinic time stepping can be activated by setting the logical |
through the variable \textbf{abEps} (dimensionless). The stagger |
| 1006 |
variable \textbf{staggerTimeStep }to '.\texttt{TRUE}.'. |
baroclinic time stepping can be activated by setting the logical |
| 1007 |
|
variable \textbf{staggerTimeStep} to '.\texttt{TRUE}.'. |
| 1008 |
\subsubsection{Equation of state} |
|
| 1009 |
|
\subsection{Equation of state} |
| 1010 |
First, because the model equations are written in terms of perturbations, a |
|
| 1011 |
reference thermodynamic state needs to be specified. This is done through |
First, because the model equations are written in terms of |
| 1012 |
the 1D arrays \textbf{tRef}\textit{\ }and \textbf{sRef}. \textbf{tRef }% |
perturbations, a reference thermodynamic state needs to be specified. |
| 1013 |
specifies the reference potential temperature profile (in $^{o}$C for |
This is done through the 1D arrays \textbf{tRef} and \textbf{sRef}. |
| 1014 |
the ocean and $^{o}$K for the atmosphere) starting from the level |
\textbf{tRef} specifies the reference potential temperature profile |
| 1015 |
k=1. Similarly, \textbf{sRef}\textit{\ }specifies the reference salinity |
(in $^{o}$C for the ocean and $^{o}$K for the atmosphere) starting |
| 1016 |
profile (in ppt) for the ocean or the reference specific humidity profile |
from the level k=1. Similarly, \textbf{sRef} specifies the reference |
| 1017 |
(in g/kg) for the atmosphere. |
salinity profile (in ppt) for the ocean or the reference specific |
| 1018 |
|
humidity profile (in g/kg) for the atmosphere. |
| 1019 |
The form of the equation of state is controlled by the character variables |
|
| 1020 |
\textbf{buoyancyRelation}\textit{\ }and \textbf{eosType}\textit{. }\textbf{% |
The form of the equation of state is controlled by the character |
| 1021 |
buoyancyRelation}\textit{\ }is set to '\texttt{OCEANIC}' by default and |
variables \textbf{buoyancyRelation} and \textbf{eosType}. |
| 1022 |
needs to be set to '\texttt{ATMOSPHERIC}' for atmosphere simulations. In |
\textbf{buoyancyRelation} is set to '\texttt{OCEANIC}' by default and |
| 1023 |
this case, \textbf{eosType}\textit{\ }must be set to '\texttt{IDEALGAS}'. |
needs to be set to '\texttt{ATMOSPHERIC}' for atmosphere simulations. |
| 1024 |
For the ocean, two forms of the equation of state are available: linear (set |
In this case, \textbf{eosType} must be set to '\texttt{IDEALGAS}'. |
| 1025 |
\textbf{eosType}\textit{\ }to '\texttt{LINEAR}') and a polynomial |
For the ocean, two forms of the equation of state are available: |
| 1026 |
approximation to the full nonlinear equation ( set \textbf{eosType}\textit{\ |
linear (set \textbf{eosType} to '\texttt{LINEAR}') and a polynomial |
| 1027 |
}to '\texttt{POLYNOMIAL}'). In the linear case, you need to specify the |
approximation to the full nonlinear equation ( set |
| 1028 |
thermal and haline expansion coefficients represented by the variables |
\textbf{eosType}\textit{\ }to '\texttt{POLYNOMIAL}'). In the linear |
| 1029 |
\textbf{tAlpha}\textit{\ }(in K$^{-1}$) and \textbf{sBeta}\textit{\ }(in ppt$% |
case, you need to specify the thermal and haline expansion |
| 1030 |
^{-1}$). For the nonlinear case, you need to generate a file of polynomial |
coefficients represented by the variables \textbf{tAlpha}\textit{\ |
| 1031 |
coefficients called \textit{POLY3.COEFFS. }To do this, use the program |
}(in K$^{-1}$) and \textbf{sBeta} (in ppt$^{-1}$). For the nonlinear |
| 1032 |
\textit{utils/knudsen2/knudsen2.f }under the model tree (a Makefile is |
case, you need to generate a file of polynomial coefficients called |
| 1033 |
available in the same directory and you will need to edit the number and the |
\textit{POLY3.COEFFS}. To do this, use the program |
| 1034 |
values of the vertical levels in \textit{knudsen2.f }so that they match |
\textit{utils/knudsen2/knudsen2.f} under the model tree (a Makefile is |
| 1035 |
those of your configuration). \textit{\ } |
available in the same directory and you will need to edit the number |
| 1036 |
|
and the values of the vertical levels in \textit{knudsen2.f} so that |
| 1037 |
|
they match those of your configuration). |
| 1038 |
|
|
| 1039 |
|
There there are also higher polynomials for the equation of state: |
| 1040 |
|
\begin{description} |
| 1041 |
|
\item['\texttt{UNESCO}':] The UNESCO equation of state formula of |
| 1042 |
|
Fofonoff and Millard \cite{fofonoff83}. This equation of state |
| 1043 |
|
assumes in-situ temperature, which is not a model variable; \emph{its use |
| 1044 |
|
is therefore discouraged, and it is only listed for completeness}. |
| 1045 |
|
\item['\texttt{JMD95Z}':] A modified UNESCO formula by Jackett and |
| 1046 |
|
McDougall \cite{jackett95}, which uses the model variable potential |
| 1047 |
|
temperature as input. The '\texttt{Z}' indicates that this equation |
| 1048 |
|
of state uses a horizontally and temporally constant pressure |
| 1049 |
|
$p_{0}=-g\rho_{0}z$. |
| 1050 |
|
\item['\texttt{JMD95P}':] A modified UNESCO formula by Jackett and |
| 1051 |
|
McDougall \cite{jackett95}, which uses the model variable potential |
| 1052 |
|
temperature as input. The '\texttt{P}' indicates that this equation |
| 1053 |
|
of state uses the actual hydrostatic pressure of the last time |
| 1054 |
|
step. Lagging the pressure in this way requires an additional pickup |
| 1055 |
|
file for restarts. |
| 1056 |
|
\item['\texttt{MDJWF}':] The new, more accurate and less expensive |
| 1057 |
|
equation of state by McDougall et~al. \cite{mcdougall03}. It also |
| 1058 |
|
requires lagging the pressure and therefore an additional pickup |
| 1059 |
|
file for restarts. |
| 1060 |
|
\end{description} |
| 1061 |
|
For none of these options an reference profile of temperature or |
| 1062 |
|
salinity is required. |
| 1063 |
|
|
| 1064 |
\subsubsection{Momentum equations} |
\subsection{Momentum equations} |
| 1065 |
|
|
| 1066 |
In this section, we only focus for now on the parameters that you are likely |
In this section, we only focus for now on the parameters that you are likely |
| 1067 |
to change, i.e. the ones relative to forcing and dissipation for example. |
to change, i.e. the ones relative to forcing and dissipation for example. |
| 1165 |
\texttt{TRUE}.' and the other to '.\texttt{FALSE}.' depending on how you |
\texttt{TRUE}.' and the other to '.\texttt{FALSE}.' depending on how you |
| 1166 |
want to deal with the ocean upper or atmosphere lower boundary). |
want to deal with the ocean upper or atmosphere lower boundary). |
| 1167 |
|
|
| 1168 |
\subsubsection{Tracer equations} |
\subsection{Tracer equations} |
| 1169 |
|
|
| 1170 |
This section covers the tracer equations i.e. the potential temperature |
This section covers the tracer equations i.e. the potential temperature |
| 1171 |
equation and the salinity (for the ocean) or specific humidity (for the |
equation and the salinity (for the ocean) or specific humidity (for the |
| 1256 |
vertically due to static instabilities. Note that \textbf{cadjFreq }and |
vertically due to static instabilities. Note that \textbf{cadjFreq }and |
| 1257 |
\textbf{ivdc\_kappa }can not both have non-zero value. |
\textbf{ivdc\_kappa }can not both have non-zero value. |
| 1258 |
|
|
| 1259 |
\subsubsection{Simulation controls} |
\subsection{Simulation controls} |
| 1260 |
|
|
| 1261 |
The model ''clock'' is defined by the variable \textbf{deltaTClock }(in s) |
The model ''clock'' is defined by the variable \textbf{deltaTClock }(in s) |
| 1262 |
which determines the IO frequencies and is used in tagging output. |
which determines the IO frequencies and is used in tagging output. |
| 1292 |
The precision with which to write the binary data is controlled by the |
The precision with which to write the binary data is controlled by the |
| 1293 |
integer variable w\textbf{riteBinaryPrec }(set it to \texttt{32} or \texttt{% |
integer variable w\textbf{riteBinaryPrec }(set it to \texttt{32} or \texttt{% |
| 1294 |
64}). |
64}). |
| 1295 |
|
|
| 1296 |
|
%%% Local Variables: |
| 1297 |
|
%%% mode: latex |
| 1298 |
|
%%% TeX-master: t |
| 1299 |
|
%%% End: |