79 |
|
|
80 |
\end{enumerate} |
\end{enumerate} |
81 |
|
|
82 |
|
\subsubsection{Checkout from CVS} |
83 |
|
\label{sect:cvs_checkout} |
84 |
|
|
85 |
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 |
86 |
provides an efficient and elegant way of organizing your code and keeping |
provides an efficient and elegant way of organizing your code and keeping |
87 |
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 |
96 |
\begin{verbatim} |
\begin{verbatim} |
97 |
% export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
% export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
98 |
\end{verbatim} |
\end{verbatim} |
99 |
in your .profile or .bashrc file. |
in your \texttt{.profile} or \texttt{.bashrc} file. |
100 |
|
|
101 |
|
|
102 |
To get MITgcm through CVS, first register with the MITgcm CVS server |
To get MITgcm through CVS, first register with the MITgcm CVS server |
124 |
\end{verbatim} |
\end{verbatim} |
125 |
\begin{rawhtml} </A> \end{rawhtml} |
\begin{rawhtml} </A> \end{rawhtml} |
126 |
|
|
127 |
|
As a convenience, the MITgcm CVS server contains aliases which are |
128 |
|
named subsets of the codebase. These aliases can be especially |
129 |
|
helpful when used over slow internet connections or on machines with |
130 |
|
restricted storage space. Table \ref{tab:cvsModules} contains a list |
131 |
|
of CVS aliases |
132 |
|
\begin{table}[htb] |
133 |
|
\centering |
134 |
|
\begin{tabular}[htb]{|lp{3.25in}|}\hline |
135 |
|
\textbf{Alias Name} & \textbf{Information (directories) Contained} \\\hline |
136 |
|
\texttt{MITgcm\_code} & Only the source code -- none of the verification examples. \\ |
137 |
|
\texttt{MITgcm\_verif\_basic} |
138 |
|
& Source code plus a small set of the verification examples |
139 |
|
(\texttt{global\_ocean.90x40x15}, \texttt{aim.5l\_cs}, \texttt{hs94.128x64x5}, |
140 |
|
\texttt{front\_relax}, and \texttt{plume\_on\_slope}). \\ |
141 |
|
\texttt{MITgcm\_verif\_atmos} & Source code plus all of the atmospheric examples. \\ |
142 |
|
\texttt{MITgcm\_verif\_ocean} & Source code plus all of the oceanic examples. \\ |
143 |
|
\texttt{MITgcm\_verif\_all} & Source code plus all of the |
144 |
|
verification examples. \\\hline |
145 |
|
\end{tabular} |
146 |
|
\caption{MITgcm CVS Modules} |
147 |
|
\label{tab:cvsModules} |
148 |
|
\end{table} |
149 |
|
|
150 |
The checkout process creates a directory called \textit{MITgcm}. If |
The checkout process creates a directory called \textit{MITgcm}. If |
151 |
the directory \textit{MITgcm} exists this command updates your code |
the directory \textit{MITgcm} exists this command updates your code |
159 |
here |
here |
160 |
\begin{rawhtml} </A> \end{rawhtml} |
\begin{rawhtml} </A> \end{rawhtml} |
161 |
. |
. |
162 |
|
It is important to note that the CVS aliases in Table |
163 |
|
\ref{tab:cvsModules} cannot be used in conjunction with the CVS |
164 |
|
\texttt{-d DIRNAME} option. However, the \texttt{MITgcm} directories |
165 |
|
they create can be changed to a different name following the check-out: |
166 |
|
\begin{verbatim} |
167 |
|
% cvs co MITgcm_verif_basic |
168 |
|
% mv MITgcm MITgcm_verif_basic |
169 |
|
\end{verbatim} |
170 |
|
|
171 |
|
|
172 |
\paragraph*{Conventional download method} |
\subsubsection{Conventional download method} |
173 |
\label{sect:conventionalDownload} |
\label{sect:conventionalDownload} |
174 |
|
|
175 |
If you do not have CVS on your system, you can download the model as a |
If you do not have CVS on your system, you can download the model as a |
189 |
\begin{rawhtml} </A> \end{rawhtml} |
\begin{rawhtml} </A> \end{rawhtml} |
190 |
mailing list. |
mailing list. |
191 |
|
|
192 |
\paragraph*{Upgrading from an earlier version} |
\subsubsection{Upgrading from an earlier version} |
193 |
|
|
194 |
If you already have an earlier version of the code you can ``upgrade'' |
If you already have an earlier version of the code you can ``upgrade'' |
195 |
your copy instead of downloading the entire repository again. First, |
your copy instead of downloading the entire repository again. First, |
666 |
\end{verbatim} |
\end{verbatim} |
667 |
|
|
668 |
|
|
669 |
|
\subsection{Using \texttt{genmake2}} |
|
\subsection{Using \textit{genmake2}} |
|
670 |
\label{sect:genmake} |
\label{sect:genmake} |
671 |
|
|
672 |
To compile the code, first use the program \texttt{genmake2} (located |
To compile the code, first use the program \texttt{genmake2} (located |
673 |
in the \textit{tools} directory) to generate a Makefile. |
in the \texttt{tools} directory) to generate a Makefile. |
674 |
\texttt{genmake2} is a shell script written to work with all |
\texttt{genmake2} is a shell script written to work with all |
675 |
``sh''--compatible shells including bash v1, bash v2, and Bourne. |
``sh''--compatible shells including bash v1, bash v2, and Bourne. |
676 |
Internally, \texttt{genmake2} determines the locations of needed |
Internally, \texttt{genmake2} determines the locations of needed |
677 |
files, the compiler, compiler options, libraries, and Unix tools. It |
files, the compiler, compiler options, libraries, and Unix tools. It |
678 |
relies upon a number of ``optfiles'' located in the {\em |
relies upon a number of ``optfiles'' located in the |
679 |
tools/build\_options} directory. |
\texttt{tools/build\_options} directory. |
680 |
|
|
681 |
The purpose of the optfiles is to provide all the compilation options |
The purpose of the optfiles is to provide all the compilation options |
682 |
for particular ``platforms'' (where ``platform'' roughly means the |
for particular ``platforms'' (where ``platform'' roughly means the |
771 |
the user's path. When these three items have been identified, |
the user's path. When these three items have been identified, |
772 |
genmake2 will try to find an optfile that has a matching name. |
genmake2 will try to find an optfile that has a matching name. |
773 |
|
|
774 |
|
\item[\texttt{--pdefault='PKG1 PKG2 PKG3 ...'}] specifies the default |
775 |
|
set of packages to be used. The normal order of precedence for |
776 |
|
packages is as follows: |
777 |
|
\begin{enumerate} |
778 |
|
\item If available, the command line (\texttt{--pdefault}) settings |
779 |
|
over-rule any others. |
780 |
|
|
781 |
|
\item Next, \texttt{genmake2} will look for a file named |
782 |
|
``\texttt{packages.conf}'' in the local directory or in any of the |
783 |
|
directories specified with the \texttt{--mods} option. |
784 |
|
|
785 |
|
\item Finally, if neither of the above are available, |
786 |
|
\texttt{genmake2} will use the \texttt{/pkg/pkg\_default} file. |
787 |
|
\end{enumerate} |
788 |
|
|
789 |
\item[\texttt{--pdepend=/PATH/FILENAME}] specifies the dependency file |
\item[\texttt{--pdepend=/PATH/FILENAME}] specifies the dependency file |
790 |
used for packages. |
used for packages. |
791 |
|
|
798 |
assumed that the two packages are compatible and will function |
assumed that the two packages are compatible and will function |
799 |
either with or without each other. |
either with or without each other. |
800 |
|
|
|
\item[\texttt{--pdefault='PKG1 PKG2 PKG3 ...'}] specifies the default |
|
|
set of packages to be used. |
|
|
|
|
|
If not set, the default package list will be read from {\em |
|
|
pkg/pkg\_default} |
|
|
|
|
801 |
\item[\texttt{--adof=/path/to/file}] specifies the "adjoint" or |
\item[\texttt{--adof=/path/to/file}] specifies the "adjoint" or |
802 |
automatic differentiation options file to be used. The file is |
automatic differentiation options file to be used. The file is |
803 |
analogous to the ``optfile'' defined above but it specifies |
analogous to the ``optfile'' defined above but it specifies |
827 |
``-standarddirs'' option) |
``-standarddirs'' option) |
828 |
\end{itemize} |
\end{itemize} |
829 |
|
|
830 |
|
\item[\texttt{--mpi}] This option enables certain MPI features (using |
831 |
|
CPP \texttt{\#define}s) within the code and is necessary for MPI |
832 |
|
builds (see Section \ref{sect:mpi-build}). |
833 |
|
|
834 |
\item[\texttt{--make=/path/to/gmake}] Due to the poor handling of |
\item[\texttt{--make=/path/to/gmake}] Due to the poor handling of |
835 |
soft-links and other bugs common with the \texttt{make} versions |
soft-links and other bugs common with the \texttt{make} versions |
836 |
provided by commercial Unix vendors, GNU \texttt{make} (sometimes |
provided by commercial Unix vendors, GNU \texttt{make} (sometimes |
837 |
called \texttt{gmake}) should be preferred. This option provides a |
called \texttt{gmake}) should be preferred. This option provides a |
838 |
means for specifying the make executable to be used. |
means for specifying the make executable to be used. |
839 |
|
|
840 |
|
\item[\texttt{--bash=/path/to/sh}] On some (usually older UNIX) |
841 |
|
machines, the ``bash'' shell is unavailable. To run on these |
842 |
|
systems, \texttt{genmake2} can be invoked using an ``sh'' (that is, |
843 |
|
a Bourne, POSIX, or compatible) shell. The syntax in these |
844 |
|
circumstances is: |
845 |
|
\begin{center} |
846 |
|
\texttt{\% /bin/sh genmake2 -bash=/bin/sh [...options...]} |
847 |
|
\end{center} |
848 |
|
where \texttt{/bin/sh} can be replaced with the full path and name |
849 |
|
of the desired shell. |
850 |
|
|
851 |
\end{description} |
\end{description} |
852 |
|
|
853 |
|
|
854 |
|
\subsection{Building with MPI} |
855 |
|
\label{sect:mpi-build} |
856 |
|
|
857 |
|
Building MITgcm to use MPI libraries can be complicated due to the |
858 |
|
variety of different MPI implementations available, their dependencies |
859 |
|
or interactions with different compilers, and their often ad-hoc |
860 |
|
locations within file systems. For these reasons, its generally a |
861 |
|
good idea to start by finding and reading the documentation for your |
862 |
|
machine(s) and, if necessary, seeking help from your local systems |
863 |
|
administrator. |
864 |
|
|
865 |
|
The steps for building MITgcm with MPI support are: |
866 |
|
\begin{enumerate} |
867 |
|
|
868 |
|
\item Determine the locations of your MPI-enabled compiler and/or MPI |
869 |
|
libraries and put them into an options file as described in Section |
870 |
|
\ref{sect:genmake}. One can start with one of the examples in: |
871 |
|
\begin{rawhtml} <A |
872 |
|
href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm/tools/build_options/"> |
873 |
|
\end{rawhtml} |
874 |
|
\begin{center} |
875 |
|
\texttt{MITgcm/tools/build\_options/} |
876 |
|
\end{center} |
877 |
|
\begin{rawhtml} </A> \end{rawhtml} |
878 |
|
such as \texttt{linux\_ia32\_g77+mpi\_cg01} or |
879 |
|
\texttt{linux\_ia64\_efc+mpi} and then edit it to suit the machine at |
880 |
|
hand. You may need help from your user guide or local systems |
881 |
|
administrator to determine the exact location of the MPI libraries. |
882 |
|
If libraries are not installed, MPI implementations and related |
883 |
|
tools are available including: |
884 |
|
\begin{itemize} |
885 |
|
\item \begin{rawhtml} <A |
886 |
|
href="http://www-unix.mcs.anl.gov/mpi/mpich/"> |
887 |
|
\end{rawhtml} |
888 |
|
MPICH |
889 |
|
\begin{rawhtml} </A> \end{rawhtml} |
890 |
|
|
891 |
|
\item \begin{rawhtml} <A |
892 |
|
href="http://www.lam-mpi.org/"> |
893 |
|
\end{rawhtml} |
894 |
|
LAM/MPI |
895 |
|
\begin{rawhtml} </A> \end{rawhtml} |
896 |
|
|
897 |
|
\item \begin{rawhtml} <A |
898 |
|
href="http://www.osc.edu/~pw/mpiexec/"> |
899 |
|
\end{rawhtml} |
900 |
|
MPIexec |
901 |
|
\begin{rawhtml} </A> \end{rawhtml} |
902 |
|
\end{itemize} |
903 |
|
|
904 |
|
\item Build the code with the \texttt{genmake2} \texttt{-mpi} option |
905 |
|
(see Section \ref{sect:genmake}) using commands such as: |
906 |
|
{\footnotesize \begin{verbatim} |
907 |
|
% ../../../tools/genmake2 -mods=../code -mpi -of=YOUR_OPTFILE |
908 |
|
% make depend |
909 |
|
% make |
910 |
|
\end{verbatim} } |
911 |
|
|
912 |
|
\item Run the code with the appropriate MPI ``run'' or ``exec'' |
913 |
|
program provided with your particular implementation of MPI. |
914 |
|
Typical MPI packages such as MPICH will use something like: |
915 |
|
\begin{verbatim} |
916 |
|
% mpirun -np 4 -machinefile mf ./mitgcmuv |
917 |
|
\end{verbatim} |
918 |
|
Sightly more complicated scripts may be needed for many machines |
919 |
|
since execution of the code may be controlled by both the MPI |
920 |
|
library and a job scheduling and queueing system such as PBS, |
921 |
|
LoadLeveller, Condor, or any of a number of similar tools. A few |
922 |
|
example scripts (those used for our \begin{rawhtml} <A |
923 |
|
href="http://mitgcm.org/testing.html"> \end{rawhtml}regular |
924 |
|
verification runs\begin{rawhtml} </A> \end{rawhtml}) are available |
925 |
|
at: |
926 |
|
\begin{rawhtml} <A |
927 |
|
href="http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm_contrib/test_scripts/"> |
928 |
|
\end{rawhtml} |
929 |
|
{\footnotesize \tt |
930 |
|
http://mitgcm.org/cgi-bin/viewcvs.cgi/MITgcm\_contrib/test\_scripts/ } |
931 |
|
\begin{rawhtml} </A> \end{rawhtml} |
932 |
|
|
933 |
|
\end{enumerate} |
934 |
|
|
935 |
|
|
936 |
|
|
937 |
\section{Running the model} |
\section{Running the model} |
938 |
\label{sect:runModel} |
\label{sect:runModel} |
939 |
|
|
940 |
If compilation finished succesfuully (section \ref{sect:buildModel}) |
If compilation finished succesfuully (section \ref{sect:buildingCode}) |
941 |
then an executable called {\em mitgcmuv} will now exist in the local |
then an executable called \texttt{mitgcmuv} will now exist in the |
942 |
directory. |
local directory. |
943 |
|
|
944 |
To run the model as a single process (ie. not in parallel) simply |
To run the model as a single process (ie. not in parallel) simply |
945 |
type: |
type: |