| 2 |
% $Name$ |
% $Name$ |
| 3 |
|
|
| 4 |
\section{Using MITgcm Packages} |
\section{Using MITgcm Packages} |
| 5 |
|
\label{sec:pkg:using} |
| 6 |
|
\begin{rawhtml} |
| 7 |
|
<!-- CMIREDIR:package_using: --> |
| 8 |
|
\end{rawhtml} |
| 9 |
|
|
| 10 |
The set of packages that will be used within a partiucular model can |
The set of packages that will be used within a partiucular model can |
| 11 |
be configured using a combination of both ``compile--time'' and |
be configured using a combination of both ``compile--time'' and |
| 79 |
still be aware of the dependency. |
still be aware of the dependency. |
| 80 |
|
|
| 81 |
|
|
| 82 |
\section{Package Coding Standards} |
\subsection{Package Coding Standards} |
| 83 |
|
|
| 84 |
The following sections describe how to modify and/or create new MITgcm |
The following sections describe how to modify and/or create new MITgcm |
| 85 |
packages. |
packages. |
| 86 |
|
|
| 87 |
\subsection{Packages are Not Libraries} |
\subsubsection{Packages are Not Libraries} |
| 88 |
|
|
| 89 |
To a beginner, the MITgcm packages may resemble libraries as used in |
To a beginner, the MITgcm packages may resemble libraries as used in |
| 90 |
myriad software projects. While future versions are likely to |
myriad software projects. While future versions are likely to |
| 240 |
} |
} |
| 241 |
|
|
| 242 |
|
|
| 243 |
\subsubsection{Package Startup or Boot Sequence} |
\subsubsection{Adding a package to PARAMS.h and packages\_boot()} |
| 244 |
|
|
| 245 |
|
An MITgcm package directory contains all the code needed for that package apart |
| 246 |
|
from one variable for each package. This variable is the {\tt use\$\{Pkg\} } |
| 247 |
|
flag. This flag, which is of type logical, {\bf must} be declared in the |
| 248 |
|
shared header file {\it PARAMS.h} in the {\it PARM\_PACKAGES} block. This |
| 249 |
|
convention is used to support a single runtime control file {\it data.pkg} |
| 250 |
|
which is read by the startup routine {\it packages\_boot()} and that sets a |
| 251 |
|
flag controlling the runtime use of a package. This routine needs to be able to |
| 252 |
|
read the flags for packages that were not built at compile time. Therefore |
| 253 |
|
when adding a new package, in addition to creating the per-package directory |
| 254 |
|
in the {\it pkg/} subdirectory a developer should add a {\tt use\$\{Pkg\} } |
| 255 |
|
flag to {\it PARAMS.h} and a {\tt use\$\{Pkg\} } entry to the |
| 256 |
|
{\it packages\_boot()} {\it PACKAGES} namelist. |
| 257 |
|
The only other package specific code that should appear outside the individual |
| 258 |
|
package directory are calls to the specific package API. |
| 259 |
|
|
| 260 |
|
|