source: CPL/oasis3/trunk/src/mod/oasis3/doc/UG6_Compilation_running.tex @ 1677

Last change on this file since 1677 was 1677, checked in by aclsce, 12 years ago

Imported oasis3 (tag ipslcm5a) from cvs server to svn server (igcmg project).

File size: 14.4 KB
Line 
1\newpage
2%
3
4\chapter{Compiling and running with OASIS3}
5\label{sec_compilationrunning}
6
7OASIS3 and its TOYCLIM coupled model has been successfully compiled
8and run on Fujitsu VPP5000, NEC SX5 and SX6, SGI IRIX64, SGI Origin
93800, Linux Opteron, IBM Power4, and Cray X1.
10
11\section{Compiling OASIS3 and the TOYCLIM coupled model}
12\label{subsec_compile}
13
14OASIS3 and the TOYCLIM coupled model use the PRISM standard directory
15structure (see also \cite{leg04}) and Standard Compiling Environment (see
16also \cite{gay04}). To
17compile OASIS3 and toyatm, toyoce and toyche component models, one
18should go through the following steps:
19\begin{enumerate}
20\item Go in the directory {\tt prism/util/compile/frames}.
21
22\item Create the include files for your platform if they do not
23already exist in directory \break {\tt
24prism/util/compile/frames/include\_<node>} where {\tt <node>} is the
25name of the platform.
26
27\item Generate a compile script for the libraries using the script
28Create\_COMP\_libs.frm:
29
30\vspace*{2ex}
31\begin{Frame}
32  \vspace*{1ex}
33  \Unixcmd{Create\_COMP\_libs.frm "" "" "" ""}
34\end{Frame}
35\vspace*{2ex}
36
37The first parameter can be either {\tt ""} or {\tt "-"} to direct the
38standard output to a file or the screen.
39
40The second parameter an be either {\tt ""}, {\tt "-"} or {\tt "+"} to
41direct the standard error to a file, the screen or the standard
42output.
43
44If the compile scripts shall be created for another platform than the
45one where the \break Create\_COMP\_libs.frm script is launched, the third
46parameter has to contain the abbreviated node name ``node".
47
48The compile script for the libraries \texttt{COMP\_libs.$<$node$>$}
49should then be created in the directory \texttt{prism/util}.
50 
51\item Generate a compile scrip for OASIS3 and for each of the component
52models using the script Create\_COMP\_models.frm:
53\vspace*{2ex}
54\begin{Frame}
55  \vspace*{1ex}
56  \Unixcmd{Create\_COMP\_models.frm oasis3 "mp" "" "" "" }\\
57  \Unixcmd{Create\_COMP\_models.frm toyoce "mp" "" "" "" "ID" "toyatm toyoce toyche"}\\
58  \Unixcmd{Create\_COMP\_models.frm toyatm "mp" "" "" "" "ID" "toyatm toyoce toyche"}\\
59  \Unixcmd{Create\_COMP\_models.frm toyche "mp" "" "" "" "ID" "toyatm toyoce toyche"}
60\end{Frame}
61\vspace*{2ex}
62
63The second parameter ``mp'' specifies the message passing used, which
64determines how the models are launched (see also section
65\ref{subsubsec_Initialisation}).  If the default `MPI2' is chosen, the
66string has to be empty (specification of MPI2 results in an error);
67otherwise, MPI1 has to be given, or NONE for the interpolator only
68mode -see section \ref{subsec_interpolator}.  The OASIS3 executable
69will have the string MPI1 or MPI2 appended to its name. The 3 toy
70models can also be compiled with either the MPI1 option or the default
71MPI2 option (empty string).
72
73The third parameter can be either {\tt ""} or {\tt "-"} to direct the
74standard output to a file or the screen.
75
76The fourth parameter an be either {\tt ""}, {\tt "-"} or {\tt "+"} to
77direct the standard error to a file, the screen or the standard
78output.
79
80If the compile scripts shall be created for another platform than the
81one where the \break Create\_COMP\_models.frm script is launched, the fifth
82parameter has to contain the abbreviated node name ``node".
83
84The sixth parameter ``ID'' is version acronym for differentiation of
85executables (not relevant for OASIS3 and TOYCLIM toy models).
86
87Finally the last parameter gives the name of all the component models
88in the coupled constellation. This list is not relevant for OASIS3,
89but it has to be given for the toymodels. The specified partner models
90are checked against allowed partners and no default is set.
91
92The scripts to compile OASIS3 and the 3 toy coupled models,
93\texttt{COMP\_oasis3\_<mp>.<node>}
94\texttt{COMP\_toyatm\_<ID>.<node>}, \texttt{COMP\_toyoce\_<ID>.<node>},
95\texttt{COMP\_toyche\_<ID>.<node>} should then be created, respectively in
96directories \texttt{prism/src/mod/oasis3}, \texttt{ /toyatm},
97\break \texttt{ /toyoce}, \texttt{ /toyche}.
98
99\item The compilation scripts created can now be used to compile
100OASIS3 and the 3 toy models. All four compile scripts have then to be
101launched explicitely by the user in their respective directory.
102\vspace*{2ex}
103\begin{Frame}
104  \vspace*{1ex}
105  \Unixcmd{COMP\_oasis3\_<mp>.<node>}\\
106  \Unixcmd{COMP\_toyatm\_<ID>.<node>}\\
107  \Unixcmd{COMP\_toyoce\_<ID>.<node>}\\
108  \Unixcmd{COMP\_toyche\_<ID>.<node>}
109\end{Frame}
110\vspace*{2ex}
111
112The scripts compile the models with the MPI library specified during
113their generation.  The script that triggers the update of the
114libraries, \texttt{COMP\_libs.$<$node$>$}, is automatically called by
115the model compilation scripts for the librairies they need. Libraries
116needed by OASIS3 are anaisg, anaism, scrip, fscint, and clim for MPI1
117and MPI2 mode (clim is not compiled in NONE mode). The toy
118models need psmile and mpp\_io.
119 
120\item The result should be executables {\tt oasis3.<mp>.x}, {\tt
121toyatm.<mp>.x}, {\tt toyoce.<mp>.x}, and {\tt toyche.<mp>.x} in the
122{\tt \$BLDROOT/bin} directory defined by the compile scripts, where
123{\tt <mp>} is either MPI1 or MPI2.
124
125\end{enumerate}
126
127\section{Configuring the TOYCLIM coupled model using OASIS3}
128\label{subsec_configuring}
129
130The TOYCLIM coupled model performs a coupling between an ``empty" ocean
131model, toyoce, an``empty" atmospheric model, toyatm, and an ``empty"
132atmospheric chemistry model, toyche. There is no real physics or
133dynamics within the models. However, the coupling fields have a
134realistic size, the operations performed within OASIS3 on the coupling
135fields are realistic, and the coupling using the PRISM System
136model interface (PSMILe) is also realistic.  The TOYCLIM atmosphere
137and chemistry models have the same grid and the same parallel
138partitioning on 3 processes. There is no need of interpolation and
139the coupling fields are directly exchanged between these two models
140without going through OASIS3 interpolation process. More details on
141the TOYCLIM coupled model can be found in \cite{val04b}.
142
143The TOYCLIM coupled model uses PRISM standard running environment
144(SRE). To run it, one has to go through the following
145steps:
146
147\begin{enumerate}
148\item Go to the directory {\tt prism/util/running/frames}
149\item Create the include files for your platform if they do not
150already exist in directory {\tt
151prism/util\break/running/frames/include\_<node>} where {\tt <node>} is
152the name of the platform.
153\item Run the script Create\_TASKS.frm to generate a setup file for
154your TOYCLIM experiment:
155
156\begin{Frame}
157 \begin{Indent}
158  \vspace*{1ex}
159  \Unixcmd{Create\_TASKS.frm toyclim <expid>}
160 \end{Indent}
161\end{Frame}
162\vspace*{2ex}
163
164where {\tt <expid>} is your experiment name.
165
166\item To change the configuration of your experiment, modify the
167values of the configurable entries in the setup file {\tt
168prism/util/running/frames/setup/setup\_toyclim\_<expid>}, which
169contains default values for these entries. Some of these configurable
170entries directly enter the OASIS3 configuration file {\it namcouple},
171other affect the running script only\footnote{Additional {\it
172namcouple} entries are also configurable by editing directly the
173namcouple base file. Refer to chapter \ref{sec_namcouple} for more
174details.}.  The {\it namcouple} file is created from the {\it
175namcouple} base file (see \texttt{namcouple\_toyclim} in
176\texttt{prism/util/running\break/adjunct\_files/oasis3}) by replacing the
177configurable entries (which begin with "\#") by the value defined in
178the setup file.  The {\it namcouple} will be read by OASIS3 at
179runtime. The variables that can be defined in the set-up file and
180correspond to configurable {\it namcouple} entries are the following:
181 
182\begin{enumerate}
183
184\item{\em jobname}: Experiment identifier; it is composed of three
185 digits; ({\em \#Jobname}).
186 
187\item{\em nlogprt}: Integer controlling the amount of information
188 written to the OASIS output file {\em cplout}. 0: minimum output, 1:
189 medium output, 2: maximum output; ({\em \#Nlogprt}).
190
191\item{\em extrapwr}: Flag to provoke the calculation of weights and
192 addresses for nearest neighbour extrapolation (EXTRAP/NINENN) within
193 OASIS3 (1) or to read them from file (0); ({\em \#Extrapwr}).
194
195\item{\em stat\_field{\bf xx}}, where {\bf xx} is the number of the
196field in the namcouple: The status of the {\bf xx} coupling/IO field
197can be either `EXPOUT' or `EXPORTED', except for $Field_3$ for which
198it is `INPUT', for $Field_5$ for which it is `OUTPUT' and for
199$Field_{10}$ and $Field_{11}$ for which it is either `IGNOUT' or
200`IGNORED' (see section \ref{subsec_namcouplesecond}); ({\em
201\#Stat\_field{\bf xx}}).
202
203\item{\em dtF{\bf xx}}, where {\bf xx} is the number of the field in
204the namcouple: The coupling or I/O period of the {\bf xx} coupling/IO field,
205which must be a multiple of 14400, except for $Field_3$ for which it
206must be a multiple of 43200, and for $Field_5$, $Field_{10}$ and
207$Field_{11}$ for which it must be a multiple of 3600; ({\em \#Dt{\bf
208xx}}).
209
210\item {\em iniyear}, {\em inimonth} and {\em iniday}: the initial date
211of the experiment, respectively as {\tt YYYY}, {\tt MM} and {\tt
212DD}({\em \#Inidate}).
213
214\item {\em message\_passing}: Message passing method, either MPI2 or
215  MPI1 (for more details, see section \ref{subsubsec_Initialisation});
216  (in {\em \#Channel})
217
218\item {\em bsend}: either `yes' or `no', indicates whether the
219 buffered {\tt MPI\_BSend} or the standard blocking send {\tt
220 MPI\_Send} will be used to send the coupling fields (for more
221 details, see section \ref{subsec_namcouplefirst}) (in {\em \#Channel})
222
223\end{enumerate}
224
225The variables that can be additionally defined in the setup file but
226do not correspond to any
227configurable {\it namcouple} entries are the following:
228 
229\begin{enumerate}
230
231\item {\em ncplvers}: the namcouple version. Put {\tt ""} to use the
232  {\it namcouple} base file completed with the values defined in the
233  setup file. To use another {\it namcouple}, a particular value has
234  to be given to {\em ncplvers}, and a {\it namcouple} named
235  {\tt namcouple\_toyclim\_$<$ncplvers$>$} has to be available in
236  \texttt{prism/util/running/adjunct\_files/oasis3}.
237
238\item{\em gridswr}: either `0' if you want the models to use the grid
239  description files if they exist, or `1' if you want the models to
240  unconditionally (re)generate those grid description files (for more
241 details, see section \ref{subsubsec_griddef}).
242
243\end{enumerate}
244
245\item Type {\tt `Create\_TASKS.frm toyclim <expid>'} a second
246time. The script will check the parameters you specified in
247{\tt setup\_toyclim\_<expid>}. If a parameter is not supported or a
248combination of parameters does not make sense Create\_TASKS.frm writes
249an error message and stops.
250\item Correct the experimental setup file if necessary and
251run Create\_TASKS.frm again until the setup check is passed
252successfully.
253
254\end{enumerate}
255
256Once the setup is done, all appropriate files and the script to start
257the experiment are available in the
258directory {\tt $<$home$>$/$<$expid$>$}, where {\tt $<$home$>$} and
259{\tt $<$expid$>$} are
260defined in the setup file.
261
262\section{Running the TOYCLIM coupled model using OASIS3}
263\label{subsec_running}
264
265After the setup and configuration phase, the experiment is ready to be
266started with the running script {\tt RUN\_toyclim\_<expid>} in
267directory {\tt $<$work$>$/$<$expid$>$/scripts}, where {\tt $<$work$>$} and
268{\tt $<$expid$>$} are
269as defined in the setup file {\tt setup\_toyclim\_<expid>}.
270
271To run a TOYCLIM experiment, one has to go through the following
272steps:
273
274\begin{enumerate} 
275%\item The file {\tt
276%  toyclim/input\_toyclim\_standard\_\-standard\_prism\_2-1.tar.gz} has
277%  to be copied from the directory {\tt prism/data} to the directory
278%{\tt <archive\_in>/toyclim} on the \break {\tt <archiving\_host>}.  The variables
279%{\tt <archive\_in>} and {\tt <archiving\_host>} are specified in the setup file .
280\item Login on the compute server (if different from the compile server).
281\item Change to the directory {\tt <work>/<expid>/scripts}.
282\item Submit the runscript {\tt RUN\_toyclim\_<expid>}.
283\end{enumerate}
284
285Running TOYCLIM with the default parameters will result in a 30-day
286experiment executed as five 6-day runs. The final results obtained the
287directory {\tt <work>/<expid>/work} should match the ones in {\tt
288prism/data/toyclim/outdata}. Intermediate results are also saved in
289different sub-directories :
290\begin{itemize} 
291 \item the OASIS3 log files of each
292run in {\tt <data>/<expid>/log } or {\tt  <archive>/<expid>/log }
293 \item the output netCDF files containing the {\tt EXPOUT} fields in {\tt
294<data>/<expid>/outdata/oasis3 } or {\tt
295 <archive>/<expid>/outdata/oasis3 }
296\item the coupling restart files in {\tt  <data>/<expid>/restart } or
297  {\tt  <archive>/<expid>/restart}.
298\end{itemize}
299where {\tt <data>} and {\tt <archive>} are
300defined in the runscript {\tt RUN\_toyclim\_<expid>}.
301
302\section{Running the TOYCLIM coupled model manually}
303\label{subsec_runningmanually}
304
305If you want to run the TOYCLIM manually, you need to copy the
306following files in your working directory:
307\begin{itemize}
308\item OASIS3, toyatm, toyoce, toyche executables
309\item OASIS3 grid, restart, and auxiliary files: grids.nc, masks.nc,
310 areas.nc, SOALBEDO.nc, flda1.nc, flda2.nc, flda3.nc,
311 flda4.nc, fldo1.nc, at31topa, runoff31, which are in
312{\tt  prism/data/toyclim\break/input\_toyclim\_standard\_standard\_prism\_2-2.tar.gz}
313\item OASIS3 adjunct files `cf\_name\_table.txt' and `namcouple' which can be
314 found under names \break `cf\_name\_table.txt' and
315 `namcouple\_toyclim\_use' in {\tt prism/util/running/adjunct\_files\break/oasis3}
316\end{itemize}
317Then you need to start the coupled model, setting up MPI parameters
318properly. For examples, refer to files {\tt config\_site\_<node>.h} and
319{\tt launching\_toyclim\_<node>.h} in {\tt
320prism/util/running\break/frames/include\_<node>} (where {\tt <node>} is the
321name of the platform). 
322
323\section{Running OASIS3 in interpolator-only mode}
324
325To run OASIS3 in interpolator-only mode, one has to go through the
326following steps (the following specific files can be
327retrieved from CERFACS CVS only):
328\begin{itemize}
329\item Compile OASIS3 following the procedure described in section
330\ref{subsec_compile} specifying {\tt NONE} as {\tt <mp>}.
331\item Compile the programs that will calculate the
332interpolation error fields, i.e. gen\_error.f90 and \break gen\_error\_vector.f90 in directory {\tt prism/util/running/testinterp/error}.
333\item Execute the
334running script {\tt prism/util/running/testinterp/sc\_run\_testinterp}.
335\item The results obtained after running the TOYCLIM with the defaults
336parameters should match the ones in {\tt prism/data/testinterp/outdata}.
337\end{itemize}
338For more details, please read the {\tt
339prism/util/running/testinterp/README\_testinterp}.
Note: See TracBrowser for help on using the repository browser.