source: CPL/oasis3/trunk/src/mod/oasis3/doc/UG3_Namcouple_generation.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: 18.6 KB
Line 
1\newpage
2\chapter{The OASIS3 configuration file {\it namcouple}}
3\label{sec_namcouple}
4
5The OASIS3 configuration file {\em namcouple} contains, below
6pre-defined keywords, all user's
7defined information necessary to configure a particular coupled
8run. The {\it namcouple} is a text file with the following
9characteristics:
10
11\begin{itemize}
12\item the keywords used to separate the information
13can appear in any order;
14\item the number of blanks between two character strings is
15non-significant;
16\item all lines beginning with \# are ignored and considered as
17comments.
18\item {\bf blank lines are not allowed.}
19\end{itemize}
20\vspace*{0.5cm}
21
22The first part of {\em namcouple } is devoted to configuration of
23general parameters such as the number of models involved in the
24simulation, the number of fields, the communication technique, etc.
25The second part gathers specific information on each coupling or I/O
26field, e.g. their coupling period, the list of transformations or
27interpolations to be performed by OASIS3 and their associated
28configuring lines (described in more details in section
29\ref{sec_transformations}), etc.
30
31\vspace*{0.5cm}
32
33In the next sections, a simple {\it namcouple} example is given and
34all configuring parameters are described. The additional lines
35containing the different parameters required for each transformation
36are described in section \ref{sec_transformations}. An example of a
37realistic {\em namcouple} can be found in directory {\tt
38/prism/util/running\break/adjunct\_files/oasis3/namcouple\_toyclim\_use}.
39
40\section{An example of a simple {\it namcouple}}
41\label{subsec_examplenamcouple}
42
43The following simple {\it namcouple} configures a run in which an
44ocean, an atmosphere and an atmospheric chemistry models are
45coupled. The ocean provides only the SOSSTSST field to the atmosphere,
46which in return provides the field CONSFTOT to the ocean. One field
47(COSENHFL) is exchanged directly from the atmosphere to the
48atmospheric chemistry, and one field (SOALBEDO) is read from a file by
49the ocean.
50
51\begin{verbatim}
52
53######################################################################
54# First section
55#
56 $SEQMODE
57    1
58#
59 $CHANNEL
60    MPI2    NOBSEND
61    1    1   arg1
62    3    1   arg2
63    3    1   arg3           
64#
65 $NFIELDS
66    4
67#
68 $JOBNAME
69    JOB
70#
71 $NBMODEL
72    3  ocemod   atmmod  chemod  55  70   99 
73#
74 $RUNTIME
75    432000
76#
77 $INIDATE
78    00010101
79#
80 $MODINFO
81    NOT
82#
83 $NLOGPRT
84   2
85#
86 $CALTYPE
87   1
88#
89######################################################################
90# Second section
91#
92 $STRINGS
93#
94# Field 1
95#
96 SOSSTSST SISUTESU 1 86400  5  sstoc.nc  EXPORTED
97 182  149  128  64  toce  atmo   LAG=+14400  SEQ=+1
98 P 2 P 0
99 LOCTRANS CHECKIN MOZAIC  BLASNEW CHECKOUT
100#
101  AVERAGE
102  INT=1
103  at31topa   91    2   48
104  CONSTANT     273.15 
105  INT=1
106#
107# Field 2
108#
109 CONSFTOT SOHEFLDO 6 86400  7   flxat.nc  EXPORTED
110 atmo   toce  LAG=+14400  SEQ=+1
111 P 0 P 2
112 LOCTRANS  CHECKIN  SCRIPR CHECKOUT
113#
114  ACCUMUL
115  INT=1
116  CONSERV  LR  SCALAR  LATLON   10  FRACAREA   FIRST
117  INT=1
118#
119# Field
120#
121 COSENHFL  SOSENHFL  37  86400   1  flda3.nc  IGNOUT
122 atmo   atmo LAG=+7200  SEQ=+1
123 LOCTRANS
124 AVERAGE
125#
126# Field 4
127#
128 SOALBEDO SOALBEDO  17  86400  0  SOALBEDO.nc  INPUT
129#
130#####################################################################
131\end{verbatim}
132
133%section{An example of a simple {\em namcouple}}
134
135\section{ First section of {\it namcouple} file}
136\label{subsec_namcouplefirst}
137
138The first section of {\it namcouple } uses some predefined keywords
139prefixed by the \$ sign to locate the related information. The
140\$ sign must be in the second column. The first ten keywords
141are described hereafter:
142
143\begin{itemize}
144
145\item {\tt \$SEQMODE}: On the line below this keyword is the maximum number of fields that
146  have to be, at one particular coupling timestep,
147  necessarily exchanged sequentially in a given order.  For {\tt
148  \$SEQMODE} $\ge 1$, the position of each coupling field in the sequence has to be
149  given by its SEQ index (see below and also section
150  \ref{subsubsec_Algoritms}).
151
152\item {\tt \$CHANNEL}: On the line below this keyword is the
153communication technique chosen. Choices are {\tt MPI1} or {\tt MPI2}
154for the CLIM communication technique and related PSMILe library, using
155{\tt MPI1} or {\tt MPI2} message passing.  To run OASIS3 as an
156interpolator only, put {\tt NONE} (see also section
157\ref{subsec_interpolator}). The communication technique using Unix
158System V Shared Memory Segments, {\tt SIPC}, is also
159supported. {\tt PIPE}, or {\tt GMEM} should still work but are not
160officially supported anymore and were not tested (corresponding
161sources can be retrieved from CERFACS CVS Server only).
162
163To use the {\tt CLIM/MPI2} communication technique, the lines below {\tt
164  \$CHANNEL} are, e.g. for 3 models:
165\begin{verbatim}
166$CHANNEL
167MPI2 NOBSEND
1681    1  arg1
1693    1  arg2
1703    1  arg3
171\end{verbatim}
172where {\tt MPI2} is the message passing used in CLIM and PSMILe, and
173{\tt NOBSEND} indicates that standard blocking send {\tt MPI\_Send}
174should be used in place of the buffered {\tt MPI\_BSend} to send the
175coupling fields.\footnote{Use the standard blocking send {\tt
176MPI\_Send} if the coupling fields are necessarily sent and received in
177the same order, or on platforms for which {\tt MPI\_Send} is
178implemented with a mailbox (e.g. VPPs; in this case, make sure
179that the size of the mailbox is sufficient). Use the less efficient
180buffered send {\tt MPI\_BSend} on platforms for which {\tt
181MPI\_Send} is not implemented with a mailbox if the
182coupling fields are not sent and received in the same order.
183
184Note that below the call to {\tt prism\_enddef\_proto}, the PSMILe
185tests whether or not the model has already attached to an MPI
186buffer. If it is the case, the PSMILe detaches from the buffer, adds
187the size of the pre-attached buffer to the size needed for the
188coupling exchanges, and reattaches to an MPI buffer. The model own
189call to {\tt MPI\_Buffer\_Attach} must therefore be done before the
190call to {\tt prism\_enddef\_proto}. Furthermore, the model is not
191allowed to call {\tt MPI\_BSend} after the call to {\tt
192prism\_terminate\_proto}, as the PSMILe definitively detaches from the
193MPI buffer in this routine. See the example in the toyatm model in
194{\tt prism/src/mod/toyatm/src} }
195
196If {\tt NOBSEND} is not specified, the buffered send {\tt MPI\_BSend}
197will be used.
198
199The following lines (one line per model listed on the {\tt \$NBMODEL}
200line) indicate for each model the total number of processes, the
201number of processes implied in the coupling, and possibly launching
202arguments. Here the first model runs on one process which is of course
203implied in the coupling and the argument passed to the model is
204"arg1"; the second and third models run on 3 processes but only one
205process is implied in the coupling (i.e. exchanging information with
206OASIS3 main process), and the argument passed to the models are
207respectively ``arg2" and ``arg3''.
208
209To use the {\tt CLIM/MPI1} communication technique, the {\tt
210\$CHANNEL} lines are are as for {\tt MPI2} except that {\tt MPI2} is
211replaced by {\tt MPI1} and there is no launching arguments.  gument.
212
213To use the {\tt SIPC} communication technique, the user has to write
214only {\tt SIPC} below the {\tt \$CHANNEL} keyword (corresponding
215sources can be retrieved from CERFACS CVS Server only).
216
217\item {\tt \$NFIELDS}: On the line below this keyword is the total
218number of fields exchanged and described in the second part of
219the {\it namcouple}.
220
221\item {\tt \$JOBNAME}: On the line below this keyword is a {\tt
222CHARACTER$\star$3} or {\tt CHARACTER$\star$4} variable giving an
223acronym for the given simulation.
224
225\item {\tt \$NBMODEL}: On the line below this keyword is the number of
226models running in the given experiment followed by {\tt
227CHARACTER$\star$6} variables giving their names. Then the user may
228indicate the maximum Fortran unit number used by the models. In the
229example, Fortran units above 55, 70, and 99 are free for respectively
230the ocean, atmosphere, and atmospheric chemistry models. If no
231maximum unit numbers are indicated, OASIS3 will suppose that units
232above 1024 are free. If {\tt \$CHANNEL}
233is {\tt NONE}, {\tt \$NBMODEL} has to be 0 and there should be no
234model name and no unit number.
235
236\item {\tt \$RUNTIME}: On the line below this keyword is the total
237simulated time of the run, expressed in seconds. If {\tt \$CHANNEL}
238is {\tt NONE}, {\tt \$RUNTIME} has to be the number of time occurrences
239of the field to interpolate from the restart file.
240
241\item {\tt \$INIDATE}: On the line below this keyword is the initial
242  date of the run. The format is {\tt YYYYMMDD}. This date is important only
243  for the {\tt FILLING} transformation and for printing information in
244  OASIS3 log file {\it cplout}.
245
246\item {\tt \$MODINFO}: If coupling restart files are binary files (see
247  section \ref{subsec_restartdata}), the line below this keyword
248  indicates if a header is encapsulated or not: it can be {\tt
249  YES} or {\tt NOT}.
250 
251\item {\tt \$NLOGPRT}: The line below this keyword refers to the
252  amount of information that will be written to the OASIS3 log file
253  {\it cplout} during the run. With 0, there is practically no output
254  written to the cplout; with 1, only some general information on the
255  run, the header of the main routines, and the names of the fields
256  when treated appear in the {\it cplout}.  Finally, with 2, the full output
257  is generated.
258
259\item {\tt \$CALTYPE}: This new keyword gives the type of calendar
260  used. For now, the calendar type is important only if {\tt FILLING}
261  analysis is used for a coupling field in the run and for printing
262  information in OASIS3 log file {\it cplout}. Below this keyword, a
263  number (0, 1 or n ) must be indicated by the user:
264  \begin{itemize}
265  \item 0 : a 365 day calendar (no leap year)
266  \item 1 : a 365 or 366 (leap years) day calendar A year is a leap
267  year if it can be divided by 4; however if it can be divided by 4
268  and 100, it is not a leap year; furthermore, if it can be divided by
269  4, 100 and 400, it is a leap year.
270  \item n :  $n \ge 1$ day month calendar.
271  \end{itemize}
272
273\end{itemize}
274
275%{Description of {\it namcouple} first section}
276
277\section{Second section of {\it namcouple} file }
278\label{subsec_namcouplesecond}
279
280The second part of the {\it namcouple}, starting after the keyword
281{\tt \$STRINGS}, contains coupling information for each coupling or
282I/O field.  Its format depends on the field status given by the last
283entry on the field first line ({\tt EXPORTED}, {\tt IGNOUT} or {\tt
284INPUT} in the example above). The field status may be the following
285({\tt AUXILARY} and {\tt EXPORTED} are supported by all communication
286techniques, while the others are supported only by the PSMILe i.e. the
287{\tt CLIM/MPI1} or {\tt CLIM/MPI2} communication technique):
288
289\begin{itemize}
290\item {\tt AUXILARY}: sent by the source model, received and used by
291  OASIS3 main process for the transformation of other fields.
292\item {\tt EXPORTED}: exchanged between component models and
293  transformed by OASIS3 main process.
294\item {\tt EXPOUT}: exchanged, transformed and also written to two
295  output files, one before the sending action in the source model
296  below the {\tt prism\_put\_proto} call, and one after the receiving
297  action in the target model below the {\tt prism\_get\_proto} call.
298\item {\tt IGNORED}: exchanged directly between the component models
299  without being transformed by OASIS3 main process. The grid and
300  partitioning of the source and target models have to be
301  identical.
302\item {\tt IGNOUT}: exchanged directly between the component models
303  without being transformed by OASIS3 main process and written to two
304  output files, one before the sending action in the source model
305  below the {\tt prism\_put\_proto} call, and one after the receiving
306  action in the target model below the {\tt prism\_get\_proto} call.
307  The grid and partitioning of the source and target models have to be
308  identical.
309\item {\tt INPUT}: simply read in from the input file by the target
310  model PSMILe below the {\tt prism\_get\_proto} call at appropriate
311  times corresponding to the input period indicated by the user in the
312  {\it namcouple}. See section
313  \ref{subsec_inputdata} for the format of the input file.
314\item {\tt OUTPUT}: simply written out to an output file by the source
315  model PSMILe below the {\tt prism\_put\_proto} call at appropriate
316  times corresponding to the output period indicated by the user in
317  the {\it namcouple}. The name of the output file (one per field) is
318  automatically built based on the field name and initial date of the
319  run ({\tt \$INIDATE}).
320
321\end{itemize}
322
323\subsection{Second section of {\it namcouple} for {\tt EXPORTED}, {\tt
324      AUXILARY} and {\tt EXPOUT} fields}
325\label{subsubsec_secondEXPORTED}
326
327  The first 3 lines for fields with status {\tt EXPORTED}, {\tt
328  AUXILARY} and {\tt EXPOUT} are as follows:
329  \begin{verbatim}
330   SOSSTSST SISUTESU 1 86400  5  sstoc.nc  sstat.nc EXPORTED
331   182  149    128  64  toce  atmo   LAG=+14400 SEQ=+1
332   P 2 P 0
333  \end{verbatim}
334  where the different entries are:
335    \begin{itemize}
336      \item Field first line:
337        \begin{itemize}
338        \item {\tt SOSSTSST} : symbolic name for the field in the
339              source model ({\tt CHARACTER*8}). It has to match the
340              argument {\tt name} of the corresponding field
341              declaration in the source model; see {\tt
342              prism\_def\_var\_proto} in section
343              \ref{subsubsec_Declaration}.
344        \item {\tt SISUTESU} : symbolic name for the field in the
345              target model ({\tt CHARACTER*8}).  It has to match the
346              argument {\tt name} of the corresponding field
347              declaration in the target model; see {\tt
348              prism\_def\_var\_proto} in section
349              \ref{subsubsec_Declaration}.
350        \item 1 : index in auxiliary file cf\_name\_table.txt used by OASIS3 and PSMILe to identify corresponding CF standard name and units (see \ref{subsec_cfnametable}).
351        \item 86400 : coupling and/or I/O period for the field, in
352        seconds. (If {\tt \$CHANNEL} is {\tt NONE}, put ``1''.)
353        \item 5 : number of transformations to be performed on this field. 
354        \item sstoc.nc : name of the coupling restart file for the
355          field ({\tt CHARACTER*8}); it may be a binary of netCDF file (for
356          more detail, see section \ref{subsec_restartdata}).
357        \item sstat.nc : name of the field output file, may be indicated for
358          {\tt NONE} (and {\tt PIPE}) communication techniques only. It
359          may be a binary of netCDF file (see section
360          \ref{subsec_restartdata}).
361        \item {\tt EXPORTED} : field status.
362        \end{itemize}
363      \item Field second line:
364        \begin{itemize}
365        \item 182 : number of points for the source grid first
366        dimension (optional if a netCDF coupling restart file is used).
367        \item 149 : number of points for the source grid second
368        dimension (optional if a netCDF coupling restart file is used).   
369        \item 128 : number of points for the target grid first
370        dimension (optional if a netCDF coupling restart file is used).
371        \item 64 : number of points for the target grid second
372        dimension (optional if a netCDF coupling restart file is used). 
373        \item toce : prefix of the source grid name in grid data files (see section
374        \ref{subsec_griddata}) ({\tt CHARACTER*4})
375        \item atmo : prefix of the target grid name in grid data files
376        ({\tt CHARACTER*4})
377        \item {\tt LAG=+14400}: lag index for the field
378        expressed in seconds ({\tt CLIM/MPI1} or {\tt CLIM/MPI2}
379        communication technique only, see section
380        \ref{subsubsec_Algoritms}). Note that in mode NONE a LAG has
381        to be defined so that the input file is opened initially.
382        \item {\tt SEQ=+1}: optional sequence index for the field
383        ({\tt CLIM/MPI1} or {\tt CLIM/MPI2} communication technique
384        only, see section \ref{subsubsec_Algoritms}).
385        \end{itemize}
386      \item Field third line
387        \begin{itemize}
388         \item P : source grid first dimension characteristic
389            (`P': periodical; `R': regional).
390         \item 2 : source grid first dimension number of overlapping grid points.
391         \item P : target grid first dimension characteristic (`P':
392         periodical; `R': regional).
393         \item 0 : target grid first dimension number of overlapping grid points.
394        \end{itemize}
395     
396      \end{itemize}
397   
398  The fourth line gives the list of transformations to be performed
399  for this field. There is then one or more additional configuring lines
400  describing some parameters for each transformation. These
401  additional lines are described in more details in the section
402  \ref{sec_transformations}.
403
404\subsection{Second section of {\it namcouple} for {\tt
405  IGNORED}, {\tt IGNOUT}, and {\tt OUTPUT} fields}
406\label{subsubsec_secondIGNORED}
407  The first 2 lines for fields with status {\tt IGNORED} or {\tt
408  IGNOUT} or {\tt OUTPUT} are as follows:
409  \begin{verbatim}
410  COSENHFL SOSENHFL 37 86400 1 flda3.nc IGNOUT
411  atmo   toce LAG=+7200 SEQ=+1\end{verbatim}where the different
412  entries are as for {\tt EXPORTED} fields, except that there is no
413  output file name on the first line.
414
415  For {\tt OUTPUT} fields, there is no target model and therefore no
416  target symbolic name; the source symbolic name must be repeated
417  twice on the field first line. Also, there is no coupling restart
418  file name ({\tt flda3.nc} here), no {\tt LAG} index and no {\tt SEQ}
419  index.
420
421  For {\tt IGNORED} fields, the name used in the coupling restart file
422  (if any) must be the target symbolic name.
423
424\vspace*{0.5cm}
425
426  The third line is {\tt LOCTRANS} if this transformation is chosen
427  for the field. Note that {\tt LOCTRANS} is the only transformation
428  supported for {\tt IGNORED}, {\tt IGNOUT} and {\tt OUTPUT} fields
429  (as it is performed directly in the PSMILe below the {\tt
430  prism\_put\_proto} call). If {\tt LOCTRANS} is chosen, a fourth line
431  giving the name of the time transformation is required. For more
432  detail on {\tt LOCTRANS}, see section \ref{subsec_timetrans}.
433
434\subsection{Second section of {\it namcouple} for {\tt
435  INPUT} fields}
436\label{subsubsec_secondINPUT}
437
438  The first and only line for fields with status {\tt INPUT} is:
439
440  \begin{verbatim}
441  SOALBEDO SOALBEDO  17  86400  0  SOALBEDO.nc  INPUT\end{verbatim} where the different entries are:
442  \begin{itemize}
443  \item  {\tt SOALBEDO}: symbolic name for the field in the target
444  model ({\tt CHARACTER*8} repeated twice)
445  \item 17:  index in auxiliary file cf\_name\_table.txt (see above for EXPORTED fields)
446  \item 86400: input period in seconds
447  \item 0: number of transformations (always 0 for {\tt INPUT} fields)
448  \item {\tt SOALBEDO.nc}: {\tt CHARACTER*32} giving the input file
449  name (for more detail on its format, see section
450  \ref{subsec_inputdata})
451  \item {\tt INPUT}: field status.
452  \end{itemize}
453
Note: See TracBrowser for help on using the repository browser.