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 |
|
|