# Changeset 9376 for branches/2017/dev_merge_2017/DOC/texfiles/chapters/chap_DIA.tex

Ignore:
Timestamp:
2018-03-06T17:12:34+01:00 (2 years ago)
Message:

Global reorganisation of DOC directory: refactoring & cleaning of TeX source code for readability

File:
1 edited

### Legend:

Unmodified
 r9373 in a very easy way. All details of iomput functionalities are listed in the following subsections. Examples of the XML files that control the outputs can be found in: \begin{alltt} \begin{verbatim} NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml NEMOGCM/CONFIG/SHARED/field_def.xml and NEMOGCM/CONFIG/SHARED/domain_def.xml. \end{verbatim} \end{alltt} \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. NEMO will need to link to the compiled XIOS library. The \href{http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/XIOS-IO-server-installation-and-use}{XIOS with NEMO} The \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS}{XIOS with NEMO} guide provides an example illustration of how this can be achieved. For example: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} ... \end{verbatim} }}\end{alltt} \end{xmlcode} Note your definition must be added to the field\_group whose reference grid is consistent with the size of the array passed to iomput. or defined in the domain\_def.xml file. $e.g.$: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} Note, if your array is computed within the surface module each nn\_fsbc time\_step, add the field definition within the field\_group defined with the id ''SBC'': $<$field\_group id=''SBC''...$>$ \item[4.] add your field in one of the output files defined in iodef.xml (again see subsequent sections for syntax and rules)   \\ \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} ... ... \end{verbatim} }}\end{alltt} \end{xmlcode} \end{description} \noindent In NEMO, by default, the field and domain definition is done in 2 separate files: {\scriptsize \tt \begin{verbatim} NEMOGCM/CONFIG/SHARED/field_def.xml and NEMOGCM/CONFIG/SHARED/domain_def.xml \end{verbatim} } \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} \noindent that are included in the main iodef.xml file through the following commands: \\ {\scriptsize \verb? ? \\ example 1: Direct inheritance. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}         \end{verbatim} }}\end{alltt} \end{xmlcode} The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' of the attribute ''operation'' from its parent. Note that a child can overwrite example 2: Inheritance by reference. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} Inherit (and overwrite, if needed) the attributes of a tag you are refering to. Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} ... \end{verbatim} }}\end{alltt} \end{xmlcode} Secondly, the group can be used to replace a list of elements. For example, a short list of the usual variables related to the U grid: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} that can be directly included in a file through the following syntax: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   \end{verbatim} }}\end{alltt} \end{xmlcode} \subsection{Detailed functionalities } of a 5 by 5 box with the bottom left corner at point (10,10). \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. For example: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain. The Equatorial section, the TAO, RAMA and PIRATA moorings are alredy registered in the code by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} Note that if the domain decomposition used in XIOS cuts the subdomain in several parts and if you use the ''multiple\_file'' type for your output files, you will endup with several files you will need to rebuild using unprovided tools (like ncpdq and ncrcat, \href{http://nco.sourceforge.net/nco.html#Concatenation}{see nco manual}). We are therefore advising to use the ''one\_file'' type in this case. Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. It must therefore be done in the axis part of the XML file. For example, in NEMOGCM/CONFIG/ORCA2\_LIM/iodef\_demo.xml, we provide the following example: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. For example: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} \subsubsection{Control of the output file names} The output file names are defined by the attributs ''name'' and ''name\_suffix'' of the tag family file. for example: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} However it is often very convienent to define the file name with the name of the experiment, the output file frequency and the date of the beginning and the end of the simulation (which are informations stored either in the namelist or in the XML file). To do so, we added the following rule: if the id of the tag file is ''fileN''(where N = 1 to 999 on 1 to 3 digits) or one of the predefined sections or moorings (see next subsection), the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by:\\ \\ \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} sst + 273.15 taum * taum qt - qsr - qns \end{verbatim} }}\end{alltt} \end{xmlcode} (2) Simple computation: define a new variable and use it in the file definition. in field\_definition: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   sst * sst \end{verbatim} }}\end{alltt} \end{xmlcode} in file\_definition: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} sst2 \end{verbatim} }}\end{alltt} \end{xmlcode} Note that in this case, the following syntaxe $<$field field\_ref="sst2" /$>$ is not working as sst2 won't be evaluated. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} Note that, then the code is crashing, writting real4 variables forces a numerical convection from real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} (5) use of the @'' function: example 1, weighted temporal average - define a new variable in field\_definition \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} toce * e3t \end{verbatim} }}\end{alltt} \end{xmlcode} - use it when defining your file. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   \end{verbatim} }}\end{alltt} \end{xmlcode} The freq\_op="5d" attribute is used to define the operation frequency of the @'' function: here 5 day. The temporal operation done by the @'' is the one defined in the field definition: here we use the default, average. So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': here the temporal average is alreday done by the @'' function so we just use instant to do the ratio of the 2 mean values. field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. Note that in this case, freq\_op must be equal to the file output\_freq. - define a new variable in field\_definition \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   ssh * ssh \end{verbatim} }}\end{alltt} \end{xmlcode} - use it when defining your file. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   \end{verbatim} }}\end{alltt} \end{xmlcode} The freq\_op="1m" attribute is used to define the operation frequency of the @'' function: here 1 month. The temporal operation done by the @'' is the one defined in the field definition: here we use the default, average. So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'': here the temporal average is alreday done by the @'' function so we just use instant. field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. Note that in this case, freq\_op must be equal to the file output\_freq. - define 2 new variables in field\_definition \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode} \end{verbatim} }}\end{alltt} \end{xmlcode} - use these 2 new variables when defining your file. \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}   \end{verbatim} }}\end{alltt} \end{xmlcode} The freq\_op="1d" attribute is used to define the operation frequency of the @'' function: here 1 day. The temporal operation done by the @'' is the one defined in the field definition: here maximum for sstmax and minimum for sstmin. So, in the above case, @sstmax will do the daily max and @sstmin the daily min. Operation="average" refers to the temporal operation to be performed on the field @sstmax - @sstmin'': here monthly mean (of daily max - daily min of the sst). field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. %------------------------------------------namnc4---------------------------------------------------- \namdisplay{namnc4} \fortranfile{namelists/namnc4} %------------------------------------------------------------------------------------------------------------- \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{fortrancode} ichunksz(1) = MIN( idomain_size,MAX( (idomain_size-1)/nn_nchunks_i + 1 ,16 ) ) ichunksz(2) = MIN( jdomain_size,MAX( (jdomain_size-1)/nn_nchunks_j + 1 ,16 ) ) ichunksz(3) = MIN( kdomain_size,MAX( (kdomain_size-1)/nn_nchunks_k + 1 , 1 ) ) ichunksz(4) = 1 \end{verbatim} }}\end{alltt} \end{fortrancode} \noindent As an example, setting: \vspace{-20pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{fortrancode} nn_nchunks_i=4, nn_nchunks_j=4 and nn_nchunks_k=31 \end{verbatim} }}\end{alltt} \vspace{-10pt} \end{fortrancode} \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} %------------------------------------------namtrd---------------------------------------------------- \namdisplay{namtrd} \fortranfile{namelists/namtrd} %------------------------------------------------------------------------------------------------------------- \label{FLO} %--------------------------------------------namflo------------------------------------------------------- \namdisplay{namflo} \fortranfile{namelists/namflo} %-------------------------------------------------------------------------------------------------------------- \vspace{-30pt} \begin{alltt}  {{\scriptsize \begin{verbatim} \begin{xmlcode}    } }\\ } } \end{verbatim} }}\end{alltt} \end{xmlcode} %------------------------------------------namdia_harm---------------------------------------------------- \namdisplay{namdia_harm} %\fortranfile{namelists/namdia_harm} %---------------------------------------------------------------------------------------------------------- %------------------------------------------namdct---------------------------------------------------- \namdisplay{namdct} \fortranfile{namelists/namdct} %------------------------------------------------------------------------------------------------------------- %------------------------------------------namptr----------------------------------------- \namdisplay{namptr} \fortranfile{namelists/namptr} %----------------------------------------------------------------------------------------- %------------------------------------------nam_dia25h------------------------------------- \namdisplay{nam_dia25h} \fortranfile{namelists/nam_dia25h} %----------------------------------------------------------------------------------------- %------------------------------------------nam_diatmb----------------------------------------------------- \namdisplay{nam_diatmb} \fortranfile{namelists/nam_diatmb} %----------------------------------------------------------------------------------------------------------