source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/oasis3-mct/doc/UG3_Namcouple_generation.tex

Last change on this file was 5725, checked in by aclsce, 3 years ago

Added new oasis3-MCT version to be used to handle ensembles simulations with XIOS.

  • Property svn:executable set to *
File size: 21.7 KB
Line 
1\newpage
2\chapter{The configuration file {\it namcouple}}
3\label{sec_namcouple}
4
5The OASIS3-MCT configuration file {\it namcouple} contains, below
6pre-defined keywords, all user-defined information necessary to
7configure a particular coupled run.
8
9The {\it namcouple} is a text file with the following characteristics:
10
11\begin{itemize}
12\item the keywords used to separate the information can appear in any
13  order;
14\item the number of blanks between two character strings is
15  non-significant;
16\item all lines beginning with \# are ignored and considered as
17  comments;
18\item blank lines are supported, but only since OASIS3-MCT\_4.0 version.
19\end{itemize}
20
21The first part of {\it namcouple } is devoted to configuration of
22general parameters such as the total run time or the desired debug level.
23The second part gathers specific
24information on each coupling (or I/O) field, e.g. their coupling
25period, the list of transformations or remapping to be performed
26by OASIS3-MCT and associated configuring lines (described in more
27details in chapter \ref{sec_transformations}).
28
29In OASIS3-MCT, several {\it namcouple} inputs have been deprecated
30but, for backwards compatibility, they are still allowed.  These
31inputs will be noted in the following text using the notation
32``UNUSED'' and not fully described. Information below these keywords
33is obsolete; they will not be read and will not be used.
34
35In the next sections, a {\it namcouple} example is given and
36all configuring parameters are described. Additional lines
37containing different parameters for each transformation
38are described in section \ref{sec_transformations}. A realistic {\it
39  namcouple} can be found in {\tt
40  oasis3-mct/examples/tutorial/data\_oasis3/} directory.
41
42\section{An example of a simple {\it namcouple}}
43\label{subsec_examplenamcouple}
44
45The following simple {\it namcouple} configures a run into which e.g. an
46ocean, an atmosphere and an atmospheric chemistry components are
47coupled. The ocean running on grid {\tt toce} provides only the SOSSTSST field to the atmosphere (grid {\tt atmo}),
48which in return provides the field CONSFTOT to the ocean. One field
49COSENHFL is exchanged from the atmosphere to the atmospheric
50chemistry (also running on grid {\tt atmo}), and one field SOALBEDO is read from a file by the ocean.
51
52\begin{verbatim}
53########## First section #############################################
54 $NFIELDS
55    4
56#
57 $RUNTIME
58    432000
59#
60 $NLOGPRT
61   2     1
62#
63 $NUNITNO
64   901     920
65#
66 $NMAPDEC
67   decomp_wghtfile
68#
69 $NMATXRD
70   ceg
71#
72 $NWGTOPT
73   ignore_bad_index
74#
75 $SEQMODE
76 $CHANNEL
77 $JOBNAME
78 $NBMODEL
79 $INIDATE
80 $MODINFO
81 $CALTYPE
82#
83########## Second section #############################################
84#
85 $STRINGS
86#
87# Field 1
88 SOSSTSST SISUTESU 1 86400  5  sstoc.nc  EXPORTED
89 182  149  128  64  toce  atmo   LAG=+14400  SEQ=+1
90 P 2 P 0
91 LOCTRANS CHECKIN MAPPING  BLASNEW CHECKOUT
92#
93  AVERAGE
94  INT=1
95  map_toce_atmo_120315.nc src opt
96  1.0  1
97  CONSTANT     273.15
98  INT=1
99#
100# Field 2
101 CONSFTOT SOHEFLDO 6 86400  4   flxat.nc  EXPORTED
102 atmo   toce  LAG=+14400  SEQ=+2
103 P 0 P 2
104 LOCTRANS  CHECKIN  SCRIPR CHECKOUT
105#
106  ACCUMUL
107  INT=1
108  BILINEAR LR SCALAR LATLON 1
109  INT=1
110#
111# Field 3
112 COSENHFL  SOSENHFL  37  86400   1  flda3.nc  IGNOUT
113 atmo   atmo LAG=+7200
114 LOCTRANS
115 AVERAGE
116#
117# Field 4
118 SOALBEDO SOALBEDO  17  86400  0  SOALBEDO.nc  INPUT
119\end{verbatim}
120
121% section{An example of a simple {\it namcouple}}
122
123\section{ First section of {\it namcouple} file}
124\label{subsec_namcouplefirst}
125
126The first section of {\it namcouple } uses some predefined keywords
127prefixed by the \$ sign to locate the related information. The \$ sign
128must be the first non-blank character on the line but can be in any column.
1298 keywords are used by OASIS3-MCT and 5 of these are optional :
130
131\begin{itemize}
132
133\item {\tt \$NFIELDS}: On the line below this keyword, put a number equal (or greater) to the total
134  number of field entries in the second part of the {\it
135    namcouple}. If more than one field are described on the same line, this
136  counts as only one entry.
137
138%\item {\tt \$NBMODEL}: On the line below this keyword is the number of
139%  models running in the given experiment followed by {\tt
140%    CHARACTER$\star$6} variables giving their names, which must
141%  correspond to the name announced by each model when calling {\tt
142%    oasis\_init\_comp} (second argument, see section
143%  \ref{subsubsec_Initialisation}).
144%
145%  Then the user may indicate on the same line the maximum Fortran unit
146%  number used by the models. In the example, Fortran units above 55,
147%  70, and 99 are free for respectively the ocean, atmosphere, and
148%  atmospheric chemistry models. {\bf In all cases, OASIS3-MCT library
149%    assumes, during the initialization phase, that units 1025 and 1026
150%    are free and temporarily uses these units to read the {\it
151%      namcouple} and to write corresponding log messages to file {\tt
152%      nout.000000}.} After the initialization phase, OASIS3-MCT will
153%  still suppose that units above 1024 are free, unless maximum unit
154%  numbers are indicated here in the {\it namcouple}.
155%  % If {\tt \$CHANNEL} is {\tt NONE}, {\tt \$NBMODEL} has to be 0 and
156%  % there should be no model name and no unit number.
157
158\item {\tt \$RUNTIME}: On the line below this keyword, put the total
159  simulated time of the run, expressed in seconds (or any other time
160  units as long as the same are used in all components and in the {\it
161    namcouple}, see \ref{subsubsec_sendingreceiving}). Note that by convention the first coupling of a run occurs at the beginning of the run and all other couplings occur at a time strictly smaller than {\tt \$RUNTIME}.
162  % If {\tt \$CHANNEL} is {\tt NONE}, {\tt \$RUNTIME} has to be the
163  % number of time occurrences of the field to interpolate from the
164  % restart file.
165
166\item {\tt \$NLOGPRT}: The first and second numbers on the line below
167  this keyword refer to the amount of debug and time statistic
168  information written by OASIS3-MCT for each component and process.
169
170  The first number (that can be modified at runtime with the {\tt
171    oasis\_set\_debug} routine, see section
172  \ref{subsubsec_auxroutines}) may be:
173  \begin{itemize}
174  \item 0 : production mode. One file debug.root.xx is open by the master process of
175    each component and one file debug\_notroot.xx is open for all the
176    other processes of each component to write only error information.
177  \item 1 : one file debug.root.xx is open by the master process of
178    each component to write information equivalent to level 10 (see
179    below) and also to write memory usage information;
180    one file debug\_notroot.xx is open for all the other
181    processes of each component to write error information.
182  \item 2 : one file debug.yy.xxxxxx is open by each process of each
183    component (with ``yy” being the component number and ``xxxxxx” the process number)
184    to write normal production diagnostics and memory usage information
185  \item 5 : as for 2 with in addition some initial debug info
186  \item 10: as for 5 with in addition the routine calling tree
187  \item 12: as for 10 with in addition some routine calling notes
188  \item 15: as for 12 with even more debug diagnostics
189  \item 20: as for 15 with in addition some extra runtime analysis
190  \item 30: full debug information
191  \end{itemize}
192  The second number defines how time statistics are written out to
193  file {\it comp\_name}.timers\_xxxx (with {\it comp\_name} being the component name, see section \ref{init_comp}); it can be:
194  \begin{itemize}
195  \item 0 : nothing is calculated or written.
196  \item 1 : some time statistics are calculated and written in a
197    single file by the processor 0 as well as the min and the max
198    times over all the processors.
199  \item 2 : some time statistics are calculated and each processor
200    writes its own file ; processor 0 also writes the min and the max
201    times over all the processors in its file.
202  \item 3 : some time statistics are calculated and each processor
203    writes its own file ; processor 0 also writes in its file the min
204    and the max times over all processors and also writes in its file
205    all the results for each processor.
206  \end{itemize}
207 For more information on the time statistics written out, see section
208  \ref{timestat}.
209
210The second number can also be set to -1 to activate the {\it lucia}
211tool that can be used to perform an analysis of the coupled components
212load balance. More information can be found in the README file in {\tt
213  oasis3-mct/util/lucia} directory and report mentioned therein.
214
215\item {\tt \$NUNITNO}: Optional (new in OASIS3-MCT\_4.0); on the line below this keyword are two integers
216  that indicate the minimum and maximum unit numbers to be used for
217  input and output files in the coupling layer.  The user should
218  choose values that will NOT conflict or overlap with unit numbers in
219  use in any of the component models. The defaults are 1024 for the minimum and 9999
220  for the maximum unit number if not explicitly set by the user.
221
222\item {\tt \$NMAPDEC}: Optional (new in OASIS3-MCT\_4.0); on the line below this keyword is a character string
223  that indicates the mapping decomposition value to be used during local mapping.  The
224  options are {\tt decomp\_1d} and {\tt decomp\_wghtfile}.  Option {\tt decomp\_1d} decomposes the grid in a simple
225  one dimensional way while {\tt decomp\_wghtfile} decomposes the grid using the
226  information in the remapping weight file to reduced mapping communication. Option {\tt decomp\_wghtfile}
227  will take some extra time in initialization but it should result in faster mapping.
228  The default is {\tt decomp\_1d} but it is recommended to test {\tt decomp\_wghtfile} to see if that
229  option improves performance. More details can be found in \cite {craig18} and in \cite{valcke11}.
230
231\item {\tt \$NMATXRD}: Optional (new in OASIS3-MCT\_4.0); on the line below this keyword is a character string
232  that indicates the method used to read remapping weights.  There are two options, {\tt orig}
233  and {\tt ceg}.  In both, the weights are read in chunks by the root process.  In the {\tt orig} option,
234  the weights are then broadcasted to all processes and each process then saves the weights needed in
235  order to be consistent with the mapping decomposition.  In the {\tt ceg} option, the root process
236  reads the weights and then decides which process each weight should be assigned to.  A
237  series of exchanges are then done and just the weights needed on
238  each process are sent.  The {\tt orig} method sends much more data but is more parallel.  The {\tt ceg}
239  method does most of the work on the root process but less data is communicated.  The default option
240  is {\tt ceg}. More details can be found in \cite {craig18}.
241
242\item {\tt \$NWGTOPT} : Optional (new in OASIS3-MCT\_4.0); on the line below this keyword is a character string
243  that indicates how to handle bad remapping weights.  There are four options \newline
244  {\tt abort\_on\_bad\_index}, {\tt ignore\_bad\_index}, {\tt ignore\_bad\_index\_silently}, and
245 \newline  {\tt use\_bad\_index}.  Bad weights are defined as weights in the mapping file for which either
246  the source or destination index are out of bounds relative to the number of grid cells
247  in the grid; in that case, the weight is referencing a gridcell that does not physically
248  exist.  Note that an index equal to zero will not be considered as a bad index if the associated weight
249  is also zero. There are other situations where the value of the actual mapping weight is
250  scientifically incorrect, but this is not easy to detect and is not dealt with in OASIS3-MCT.
251  \begin{itemize}
252  \item {\tt abort\_on\_bad\_index} will write error messages to the log files and abort if a bad weight
253  index is detected. This is the default option.
254  \item {\tt ignore\_bad\_index} will write an error message and then remove bad
255  weights internally before continuing.
256  \item {\tt ignore\_bad\_index\_silently} will remove bad weights and continue without writing an error
257  message.
258  \item {\tt use\_bad\_index} will attempt to keep bad weights in the interpolation computation,
259  but this can result in memory corruption, silent dropping of weights, and incorrect results ; this is not recommended.
260  \end{itemize}
261
262  Note that the ability to check mapping files at runtime in OASIS3-MCT is limited.  It is always
263  recommended that mapping files be analyzed offline before long production runs are carried out.
264  Checks can be done to make sure the source and destination indices are valid, that weights values
265  are reasonable (for instance, between 0 and 1, although this will depend on the mapping method),
266  and that the sum of weights on the destination cells are reasonable (for instance, 1, in many cases).
267  In addition, offline tests can be run with analytical functions to verify conservation, gradient
268  preserving features and other characteristics associated with the particular mapping approach.
269
270\item {\tt \$NNOREST}: Optional (new in OASIS3-MCT\_4.0); on the line below this keyword is a character
271  string that can override the requirement that restart files must exist
272  if they are needed.  If the character string value starts with T, t, .T,
273  or .t (as in true), then OASIS3-MCT will initialise with zero any variable that normally requires
274  a restart (for instance, variables with LAG $>$ 0) if the restart file does not exist. By default, missing
275  restart files will cause the model to abort.  It is strongly recommended
276  that this keyword NOT be used in production runs.  It exists to provide a
277  quick shortcut for running technical tests.
278  Note that if {\tt \$NNOREST} is true but the restart file nonetheless exists, it will be used.
279
280\item {\tt Keywords \$SEQMODE, \$CHANNEL, \$JOBNAME, \$NBMODEL, \$INIDATE, \$MODINFO, \$CALTYPE} are not used anymore.
281
282\end{itemize}
283
284% {Description of {\it namcouple} first section}
285
286\section{Second section of {\it namcouple} file }
287\label{subsec_namcouplesecond}
288
289The second part of the {\it namcouple}, starting after the keyword
290{\tt \$STRINGS}, contains coupling information for each coupling (or
291I/O) field.  Its format depends on the field status given by the last
292entry on the field first line ({\tt EXPORTED}, {\tt IGNOUT} or {\tt
293  INPUT} in the example above). The field may be (status {\tt AUXILARY} is now UNUSED) :
294
295\begin{itemize}
296\item {\tt EXPORTED}: exchanged between components and
297  transformed by OASIS3-MCT
298\item {\tt EXPOUT}: exchanged, transformed and also written to two
299  debug NetCDF files, one before the sending action in the source
300  component below the {\tt oasis\_put} call (after local transformations
301  {\tt LOCTRANS} and {\tt BLASOLD} if present), and one after the
302  receiving action in the target component below the {\tt oasis\_get} call
303  (after all transformations). {\tt EXPOUT} should be used only when
304  debugging the coupled model. The name of the debug NetCDF file
305  (one per field) is automatically defined based on the field and
306  component names.
307\item {\tt IGNORED}: with OASIS3-MCT, this setting is equivalent to
308  and converted to EXPORTED
309\item {\tt IGNOUT}: with OASIS3-MCT, this setting is equivalent to and
310  converted to EXPOUT
311\item {\tt INPUT}: read in from the input file by the target component
312  below the {\tt oasis\_get} call at
313  appropriate times corresponding to the input period indicated by the
314  user in the {\it namcouple}. See section \ref{subsec_inputdata} for
315  the format of the input file.
316\item {\tt OUTPUT}: written out to an output debug NetCDF file by the
317  source component below the {\tt oasis\_put} call, after local
318  transformations {\tt LOCTRANS} and {\tt BLASOLD}, at appropriate
319  times corresponding to the output period indicated by the user in
320  the {\it namcouple}.
321
322\end{itemize}
323
324\subsection{Second section of {\it namcouple} for {\tt EXPORTED} and
325  {\tt EXPOUT} fields}
326\label{subsubsec_secondEXPORTED}
327
328The first 3 lines for fields with status {\tt EXPORTED} and {\tt
329  EXPOUT} are as follows:
330  \begin{verbatim}
331   SOSSTSST SISUTESU 1 86400  5  sstoc.nc  EXPORTED
332   182  149    128  64  toce  atmo   LAG=+14400 SEQ=+1
333   P 2 P 0
334\end{verbatim}
335%\vspace{-0.2cm}
336where the different entries are:
337\begin{itemize}
338\item Field first line:
339  \begin{itemize}
340
341  \item {\tt SOSSTSST} : symbolic name for the field in the source
342    component (80 characters maximum). It has to match the argument {\tt name}
343    of the corresponding field declaration in the source component; see
344    {\tt oasis\_def\_var} in section \ref{subsubsec_Declaration}
345  \item {\tt SISUTESU} : symbolic name for the field in the target
346    component (80 characters maximum).  It has to match the argument {\tt
347      name} of the corresponding field declaration in the target
348    component; see {\tt oasis\_def\_var} in section
349    \ref{subsubsec_Declaration}
350  \item 1 : UNUSED but still required for parsing
351  \item 86400 : coupling and/or I/O period for the field, in seconds
352  \item 5 : number of transformations to be performed by OASIS3 on
353    this field
354  \item sstoc.nc : name of the coupling restart file for the field
355    (32 characters maximum); mandatory even if no coupling restart file is
356    effectively used (for more detail, see section
357    \ref{subsec_restartdata})
358  \item {\tt EXPORTED} : field status
359  \end{itemize}
360\item Field second line:
361  \begin{itemize}
362  \item 182 : number of points for the source grid first dimension
363    (optional)
364  \item 149 : number of points for the source grid second dimension
365    (optional)\footnote{For 1D field, put {\tt 1} as the second dimension}
366  \item 128 : number of points for the target grid first dimension
367    (optional)
368  \item 64 : number of points for the target grid second dimension
369    (optional)$^{1}$
370
371    These source and target grid dimensions are optional but note that
372    in order to have 2D fields written as 2D arrays in the debug
373    files, these dimensions must be provided in the {\it namcouple};
374    otherwise, the fields will be written out as 1D arrays.
375
376  \item toce : prefix of the source grid name in grid data files (see
377    section \ref{subsec_griddata}) (80 characters maximum)
378  \item atmo : prefix of the target grid name in grid data files (80 characters maximum)
379  \item {\tt LAG=+14400}: optional lag index for the field (see section \ref{subsec_lag})
380  \item {\tt SEQ=+1}: optional sequence index for the field (see
381    section \ref{subsec_sec})
382  \end{itemize}
383\item Field third line
384  \begin{itemize}
385  \item P : source grid first dimension characteristic (`P':
386    periodical; `R': regional).
387  \item 2 : source grid first dimension number of overlapping grid
388    points.
389  \item P : target grid first dimension characteristic (`P':
390    periodical; `R': regional).
391  \item 0 : target grid first dimension number of overlapping grid
392    points.
393  \end{itemize}
394
395\item The fourth line gives the list of transformations to be performed for
396this field. In addition, there is one or more configuring lines
397describing some parameters for each transformation. These additional
398lines are described in more details in the chapter
399\ref{sec_transformations}.
400
401\end{itemize}
402
403{\bf Support to couple multiple fields via a single communication}
404
405With OASIS3-MCT, it is possible to couple mutiple fields via a
406single communication. To activate this option, the user must list the
407related fields on a single entry line (with a maximum of 5000 characters on one line) through a colon
408delimited list in the {\it namcouple}, for example:
409
410{\tt ATMTAUX:ATMTAUY:ATMHFLUX  TAUX:TAUY:HEATFLUX 1 3600 3 rstrt.nc EXPORTED}
411
412All fields will then use the same
413{\it namcouple} settings (source and target grids, transformations, etc.) for that entry. In the component model codes,
414these fields are still apparently sent or received one at a
415time through individual {\tt oasis\_put} and {\tt oasis\_get}. Inside OASIS3-MCT, the fields are stored and a single mapping
416and send or receive instruction is executed for all fields. This is
417useful in cases where multiple fields have the same coupling
418transformations and to reduce communication costs by aggregating multiple
419fields into a single communication.
420
421This option does not put any constraint
422on the order of the related {\tt oasis\_put} and {\tt oasis\_get} in the codes.
423
424As they appear in one single entry line, these fields must share the same coupling restart file
425but this restart file may contain other fields.
426
427\subsection{Second section of {\it namcouple} for {\tt OUTPUT} fields}
428\label{subsubsec_secondOUTPUT}
429The first 2 lines for fields with status {\tt OUTPUT} are as follows:
430  \begin{verbatim}
431  COSHFTOT  COSHFTOT   1   86400  0  fldhftot.nc OUTPUT
432  atmo   atmo
433\end{verbatim}
434% \vspace{-0.2cm}
435where the different entries are as for {\tt EXPOUT} fields, except
436that:
437\begin{itemize}
438\item the source symbolic name must be repeated twice on the field
439  first line,
440\item the restart file name (here {\tt fldhftot.nc}) is needed only if
441  a {\tt LOCTRANS} transformation is present,
442\item there is no grid dimension (which means that all output
443    fields will be written out in the output files as 1D arrays) and no LAG or SEQ
444  index on the second line; ;
445\end{itemize}
446The name of the output file is automatically defined based on the
447field and component names.
448
449The third line is {\tt LOCTRANS} if this transformation is chosen for
450the field. Note that {\tt LOCTRANS} is the only transformation
451supported for {\tt OUTPUT} fields.
452
453\subsection{Second section of {\it namcouple} for {\tt INPUT} fields}
454\label{subsubsec_secondINPUT}
455
456The first and only line for fields with status {\tt INPUT} is:
457
458  \begin{verbatim}
459  SOALBEDO SOALBEDO  1  86400  0  SOALBEDO.nc  INPUT
460  \end{verbatim}
461\vspace{-0.5cm}
462where the different entries are:
463\begin{itemize}
464\item {\tt SOALBEDO}: symbolic name for the field in the target component
465  (80 characters maximum, repeated twice)
466\item 1: UNUSED but still required for parsing (as for
467  EXPORTED fields above)
468\item 86400: input period in seconds
469\item 0: number of transformations (always 0 for {\tt INPUT} fields)
470\item {\tt SOALBEDO.nc}:  the input file name (32 characters maximum)
471  (for more detail on its format, see section \ref{subsec_inputdata})
472\item {\tt INPUT}: field status.
473\end{itemize}
Note: See TracBrowser for help on using the repository browser.