1 | \newpage |
---|
2 | % |
---|
3 | |
---|
4 | \chapter{Compiling and running with OASIS3} |
---|
5 | \label{sec_compilationrunning} |
---|
6 | |
---|
7 | OASIS3 and its TOYCLIM coupled model has been successfully compiled |
---|
8 | and run on Fujitsu VPP5000, NEC SX5 and SX6, SGI IRIX64, SGI Origin |
---|
9 | 3800, Linux Opteron, IBM Power4, and Cray X1. |
---|
10 | |
---|
11 | \section{Compiling OASIS3 and the TOYCLIM coupled model} |
---|
12 | \label{subsec_compile} |
---|
13 | |
---|
14 | OASIS3 and the TOYCLIM coupled model use the PRISM standard directory |
---|
15 | structure (see also \cite{leg04}) and Standard Compiling Environment (see |
---|
16 | also \cite{gay04}). To |
---|
17 | compile OASIS3 and toyatm, toyoce and toyche component models, one |
---|
18 | should 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 |
---|
23 | already exist in directory \break {\tt |
---|
24 | prism/util/compile/frames/include\_<node>} where {\tt <node>} is the |
---|
25 | name of the platform. |
---|
26 | |
---|
27 | \item Generate a compile script for the libraries using the script |
---|
28 | Create\_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 | |
---|
37 | The first parameter can be either {\tt ""} or {\tt "-"} to direct the |
---|
38 | standard output to a file or the screen. |
---|
39 | |
---|
40 | The second parameter an be either {\tt ""}, {\tt "-"} or {\tt "+"} to |
---|
41 | direct the standard error to a file, the screen or the standard |
---|
42 | output. |
---|
43 | |
---|
44 | If the compile scripts shall be created for another platform than the |
---|
45 | one where the \break Create\_COMP\_libs.frm script is launched, the third |
---|
46 | parameter has to contain the abbreviated node name ``node". |
---|
47 | |
---|
48 | The compile script for the libraries \texttt{COMP\_libs.$<$node$>$} |
---|
49 | should then be created in the directory \texttt{prism/util}. |
---|
50 | |
---|
51 | \item Generate a compile scrip for OASIS3 and for each of the component |
---|
52 | models 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 | |
---|
63 | The second parameter ``mp'' specifies the message passing used, which |
---|
64 | determines how the models are launched (see also section |
---|
65 | \ref{subsubsec_Initialisation}). If the default `MPI2' is chosen, the |
---|
66 | string has to be empty (specification of MPI2 results in an error); |
---|
67 | otherwise, MPI1 has to be given, or NONE for the interpolator only |
---|
68 | mode -see section \ref{subsec_interpolator}. The OASIS3 executable |
---|
69 | will have the string MPI1 or MPI2 appended to its name. The 3 toy |
---|
70 | models can also be compiled with either the MPI1 option or the default |
---|
71 | MPI2 option (empty string). |
---|
72 | |
---|
73 | The third parameter can be either {\tt ""} or {\tt "-"} to direct the |
---|
74 | standard output to a file or the screen. |
---|
75 | |
---|
76 | The fourth parameter an be either {\tt ""}, {\tt "-"} or {\tt "+"} to |
---|
77 | direct the standard error to a file, the screen or the standard |
---|
78 | output. |
---|
79 | |
---|
80 | If the compile scripts shall be created for another platform than the |
---|
81 | one where the \break Create\_COMP\_models.frm script is launched, the fifth |
---|
82 | parameter has to contain the abbreviated node name ``node". |
---|
83 | |
---|
84 | The sixth parameter ``ID'' is version acronym for differentiation of |
---|
85 | executables (not relevant for OASIS3 and TOYCLIM toy models). |
---|
86 | |
---|
87 | Finally the last parameter gives the name of all the component models |
---|
88 | in the coupled constellation. This list is not relevant for OASIS3, |
---|
89 | but it has to be given for the toymodels. The specified partner models |
---|
90 | are checked against allowed partners and no default is set. |
---|
91 | |
---|
92 | The 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 |
---|
96 | directories \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 |
---|
100 | OASIS3 and the 3 toy models. All four compile scripts have then to be |
---|
101 | launched 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 | |
---|
112 | The scripts compile the models with the MPI library specified during |
---|
113 | their generation. The script that triggers the update of the |
---|
114 | libraries, \texttt{COMP\_libs.$<$node$>$}, is automatically called by |
---|
115 | the model compilation scripts for the librairies they need. Libraries |
---|
116 | needed by OASIS3 are anaisg, anaism, scrip, fscint, and clim for MPI1 |
---|
117 | and MPI2 mode (clim is not compiled in NONE mode). The toy |
---|
118 | models need psmile and mpp\_io. |
---|
119 | |
---|
120 | \item The result should be executables {\tt oasis3.<mp>.x}, {\tt |
---|
121 | toyatm.<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 | |
---|
130 | The TOYCLIM coupled model performs a coupling between an ``empty" ocean |
---|
131 | model, toyoce, an``empty" atmospheric model, toyatm, and an ``empty" |
---|
132 | atmospheric chemistry model, toyche. There is no real physics or |
---|
133 | dynamics within the models. However, the coupling fields have a |
---|
134 | realistic size, the operations performed within OASIS3 on the coupling |
---|
135 | fields are realistic, and the coupling using the PRISM System |
---|
136 | model interface (PSMILe) is also realistic. The TOYCLIM atmosphere |
---|
137 | and chemistry models have the same grid and the same parallel |
---|
138 | partitioning on 3 processes. There is no need of interpolation and |
---|
139 | the coupling fields are directly exchanged between these two models |
---|
140 | without going through OASIS3 interpolation process. More details on |
---|
141 | the TOYCLIM coupled model can be found in \cite{val04b}. |
---|
142 | |
---|
143 | The TOYCLIM coupled model uses PRISM standard running environment |
---|
144 | (SRE). To run it, one has to go through the following |
---|
145 | steps: |
---|
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 |
---|
150 | already exist in directory {\tt |
---|
151 | prism/util\break/running/frames/include\_<node>} where {\tt <node>} is |
---|
152 | the name of the platform. |
---|
153 | \item Run the script Create\_TASKS.frm to generate a setup file for |
---|
154 | your 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 | |
---|
164 | where {\tt <expid>} is your experiment name. |
---|
165 | |
---|
166 | \item To change the configuration of your experiment, modify the |
---|
167 | values of the configurable entries in the setup file {\tt |
---|
168 | prism/util/running/frames/setup/setup\_toyclim\_<expid>}, which |
---|
169 | contains default values for these entries. Some of these configurable |
---|
170 | entries directly enter the OASIS3 configuration file {\it namcouple}, |
---|
171 | other affect the running script only\footnote{Additional {\it |
---|
172 | namcouple} entries are also configurable by editing directly the |
---|
173 | namcouple base file. Refer to chapter \ref{sec_namcouple} for more |
---|
174 | details.}. The {\it namcouple} file is created from the {\it |
---|
175 | namcouple} base file (see \texttt{namcouple\_toyclim} in |
---|
176 | \texttt{prism/util/running\break/adjunct\_files/oasis3}) by replacing the |
---|
177 | configurable entries (which begin with "\#") by the value defined in |
---|
178 | the setup file. The {\it namcouple} will be read by OASIS3 at |
---|
179 | runtime. The variables that can be defined in the set-up file and |
---|
180 | correspond 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 |
---|
196 | field in the namcouple: The status of the {\bf xx} coupling/IO field |
---|
197 | can be either `EXPOUT' or `EXPORTED', except for $Field_3$ for which |
---|
198 | it 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 |
---|
204 | the namcouple: The coupling or I/O period of the {\bf xx} coupling/IO field, |
---|
205 | which must be a multiple of 14400, except for $Field_3$ for which it |
---|
206 | must 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 |
---|
208 | xx}}). |
---|
209 | |
---|
210 | \item {\em iniyear}, {\em inimonth} and {\em iniday}: the initial date |
---|
211 | of the experiment, respectively as {\tt YYYY}, {\tt MM} and {\tt |
---|
212 | DD}({\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 | |
---|
225 | The variables that can be additionally defined in the setup file but |
---|
226 | do not correspond to any |
---|
227 | configurable {\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 |
---|
246 | time. The script will check the parameters you specified in |
---|
247 | {\tt setup\_toyclim\_<expid>}. If a parameter is not supported or a |
---|
248 | combination of parameters does not make sense Create\_TASKS.frm writes |
---|
249 | an error message and stops. |
---|
250 | \item Correct the experimental setup file if necessary and |
---|
251 | run Create\_TASKS.frm again until the setup check is passed |
---|
252 | successfully. |
---|
253 | |
---|
254 | \end{enumerate} |
---|
255 | |
---|
256 | Once the setup is done, all appropriate files and the script to start |
---|
257 | the experiment are available in the |
---|
258 | directory {\tt $<$home$>$/$<$expid$>$}, where {\tt $<$home$>$} and |
---|
259 | {\tt $<$expid$>$} are |
---|
260 | defined in the setup file. |
---|
261 | |
---|
262 | \section{Running the TOYCLIM coupled model using OASIS3} |
---|
263 | \label{subsec_running} |
---|
264 | |
---|
265 | After the setup and configuration phase, the experiment is ready to be |
---|
266 | started with the running script {\tt RUN\_toyclim\_<expid>} in |
---|
267 | directory {\tt $<$work$>$/$<$expid$>$/scripts}, where {\tt $<$work$>$} and |
---|
268 | {\tt $<$expid$>$} are |
---|
269 | as defined in the setup file {\tt setup\_toyclim\_<expid>}. |
---|
270 | |
---|
271 | To run a TOYCLIM experiment, one has to go through the following |
---|
272 | steps: |
---|
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 | |
---|
285 | Running TOYCLIM with the default parameters will result in a 30-day |
---|
286 | experiment executed as five 6-day runs. The final results obtained the |
---|
287 | directory {\tt <work>/<expid>/work} should match the ones in {\tt |
---|
288 | prism/data/toyclim/outdata}. Intermediate results are also saved in |
---|
289 | different sub-directories : |
---|
290 | \begin{itemize} |
---|
291 | \item the OASIS3 log files of each |
---|
292 | run 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} |
---|
299 | where {\tt <data>} and {\tt <archive>} are |
---|
300 | defined in the runscript {\tt RUN\_toyclim\_<expid>}. |
---|
301 | |
---|
302 | \section{Running the TOYCLIM coupled model manually} |
---|
303 | \label{subsec_runningmanually} |
---|
304 | |
---|
305 | If you want to run the TOYCLIM manually, you need to copy the |
---|
306 | following 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} |
---|
317 | Then you need to start the coupled model, setting up MPI parameters |
---|
318 | properly. For examples, refer to files {\tt config\_site\_<node>.h} and |
---|
319 | {\tt launching\_toyclim\_<node>.h} in {\tt |
---|
320 | prism/util/running\break/frames/include\_<node>} (where {\tt <node>} is the |
---|
321 | name of the platform). |
---|
322 | |
---|
323 | \section{Running OASIS3 in interpolator-only mode} |
---|
324 | |
---|
325 | To run OASIS3 in interpolator-only mode, one has to go through the |
---|
326 | following steps (the following specific files can be |
---|
327 | retrieved 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 |
---|
332 | interpolation 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 |
---|
334 | running script {\tt prism/util/running/testinterp/sc\_run\_testinterp}. |
---|
335 | \item The results obtained after running the TOYCLIM with the defaults |
---|
336 | parameters should match the ones in {\tt prism/data/testinterp/outdata}. |
---|
337 | \end{itemize} |
---|
338 | For more details, please read the {\tt |
---|
339 | prism/util/running/testinterp/README\_testinterp}. |
---|