--- manual/s_phys_pkgs/text/packages.tex 2004/10/12 18:16:03 1.4 +++ manual/s_phys_pkgs/text/packages.tex 2005/07/18 20:45:27 1.6 @@ -1,4 +1,4 @@ -% $Header: /home/ubuntu/mnt/e9_copy/manual/s_phys_pkgs/text/packages.tex,v 1.4 2004/10/12 18:16:03 edhill Exp $ +% $Header: /home/ubuntu/mnt/e9_copy/manual/s_phys_pkgs/text/packages.tex,v 1.6 2005/07/18 20:45:27 molod Exp $ % $Name: $ \section{Using MITgcm Packages} @@ -79,12 +79,12 @@ still be aware of the dependency. -\section{Package Coding Standards} +\subsection{Package Coding Standards} The following sections describe how to modify and/or create new MITgcm packages. -\subsection{Packages are Not Libraries} +\subsubsection{Packages are Not Libraries} To a beginner, the MITgcm packages may resemble libraries as used in myriad software projects. While future versions are likely to @@ -240,5 +240,21 @@ } -\subsubsection{Package Startup or Boot Sequence} +\subsubsection{Adding a package to PARAMS.h and packages\_boot()} + +An MITgcm package directory contains all the code needed for that package apart +from one variable for each package. This variable is the {\tt use\$\{Pkg\} } +flag. This flag, which is of type logical, {\bf must} be declared in the +shared header file {\it PARAMS.h} in the {\it PARM\_PACKAGES} block. This +convention is used to support a single runtime control file {\it data.pkg} +which is read by the startup routine {\it packages\_boot()} and that sets a +flag controlling the runtime use of a package. This routine needs to be able to +read the flags for packages that were not built at compile time. Therefore +when adding a new package, in addition to creating the per-package directory +in the {\it pkg/} subdirectory a developer should add a {\tt use\$\{Pkg\} } +flag to {\it PARAMS.h} and a {\tt use\$\{Pkg\} } entry to the +{\it packages\_boot()} {\it PACKAGES} namelist. +The only other package specific code that should appear outside the individual +package directory are calls to the specific package API. +