[10414] | 1 | \documentclass[../main/NEMO_manual]{subfiles} |
---|
| 2 | |
---|
[6997] | 3 | \begin{document} |
---|
[2541] | 4 | % ================================================================ |
---|
[4153] | 5 | % Chapter I/O & Diagnostics |
---|
[2541] | 6 | % ================================================================ |
---|
[6140] | 7 | \chapter{Output and Diagnostics (IOM, DIA, TRD, FLO)} |
---|
[9407] | 8 | \label{chap:DIA} |
---|
[10414] | 9 | |
---|
[11512] | 10 | \chaptertoc |
---|
[2541] | 11 | |
---|
[11353] | 12 | \vfill |
---|
| 13 | \begin{figure}[b] |
---|
| 14 | \subsubsection*{Changes record} |
---|
| 15 | \begin{tabular}{l||l|m{0.65\linewidth}} |
---|
| 16 | Release & Author & Modifications \\ |
---|
| 17 | {\em 4.0} & {\em Mirek Andrejczuk, Massimiliano Drudi} & {\em } \\ |
---|
| 18 | {\em } & {\em Dorotea Iovino, Nicolas Martin} & {\em } \\ |
---|
| 19 | {\em 3.6} & {\em Gurvan Madec, Sebastien Masson } & {\em } \\ |
---|
[11512] | 20 | {\em 3.4} & {\em Gurvan Madec, Rachid Benshila, Andrew Coward } & {\em } \\ |
---|
| 21 | {\em } & {\em Christian Ethe, Sebastien Masson } & {\em } \\ |
---|
[11353] | 22 | \end{tabular} |
---|
[11512] | 23 | \end{figure} |
---|
[11353] | 24 | |
---|
[2541] | 25 | \newpage |
---|
| 26 | |
---|
| 27 | % ================================================================ |
---|
[11512] | 28 | % Old Model Output |
---|
[2541] | 29 | % ================================================================ |
---|
[11353] | 30 | \section{Model output} |
---|
[9407] | 31 | \label{sec:DIA_io_old} |
---|
[2541] | 32 | |
---|
[10354] | 33 | The model outputs are of three types: the restart file, the output listing, and the diagnostic output file(s). |
---|
| 34 | The restart file is used internally by the code when the user wants to start the model with |
---|
[9413] | 35 | initial conditions defined by a previous simulation. |
---|
[10354] | 36 | It contains all the information that is necessary in order for there to be no changes in the model results |
---|
| 37 | (even at the computer precision) between a run performed with several restarts and |
---|
[9413] | 38 | the same run performed in one step. |
---|
[10354] | 39 | It should be noted that this requires that the restart file contains two consecutive time steps for |
---|
[11263] | 40 | all the prognostic variables. |
---|
[4153] | 41 | |
---|
[10354] | 42 | The output listing and file(s) are predefined but should be checked and eventually adapted to the user's needs. |
---|
[11512] | 43 | The output listing is stored in the \textit{ocean.output} file. |
---|
| 44 | The information is printed from within the code on the logical unit \texttt{numout}. |
---|
[9413] | 45 | To locate these prints, use the UNIX command "\textit{grep -i numout}" in the source code directory. |
---|
[2541] | 46 | |
---|
[9413] | 47 | By default, diagnostic output files are written in NetCDF format. |
---|
[10354] | 48 | Since version 3.2, when defining \key{iomput}, an I/O server has been added which |
---|
| 49 | provides more flexibility in the choice of the fields to be written as well as how |
---|
| 50 | the writing work is distributed over the processors in massively parallel computing. |
---|
| 51 | A complete description of the use of this I/O server is presented in the next section. |
---|
[2541] | 52 | |
---|
| 53 | %\gmcomment{ % start of gmcomment |
---|
| 54 | |
---|
| 55 | % ================================================================ |
---|
| 56 | % Diagnostics |
---|
| 57 | % ================================================================ |
---|
[9393] | 58 | \section{Standard model output (IOM)} |
---|
[9407] | 59 | \label{sec:DIA_iom} |
---|
[2541] | 60 | |
---|
[11512] | 61 | Since version 3.2, iomput is the \NEMO\ output interface of choice. |
---|
[10354] | 62 | It has been designed to be simple to use, flexible and efficient. |
---|
[11512] | 63 | The two main purposes of iomput are: |
---|
[9413] | 64 | |
---|
[4153] | 65 | \begin{enumerate} |
---|
[10354] | 66 | \item |
---|
| 67 | The complete and flexible control of the output files through external XML files adapted by |
---|
| 68 | the user from standard templates. |
---|
| 69 | \item |
---|
| 70 | To achieve high performance and scalable output through the optional distribution of |
---|
| 71 | all diagnostic output related tasks to dedicated processes. |
---|
[4153] | 72 | \end{enumerate} |
---|
[9413] | 73 | |
---|
[11512] | 74 | The first functionality allows the user to specify, without code changes or recompilation, |
---|
[6289] | 75 | aspects of the diagnostic output stream, such as: |
---|
[9413] | 76 | |
---|
[4153] | 77 | \begin{itemize} |
---|
[10354] | 78 | \item |
---|
| 79 | The choice of output frequencies that can be different for each file (including real months and years). |
---|
| 80 | \item |
---|
| 81 | The choice of file contents; includes complete flexibility over which data are written in which files |
---|
| 82 | (the same data can be written in different files). |
---|
| 83 | \item |
---|
| 84 | The possibility to split output files at a chosen frequency. |
---|
| 85 | \item |
---|
| 86 | The possibility to extract a vertical or an horizontal subdomain. |
---|
| 87 | \item |
---|
[10442] | 88 | The choice of the temporal operation to perform, \eg: average, accumulate, instantaneous, min, max and once. |
---|
[10354] | 89 | \item |
---|
| 90 | Control over metadata via a large XML "database" of possible output fields. |
---|
[4153] | 91 | \end{itemize} |
---|
[2541] | 92 | |
---|
[10354] | 93 | In addition, iomput allows the user to add in the code the output of any new variable (scalar, 2D or 3D) |
---|
| 94 | in a very easy way. |
---|
[9413] | 95 | All details of iomput functionalities are listed in the following subsections. |
---|
[11512] | 96 | Examples of the XML files that control the outputs can be found in: |
---|
[11263] | 97 | \path{cfgs/ORCA2_ICE_PISCES/EXPREF/iodef.xml}, |
---|
| 98 | \path{cfgs/SHARED/field_def_nemo-oce.xml}, |
---|
| 99 | \path{cfgs/SHARED/field_def_nemo-pisces.xml}, |
---|
| 100 | \path{cfgs/SHARED/field_def_nemo-ice.xml} and \path{cfgs/SHARED/domain_def_nemo.xml}. \\ |
---|
[2541] | 101 | |
---|
[9413] | 102 | The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). |
---|
[11512] | 103 | Iomput provides the possibility to specify N dedicated I/O processes (in addition to the \NEMO\ processes) |
---|
[10354] | 104 | to collect and write the outputs. |
---|
| 105 | With an appropriate choice of N by the user, the bottleneck associated with the writing of |
---|
[9413] | 106 | the output files can be greatly reduced. |
---|
| 107 | |
---|
[11512] | 108 | In version 3.6, the \rou{iom\_put} interface depends on |
---|
| 109 | an external code called \href{https://forge.ipsl.jussieu.fr/ioserver/browser/XIOS/branchs/xios-2.5}{XIOS-2.5} |
---|
| 110 | %(use of revision 618 or higher is required). |
---|
[10354] | 111 | This new IO server can take advantage of the parallel I/O functionality of NetCDF4 to |
---|
[9413] | 112 | create a single output file and therefore to bypass the rebuilding phase. |
---|
[10354] | 113 | Note that writing in parallel into the same NetCDF files requires that your NetCDF4 library is linked to |
---|
[11512] | 114 | an HDF5 library that has been correctly compiled (\ie\ with the configure option $--$enable-parallel). |
---|
[9413] | 115 | Note that the files created by iomput through XIOS are incompatible with NetCDF3. |
---|
[10354] | 116 | All post-processsing and visualization tools must therefore be compatible with NetCDF4 and not only NetCDF3. |
---|
[2541] | 117 | |
---|
[10354] | 118 | Even if not using the parallel I/O functionality of NetCDF4, using N dedicated I/O servers, |
---|
[11512] | 119 | where N is typically much less than the number of \NEMO\ processors, will reduce the number of output files created. |
---|
| 120 | This can greatly reduce the post-processing burden usually associated with using large numbers of \NEMO\ processors. |
---|
[10354] | 121 | Note that for smaller configurations, the rebuilding phase can be avoided, |
---|
| 122 | even without a parallel-enabled NetCDF4 library, simply by employing only one dedicated I/O server. |
---|
[2541] | 123 | |
---|
[10509] | 124 | \subsection{XIOS: Reading and writing restart file} |
---|
| 125 | |
---|
[11512] | 126 | XIOS may be used to read single file restart produced by \NEMO. Currently only the variables written to |
---|
[10509] | 127 | file \forcode{numror} can be handled by XIOS. To activate restart reading using XIOS, set \np{ln\_xios\_read}\forcode{ = .true. } |
---|
[11512] | 128 | in \textit{namelist\_cfg}. This setting will be ignored when multiple restart files are present, and default \NEMO |
---|
| 129 | functionality will be used for reading. There is no need to change iodef.xml file to use XIOS to read |
---|
| 130 | restart, all definitions are done within the \NEMO\ code. For high resolution configuration, however, |
---|
[10509] | 131 | there may be a need to add the following line in iodef.xml (xios context): |
---|
| 132 | |
---|
| 133 | \begin{xmllines} |
---|
| 134 | <variable id="recv_field_timeout" type="double">1800</variable> |
---|
| 135 | \end{xmllines} |
---|
| 136 | |
---|
[11512] | 137 | This variable sets timeout for reading. |
---|
[10509] | 138 | |
---|
[11512] | 139 | If XIOS is to be used to read restart from file generated with an earlier \NEMO\ version (3.6 for instance), |
---|
[10509] | 140 | dimension \forcode{z} defined in restart file must be renamed to \forcode{nav_lev}.\\ |
---|
| 141 | |
---|
[11512] | 142 | XIOS can also be used to write \NEMO\ restart. A namelist parameter \np{nn\_wxios} is used to determine the |
---|
| 143 | type of restart \NEMO\ will write. If it is set to 0, default \NEMO\ functionality will be used - each |
---|
| 144 | processor writes its own restart file; if it is set to 1 XIOS will write restart into a single file; |
---|
| 145 | for \np{nn\_wxios}\forcode{ = 2} the restart will be written by XIOS into multiple files, one for each XIOS server. |
---|
| 146 | Note, however, that \textbf{\NEMO\ will not read restart generated by XIOS when \np{nn\_wxios}\forcode{ = 2}}. The restart will |
---|
| 147 | have to be rebuild before continuing the run. This option aims to reduce number of restart files generated by \NEMO\ only, |
---|
| 148 | and may be useful when there is a need to change number of processors used to run simulation. |
---|
[10509] | 149 | |
---|
| 150 | If an additional variable must be written to a restart file, the following steps are needed: |
---|
| 151 | \begin{description} |
---|
[11512] | 152 | \item[step 1:] add variable name to a list of restart variables (in subroutine \rou{iom\_set\_rst\_vars,} \mdl{iom}) and |
---|
| 153 | define correct grid for the variable (\forcode{grid_N_3D} - 3D variable, \forcode{grid_N} - 2D variable, \forcode{grid_vector} - |
---|
[10509] | 154 | 1D variable, \forcode{grid_scalar} - scalar), |
---|
[11512] | 155 | \item[step 2:] add variable to the list of fields written by restart. This can be done either in subroutine |
---|
| 156 | \rou{iom\_set\_rstw\_core} (\mdl{iom}) or by calling \rou{iom\_set\_rstw\_active} (\mdl{iom}) with the name of a variable |
---|
| 157 | as an argument. This convention follows approach for writing restart using iom, where variables are |
---|
[10509] | 158 | written either by \rou{rst\_write} or by calling \rou{iom\_rstput} from individual routines. |
---|
| 159 | \end{description} |
---|
| 160 | |
---|
| 161 | |
---|
| 162 | An older versions of XIOS do not support reading functionality. It's recommended to use at least XIOS2@1451. |
---|
| 163 | |
---|
| 164 | |
---|
[9393] | 165 | \subsection{XIOS: XML Inputs-Outputs Server} |
---|
[4153] | 166 | |
---|
| 167 | \subsubsection{Attached or detached mode?} |
---|
| 168 | |
---|
[10354] | 169 | Iomput is based on \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS}, |
---|
[9413] | 170 | the io\_server developed by Yann Meurdesoif from IPSL. |
---|
| 171 | The behaviour of the I/O subsystem is controlled by settings in the external XML files listed above. |
---|
| 172 | Key settings in the iodef.xml file are the tags associated with each defined file. |
---|
| 173 | |
---|
| 174 | \xmlline|<variable id="using_server" type="bool"></variable>| |
---|
| 175 | |
---|
[11263] | 176 | The {\ttfamily using\_server} setting determines whether or not the server will be used in \textit{attached mode} |
---|
| 177 | (as a library) [{\ttfamily> false <}] or in \textit{detached mode} |
---|
| 178 | (as an external executable on N additional, dedicated cpus) [{\ttfamily > true <}]. |
---|
[9413] | 179 | The \textit{attached mode} is simpler to use but much less efficient for massively parallel applications. |
---|
[6289] | 180 | The type of each file can be either ''multiple\_file'' or ''one\_file''. |
---|
[4153] | 181 | |
---|
[10354] | 182 | In \textit{attached mode} and if the type of file is ''multiple\_file'', |
---|
[11512] | 183 | then each \NEMO\ process will also act as an IO server and produce its own set of output files. |
---|
[9413] | 184 | Superficially, this emulates the standard behaviour in previous versions. |
---|
[10354] | 185 | However, the subdomain written out by each process does not correspond to |
---|
[9413] | 186 | the \forcode{jpi x jpj x jpk} domain actually computed by the process (although it may if \forcode{jpni=1}). |
---|
| 187 | Instead each process will have collected and written out a number of complete longitudinal strips. |
---|
[10354] | 188 | If the ''one\_file'' option is chosen then all processes will collect their longitudinal strips and |
---|
[9413] | 189 | write (in parallel) to a single output file. |
---|
[4153] | 190 | |
---|
[10354] | 191 | In \textit{detached mode} and if the type of file is ''multiple\_file'', |
---|
| 192 | then each stand-alone XIOS process will collect data for a range of complete longitudinal strips and |
---|
[9413] | 193 | write to its own set of output files. |
---|
[10354] | 194 | If the ''one\_file'' option is chosen then all XIOS processes will collect their longitudinal strips and |
---|
[11512] | 195 | write (in parallel) to a single output file. |
---|
[9413] | 196 | Note running in detached mode requires launching a Multiple Process Multiple Data (MPMD) parallel job. |
---|
[10354] | 197 | The following subsection provides a typical example but the syntax will vary in different MPP environments. |
---|
[4153] | 198 | |
---|
| 199 | \subsubsection{Number of cpu used by XIOS in detached mode} |
---|
| 200 | |
---|
[9413] | 201 | The number of cores used by the XIOS is specified when launching the model. |
---|
[11512] | 202 | The number of cores dedicated to XIOS should be from \texttildelow1/10 to \texttildelow1/50 of the number of |
---|
| 203 | cores dedicated to \NEMO. |
---|
[10354] | 204 | Some manufacturers suggest using O($\sqrt{N}$) dedicated IO processors for N processors but |
---|
[11512] | 205 | this is a general recommendation and not specific to \NEMO. |
---|
[10354] | 206 | It is difficult to provide precise recommendations because the optimal choice will depend on |
---|
[11512] | 207 | the particular hardware properties of the target system |
---|
[10354] | 208 | (parallel filesystem performance, available memory, memory bandwidth etc.) |
---|
| 209 | and the volume and frequency of data to be created. |
---|
[6289] | 210 | Here is an example of 2 cpus for the io\_server and 62 cpu for nemo using mpirun: |
---|
[9413] | 211 | \cmd|mpirun -np 62 ./nemo.exe : -np 2 ./xios_server.exe| |
---|
[4153] | 212 | |
---|
[9393] | 213 | \subsubsection{Control of XIOS: the context in iodef.xml} |
---|
[4153] | 214 | |
---|
[11512] | 215 | As well as the \texttt{using\_server} flag, other controls on the use of XIOS are set in |
---|
| 216 | the XIOS context in \textit{iodef.xml}. |
---|
[6289] | 217 | See the XML basics section below for more details on XML syntax and rules. |
---|
[4153] | 218 | |
---|
[10414] | 219 | \begin{table} |
---|
| 220 | \scriptsize |
---|
| 221 | \begin{tabularx}{\textwidth}{|lXl|} |
---|
| 222 | \hline |
---|
| 223 | variable name & |
---|
| 224 | description & |
---|
| 225 | example \\ |
---|
| 226 | \hline |
---|
| 227 | \hline |
---|
| 228 | buffer\_size & |
---|
[11512] | 229 | buffer size used by XIOS to send data from \NEMO\ to XIOS. |
---|
[10414] | 230 | Larger is more efficient. |
---|
| 231 | Note that needed/used buffer sizes are summarized at the end of the job & |
---|
| 232 | 25000000 \\ |
---|
| 233 | \hline |
---|
| 234 | buffer\_server\_factor\_size & |
---|
[11512] | 235 | ratio between \NEMO\ and XIOS buffer size. |
---|
[10414] | 236 | Should be 2. & |
---|
| 237 | 2 \\ |
---|
| 238 | \hline |
---|
| 239 | info\_level & |
---|
| 240 | verbosity level (0 to 100) & |
---|
| 241 | 0 \\ |
---|
| 242 | \hline |
---|
| 243 | using\_server & |
---|
| 244 | activate attached(false) or detached(true) mode & |
---|
| 245 | true \\ |
---|
| 246 | \hline |
---|
| 247 | using\_oasis & |
---|
| 248 | XIOS is used with OASIS(true) or not (false) & |
---|
| 249 | false \\ |
---|
| 250 | \hline |
---|
| 251 | oasis\_codes\_id & |
---|
[11512] | 252 | when using oasis, define the identifier of \NEMO\ in the namcouple. |
---|
[10414] | 253 | Note that the identifier of XIOS is xios.x & |
---|
| 254 | oceanx \\ |
---|
| 255 | \hline |
---|
| 256 | \end{tabularx} |
---|
[9413] | 257 | \end{table} |
---|
[4153] | 258 | |
---|
| 259 | \subsection{Practical issues} |
---|
| 260 | |
---|
| 261 | \subsubsection{Installation} |
---|
| 262 | |
---|
[11512] | 263 | As mentioned, XIOS is supported separately and must be downloaded and compiled before it can be used with \NEMO. |
---|
[10354] | 264 | See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. |
---|
[11512] | 265 | \NEMO\ will need to link to the compiled XIOS library. |
---|
[11263] | 266 | The \href{https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/guide/html/install.html#extract-and-install-xios} |
---|
| 267 | {Extract and install XIOS} guide provides an example illustration of how this can be achieved. |
---|
[4153] | 268 | |
---|
| 269 | \subsubsection{Add your own outputs} |
---|
| 270 | |
---|
[9413] | 271 | It is very easy to add your own outputs with iomput. |
---|
[10442] | 272 | Many standard fields and diagnostics are already prepared (\ie, steps 1 to 3 below have been done) and |
---|
[9413] | 273 | simply need to be activated by including the required output in a file definition in iodef.xml (step 4). |
---|
[6289] | 274 | To add new output variables, all 4 of the following steps must be taken. |
---|
[4153] | 275 | |
---|
[9413] | 276 | \begin{enumerate} |
---|
[10354] | 277 | \item[1.] |
---|
[11512] | 278 | in \NEMO\ code, add a \forcode{CALL iom_put( 'identifier', array )} where you want to output a 2D or 3D array. |
---|
[10354] | 279 | \item[2.] |
---|
| 280 | If necessary, add \forcode{USE iom ! I/O manager library} to the list of used modules in |
---|
| 281 | the upper part of your module. |
---|
| 282 | \item[3.] |
---|
| 283 | in the field\_def.xml file, add the definition of your variable using the same identifier you used in the f90 code |
---|
| 284 | (see subsequent sections for a details of the XML syntax and rules). |
---|
| 285 | For example: |
---|
[4153] | 286 | |
---|
[9392] | 287 | \begin{xmllines} |
---|
[9413] | 288 | <field_definition> |
---|
| 289 | <field_group id="grid_T" grid_ref="grid_T_3D"> <!-- T grid --> |
---|
| 290 | ... |
---|
[11512] | 291 | <field id="identifier" long_name="blabla" ... /> |
---|
[9413] | 292 | ... |
---|
[11512] | 293 | </field_definition> |
---|
[9413] | 294 | \end{xmllines} |
---|
[4153] | 295 | |
---|
[10354] | 296 | Note your definition must be added to the field\_group whose reference grid is consistent with the size of |
---|
| 297 | the array passed to iomput. |
---|
| 298 | The grid\_ref attribute refers to definitions set in iodef.xml which, in turn, |
---|
| 299 | reference grids and axes either defined in the code |
---|
| 300 | (iom\_set\_domain\_attr and iom\_set\_axis\_attr in \mdl{iom}) or defined in the domain\_def.xml file. |
---|
[10442] | 301 | \eg: |
---|
[9413] | 302 | |
---|
[9392] | 303 | \begin{xmllines} |
---|
[9413] | 304 | <grid id="grid_T_3D" domain_ref="grid_T" axis_ref="deptht"/> |
---|
[9392] | 305 | \end{xmllines} |
---|
[9413] | 306 | |
---|
[10354] | 307 | Note, if your array is computed within the surface module each \np{nn\_fsbc} time\_step, |
---|
[9413] | 308 | add the field definition within the field\_group defined with the id "SBC": |
---|
[10354] | 309 | \xmlcode{<field_group id="SBC" ...>} which has been defined with the correct frequency of operations |
---|
| 310 | (iom\_set\_field\_attr in \mdl{iom}) |
---|
| 311 | \item[4.] |
---|
| 312 | add your field in one of the output files defined in iodef.xml |
---|
| 313 | (again see subsequent sections for syntax and rules) |
---|
[4153] | 314 | |
---|
[9392] | 315 | \begin{xmllines} |
---|
[11512] | 316 | <file id="file1" .../> |
---|
[9413] | 317 | ... |
---|
[11512] | 318 | <field field_ref="identifier" /> |
---|
[9413] | 319 | ... |
---|
[11512] | 320 | </file> |
---|
[9392] | 321 | \end{xmllines} |
---|
[4153] | 322 | |
---|
[9413] | 323 | \end{enumerate} |
---|
[9393] | 324 | |
---|
[4153] | 325 | \subsection{XML fundamentals} |
---|
| 326 | |
---|
[2541] | 327 | \subsubsection{ XML basic rules} |
---|
| 328 | |
---|
[9413] | 329 | XML tags begin with the less-than character ("$<$") and end with the greater-than character ("$>$"). |
---|
[10354] | 330 | You use tags to mark the start and end of elements, which are the logical units of information in an XML document. |
---|
| 331 | In addition to marking the beginning of an element, XML start tags also provide a place to specify attributes. |
---|
| 332 | An attribute specifies a single property for an element, using a name/value pair, for example: |
---|
[9413] | 333 | \xmlcode{<a b="x" c="y" d="z"> ... </a>}. |
---|
[2541] | 334 | See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. |
---|
| 335 | |
---|
[11512] | 336 | \subsubsection{Structure of the XML file used in \NEMO} |
---|
[2541] | 337 | |
---|
[10354] | 338 | The XML file used in XIOS is structured by 7 families of tags: |
---|
[9413] | 339 | context, axis, domain, grid, field, file and variable. |
---|
[6289] | 340 | Each tag family has hierarchy of three flavors (except for context): |
---|
[4148] | 341 | |
---|
[10414] | 342 | \begin{table} |
---|
| 343 | \scriptsize |
---|
| 344 | \begin{tabular*}{\textwidth}{|p{0.15\textwidth}p{0.4\textwidth}p{0.35\textwidth}|} |
---|
| 345 | \hline |
---|
| 346 | flavor & description & |
---|
| 347 | example \\ |
---|
| 348 | \hline |
---|
| 349 | \hline |
---|
| 350 | root & declaration of the root element that can contain element groups or elements & |
---|
| 351 | \xmlcode{<file_definition ... >} \\ |
---|
| 352 | \hline |
---|
| 353 | group & declaration of a group element that can contain element groups or elements & |
---|
| 354 | \xmlcode{<file_group ... >} \\ |
---|
| 355 | \hline |
---|
| 356 | element & declaration of an element that can contain elements & |
---|
| 357 | \xmlcode{<file ... >} \\ |
---|
| 358 | \hline |
---|
| 359 | \end{tabular*} |
---|
[9413] | 360 | \end{table} |
---|
| 361 | |
---|
| 362 | Each element may have several attributes. |
---|
[10354] | 363 | Some attributes are mandatory, other are optional but have a default value and other are completely optional. |
---|
[9413] | 364 | Id is a special attribute used to identify an element or a group of elements. |
---|
| 365 | It must be unique for a kind of element. |
---|
[6289] | 366 | It is optional, but no reference to the corresponding element can be done if it is not defined. |
---|
[4148] | 367 | |
---|
[10354] | 368 | The XML file is split into context tags that are used to isolate IO definition from |
---|
| 369 | different codes or different parts of a code. |
---|
[9413] | 370 | No interference is possible between 2 different contexts. |
---|
| 371 | Each context has its own calendar and an associated timestep. |
---|
| 372 | In \NEMO, we used the following contexts (that can be defined in any order): |
---|
[4148] | 373 | |
---|
[10414] | 374 | \begin{table} |
---|
| 375 | \scriptsize |
---|
| 376 | \begin{tabular}{|p{0.15\textwidth}p{0.4\textwidth}p{0.35\textwidth}|} |
---|
| 377 | \hline |
---|
| 378 | context & description & |
---|
| 379 | example \\ |
---|
| 380 | \hline |
---|
| 381 | \hline |
---|
| 382 | context xios & context containing information for XIOS & |
---|
| 383 | \xmlcode{<context id="xios" ... >} \\ |
---|
| 384 | \hline |
---|
[11512] | 385 | context nemo & context containing IO information for \NEMO\ (mother grid when using AGRIF) & |
---|
[10414] | 386 | \xmlcode{<context id="nemo" ... >} \\ |
---|
| 387 | \hline |
---|
[11512] | 388 | context 1\_nemo & context containing IO information for \NEMO\ child grid 1 (when using AGRIF) & |
---|
[10414] | 389 | \xmlcode{<context id="1_nemo" ... >} \\ |
---|
| 390 | \hline |
---|
[11512] | 391 | context n\_nemo & context containing IO information for \NEMO\ child grid n (when using AGRIF) & |
---|
[10414] | 392 | \xmlcode{<context id="n_nemo" ... >} \\ |
---|
| 393 | \hline |
---|
| 394 | \end{tabular} |
---|
[9413] | 395 | \end{table} |
---|
| 396 | |
---|
[4153] | 397 | \noindent The xios context contains only 1 tag: |
---|
[2541] | 398 | |
---|
[10414] | 399 | \begin{table} |
---|
| 400 | \scriptsize |
---|
| 401 | \begin{tabular}{|p{0.15\textwidth}p{0.4\textwidth}p{0.35\textwidth}|} |
---|
| 402 | \hline |
---|
| 403 | context tag & |
---|
| 404 | description & |
---|
| 405 | example \\ |
---|
| 406 | \hline |
---|
| 407 | \hline |
---|
| 408 | variable\_definition & |
---|
| 409 | define variables needed by XIOS. |
---|
| 410 | This can be seen as a kind of namelist for XIOS. & |
---|
| 411 | \xmlcode{<variable_definition ... >} \\ |
---|
| 412 | \hline |
---|
[9413] | 413 | \end{tabular} |
---|
| 414 | \end{table} |
---|
| 415 | |
---|
[11512] | 416 | \noindent Each context tag related to \NEMO\ (mother or child grids) is divided into 5 parts |
---|
[9413] | 417 | (that can be defined in any order): |
---|
[2541] | 418 | |
---|
[10414] | 419 | \begin{table} |
---|
| 420 | \scriptsize |
---|
| 421 | \begin{tabular}{|p{0.15\textwidth}p{0.4\textwidth}p{0.35\textwidth}|} |
---|
| 422 | \hline |
---|
| 423 | context tag & description & |
---|
| 424 | example \\ |
---|
| 425 | \hline |
---|
| 426 | \hline |
---|
| 427 | field\_definition & define all variables that can potentially be outputted & |
---|
| 428 | \xmlcode{<field_definition ... >} \\ |
---|
| 429 | \hline |
---|
| 430 | file\_definition & define the netcdf files to be created and the variables they will contain & |
---|
| 431 | \xmlcode{<file_definition ... >} \\ |
---|
| 432 | \hline |
---|
| 433 | axis\_definition & define vertical axis & |
---|
| 434 | \xmlcode{<axis_definition ... >} \\ |
---|
| 435 | \hline |
---|
| 436 | domain\_definition & define the horizontal grids & |
---|
| 437 | \xmlcode{<domain_definition ... >} \\ |
---|
| 438 | \hline |
---|
| 439 | grid\_definition & define the 2D and 3D grids (association of an axis and a domain) & |
---|
| 440 | \xmlcode{<grid_definition ... >} \\ |
---|
| 441 | \hline |
---|
| 442 | \end{tabular} |
---|
[9413] | 443 | \end{table} |
---|
| 444 | |
---|
[4153] | 445 | \subsubsection{Nesting XML files} |
---|
[4148] | 446 | |
---|
[9413] | 447 | The XML file can be split in different parts to improve its readability and facilitate its use. |
---|
| 448 | The inclusion of XML files into the main XML file can be done through the attribute src: |
---|
| 449 | \xmlline|<context src="./nemo_def.xml" />| |
---|
[11512] | 450 | |
---|
| 451 | \noindent In \NEMO, by default, the field definition is done in 3 separate files ( |
---|
[11263] | 452 | \path{cfgs/SHARED/field_def_nemo-oce.xml}, |
---|
| 453 | \path{cfgs/SHARED/field_def_nemo-pisces.xml} and |
---|
| 454 | \path{cfgs/SHARED/field_def_nemo-ice.xml} ) and the domain definition is done in another file ( \path{cfgs/SHARED/domain_def_nemo.xml} ) |
---|
| 455 | that |
---|
[10354] | 456 | are included in the main iodef.xml file through the following commands: |
---|
[9413] | 457 | \begin{xmllines} |
---|
[11512] | 458 | <context id="nemo" src="./context_nemo.xml"/> |
---|
[9413] | 459 | \end{xmllines} |
---|
[9376] | 460 | |
---|
[4148] | 461 | \subsubsection{Use of inheritance} |
---|
| 462 | |
---|
[9413] | 463 | XML extensively uses the concept of inheritance. |
---|
[10354] | 464 | XML has a tree based structure with a parent-child oriented relation: all children inherit attributes from parent, |
---|
| 465 | but an attribute defined in a child replace the inherited attribute value. |
---|
| 466 | Note that the special attribute ''id'' is never inherited. |
---|
| 467 | \\ |
---|
| 468 | \\ |
---|
[4153] | 469 | example 1: Direct inheritance. |
---|
[9413] | 470 | |
---|
[9392] | 471 | \begin{xmllines} |
---|
[9413] | 472 | <field_definition operation="average" > |
---|
[11512] | 473 | <field id="sst" /> <!-- averaged sst --> |
---|
| 474 | <field id="sss" operation="instant"/> <!-- instantaneous sss --> |
---|
| 475 | </field_definition> |
---|
[9392] | 476 | \end{xmllines} |
---|
[9413] | 477 | |
---|
[10354] | 478 | The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' of |
---|
| 479 | the attribute ''operation'' from its parent. |
---|
[9413] | 480 | Note that a child can overwrite the attribute definition inherited from its parents. |
---|
[10354] | 481 | In the example above, the field ''sss'' will for example output instantaneous values instead of average values. |
---|
| 482 | \\ |
---|
| 483 | \\ |
---|
[4153] | 484 | example 2: Inheritance by reference. |
---|
[9413] | 485 | |
---|
[9392] | 486 | \begin{xmllines} |
---|
[9413] | 487 | <field_definition> |
---|
| 488 | <field id="sst" long_name="sea surface temperature" /> |
---|
| 489 | <field id="sss" long_name="sea surface salinity" /> |
---|
| 490 | </field_definition> |
---|
| 491 | <file_definition> |
---|
[11512] | 492 | <file id="myfile" output_freq="1d" /> |
---|
[9413] | 493 | <field field_ref="sst" /> <!-- default def --> |
---|
| 494 | <field field_ref="sss" long_name="my description" /> <!-- overwrite --> |
---|
| 495 | </file> |
---|
[11512] | 496 | </file_definition> |
---|
[9413] | 497 | \end{xmllines} |
---|
[2541] | 498 | |
---|
[4153] | 499 | Inherit (and overwrite, if needed) the attributes of a tag you are refering to. |
---|
[2541] | 500 | |
---|
[9393] | 501 | \subsubsection{Use of groups} |
---|
[2541] | 502 | |
---|
[9413] | 503 | Groups can be used for 2 purposes. |
---|
[10354] | 504 | Firstly, the group can be used to define common attributes to be shared by the elements of |
---|
[9413] | 505 | the group through inheritance. |
---|
| 506 | In the following example, we define a group of field that will share a common grid ''grid\_T\_2D''. |
---|
[10354] | 507 | Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. |
---|
[9413] | 508 | |
---|
[9392] | 509 | \begin{xmllines} |
---|
[9413] | 510 | <field_group id="grid_T" grid_ref="grid_T_2D"> |
---|
| 511 | <field id="toce" long_name="temperature" unit="degC" grid_ref="grid_T_3D"/> |
---|
| 512 | <field id="sst" long_name="sea surface temperature" unit="degC" /> |
---|
| 513 | <field id="sss" long_name="sea surface salinity" unit="psu" /> |
---|
| 514 | <field id="ssh" long_name="sea surface height" unit="m" /> |
---|
| 515 | ... |
---|
[9392] | 516 | \end{xmllines} |
---|
[2541] | 517 | |
---|
[9413] | 518 | Secondly, the group can be used to replace a list of elements. |
---|
[11263] | 519 | Several examples of groups of fields are proposed at the end of the XML field files ( |
---|
| 520 | \path{cfgs/SHARED/field_def_nemo-oce.xml}, |
---|
| 521 | \path{cfgs/SHARED/field_def_nemo-pisces.xml} and |
---|
| 522 | \path{cfgs/SHARED/field_def_nemo-ice.xml} ) . |
---|
[6289] | 523 | For example, a short list of the usual variables related to the U grid: |
---|
[9413] | 524 | |
---|
[9392] | 525 | \begin{xmllines} |
---|
[9413] | 526 | <field_group id="groupU" > |
---|
| 527 | <field field_ref="uoce" /> |
---|
[11263] | 528 | <field field_ref="ssu" /> |
---|
[9413] | 529 | <field field_ref="utau" /> |
---|
| 530 | </field_group> |
---|
[9392] | 531 | \end{xmllines} |
---|
[9413] | 532 | |
---|
[4153] | 533 | that can be directly included in a file through the following syntax: |
---|
[9413] | 534 | |
---|
[9392] | 535 | \begin{xmllines} |
---|
[9413] | 536 | <file id="myfile_U" output_freq="1d" /> |
---|
| 537 | <field_group group_ref="groupU" /> |
---|
| 538 | <field field_ref="uocetr_eff" /> <!-- add another field --> |
---|
[11512] | 539 | </file> |
---|
[9392] | 540 | \end{xmllines} |
---|
[4148] | 541 | |
---|
[9413] | 542 | \subsection{Detailed functionalities} |
---|
[4148] | 543 | |
---|
[10354] | 544 | The file \path{NEMOGCM/CONFIG/ORCA2_LIM/iodef_demo.xml} provides several examples of the use of |
---|
[9413] | 545 | the new functionalities offered by the XML interface of XIOS. |
---|
[4148] | 546 | |
---|
| 547 | \subsubsection{Define horizontal subdomains} |
---|
[9413] | 548 | |
---|
[10354] | 549 | Horizontal subdomains are defined through the attributs zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj of |
---|
[9413] | 550 | the tag family domain. |
---|
[11512] | 551 | It must therefore be done in the domain part of the XML file. |
---|
| 552 | For example, in \path{cfgs/SHARED/domain_def.xml}, we provide the following example of a definition of |
---|
[9413] | 553 | a 5 by 5 box with the bottom left corner at point (10,10). |
---|
| 554 | |
---|
[9392] | 555 | \begin{xmllines} |
---|
[11263] | 556 | <domain id="myzoomT" domain_ref="grid_T"> |
---|
| 557 | <zoom_domain ibegin="10" jbegin="10" ni="5" nj="5" /> |
---|
[9392] | 558 | \end{xmllines} |
---|
[9413] | 559 | |
---|
[10354] | 560 | The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. |
---|
[9413] | 561 | For example: |
---|
| 562 | |
---|
[9392] | 563 | \begin{xmllines} |
---|
[9413] | 564 | <file id="myfile_vzoom" output_freq="1d" > |
---|
[11263] | 565 | <field field_ref="toce" domain_ref="myzoomT"/> |
---|
[9413] | 566 | </file> |
---|
[9392] | 567 | \end{xmllines} |
---|
[9413] | 568 | |
---|
[11512] | 569 | Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain. |
---|
[10354] | 570 | The Equatorial section, the TAO, RAMA and PIRATA moorings are already registered in the code and |
---|
[9413] | 571 | can therefore be outputted without taking care of their (i,j) position in the grid. |
---|
| 572 | These predefined domains can be activated by the use of specific domain\_ref: |
---|
[10354] | 573 | ''EqT'', ''EqU'' or ''EqW'' for the equatorial sections and |
---|
| 574 | the mooring position for TAO, RAMA and PIRATA followed by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) |
---|
[9413] | 575 | |
---|
[9392] | 576 | \begin{xmllines} |
---|
[9413] | 577 | <file id="myfile_vzoom" output_freq="1d" > |
---|
| 578 | <field field_ref="toce" domain_ref="0n180wT"/> |
---|
| 579 | </file> |
---|
[9392] | 580 | \end{xmllines} |
---|
[4148] | 581 | |
---|
[11512] | 582 | Note that if the domain decomposition used in XIOS cuts the subdomain in several parts and if |
---|
| 583 | you use the ''multiple\_file'' type for your output files, |
---|
| 584 | you will endup with several files you will need to rebuild using unprovided tools (like ncpdq and ncrcat, |
---|
[9413] | 585 | \href{http://nco.sourceforge.net/nco.html#Concatenation}{see nco manual}). |
---|
| 586 | We are therefore advising to use the ''one\_file'' type in this case. |
---|
| 587 | |
---|
[4148] | 588 | \subsubsection{Define vertical zooms} |
---|
[9413] | 589 | |
---|
[11263] | 590 | Vertical zooms are defined through the attributs zoom\_begin and zoom\_n of the tag family axis. |
---|
[10354] | 591 | It must therefore be done in the axis part of the XML file. |
---|
[11263] | 592 | For example, in \path{cfgs/ORCA2_ICE_PISCES/EXPREF/iodef_demo.xml}, we provide the following example: |
---|
[9413] | 593 | |
---|
[9392] | 594 | \begin{xmllines} |
---|
[11263] | 595 | <axis_definition> |
---|
| 596 | <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" /> |
---|
| 597 | <axis id="deptht_zoom" azix_ref="deptht" > |
---|
| 598 | <zoom_axis zoom_begin="1" zoom_n="10" /> |
---|
| 599 | </axis> |
---|
[9392] | 600 | \end{xmllines} |
---|
[9413] | 601 | |
---|
[10354] | 602 | The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. |
---|
[9413] | 603 | For example: |
---|
| 604 | |
---|
[9392] | 605 | \begin{xmllines} |
---|
[9413] | 606 | <file id="myfile_hzoom" output_freq="1d" > |
---|
| 607 | <field field_ref="toce" axis_ref="deptht_myzoom"/> |
---|
| 608 | </file> |
---|
[9392] | 609 | \end{xmllines} |
---|
[4148] | 610 | |
---|
| 611 | \subsubsection{Control of the output file names} |
---|
| 612 | |
---|
[9413] | 613 | The output file names are defined by the attributs ''name'' and ''name\_suffix'' of the tag family file. |
---|
| 614 | For example: |
---|
| 615 | |
---|
[9392] | 616 | \begin{xmllines} |
---|
[11512] | 617 | <file_group id="1d" output_freq="1d" name="myfile_1d" > |
---|
[9413] | 618 | <file id="myfileA" name_suffix="_AAA" > <!-- will create file "myfile_1d_AAA" --> |
---|
| 619 | ... |
---|
| 620 | </file> |
---|
| 621 | <file id="myfileB" name_suffix="_BBB" > <!-- will create file "myfile_1d_BBB" --> |
---|
| 622 | ... |
---|
| 623 | </file> |
---|
| 624 | </file_group> |
---|
[9392] | 625 | \end{xmllines} |
---|
[2541] | 626 | |
---|
[10354] | 627 | However it is often very convienent to define the file name with the name of the experiment, |
---|
| 628 | the output file frequency and the date of the beginning and the end of the simulation |
---|
[9413] | 629 | (which are informations stored either in the namelist or in the XML file). |
---|
[10354] | 630 | To do so, we added the following rule: |
---|
| 631 | if the id of the tag file is ''fileN'' (where N = 1 to 999 on 1 to 3 digits) or |
---|
| 632 | one of the predefined sections or moorings (see next subsection), |
---|
| 633 | the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by: |
---|
[9413] | 634 | |
---|
[10414] | 635 | \begin{table} |
---|
| 636 | \scriptsize |
---|
| 637 | \begin{tabularx}{\textwidth}{|lX|} |
---|
| 638 | \hline |
---|
| 639 | \centering placeholder string & |
---|
| 640 | automatically replaced by \\ |
---|
| 641 | \hline |
---|
| 642 | \hline |
---|
| 643 | \centering @expname@ & |
---|
| 644 | the experiment name (from cn\_exp in the namelist) \\ |
---|
| 645 | \hline |
---|
| 646 | \centering @freq@ & |
---|
| 647 | output frequency (from attribute output\_freq) \\ |
---|
| 648 | \hline |
---|
| 649 | \centering @startdate@ & |
---|
| 650 | starting date of the simulation (from nn\_date0 in the restart or the namelist). |
---|
| 651 | \newline |
---|
| 652 | \verb?yyyymmdd? format \\ |
---|
| 653 | \hline |
---|
| 654 | \centering @startdatefull@ & |
---|
| 655 | starting date of the simulation (from nn\_date0 in the restart or the namelist). |
---|
| 656 | \newline |
---|
| 657 | \verb?yyyymmdd_hh:mm:ss? format \\ |
---|
| 658 | \hline |
---|
| 659 | \centering @enddate@ & |
---|
| 660 | ending date of the simulation (from nn\_date0 and nn\_itend in the namelist). |
---|
| 661 | \newline |
---|
| 662 | \verb?yyyymmdd? format \\ |
---|
| 663 | \hline |
---|
| 664 | \centering @enddatefull@ & |
---|
| 665 | ending date of the simulation (from nn\_date0 and nn\_itend in the namelist). |
---|
| 666 | \newline |
---|
| 667 | \verb?yyyymmdd_hh:mm:ss? format \\ |
---|
| 668 | \hline |
---|
| 669 | \end{tabularx} |
---|
[9413] | 670 | \end{table} |
---|
| 671 | |
---|
[11512] | 672 | \noindent For example, |
---|
[9413] | 673 | \xmlline|<file id="myfile_hzoom" name="myfile_@expname@_@startdate@_freq@freq@" output_freq="1d" >| |
---|
| 674 | |
---|
[4153] | 675 | \noindent with the namelist: |
---|
[9413] | 676 | \begin{forlines} |
---|
| 677 | cn_exp = "ORCA2" |
---|
| 678 | nn_date0 = 19891231 |
---|
| 679 | ln_rstart = .false. |
---|
| 680 | \end{forlines} |
---|
| 681 | |
---|
[10354] | 682 | \noindent will give the following file name radical: \ifile{myfile\_ORCA2\_19891231\_freq1d} |
---|
[4148] | 683 | |
---|
[11512] | 684 | \subsubsection{Other controls of the XML attributes from \NEMO} |
---|
[4148] | 685 | |
---|
[11512] | 686 | The values of some attributes are defined by subroutine calls within \NEMO |
---|
[10354] | 687 | (calls to iom\_set\_domain\_attr, iom\_set\_axis\_attr and iom\_set\_field\_attr in \mdl{iom}). |
---|
| 688 | Any definition given in the XML file will be overwritten. |
---|
| 689 | By convention, these attributes are defined to ''auto'' (for string) or ''0000'' (for integer) in the XML file |
---|
| 690 | (but this is not necessary). |
---|
| 691 | \\ |
---|
[4148] | 692 | |
---|
[10354] | 693 | Here is the list of these attributes: |
---|
| 694 | \\ |
---|
[2541] | 695 | |
---|
[10414] | 696 | \begin{table} |
---|
| 697 | \scriptsize |
---|
| 698 | \begin{tabularx}{\textwidth}{|X|c|c|c|} |
---|
| 699 | \hline |
---|
| 700 | tag ids affected by automatic definition of some of their attributes & |
---|
| 701 | name attribute & |
---|
| 702 | attribute value \\ |
---|
| 703 | \hline |
---|
| 704 | \hline |
---|
| 705 | field\_definition & |
---|
| 706 | freq\_op & |
---|
| 707 | \np{rn\_rdt} \\ |
---|
| 708 | \hline |
---|
| 709 | SBC & |
---|
| 710 | freq\_op & |
---|
| 711 | \np{rn\_rdt} $\times$ \np{nn\_fsbc} \\ |
---|
| 712 | \hline |
---|
| 713 | ptrc\_T & |
---|
| 714 | freq\_op & |
---|
| 715 | \np{rn\_rdt} $\times$ \np{nn\_dttrc} \\ |
---|
| 716 | \hline |
---|
| 717 | diad\_T & |
---|
| 718 | freq\_op & |
---|
| 719 | \np{rn\_rdt} $\times$ \np{nn\_dttrc} \\ |
---|
| 720 | \hline |
---|
| 721 | EqT, EqU, EqW & |
---|
| 722 | jbegin, ni, & |
---|
| 723 | according to the grid \\ |
---|
| 724 | & |
---|
| 725 | name\_suffix & |
---|
| 726 | \\ |
---|
| 727 | \hline |
---|
| 728 | TAO, RAMA and PIRATA moorings & |
---|
| 729 | zoom\_ibegin, zoom\_jbegin, & |
---|
| 730 | according to the grid \\ |
---|
| 731 | & |
---|
| 732 | name\_suffix & |
---|
| 733 | \\ |
---|
| 734 | \hline |
---|
| 735 | \end{tabularx} |
---|
[9413] | 736 | \end{table} |
---|
| 737 | |
---|
[5107] | 738 | \subsubsection{Advanced use of XIOS functionalities} |
---|
[2541] | 739 | |
---|
[4153] | 740 | \subsection{XML reference tables} |
---|
[9407] | 741 | \label{subsec:IOM_xmlref} |
---|
[4153] | 742 | |
---|
[9413] | 743 | \begin{enumerate} |
---|
[10354] | 744 | \item |
---|
| 745 | Simple computation: directly define the computation when refering to the variable in the file definition. |
---|
[5107] | 746 | |
---|
[9392] | 747 | \begin{xmllines} |
---|
[9413] | 748 | <field field_ref="sst" name="tosK" unit="degK" > sst + 273.15 </field> |
---|
| 749 | <field field_ref="taum" name="taum2" unit="N2/m4" long_name="square of wind stress module" > taum * taum </field> |
---|
| 750 | <field field_ref="qt" name="stupid_check" > qt - qsr - qns </field> |
---|
[9392] | 751 | \end{xmllines} |
---|
[5107] | 752 | |
---|
[10354] | 753 | \item |
---|
| 754 | Simple computation: define a new variable and use it in the file definition. |
---|
[5107] | 755 | |
---|
| 756 | in field\_definition: |
---|
[9413] | 757 | |
---|
[9392] | 758 | \begin{xmllines} |
---|
[9413] | 759 | <field id="sst2" long_name="square of sea surface temperature" unit="degC2" > sst * sst </field > |
---|
[9392] | 760 | \end{xmllines} |
---|
[9413] | 761 | |
---|
[5107] | 762 | in file\_definition: |
---|
[9413] | 763 | |
---|
[9392] | 764 | \begin{xmllines} |
---|
[9413] | 765 | <field field_ref="sst2" > sst2 </field> |
---|
[9392] | 766 | \end{xmllines} |
---|
[5107] | 767 | |
---|
[10354] | 768 | Note that in this case, the following syntaxe \xmlcode{<field field_ref="sst2" />} is not working as |
---|
[9413] | 769 | sst2 won't be evaluated. |
---|
[5107] | 770 | |
---|
[10354] | 771 | \item |
---|
| 772 | Change of variable precision: |
---|
[9413] | 773 | |
---|
[9392] | 774 | \begin{xmllines} |
---|
[9413] | 775 | <!-- force to keep real 8 --> |
---|
| 776 | <field field_ref="sst" name="tos_r8" prec="8" /> |
---|
| 777 | <!-- integer 2 with add_offset and scale_factor attributes --> |
---|
| 778 | <field field_ref="sss" name="sos_i2" prec="2" add_offset="20." scale_factor="1.e-3" /> |
---|
[9392] | 779 | \end{xmllines} |
---|
[5107] | 780 | |
---|
[11512] | 781 | Note that, then the code is crashing, writting real4 variables forces a numerical conversion from |
---|
[10354] | 782 | real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. |
---|
| 783 | Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. |
---|
[5107] | 784 | |
---|
[10354] | 785 | \item |
---|
| 786 | add user defined attributes: |
---|
[9413] | 787 | |
---|
[9392] | 788 | \begin{xmllines} |
---|
[11512] | 789 | <file_group id="1d" output_freq="1d" output_level="10" enabled=".true."> <!-- 1d files --> |
---|
[9393] | 790 | <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > |
---|
[9413] | 791 | <field field_ref="sst" name="tos" > |
---|
| 792 | <variable id="my_attribute1" type="string" > blabla </variable> |
---|
| 793 | <variable id="my_attribute2" type="integer" > 3 </variable> |
---|
| 794 | <variable id="my_attribute3" type="float" > 5.0 </variable> |
---|
| 795 | </field> |
---|
| 796 | <variable id="my_global_attribute" type="string" > blabla_global </variable> |
---|
| 797 | </file> |
---|
[11512] | 798 | </file_group> |
---|
[9392] | 799 | \end{xmllines} |
---|
[5107] | 800 | |
---|
[10354] | 801 | \item |
---|
| 802 | use of the ``@'' function: example 1, weighted temporal average |
---|
[5107] | 803 | |
---|
| 804 | - define a new variable in field\_definition |
---|
[9413] | 805 | |
---|
[9392] | 806 | \begin{xmllines} |
---|
[9413] | 807 | <field id="toce_e3t" long_name="temperature * e3t" unit="degC*m" grid_ref="grid_T_3D" >toce * e3t</field> |
---|
[9392] | 808 | \end{xmllines} |
---|
[9413] | 809 | |
---|
| 810 | - use it when defining your file. |
---|
| 811 | |
---|
[9392] | 812 | \begin{xmllines} |
---|
[11512] | 813 | <file_group id="5d" output_freq="5d" output_level="10" enabled=".true." > <!-- 5d files --> |
---|
[9413] | 814 | <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > |
---|
| 815 | <field field_ref="toce" operation="instant" freq_op="5d" > @toce_e3t / @e3t </field> |
---|
| 816 | </file> |
---|
[11512] | 817 | </file_group> |
---|
[9392] | 818 | \end{xmllines} |
---|
[5107] | 819 | |
---|
[9413] | 820 | The freq\_op="5d" attribute is used to define the operation frequency of the ``@'' function: here 5 day. |
---|
[10354] | 821 | The temporal operation done by the ``@'' is the one defined in the field definition: |
---|
[9413] | 822 | here we use the default, average. |
---|
| 823 | So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. |
---|
[10354] | 824 | Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': |
---|
| 825 | here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of |
---|
[9413] | 826 | the 2 mean values. |
---|
| 827 | field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. |
---|
| 828 | Note that in this case, freq\_op must be equal to the file output\_freq. |
---|
[5107] | 829 | |
---|
[10354] | 830 | \item |
---|
| 831 | use of the ``@'' function: example 2, monthly SSH standard deviation |
---|
[9413] | 832 | |
---|
[5107] | 833 | - define a new variable in field\_definition |
---|
[9413] | 834 | |
---|
[9392] | 835 | \begin{xmllines} |
---|
[9413] | 836 | <field id="ssh2" long_name="square of sea surface temperature" unit="degC2" > ssh * ssh </field > |
---|
[9392] | 837 | \end{xmllines} |
---|
[9413] | 838 | |
---|
| 839 | - use it when defining your file. |
---|
| 840 | |
---|
[9392] | 841 | \begin{xmllines} |
---|
[11512] | 842 | <file_group id="1m" output_freq="1m" output_level="10" enabled=".true." > <!-- 1m files --> |
---|
[9413] | 843 | <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > |
---|
[11512] | 844 | <field field_ref="ssh" name="sshstd" long_name="sea_surface_temperature_standard_deviation" |
---|
[9413] | 845 | operation="instant" freq_op="1m" > |
---|
| 846 | sqrt( @ssh2 - @ssh * @ssh ) |
---|
| 847 | </field> |
---|
| 848 | </file> |
---|
[11512] | 849 | </file_group> |
---|
[9392] | 850 | \end{xmllines} |
---|
[5107] | 851 | |
---|
[9413] | 852 | The freq\_op="1m" attribute is used to define the operation frequency of the ``@'' function: here 1 month. |
---|
[10354] | 853 | The temporal operation done by the ``@'' is the one defined in the field definition: |
---|
[9413] | 854 | here we use the default, average. |
---|
| 855 | So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. |
---|
[11512] | 856 | Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'': |
---|
[9413] | 857 | here the temporal average is alreday done by the ``@'' function so we just use instant. |
---|
| 858 | field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. |
---|
| 859 | Note that in this case, freq\_op must be equal to the file output\_freq. |
---|
[5107] | 860 | |
---|
[10354] | 861 | \item |
---|
| 862 | use of the ``@'' function: example 3, monthly average of SST diurnal cycle |
---|
[9413] | 863 | |
---|
[5107] | 864 | - define 2 new variables in field\_definition |
---|
[9413] | 865 | |
---|
[9392] | 866 | \begin{xmllines} |
---|
[9413] | 867 | <field id="sstmax" field_ref="sst" long_name="max of sea surface temperature" operation="maximum" /> |
---|
| 868 | <field id="sstmin" field_ref="sst" long_name="min of sea surface temperature" operation="minimum" /> |
---|
[9392] | 869 | \end{xmllines} |
---|
[9413] | 870 | |
---|
| 871 | - use these 2 new variables when defining your file. |
---|
| 872 | |
---|
[9392] | 873 | \begin{xmllines} |
---|
[11512] | 874 | <file_group id="1m" output_freq="1m" output_level="10" enabled=".true." > <!-- 1m files --> |
---|
[9413] | 875 | <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" > |
---|
| 876 | <field field_ref="sst" name="sstdcy" long_name="amplitude of sst diurnal cycle" operation="average" freq_op="1d" > |
---|
| 877 | @sstmax - @sstmin |
---|
| 878 | </field> |
---|
| 879 | </file> |
---|
[11512] | 880 | </file_group> |
---|
[9392] | 881 | \end{xmllines} |
---|
[5107] | 882 | |
---|
[9413] | 883 | \end{enumerate} |
---|
[5107] | 884 | |
---|
[9413] | 885 | The freq\_op="1d" attribute is used to define the operation frequency of the ``@'' function: here 1 day. |
---|
[10354] | 886 | The temporal operation done by the ``@'' is the one defined in the field definition: |
---|
| 887 | here maximum for sstmax and minimum for sstmin. |
---|
[9413] | 888 | So, in the above case, @sstmax will do the daily max and @sstmin the daily min. |
---|
[10354] | 889 | Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': |
---|
[9413] | 890 | here monthly mean (of daily max - daily min of the sst). |
---|
| 891 | field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. |
---|
[5107] | 892 | |
---|
[9413] | 893 | \subsubsection{Tag list per family} |
---|
[2541] | 894 | |
---|
[10414] | 895 | \begin{table} |
---|
| 896 | \scriptsize |
---|
| 897 | \begin{tabularx}{\textwidth}{|l|X|X|l|X|} |
---|
| 898 | \hline |
---|
| 899 | tag name & |
---|
| 900 | description & |
---|
| 901 | accepted attribute & |
---|
| 902 | child of & |
---|
| 903 | parent of \\ |
---|
| 904 | \hline |
---|
| 905 | \hline |
---|
| 906 | simulation & |
---|
| 907 | this tag is the root tag which encapsulates all the content of the XML file & |
---|
| 908 | none & |
---|
| 909 | none & |
---|
| 910 | context \\ |
---|
| 911 | \hline |
---|
| 912 | context & |
---|
| 913 | encapsulates parts of the XML file dedicated to different codes or different parts of a code & |
---|
| 914 | id (''xios'', ''nemo'' or ''n\_nemo'' for the nth AGRIF zoom), src, time\_origin & |
---|
| 915 | simulation & |
---|
| 916 | all root tags: ... \_definition \\ |
---|
| 917 | \hline |
---|
| 918 | \end{tabularx} |
---|
| 919 | \caption{Context tags} |
---|
[9413] | 920 | \end{table} |
---|
[2541] | 921 | |
---|
[10414] | 922 | \begin{table} |
---|
| 923 | \scriptsize |
---|
| 924 | \begin{tabularx}{\textwidth}{|l|X|X|X|l|} |
---|
| 925 | \hline |
---|
| 926 | tag name & |
---|
| 927 | description & |
---|
| 928 | accepted attribute & |
---|
| 929 | child of & |
---|
| 930 | parent of \\ |
---|
| 931 | \hline |
---|
| 932 | \hline |
---|
| 933 | field\_definition & |
---|
| 934 | encapsulates the definition of all the fields that can potentially be outputted & |
---|
| 935 | axis\_ref, default\_value, domain\_ref, enabled, grid\_ref, level, operation, prec, src & |
---|
| 936 | context & |
---|
| 937 | field or field\_group \\ |
---|
| 938 | \hline |
---|
| 939 | field\_group & |
---|
| 940 | encapsulates a group of fields & |
---|
| 941 | axis\_ref, default\_value, domain\_ref, enabled, group\_ref, grid\_ref, |
---|
| 942 | id, level, operation, prec, src & |
---|
| 943 | field\_definition, field\_group, file & |
---|
| 944 | field or field\_group \\ |
---|
| 945 | \hline |
---|
| 946 | field & |
---|
| 947 | define a specific field & |
---|
| 948 | axis\_ref, default\_value, domain\_ref, enabled, field\_ref, grid\_ref, |
---|
| 949 | id, level, long\_name, name, operation, prec, standard\_name, unit & |
---|
| 950 | field\_definition, field\_group, file & |
---|
| 951 | none \\ |
---|
| 952 | \hline |
---|
| 953 | \end{tabularx} |
---|
[11263] | 954 | \caption{Field tags ("\ttfamily{field\_*}")} |
---|
[9413] | 955 | \end{table} |
---|
[2541] | 956 | |
---|
[10414] | 957 | \begin{table} |
---|
| 958 | \scriptsize |
---|
| 959 | \begin{tabularx}{\textwidth}{|l|X|X|X|l|} |
---|
| 960 | \hline |
---|
| 961 | tag name & |
---|
| 962 | description & |
---|
| 963 | accepted attribute & |
---|
| 964 | child of & |
---|
| 965 | parent of \\ |
---|
| 966 | \hline |
---|
| 967 | \hline |
---|
| 968 | file\_definition & |
---|
| 969 | encapsulates the definition of all the files that will be outputted & |
---|
| 970 | enabled, min\_digits, name, name\_suffix, output\_level, |
---|
| 971 | split\_freq\_format, split\_freq, sync\_freq, type, src & |
---|
| 972 | context & |
---|
| 973 | file or file\_group \\ |
---|
| 974 | \hline |
---|
| 975 | file\_group & |
---|
| 976 | encapsulates a group of files that will be outputted & |
---|
| 977 | enabled, description, id, min\_digits, name, name\_suffix, output\_freq, output\_level, |
---|
| 978 | split\_freq\_format, split\_freq, sync\_freq, type, src & |
---|
| 979 | file\_definition, file\_group & |
---|
| 980 | file or file\_group \\ |
---|
| 981 | \hline |
---|
| 982 | file & |
---|
| 983 | define the contents of a file to be outputted & |
---|
| 984 | enabled, description, id, min\_digits, name, name\_suffix, output\_freq, output\_level, |
---|
| 985 | split\_freq\_format, split\_freq, sync\_freq, type, src & |
---|
| 986 | file\_definition, file\_group & |
---|
| 987 | field \\ |
---|
| 988 | \hline |
---|
| 989 | \end{tabularx} |
---|
[11263] | 990 | \caption{File tags ("\ttfamily{file\_*}")} |
---|
[9413] | 991 | \end{table} |
---|
[2541] | 992 | |
---|
[10414] | 993 | \begin{table} |
---|
| 994 | \scriptsize |
---|
| 995 | \begin{tabularx}{\textwidth}{|l|X|X|X|X|} |
---|
| 996 | \hline |
---|
| 997 | tag name & |
---|
| 998 | description & |
---|
| 999 | accepted attribute & |
---|
| 1000 | child of & |
---|
| 1001 | parent of \\ |
---|
| 1002 | \hline |
---|
| 1003 | \hline |
---|
| 1004 | axis\_definition & |
---|
| 1005 | define all the vertical axis potentially used by the variables & |
---|
| 1006 | src & |
---|
| 1007 | context & |
---|
| 1008 | axis\_group, axis \\ |
---|
| 1009 | \hline |
---|
| 1010 | axis\_group & |
---|
| 1011 | encapsulates a group of vertical axis & |
---|
| 1012 | id, lon\_name, positive, src, standard\_name, unit, zoom\_begin, zoom\_end, zoom\_size & |
---|
| 1013 | axis\_definition, axis\_group & |
---|
| 1014 | axis\_group, axis \\ |
---|
| 1015 | \hline |
---|
| 1016 | axis & |
---|
| 1017 | define a vertical axis & |
---|
| 1018 | id, lon\_name, positive, src, standard\_name, unit, zoom\_begin, zoom\_end, zoom\_size & |
---|
| 1019 | axis\_definition, axis\_group & |
---|
| 1020 | none \\ |
---|
| 1021 | \hline |
---|
| 1022 | \end{tabularx} |
---|
[11263] | 1023 | \caption{Axis tags ("\ttfamily{axis\_*}")} |
---|
[9413] | 1024 | \end{table} |
---|
[2541] | 1025 | |
---|
[10414] | 1026 | \begin{table} |
---|
| 1027 | \scriptsize |
---|
| 1028 | \begin{tabularx}{\textwidth}{|l|X|X|X|X|} |
---|
| 1029 | \hline |
---|
| 1030 | tag name & |
---|
| 1031 | description & |
---|
| 1032 | accepted attribute & |
---|
| 1033 | child of & |
---|
| 1034 | parent of \\ |
---|
| 1035 | \hline |
---|
| 1036 | \hline |
---|
| 1037 | domain\_\-definition & |
---|
| 1038 | define all the horizontal domains potentially used by the variables & |
---|
| 1039 | src & |
---|
| 1040 | context & |
---|
| 1041 | domain\_\-group, domain \\ |
---|
| 1042 | \hline |
---|
| 1043 | domain\_group & |
---|
| 1044 | encapsulates a group of horizontal domains & |
---|
| 1045 | id, lon\_name, src, zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj & |
---|
| 1046 | domain\_\-definition, domain\_group & |
---|
| 1047 | domain\_\-group, domain \\ |
---|
| 1048 | \hline |
---|
| 1049 | domain & |
---|
| 1050 | define an horizontal domain & |
---|
| 1051 | id, lon\_name, src, zoom\_ibegin, zoom\_jbegin, zoom\_ni, zoom\_nj & |
---|
| 1052 | domain\_\-definition, domain\_group & |
---|
| 1053 | none \\ |
---|
| 1054 | \hline |
---|
| 1055 | \end{tabularx} |
---|
[11263] | 1056 | \caption{Domain tags ("\ttfamily{domain\_*)}"} |
---|
[9413] | 1057 | \end{table} |
---|
| 1058 | |
---|
[10414] | 1059 | \begin{table} |
---|
| 1060 | \scriptsize |
---|
| 1061 | \begin{tabularx}{\textwidth}{|l|X|X|X|X|} |
---|
| 1062 | \hline |
---|
| 1063 | tag name & |
---|
| 1064 | description & |
---|
| 1065 | accepted attribute & |
---|
| 1066 | child of & |
---|
| 1067 | parent of \\ |
---|
| 1068 | \hline |
---|
| 1069 | \hline |
---|
| 1070 | grid\_definition & |
---|
| 1071 | define all the grid (association of a domain and/or an axis) potentially used by the variables & |
---|
| 1072 | src & |
---|
| 1073 | context & |
---|
| 1074 | grid\_group, grid \\ |
---|
| 1075 | \hline |
---|
| 1076 | grid\_group & |
---|
| 1077 | encapsulates a group of grids & |
---|
| 1078 | id, domain\_ref,axis\_ref & |
---|
| 1079 | grid\_definition, grid\_group & |
---|
| 1080 | grid\_group, grid \\ |
---|
| 1081 | \hline |
---|
| 1082 | grid & |
---|
| 1083 | define a grid & |
---|
| 1084 | id, domain\_ref,axis\_ref & |
---|
| 1085 | grid\_definition, grid\_group & |
---|
| 1086 | none \\ |
---|
| 1087 | \hline |
---|
| 1088 | \end{tabularx} |
---|
[11263] | 1089 | \caption{Grid tags ("\ttfamily{grid\_*}")} |
---|
[9413] | 1090 | \end{table} |
---|
| 1091 | |
---|
| 1092 | \subsubsection{Attributes list per family} |
---|
| 1093 | |
---|
[10414] | 1094 | \begin{table} |
---|
| 1095 | \scriptsize |
---|
| 1096 | \begin{tabularx}{\textwidth}{|l|X|l|l|} |
---|
| 1097 | \hline |
---|
| 1098 | attribute name & |
---|
| 1099 | description & |
---|
| 1100 | example & |
---|
| 1101 | accepted by \\ |
---|
| 1102 | \hline |
---|
| 1103 | \hline |
---|
| 1104 | axis\_ref & |
---|
| 1105 | refers to the id of a vertical axis & |
---|
| 1106 | axis\_ref="deptht" & |
---|
| 1107 | field, grid families \\ |
---|
| 1108 | \hline |
---|
| 1109 | domain\_ref & |
---|
| 1110 | refers to the id of a domain & |
---|
| 1111 | domain\_ref="grid\_T" & |
---|
| 1112 | field or grid families \\ |
---|
| 1113 | \hline |
---|
| 1114 | field\_ref & |
---|
| 1115 | id of the field we want to add in a file & |
---|
| 1116 | field\_ref="toce" & |
---|
| 1117 | field \\ |
---|
| 1118 | \hline |
---|
| 1119 | grid\_ref & |
---|
| 1120 | refers to the id of a grid & |
---|
| 1121 | grid\_ref="grid\_T\_2D" & |
---|
| 1122 | field family \\ |
---|
| 1123 | \hline |
---|
| 1124 | group\_ref & |
---|
| 1125 | refer to a group of variables & |
---|
| 1126 | group\_ref="mooring" & |
---|
| 1127 | field\_group \\ |
---|
| 1128 | \hline |
---|
| 1129 | \end{tabularx} |
---|
[11263] | 1130 | \caption{Reference attributes ("\ttfamily{*\_ref}")} |
---|
[9413] | 1131 | \end{table} |
---|
| 1132 | |
---|
[10414] | 1133 | \begin{table} |
---|
| 1134 | \scriptsize |
---|
| 1135 | \begin{tabularx}{\textwidth}{|l|X|l|l|} |
---|
| 1136 | \hline |
---|
| 1137 | attribute name & |
---|
| 1138 | description & |
---|
| 1139 | example & |
---|
| 1140 | accepted by \\ |
---|
| 1141 | \hline |
---|
| 1142 | \hline |
---|
| 1143 | zoom\_ibegin & |
---|
| 1144 | starting point along x direction of the zoom. |
---|
| 1145 | Automatically defined for TAO/RAMA/PIRATA moorings & |
---|
| 1146 | zoom\_ibegin="1" & |
---|
| 1147 | domain family \\ |
---|
| 1148 | \hline |
---|
| 1149 | zoom\_jbegin & |
---|
| 1150 | starting point along y direction of the zoom. |
---|
| 1151 | Automatically defined for TAO/RAMA/PIRATA moorings & |
---|
| 1152 | zoom\_jbegin="1" & |
---|
| 1153 | domain family \\ |
---|
| 1154 | \hline |
---|
| 1155 | zoom\_ni & |
---|
| 1156 | zoom extent along x direction & |
---|
| 1157 | zoom\_ni="1" & |
---|
| 1158 | domain family \\ |
---|
| 1159 | \hline |
---|
| 1160 | zoom\_nj & |
---|
| 1161 | zoom extent along y direction & |
---|
| 1162 | zoom\_nj="1" & |
---|
| 1163 | domain family \\ |
---|
| 1164 | \hline |
---|
| 1165 | \end{tabularx} |
---|
[11263] | 1166 | \caption{Domain attributes ("\ttfamily{zoom\_*}")} |
---|
[9413] | 1167 | \end{table} |
---|
| 1168 | |
---|
[10414] | 1169 | \begin{table} |
---|
| 1170 | \scriptsize |
---|
| 1171 | \begin{tabularx}{\textwidth}{|l|X|l|l|} |
---|
| 1172 | \hline |
---|
| 1173 | attribute name & |
---|
| 1174 | description & |
---|
| 1175 | example & |
---|
| 1176 | accepted by \\ |
---|
| 1177 | \hline |
---|
| 1178 | \hline |
---|
| 1179 | min\_digits & |
---|
| 1180 | specify the minimum of digits used in the core number in the name of the NetCDF file & |
---|
| 1181 | min\_digits="4" & |
---|
| 1182 | file family \\ |
---|
| 1183 | \hline |
---|
| 1184 | name\_suffix & |
---|
| 1185 | suffix to be inserted after the name and before the cpu number and the ''.nc'' termination of a file & |
---|
| 1186 | name\_suffix="\_myzoom" & |
---|
| 1187 | file family \\ |
---|
| 1188 | \hline |
---|
| 1189 | output\_level & |
---|
| 1190 | output priority of variables in a file: 0 (high) to 10 (low). |
---|
| 1191 | All variables listed in the file with a level smaller or equal to output\_level will be output. |
---|
| 1192 | Other variables won't be output even if they are listed in the file. & |
---|
| 1193 | output\_level="10" & |
---|
| 1194 | file family \\ |
---|
| 1195 | \hline |
---|
| 1196 | split\_freq & |
---|
| 1197 | frequency at which to temporally split output files. |
---|
| 1198 | Units can be ts (timestep), y, mo, d, h, mi, s. |
---|
| 1199 | Useful for long runs to prevent over-sized output files. & |
---|
| 1200 | split\_freq="1mo" & |
---|
| 1201 | file family \\ |
---|
| 1202 | \hline |
---|
| 1203 | split\_freq\-\_format & |
---|
| 1204 | date format used in the name of temporally split output files. |
---|
| 1205 | Can be specified using the following syntaxes: \%y, \%mo, \%d, \%h \%mi and \%s & |
---|
| 1206 | split\_freq\_format= "\%y\%mo\%d" & |
---|
| 1207 | file family \\ |
---|
| 1208 | \hline |
---|
| 1209 | sync\_freq & |
---|
| 1210 | NetCDF file synchronization frequency (update of the time\_counter). |
---|
| 1211 | Units can be ts (timestep), y, mo, d, h, mi, s. & |
---|
| 1212 | sync\_freq="10d" & |
---|
| 1213 | file family \\ |
---|
| 1214 | \hline |
---|
| 1215 | type (1) & |
---|
| 1216 | specify if the output files are to be split spatially (multiple\_file) or not (one\_file) & |
---|
| 1217 | type="multiple\_file" & |
---|
| 1218 | file familly \\ |
---|
| 1219 | \hline |
---|
| 1220 | \end{tabularx} |
---|
| 1221 | \caption{File attributes} |
---|
[9413] | 1222 | \end{table} |
---|
| 1223 | |
---|
[10414] | 1224 | \begin{table} |
---|
| 1225 | \scriptsize |
---|
| 1226 | \begin{tabularx}{\textwidth}{|l|X|l|l|} |
---|
| 1227 | \hline |
---|
| 1228 | attribute name & |
---|
| 1229 | description & |
---|
| 1230 | example & |
---|
| 1231 | accepted by \\ |
---|
| 1232 | \hline |
---|
| 1233 | \hline |
---|
| 1234 | default\_value & |
---|
| 1235 | missing\_value definition & |
---|
| 1236 | default\_value="1.e20" & |
---|
| 1237 | field family \\ |
---|
| 1238 | \hline |
---|
| 1239 | level & |
---|
| 1240 | output priority of a field: 0 (high) to 10 (low) & |
---|
| 1241 | level="1" & |
---|
| 1242 | field family \\ |
---|
| 1243 | \hline |
---|
| 1244 | operation & |
---|
| 1245 | type of temporal operation: average, accumulate, instantaneous, min, max and once & |
---|
| 1246 | operation="average" & |
---|
| 1247 | field family \\ |
---|
| 1248 | \hline |
---|
| 1249 | output\_freq & |
---|
| 1250 | operation frequency. units can be ts (timestep), y, mo, d, h, mi, s. & |
---|
| 1251 | output\_freq="1d12h" & |
---|
| 1252 | field family \\ |
---|
| 1253 | \hline |
---|
| 1254 | prec & |
---|
| 1255 | output precision: real 4 or real 8 & |
---|
| 1256 | prec="4" & |
---|
| 1257 | field family \\ |
---|
| 1258 | \hline |
---|
| 1259 | long\_name & |
---|
| 1260 | define the long\_name attribute in the NetCDF file & |
---|
| 1261 | long\_name="Vertical T levels" & |
---|
| 1262 | field \\ |
---|
| 1263 | \hline |
---|
| 1264 | standard\_name & |
---|
| 1265 | define the standard\_name attribute in the NetCDF file & |
---|
| 1266 | standard\_name= "Eastward\_Sea\_Ice\_Transport" & |
---|
| 1267 | field \\ |
---|
| 1268 | \hline |
---|
| 1269 | \end{tabularx} |
---|
| 1270 | \caption{Field attributes} |
---|
[9413] | 1271 | \end{table} |
---|
| 1272 | |
---|
[10414] | 1273 | \begin{table} |
---|
| 1274 | \scriptsize |
---|
| 1275 | \begin{tabularx}{\textwidth}{|l|X|X|X|} |
---|
| 1276 | \hline |
---|
| 1277 | attribute name & |
---|
| 1278 | description & |
---|
| 1279 | example & |
---|
| 1280 | accepted by \\ |
---|
| 1281 | \hline |
---|
| 1282 | \hline |
---|
| 1283 | enabled & |
---|
| 1284 | switch on/off the output of a field or a file & |
---|
| 1285 | enabled=".true." & |
---|
| 1286 | field, file families \\ |
---|
| 1287 | \hline |
---|
| 1288 | description & |
---|
| 1289 | just for information, not used & |
---|
| 1290 | description="ocean T grid variables" & |
---|
| 1291 | all tags \\ |
---|
| 1292 | \hline |
---|
| 1293 | id & |
---|
| 1294 | allow to identify a tag & |
---|
| 1295 | id="nemo" & |
---|
| 1296 | accepted by all tags except simulation \\ |
---|
| 1297 | \hline |
---|
| 1298 | name & |
---|
| 1299 | name of a variable or a file. If the name of a file is undefined, its id is used as a name & |
---|
| 1300 | name="tos" & |
---|
| 1301 | field or file families \\ |
---|
| 1302 | \hline |
---|
| 1303 | positive & |
---|
| 1304 | convention used for the orientation of vertival axis (positive downward in \NEMO). & |
---|
| 1305 | positive="down" & |
---|
| 1306 | axis family \\ |
---|
| 1307 | \hline |
---|
| 1308 | src & |
---|
| 1309 | allow to include a file & |
---|
| 1310 | src="./field\_def.xml" & |
---|
| 1311 | accepted by all tags except simulation \\ |
---|
| 1312 | \hline |
---|
| 1313 | time\_origin & |
---|
| 1314 | specify the origin of the time counter & |
---|
| 1315 | time\_origin="1900-01-01 00:00:00" & |
---|
| 1316 | context \\ |
---|
| 1317 | \hline |
---|
| 1318 | type (2) & |
---|
| 1319 | define the type of a variable tag & |
---|
| 1320 | type="boolean" & |
---|
| 1321 | variable \\ |
---|
| 1322 | \hline |
---|
| 1323 | unit & |
---|
| 1324 | unit of a variable or the vertical axis & |
---|
| 1325 | unit="m" & |
---|
| 1326 | field and axis families \\ |
---|
| 1327 | \hline |
---|
| 1328 | \end{tabularx} |
---|
| 1329 | \caption{Miscellaneous attributes} |
---|
[9413] | 1330 | \end{table} |
---|
| 1331 | |
---|
[5515] | 1332 | \subsection{CF metadata standard compliance} |
---|
[2541] | 1333 | |
---|
[11512] | 1334 | Output from the XIOS IO server is compliant with |
---|
[10354] | 1335 | \href{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html}{version 1.5} of |
---|
[11512] | 1336 | the CF metadata standard. |
---|
[10354] | 1337 | Therefore while a user may wish to add their own metadata to the output files (as demonstrated in example 4 of |
---|
| 1338 | section \autoref{subsec:IOM_xmlref}) the metadata should, for the most part, comply with the CF-1.5 standard. |
---|
[2541] | 1339 | |
---|
[10354] | 1340 | Some metadata that may significantly increase the file size (horizontal cell areas and vertices) are controlled by |
---|
[11512] | 1341 | the namelist parameter \np{ln\_cfmeta} in the \nam{run} namelist. |
---|
[9413] | 1342 | This must be set to true if these metadata are to be included in the output files. |
---|
[5515] | 1343 | |
---|
| 1344 | |
---|
[2541] | 1345 | % ================================================================ |
---|
| 1346 | % NetCDF4 support |
---|
| 1347 | % ================================================================ |
---|
[11263] | 1348 | \section[NetCDF4 support (\texttt{\textbf{key\_netcdf4}})] |
---|
| 1349 | {NetCDF4 support (\protect\key{netcdf4})} |
---|
[9413] | 1350 | \label{sec:DIA_nc4} |
---|
[2541] | 1351 | |
---|
[9413] | 1352 | Since version 3.3, support for NetCDF4 chunking and (loss-less) compression has been included. |
---|
[10354] | 1353 | These options build on the standard NetCDF output and allow the user control over the size of the chunks via |
---|
| 1354 | namelist settings. |
---|
[9413] | 1355 | Chunking and compression can lead to significant reductions in file sizes for a small runtime overhead. |
---|
[10354] | 1356 | For a fuller discussion on chunking and other performance issues the reader is referred to |
---|
[11263] | 1357 | the NetCDF4 documentation found \href{https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_perf_chunking.html}{here}. |
---|
[2541] | 1358 | |
---|
[10354] | 1359 | The new features are only available when the code has been linked with a NetCDF4 library |
---|
| 1360 | (version 4.1 onwards, recommended) which has been built with HDF5 support (version 1.8.4 onwards, recommended). |
---|
| 1361 | Datasets created with chunking and compression are not backwards compatible with NetCDF3 "classic" format but |
---|
| 1362 | most analysis codes can be relinked simply with the new libraries and will then read both NetCDF3 and NetCDF4 files. |
---|
[11512] | 1363 | \NEMO\ executables linked with NetCDF4 libraries can be made to produce NetCDF3 files by |
---|
| 1364 | setting the \np{ln\_nc4zip} logical to false in the \nam{nc4} namelist: |
---|
[2541] | 1365 | |
---|
| 1366 | %------------------------------------------namnc4---------------------------------------------------- |
---|
[10146] | 1367 | |
---|
| 1368 | \nlst{namnc4} |
---|
[2541] | 1369 | %------------------------------------------------------------------------------------------------------------- |
---|
| 1370 | |
---|
[9413] | 1371 | If \key{netcdf4} has not been defined, these namelist parameters are not read. |
---|
[10354] | 1372 | In this case, \np{ln\_nc4zip} is set false and dummy routines for a few NetCDF4-specific functions are defined. |
---|
| 1373 | These functions will not be used but need to be included so that compilation is possible with NetCDF3 libraries. |
---|
[2541] | 1374 | |
---|
[10354] | 1375 | When using NetCDF4 libraries, \key{netcdf4} should be defined even if the intention is to |
---|
[9413] | 1376 | create only NetCDF3-compatible files. |
---|
[10354] | 1377 | This is necessary to avoid duplication between the dummy routines and the actual routines present in the library. |
---|
[9413] | 1378 | Most compilers will fail at compile time when faced with such duplication. |
---|
[10354] | 1379 | Thus when linking with NetCDF4 libraries the user must define \key{netcdf4} and |
---|
[9413] | 1380 | control the type of NetCDF file produced via the namelist parameter. |
---|
[2541] | 1381 | |
---|
[10354] | 1382 | Chunking and compression is applied only to 4D fields and |
---|
| 1383 | there is no advantage in chunking across more than one time dimension since |
---|
| 1384 | previously written chunks would have to be read back and decompressed before being added to. |
---|
[9413] | 1385 | Therefore, user control over chunk sizes is provided only for the three space dimensions. |
---|
| 1386 | The user sets an approximate number of chunks along each spatial axis. |
---|
[10354] | 1387 | The actual size of the chunks will depend on global domain size for mono-processors or, more likely, |
---|
| 1388 | the local processor domain size for distributed processing. |
---|
| 1389 | The derived values are subject to practical minimum values (to avoid wastefully small chunk sizes) and |
---|
[9413] | 1390 | cannot be greater than the domain size in any dimension. |
---|
| 1391 | The algorithm used is: |
---|
[2541] | 1392 | |
---|
[9388] | 1393 | \begin{forlines} |
---|
[9413] | 1394 | ichunksz(1) = MIN(idomain_size, MAX((idomain_size-1) / nn_nchunks_i + 1 ,16 )) |
---|
| 1395 | ichunksz(2) = MIN(jdomain_size, MAX((jdomain_size-1) / nn_nchunks_j + 1 ,16 )) |
---|
| 1396 | ichunksz(3) = MIN(kdomain_size, MAX((kdomain_size-1) / nn_nchunks_k + 1 , 1 )) |
---|
| 1397 | ichunksz(4) = 1 |
---|
[9388] | 1398 | \end{forlines} |
---|
[2541] | 1399 | |
---|
| 1400 | \noindent As an example, setting: |
---|
[9413] | 1401 | |
---|
[9388] | 1402 | \begin{forlines} |
---|
[9413] | 1403 | nn_nchunks_i=4, nn_nchunks_j=4 and nn_nchunks_k=31 |
---|
[9388] | 1404 | \end{forlines} |
---|
[2541] | 1405 | |
---|
[11263] | 1406 | \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\ttfamily 46x38x1} respectively in |
---|
[11512] | 1407 | the mono-processor case (\ie\ global domain of {\small\ttfamily 182x149x31}). |
---|
| 1408 | An illustration of the potential space savings that NetCDF4 chunking and compression provides is given in |
---|
[10354] | 1409 | table \autoref{tab:NC4} which compares the results of two short runs of the ORCA2\_LIM reference configuration with |
---|
| 1410 | a 4x2 mpi partitioning. |
---|
| 1411 | Note the variation in the compression ratio achieved which reflects chiefly the dry to wet volume ratio of |
---|
| 1412 | each processing region. |
---|
[2541] | 1413 | |
---|
| 1414 | %------------------------------------------TABLE---------------------------------------------------- |
---|
[10414] | 1415 | \begin{table} |
---|
| 1416 | \scriptsize |
---|
| 1417 | \centering |
---|
| 1418 | \begin{tabular}{lrrr} |
---|
| 1419 | Filename & NetCDF3 & NetCDF4 & Reduction \\ |
---|
| 1420 | & filesize & filesize & \% \\ |
---|
| 1421 | & (KB) & (KB) & \\ |
---|
| 1422 | ORCA2\_restart\_0000.nc & 16420 & 8860 & 47\% \\ |
---|
| 1423 | ORCA2\_restart\_0001.nc & 16064 & 11456 & 29\% \\ |
---|
| 1424 | ORCA2\_restart\_0002.nc & 16064 & 9744 & 40\% \\ |
---|
| 1425 | ORCA2\_restart\_0003.nc & 16420 & 9404 & 43\% \\ |
---|
| 1426 | ORCA2\_restart\_0004.nc & 16200 & 5844 & 64\% \\ |
---|
| 1427 | ORCA2\_restart\_0005.nc & 15848 & 8172 & 49\% \\ |
---|
| 1428 | ORCA2\_restart\_0006.nc & 15848 & 8012 & 50\% \\ |
---|
| 1429 | ORCA2\_restart\_0007.nc & 16200 & 5148 & 69\% \\ |
---|
| 1430 | ORCA2\_2d\_grid\_T\_0000.nc & 2200 & 1504 & 32\% \\ |
---|
| 1431 | ORCA2\_2d\_grid\_T\_0001.nc & 2200 & 1748 & 21\% \\ |
---|
| 1432 | ORCA2\_2d\_grid\_T\_0002.nc & 2200 & 1592 & 28\% \\ |
---|
| 1433 | ORCA2\_2d\_grid\_T\_0003.nc & 2200 & 1540 & 30\% \\ |
---|
| 1434 | ORCA2\_2d\_grid\_T\_0004.nc & 2200 & 1204 & 46\% \\ |
---|
| 1435 | ORCA2\_2d\_grid\_T\_0005.nc & 2200 & 1444 & 35\% \\ |
---|
| 1436 | ORCA2\_2d\_grid\_T\_0006.nc & 2200 & 1428 & 36\% \\ |
---|
| 1437 | ORCA2\_2d\_grid\_T\_0007.nc & 2200 & 1148 & 48\% \\ |
---|
| 1438 | ... & ... & ... & ... \\ |
---|
| 1439 | ORCA2\_2d\_grid\_W\_0000.nc & 4416 & 2240 & 50\% \\ |
---|
| 1440 | ORCA2\_2d\_grid\_W\_0001.nc & 4416 & 2924 & 34\% \\ |
---|
| 1441 | ORCA2\_2d\_grid\_W\_0002.nc & 4416 & 2512 & 44\% \\ |
---|
| 1442 | ORCA2\_2d\_grid\_W\_0003.nc & 4416 & 2368 & 47\% \\ |
---|
| 1443 | ORCA2\_2d\_grid\_W\_0004.nc & 4416 & 1432 & 68\% \\ |
---|
| 1444 | ORCA2\_2d\_grid\_W\_0005.nc & 4416 & 1972 & 56\% \\ |
---|
| 1445 | ORCA2\_2d\_grid\_W\_0006.nc & 4416 & 2028 & 55\% \\ |
---|
| 1446 | ORCA2\_2d\_grid\_W\_0007.nc & 4416 & 1368 & 70\% \\ |
---|
| 1447 | \end{tabular} |
---|
| 1448 | \caption{ |
---|
| 1449 | \protect\label{tab:NC4} |
---|
| 1450 | Filesize comparison between NetCDF3 and NetCDF4 with chunking and compression |
---|
| 1451 | } |
---|
[2541] | 1452 | \end{table} |
---|
| 1453 | %---------------------------------------------------------------------------------------------------- |
---|
| 1454 | |
---|
[10354] | 1455 | When \key{iomput} is activated with \key{netcdf4} chunking and compression parameters for fields produced via |
---|
[11512] | 1456 | \rou{iom\_put} calls are set via an equivalent and identically named namelist to \nam{nc4} in |
---|
| 1457 | \textit{xmlio\_server.def}. |
---|
| 1458 | Typically this namelist serves the mean files whilst the \nam{nc4} in the main namelist file continues to |
---|
[10354] | 1459 | serve the restart files. |
---|
| 1460 | This duplication is unfortunate but appropriate since, if using io\_servers, the domain sizes of |
---|
| 1461 | the individual files produced by the io\_server processes may be different to those produced by |
---|
[9413] | 1462 | the invidual processing regions and different chunking choices may be desired. |
---|
[11512] | 1463 | |
---|
[2541] | 1464 | % ------------------------------------------------------------------------------------------------------------- |
---|
| 1465 | % Tracer/Dynamics Trends |
---|
| 1466 | % ------------------------------------------------------------------------------------------------------------- |
---|
[11263] | 1467 | \section[Tracer/Dynamics trends (\texttt{namtrd})] |
---|
[11512] | 1468 | {Tracer/Dynamics trends (\protect\nam{trd})} |
---|
[9407] | 1469 | \label{sec:DIA_trd} |
---|
[2541] | 1470 | |
---|
| 1471 | %------------------------------------------namtrd---------------------------------------------------- |
---|
[10146] | 1472 | |
---|
[11512] | 1473 | \nlst{namtrd} |
---|
[2541] | 1474 | %------------------------------------------------------------------------------------------------------------- |
---|
| 1475 | |
---|
[10354] | 1476 | Each trend of the dynamics and/or temperature and salinity time evolution equations can be send to |
---|
| 1477 | \mdl{trddyn} and/or \mdl{trdtra} modules (see TRD directory) just after their computation |
---|
[11512] | 1478 | (\ie\ at the end of each \textit{dyn....F90} and/or \textit{tra....F90} routines). |
---|
| 1479 | This capability is controlled by options offered in \nam{trd} namelist. |
---|
[11263] | 1480 | Note that the output are done with XIOS, and therefore the \key{iomput} is required. |
---|
[2541] | 1481 | |
---|
[11512] | 1482 | What is done depends on the \nam{trd} logical set to \forcode{.true.}: |
---|
[9413] | 1483 | |
---|
[2541] | 1484 | \begin{description} |
---|
[10354] | 1485 | \item[\np{ln\_glo\_trd}]: |
---|
| 1486 | at each \np{nn\_trd} time-step a check of the basin averaged properties of |
---|
| 1487 | the momentum and tracer equations is performed. |
---|
| 1488 | This also includes a check of $T^2$, $S^2$, $\tfrac{1}{2} (u^2+v2)$, |
---|
| 1489 | and potential energy time evolution equations properties; |
---|
| 1490 | \item[\np{ln\_dyn\_trd}]: |
---|
| 1491 | each 3D trend of the evolution of the two momentum components is output; |
---|
| 1492 | \item[\np{ln\_dyn\_mxl}]: |
---|
| 1493 | each 3D trend of the evolution of the two momentum components averaged over the mixed layer is output; |
---|
| 1494 | \item[\np{ln\_vor\_trd}]: |
---|
| 1495 | a vertical summation of the moment tendencies is performed, |
---|
| 1496 | then the curl is computed to obtain the barotropic vorticity tendencies which are output; |
---|
| 1497 | \item[\np{ln\_KE\_trd}] : |
---|
| 1498 | each 3D trend of the Kinetic Energy equation is output; |
---|
| 1499 | \item[\np{ln\_tra\_trd}]: |
---|
| 1500 | each 3D trend of the evolution of temperature and salinity is output; |
---|
| 1501 | \item[\np{ln\_tra\_mxl}]: |
---|
| 1502 | each 2D trend of the evolution of temperature and salinity averaged over the mixed layer is output; |
---|
[2541] | 1503 | \end{description} |
---|
| 1504 | |
---|
[11512] | 1505 | Note that the mixed layer tendency diagnostic can also be used on biogeochemical models via |
---|
[11263] | 1506 | the \key{trdtrc} and \key{trdmxl\_trc} CPP keys. |
---|
[2541] | 1507 | |
---|
[9413] | 1508 | \textbf{Note that} in the current version (v3.6), many changes has been introduced but not fully tested. |
---|
[10354] | 1509 | In particular, options associated with \np{ln\_dyn\_mxl}, \np{ln\_vor\_trd}, and \np{ln\_tra\_mxl} are not working, |
---|
[11512] | 1510 | and none of the options have been tested with variable volume (\ie\ \np{ln\_linssh}\forcode{ = .true.}). |
---|
[2541] | 1511 | |
---|
| 1512 | % ------------------------------------------------------------------------------------------------------------- |
---|
| 1513 | % On-line Floats trajectories |
---|
| 1514 | % ------------------------------------------------------------------------------------------------------------- |
---|
[11263] | 1515 | \section[FLO: On-Line Floats trajectories (\texttt{\textbf{key\_floats}})] |
---|
| 1516 | {FLO: On-Line Floats trajectories (\protect\key{floats})} |
---|
[9407] | 1517 | \label{sec:FLO} |
---|
[2541] | 1518 | %--------------------------------------------namflo------------------------------------------------------- |
---|
[10146] | 1519 | |
---|
[11512] | 1520 | \nlst{namflo} |
---|
[2541] | 1521 | %-------------------------------------------------------------------------------------------------------------- |
---|
| 1522 | |
---|
[10354] | 1523 | The on-line computation of floats advected either by the three dimensional velocity field or constraint to |
---|
| 1524 | remain at a given depth ($w = 0$ in the computation) have been introduced in the system during the CLIPPER project. |
---|
[11512] | 1525 | Options are defined by \nam{flo} namelist variables. |
---|
[11263] | 1526 | The algorithm used is based either on the work of \cite{blanke.raynaud_JPO97} (default option), |
---|
[10354] | 1527 | or on a $4^th$ Runge-Hutta algorithm (\np{ln\_flork4}\forcode{ = .true.}). |
---|
[11263] | 1528 | Note that the \cite{blanke.raynaud_JPO97} algorithm have the advantage of providing trajectories which |
---|
[9413] | 1529 | are consistent with the numeric of the code, so that the trajectories never intercept the bathymetry. |
---|
[2541] | 1530 | |
---|
[9413] | 1531 | \subsubsection{Input data: initial coordinates} |
---|
[3294] | 1532 | |
---|
[10354] | 1533 | Initial coordinates can be given with Ariane Tools convention |
---|
| 1534 | (IJK coordinates, (\np{ln\_ariane}\forcode{ = .true.}) ) or with longitude and latitude. |
---|
[3294] | 1535 | |
---|
[11512] | 1536 | In case of Ariane convention, input filename is \textit{init\_float\_ariane}. |
---|
[9413] | 1537 | Its format is: \\ |
---|
[11263] | 1538 | {\scriptsize \texttt{I J K nisobfl itrash}} |
---|
[3294] | 1539 | |
---|
[9413] | 1540 | \noindent with: |
---|
[3294] | 1541 | |
---|
| 1542 | - I,J,K : indexes of initial position |
---|
| 1543 | |
---|
[11512] | 1544 | - nisobfl: 0 for an isobar float, 1 for a float following the w velocity |
---|
[3294] | 1545 | |
---|
| 1546 | - itrash : set to zero; it is a dummy variable to respect Ariane Tools convention |
---|
| 1547 | |
---|
[9413] | 1548 | \noindent Example: \\ |
---|
[10414] | 1549 | \noindent |
---|
| 1550 | {\scriptsize |
---|
| 1551 | \texttt{ |
---|
| 1552 | 100.00000 90.00000 -1.50000 1.00000 0.00000 \\ |
---|
| 1553 | 102.00000 90.00000 -1.50000 1.00000 0.00000 \\ |
---|
| 1554 | 104.00000 90.00000 -1.50000 1.00000 0.00000 \\ |
---|
| 1555 | 106.00000 90.00000 -1.50000 1.00000 0.00000 \\ |
---|
| 1556 | 108.00000 90.00000 -1.50000 1.00000 0.00000} |
---|
| 1557 | } \\ |
---|
[3294] | 1558 | |
---|
[9413] | 1559 | In the other case (longitude and latitude), input filename is init\_float. |
---|
| 1560 | Its format is: \\ |
---|
| 1561 | {\scriptsize \texttt{Long Lat depth nisobfl ngrpfl itrash}} |
---|
[3294] | 1562 | |
---|
| 1563 | \noindent with: |
---|
| 1564 | |
---|
| 1565 | - Long, Lat, depth : Longitude, latitude, depth |
---|
| 1566 | |
---|
| 1567 | - nisobfl: 0 for an isobar float, 1 for a float following the w velocity |
---|
| 1568 | |
---|
| 1569 | - ngrpfl : number to identify searcher group |
---|
| 1570 | |
---|
| 1571 | - itrash :set to 1; it is a dummy variable. |
---|
| 1572 | |
---|
[9413] | 1573 | \noindent Example: \\ |
---|
[10414] | 1574 | \noindent |
---|
| 1575 | {\scriptsize |
---|
| 1576 | \texttt{ |
---|
| 1577 | 20.0 0.0 0.0 0 1 1 \\ |
---|
| 1578 | -21.0 0.0 0.0 0 1 1 \\ |
---|
| 1579 | -22.0 0.0 0.0 0 1 1 \\ |
---|
| 1580 | -23.0 0.0 0.0 0 1 1 \\ |
---|
| 1581 | -24.0 0.0 0.0 0 1 1 } |
---|
| 1582 | } \\ |
---|
[3294] | 1583 | |
---|
| 1584 | \np{jpnfl} is the total number of floats during the run. |
---|
[10354] | 1585 | When initial positions are read in a restart file (\np{ln\_rstflo}\forcode{ = .true.} ), |
---|
[9413] | 1586 | \np{jpnflnewflo} can be added in the initialization file. |
---|
[3294] | 1587 | |
---|
[9393] | 1588 | \subsubsection{Output data} |
---|
[3294] | 1589 | |
---|
[10354] | 1590 | \np{nn\_writefl} is the frequency of writing in float output file and \np{nn\_stockfl} is the frequency of |
---|
| 1591 | creation of the float restart file. |
---|
[3294] | 1592 | |
---|
[9413] | 1593 | Output data can be written in ascii files (\np{ln\_flo\_ascii}\forcode{ = .true.}). |
---|
| 1594 | In that case, output filename is trajec\_float. |
---|
[3294] | 1595 | |
---|
[11263] | 1596 | Another possiblity of writing format is Netcdf (\np{ln\_flo\_ascii}\forcode{ = .false.}) with |
---|
| 1597 | \key{iomput} and outputs selected in iodef.xml. |
---|
[10354] | 1598 | Here it is an example of specification to put in files description section: |
---|
[3294] | 1599 | |
---|
[9392] | 1600 | \begin{xmllines} |
---|
[9413] | 1601 | <group id="1d_grid_T" name="auto" description="ocean T grid variables" > } |
---|
| 1602 | <file id="floats" description="floats variables"> } |
---|
| 1603 | <field ref="traj_lon" name="floats_longitude" freq_op="86400" />} |
---|
| 1604 | <field ref="traj_lat" name="floats_latitude" freq_op="86400" />} |
---|
| 1605 | <field ref="traj_dep" name="floats_depth" freq_op="86400" />} |
---|
| 1606 | <field ref="traj_temp" name="floats_temperature" freq_op="86400" />} |
---|
| 1607 | <field ref="traj_salt" name="floats_salinity" freq_op="86400" />} |
---|
| 1608 | <field ref="traj_dens" name="floats_density" freq_op="86400" />} |
---|
| 1609 | <field ref="traj_group" name="floats_group" freq_op="86400" />} |
---|
| 1610 | </file>} |
---|
| 1611 | </group>} |
---|
[9392] | 1612 | \end{xmllines} |
---|
[3294] | 1613 | |
---|
| 1614 | |
---|
[2541] | 1615 | % ------------------------------------------------------------------------------------------------------------- |
---|
[3294] | 1616 | % Harmonic analysis of tidal constituents |
---|
| 1617 | % ------------------------------------------------------------------------------------------------------------- |
---|
[11263] | 1618 | \section[Harmonic analysis of tidal constituents (\texttt{\textbf{key\_diaharm}})] |
---|
| 1619 | {Harmonic analysis of tidal constituents (\protect\key{diaharm})} |
---|
[9407] | 1620 | \label{sec:DIA_diag_harm} |
---|
[3294] | 1621 | |
---|
[11263] | 1622 | %------------------------------------------nam_diaharm---------------------------------------------------- |
---|
[10146] | 1623 | % |
---|
| 1624 | \nlst{nam_diaharm} |
---|
[3294] | 1625 | %---------------------------------------------------------------------------------------------------------- |
---|
| 1626 | |
---|
[9413] | 1627 | A module is available to compute the amplitude and phase of tidal waves. |
---|
[6289] | 1628 | This on-line Harmonic analysis is actived with \key{diaharm}. |
---|
[9413] | 1629 | |
---|
[11512] | 1630 | Some parameters are available in namelist \nam{\_diaharm}: |
---|
[3294] | 1631 | |
---|
[9413] | 1632 | - \np{nit000\_han} is the first time step used for harmonic analysis |
---|
[3294] | 1633 | |
---|
[9413] | 1634 | - \np{nitend\_han} is the last time step used for harmonic analysis |
---|
[3294] | 1635 | |
---|
[9413] | 1636 | - \np{nstep\_han} is the time step frequency for harmonic analysis |
---|
[3294] | 1637 | |
---|
[11512] | 1638 | % - \np{nb\_ana} is the number of harmonics to analyse |
---|
[3294] | 1639 | |
---|
[9413] | 1640 | - \np{tname} is an array with names of tidal constituents to analyse |
---|
[3294] | 1641 | |
---|
[10354] | 1642 | \np{nit000\_han} and \np{nitend\_han} must be between \np{nit000} and \np{nitend} of the simulation. |
---|
| 1643 | The restart capability is not implemented. |
---|
[3294] | 1644 | |
---|
[10354] | 1645 | The Harmonic analysis solve the following equation: |
---|
[3294] | 1646 | |
---|
[10414] | 1647 | \[ |
---|
| 1648 | h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[A_{j}cos(\nu_{j}t_{j}-\phi_{j})] = e_{i} |
---|
| 1649 | \] |
---|
[9413] | 1650 | |
---|
[10354] | 1651 | With $A_{j}$, $\nu_{j}$, $\phi_{j}$, the amplitude, frequency and phase for each wave and $e_{i}$ the error. |
---|
[3294] | 1652 | $h_{i}$ is the sea level for the time $t_{i}$ and $A_{0}$ is the mean sea level. \\ |
---|
| 1653 | We can rewrite this equation: |
---|
| 1654 | |
---|
[10414] | 1655 | \[ |
---|
| 1656 | h_{i} - A_{0} + \sum^{nb\_ana}_{j=1}[C_{j}cos(\nu_{j}t_{j})+S_{j}sin(\nu_{j}t_{j})] = e_{i} |
---|
| 1657 | \] |
---|
[9413] | 1658 | |
---|
| 1659 | with $A_{j}=\sqrt{C^{2}_{j}+S^{2}_{j}}$ and $\phi_{j}=arctan(S_{j}/C_{j})$. |
---|
| 1660 | |
---|
[3294] | 1661 | We obtain in output $C_{j}$ and $S_{j}$ for each tidal wave. |
---|
| 1662 | |
---|
| 1663 | % ------------------------------------------------------------------------------------------------------------- |
---|
| 1664 | % Sections transports |
---|
| 1665 | % ------------------------------------------------------------------------------------------------------------- |
---|
[11263] | 1666 | \section[Transports across sections (\texttt{\textbf{key\_diadct}})] |
---|
| 1667 | {Transports across sections (\protect\key{diadct})} |
---|
[9407] | 1668 | \label{sec:DIA_diag_dct} |
---|
[3294] | 1669 | |
---|
[11366] | 1670 | %------------------------------------------nam_diadct---------------------------------------------------- |
---|
[10146] | 1671 | |
---|
[11366] | 1672 | \nlst{nam_diadct} |
---|
[6497] | 1673 | %------------------------------------------------------------------------------------------------------------- |
---|
| 1674 | |
---|
[10354] | 1675 | A module is available to compute the transport of volume, heat and salt through sections. |
---|
[6289] | 1676 | This diagnostic is actived with \key{diadct}. |
---|
[3294] | 1677 | |
---|
[9413] | 1678 | Each section is defined by the coordinates of its 2 extremities. |
---|
[11263] | 1679 | The pathways between them are contructed using tools which can be found in \texttt{tools/SECTIONS\_DIADCT} |
---|
| 1680 | and are written in a binary file \texttt{section\_ijglobal.diadct} which is later read in by |
---|
[11512] | 1681 | \NEMO\ to compute on-line transports. |
---|
[3294] | 1682 | |
---|
[9413] | 1683 | The on-line transports module creates three output ascii files: |
---|
[3294] | 1684 | |
---|
[9413] | 1685 | - \texttt{volume\_transport} for volume transports (unit: $10^{6} m^{3} s^{-1}$) |
---|
[3294] | 1686 | |
---|
[9413] | 1687 | - \texttt{heat\_transport} for heat transports (unit: $10^{15} W$) |
---|
[3294] | 1688 | |
---|
[9413] | 1689 | - \texttt{salt\_transport} for salt transports (unit: $10^{9}Kg s^{-1}$) \\ |
---|
[3294] | 1690 | |
---|
[11512] | 1691 | Namelist variables in \nam{\_diadct} control how frequently the flows are summed and the time scales over which |
---|
[10354] | 1692 | they are averaged, as well as the level of output for debugging: |
---|
[9413] | 1693 | \np{nn\_dct} : frequency of instantaneous transports computing |
---|
[9393] | 1694 | \np{nn\_dctwri}: frequency of writing ( mean of instantaneous transports ) |
---|
[9413] | 1695 | \np{nn\_debug} : debugging of the section |
---|
[3294] | 1696 | |
---|
[9393] | 1697 | \subsubsection{Creating a binary file containing the pathway of each section} |
---|
[3294] | 1698 | |
---|
[11263] | 1699 | In \texttt{tools/SECTIONS\_DIADCT/run}, |
---|
[10354] | 1700 | the file \textit{ {list\_sections.ascii\_global}} contains a list of all the sections that are to be computed |
---|
| 1701 | (this list of sections is based on MERSEA project metrics). |
---|
[3294] | 1702 | |
---|
[9413] | 1703 | Another file is available for the GYRE configuration (\texttt{ {list\_sections.ascii\_GYRE}}). |
---|
[3294] | 1704 | |
---|
[9413] | 1705 | Each section is defined by: \\ |
---|
| 1706 | \noindent {\scriptsize \texttt{long1 lat1 long2 lat2 nclass (ok/no)strpond (no)ice section\_name}} \\ |
---|
[3294] | 1707 | with: |
---|
| 1708 | |
---|
[9413] | 1709 | - \texttt{long1 lat1}, coordinates of the first extremity of the section; |
---|
[3294] | 1710 | |
---|
[9413] | 1711 | - \texttt{long2 lat2}, coordinates of the second extremity of the section; |
---|
[3294] | 1712 | |
---|
[11512] | 1713 | - \texttt{nclass} the number of bounds of your classes (\eg\ bounds for 2 classes); |
---|
[3294] | 1714 | |
---|
[9413] | 1715 | - \texttt{okstrpond} to compute heat and salt transports, \texttt{nostrpond} if no; |
---|
[3294] | 1716 | |
---|
[9413] | 1717 | - \texttt{ice} to compute surface and volume ice transports, \texttt{noice} if no. \\ |
---|
[3294] | 1718 | |
---|
[10354] | 1719 | \noindent The results of the computing of transports, and the directions of positive and |
---|
| 1720 | negative flow do not depend on the order of the 2 extremities in this file. \\ |
---|
[3294] | 1721 | |
---|
[10354] | 1722 | \noindent If nclass $\neq$ 0, the next lines contain the class type and the nclass bounds: \\ |
---|
[10414] | 1723 | {\scriptsize |
---|
| 1724 | \texttt{ |
---|
| 1725 | long1 lat1 long2 lat2 nclass (ok/no)strpond (no)ice section\_name \\ |
---|
| 1726 | classtype \\ |
---|
| 1727 | zbound1 \\ |
---|
| 1728 | zbound2 \\ |
---|
| 1729 | . \\ |
---|
| 1730 | . \\ |
---|
| 1731 | nclass-1 \\ |
---|
| 1732 | nclass} |
---|
| 1733 | } |
---|
[3294] | 1734 | |
---|
| 1735 | \noindent where \texttt{classtype} can be: |
---|
| 1736 | |
---|
[9413] | 1737 | - \texttt{zsal} for salinity classes |
---|
[3294] | 1738 | |
---|
[9413] | 1739 | - \texttt{ztem} for temperature classes |
---|
[3294] | 1740 | |
---|
[9413] | 1741 | - \texttt{zlay} for depth classes |
---|
[3294] | 1742 | |
---|
[9413] | 1743 | - \texttt{zsigi} for insitu density classes |
---|
[3294] | 1744 | |
---|
[9413] | 1745 | - \texttt{zsigp} for potential density classes \\ |
---|
[11512] | 1746 | |
---|
[10354] | 1747 | The script \texttt{job.ksh} computes the pathway for each section and creates a binary file |
---|
[11512] | 1748 | \texttt{section\_ijglobal.diadct} which is read by \NEMO. \\ |
---|
[3294] | 1749 | |
---|
[10354] | 1750 | It is possible to use this tools for new configuations: \texttt{job.ksh} has to be updated with |
---|
| 1751 | the coordinates file name and path. \\ |
---|
[3294] | 1752 | |
---|
[10354] | 1753 | Examples of two sections, the ACC\_Drake\_Passage with no classes, |
---|
| 1754 | and the ATL\_Cuba\_Florida with 4 temperature clases (5 class bounds), are shown: \\ |
---|
[10414] | 1755 | \noindent |
---|
| 1756 | {\scriptsize |
---|
| 1757 | \texttt{ |
---|
| 1758 | -68. -54.5 -60. -64.7 00 okstrpond noice ACC\_Drake\_Passage \\ |
---|
| 1759 | -80.5 22.5 -80.5 25.5 05 nostrpond noice ATL\_Cuba\_Florida \\ |
---|
| 1760 | ztem \\ |
---|
| 1761 | -2.0 \\ |
---|
| 1762 | 4.5 \\ |
---|
| 1763 | 7.0 \\ |
---|
| 1764 | 12.0 \\ |
---|
| 1765 | 40.0} |
---|
| 1766 | } |
---|
[3294] | 1767 | |
---|
[9393] | 1768 | \subsubsection{To read the output files} |
---|
[3294] | 1769 | |
---|
[9413] | 1770 | The output format is: \\ |
---|
[10414] | 1771 | {\scriptsize |
---|
| 1772 | \texttt{ |
---|
| 1773 | date, time-step number, section number, \\ |
---|
| 1774 | section name, section slope coefficient, class number, \\ |
---|
| 1775 | class name, class bound 1 , classe bound2, \\ |
---|
| 1776 | transport\_direction1, transport\_direction2, \\ |
---|
| 1777 | transport\_total} |
---|
| 1778 | } \\ |
---|
[3294] | 1779 | |
---|
[10354] | 1780 | For sections with classes, the first \texttt{nclass-1} lines correspond to the transport for each class and |
---|
| 1781 | the last line corresponds to the total transport summed over all classes. |
---|
| 1782 | For sections with no classes, class number \texttt{1} corresponds to \texttt{total class} and |
---|
[9413] | 1783 | this class is called \texttt{N}, meaning \texttt{none}. |
---|
[3294] | 1784 | |
---|
[9413] | 1785 | - \texttt{transport\_direction1} is the positive part of the transport ($\geq$ 0). |
---|
[3294] | 1786 | |
---|
[9413] | 1787 | - \texttt{transport\_direction2} is the negative part of the transport ($\leq$ 0). \\ |
---|
[3294] | 1788 | |
---|
[10354] | 1789 | \noindent The \texttt{section slope coefficient} gives information about the significance of transports signs and |
---|
| 1790 | direction: \\ |
---|
[3294] | 1791 | |
---|
[10414] | 1792 | \begin{table} |
---|
| 1793 | \scriptsize |
---|
| 1794 | \begin{tabular}{|l|l|l|l|l|} |
---|
| 1795 | \hline |
---|
| 1796 | section slope coefficient & section type & direction 1 & direction 2 & total transport \\ |
---|
| 1797 | \hline |
---|
| 1798 | 0. & horizontal & northward & southward & postive: northward \\ |
---|
| 1799 | \hline |
---|
| 1800 | 1000. & vertical & eastward & westward & postive: eastward \\ |
---|
| 1801 | \hline |
---|
| 1802 | \texttt{$\neq$ 0, $\neq$ 1000.} & diagonal & eastward & westward & postive: eastward \\ |
---|
| 1803 | \hline |
---|
| 1804 | \end{tabular} |
---|
[9413] | 1805 | \end{table} |
---|
[3294] | 1806 | |
---|
[2541] | 1807 | % ================================================================ |
---|
| 1808 | % Steric effect in sea surface height |
---|
| 1809 | % ================================================================ |
---|
[9393] | 1810 | \section{Diagnosing the steric effect in sea surface height} |
---|
[9407] | 1811 | \label{sec:DIA_steric} |
---|
[2541] | 1812 | |
---|
| 1813 | |
---|
[10354] | 1814 | Changes in steric sea level are caused when changes in the density of the water column imply an expansion or |
---|
| 1815 | contraction of the column. |
---|
| 1816 | It is essentially produced through surface heating/cooling and to a lesser extent through non-linear effects of |
---|
| 1817 | the equation of state (cabbeling, thermobaricity...). |
---|
[9413] | 1818 | Non-Boussinesq models contain all ocean effects within the ocean acting on the sea level. |
---|
| 1819 | In particular, they include the steric effect. |
---|
[10354] | 1820 | In contrast, Boussinesq models, such as \NEMO, conserve volume, rather than mass, |
---|
[9413] | 1821 | and so do not properly represent expansion or contraction. |
---|
| 1822 | The steric effect is therefore not explicitely represented. |
---|
[10354] | 1823 | This approximation does not represent a serious error with respect to the flow field calculated by the model |
---|
[11263] | 1824 | \citep{greatbatch_JGR94}, but extra attention is required when investigating sea level, |
---|
[10354] | 1825 | as steric changes are an important contribution to local changes in sea level on seasonal and climatic time scales. |
---|
| 1826 | This is especially true for investigation into sea level rise due to global warming. |
---|
[2541] | 1827 | |
---|
[10354] | 1828 | Fortunately, the steric contribution to the sea level consists of a spatially uniform component that |
---|
[11263] | 1829 | can be diagnosed by considering the mass budget of the world ocean \citep{greatbatch_JGR94}. |
---|
[10354] | 1830 | In order to better understand how global mean sea level evolves and thus how the steric sea level can be diagnosed, |
---|
| 1831 | we compare, in the following, the non-Boussinesq and Boussinesq cases. |
---|
[2541] | 1832 | |
---|
[9413] | 1833 | Let denote |
---|
[11512] | 1834 | $\mathcal{M}$ the total mass of liquid seawater ($\mathcal{M} = \int_D \rho dv$), |
---|
| 1835 | $\mathcal{V}$ the total volume of seawater ($\mathcal{V} = \int_D dv$), |
---|
| 1836 | $\mathcal{A}$ the total surface of the ocean ($\mathcal{A} = \int_S ds$), |
---|
| 1837 | $\bar{\rho}$ the global mean seawater (\textit{in situ}) density |
---|
[9413] | 1838 | ($\bar{\rho} = 1/\mathcal{V} \int_D \rho \,dv$), and |
---|
[11512] | 1839 | $\bar{\eta}$ the global mean sea level |
---|
[9413] | 1840 | ($\bar{\eta} = 1/\mathcal{A} \int_S \eta \,ds$). |
---|
[2541] | 1841 | |
---|
| 1842 | A non-Boussinesq fluid conserves mass. It satisfies the following relations: |
---|
[9413] | 1843 | |
---|
[10414] | 1844 | \begin{equation} |
---|
| 1845 | \begin{split} |
---|
| 1846 | \mathcal{M} &= \mathcal{V} \;\bar{\rho} \\ |
---|
| 1847 | \mathcal{V} &= \mathcal{A} \;\bar{\eta} |
---|
| 1848 | \end{split} |
---|
| 1849 | \label{eq:MV_nBq} |
---|
| 1850 | \end{equation} |
---|
[9413] | 1851 | |
---|
[10354] | 1852 | Temporal changes in total mass is obtained from the density conservation equation: |
---|
[9413] | 1853 | |
---|
[10414] | 1854 | \begin{equation} |
---|
| 1855 | \frac{1}{e_3} \partial_t ( e_3\,\rho) + \nabla( \rho \, \textbf{U} ) |
---|
| 1856 | = \left. \frac{\textit{emp}}{e_3}\right|_\textit{surface} |
---|
| 1857 | \label{eq:Co_nBq} |
---|
| 1858 | \end{equation} |
---|
[9413] | 1859 | |
---|
[10354] | 1860 | where $\rho$ is the \textit{in situ} density, and \textit{emp} the surface mass exchanges with the other media of |
---|
| 1861 | the Earth system (atmosphere, sea-ice, land). |
---|
[11512] | 1862 | Its global averaged leads to the total mass change |
---|
[9413] | 1863 | |
---|
[10414] | 1864 | \begin{equation} |
---|
| 1865 | \partial_t \mathcal{M} = \mathcal{A} \;\overline{\textit{emp}} |
---|
| 1866 | \label{eq:Mass_nBq} |
---|
| 1867 | \end{equation} |
---|
[9413] | 1868 | |
---|
| 1869 | where $\overline{\textit{emp}} = \int_S \textit{emp}\,ds$ is the net mass flux through the ocean surface. |
---|
[10354] | 1870 | Bringing \autoref{eq:Mass_nBq} and the time derivative of \autoref{eq:MV_nBq} together leads to |
---|
[9413] | 1871 | the evolution equation of the mean sea level |
---|
| 1872 | |
---|
[10414] | 1873 | \begin{equation} |
---|
| 1874 | \partial_t \bar{\eta} = \frac{\overline{\textit{emp}}}{ \bar{\rho}} |
---|
| 1875 | - \frac{\mathcal{V}}{\mathcal{A}} \;\frac{\partial_t \bar{\rho} }{\bar{\rho}} |
---|
| 1876 | \label{eq:ssh_nBq} |
---|
| 1877 | \end{equation} |
---|
[9413] | 1878 | |
---|
[11512] | 1879 | The first term in equation \autoref{eq:ssh_nBq} alters sea level by adding or subtracting mass from the ocean. |
---|
| 1880 | The second term arises from temporal changes in the global mean density; \ie\ from steric effects. |
---|
[2541] | 1881 | |
---|
[10354] | 1882 | In a Boussinesq fluid, $\rho$ is replaced by $\rho_o$ in all the equation except when $\rho$ appears multiplied by |
---|
[11512] | 1883 | the gravity (\ie\ in the hydrostatic balance of the primitive Equations). |
---|
[10354] | 1884 | In particular, the mass conservation equation, \autoref{eq:Co_nBq}, degenerates into the incompressibility equation: |
---|
[9413] | 1885 | |
---|
[10414] | 1886 | \[ |
---|
| 1887 | \frac{1}{e_3} \partial_t ( e_3 ) + \nabla( \textbf{U} ) = \left. \frac{\textit{emp}}{\rho_o \,e_3}\right|_ \textit{surface} |
---|
| 1888 | % \label{eq:Co_Bq} |
---|
| 1889 | \] |
---|
[9413] | 1890 | |
---|
[2541] | 1891 | and the global average of this equation now gives the temporal change of the total volume, |
---|
[9413] | 1892 | |
---|
[10414] | 1893 | \[ |
---|
| 1894 | \partial_t \mathcal{V} = \mathcal{A} \;\frac{\overline{\textit{emp}}}{\rho_o} |
---|
| 1895 | % \label{eq:V_Bq} |
---|
| 1896 | \] |
---|
[9413] | 1897 | |
---|
[10354] | 1898 | Only the volume is conserved, not mass, or, more precisely, the mass which is conserved is the Boussinesq mass, |
---|
| 1899 | $\mathcal{M}_o = \rho_o \mathcal{V}$. |
---|
| 1900 | The total volume (or equivalently the global mean sea level) is altered only by net volume fluxes across |
---|
| 1901 | the ocean surface, not by changes in mean mass of the ocean: the steric effect is missing in a Boussinesq fluid. |
---|
[9413] | 1902 | |
---|
[11263] | 1903 | Nevertheless, following \citep{greatbatch_JGR94}, the steric effect on the volume can be diagnosed by |
---|
[11512] | 1904 | considering the mass budget of the ocean. |
---|
[10354] | 1905 | The apparent changes in $\mathcal{M}$, mass of the ocean, which are not induced by surface mass flux |
---|
| 1906 | must be compensated by a spatially uniform change in the mean sea level due to expansion/contraction of the ocean |
---|
[11263] | 1907 | \citep{greatbatch_JGR94}. |
---|
[10354] | 1908 | In others words, the Boussinesq mass, $\mathcal{M}_o$, can be related to $\mathcal{M}$, |
---|
| 1909 | the total mass of the ocean seen by the Boussinesq model, via the steric contribution to the sea level, |
---|
[9413] | 1910 | $\eta_s$, a spatially uniform variable, as follows: |
---|
| 1911 | |
---|
[10414] | 1912 | \begin{equation} |
---|
| 1913 | \mathcal{M}_o = \mathcal{M} + \rho_o \,\eta_s \,\mathcal{A} |
---|
| 1914 | \label{eq:M_Bq} |
---|
| 1915 | \end{equation} |
---|
[9413] | 1916 | |
---|
[10354] | 1917 | Any change in $\mathcal{M}$ which cannot be explained by the net mass flux through the ocean surface |
---|
| 1918 | is converted into a mean change in sea level. |
---|
| 1919 | Introducing the total density anomaly, $\mathcal{D}= \int_D d_a \,dv$, |
---|
[11512] | 1920 | where $d_a = (\rho -\rho_o ) / \rho_o$ is the density anomaly used in \NEMO\ (cf. \autoref{subsec:TRA_eos}) |
---|
[10354] | 1921 | in \autoref{eq:M_Bq} leads to a very simple form for the steric height: |
---|
[2541] | 1922 | |
---|
[10414] | 1923 | \begin{equation} |
---|
| 1924 | \eta_s = - \frac{1}{\mathcal{A}} \mathcal{D} |
---|
| 1925 | \label{eq:steric_Bq} |
---|
| 1926 | \end{equation} |
---|
[9413] | 1927 | |
---|
[2541] | 1928 | The above formulation of the steric height of a Boussinesq ocean requires four remarks. |
---|
| 1929 | First, one can be tempted to define $\rho_o$ as the initial value of $\mathcal{M}/\mathcal{V}$, |
---|
[11512] | 1930 | \ie\ set $\mathcal{D}_{t=0}=0$, so that the initial steric height is zero. |
---|
[9413] | 1931 | We do not recommend that. |
---|
| 1932 | Indeed, in this case $\rho_o$ depends on the initial state of the ocean. |
---|
[10354] | 1933 | Since $\rho_o$ has a direct effect on the dynamics of the ocean |
---|
| 1934 | (it appears in the pressure gradient term of the momentum equation) |
---|
| 1935 | it is definitively not a good idea when inter-comparing experiments. |
---|
[9413] | 1936 | We better recommend to fixe once for all $\rho_o$ to $1035\;Kg\,m^{-3}$. |
---|
[10354] | 1937 | This value is a sensible choice for the reference density used in a Boussinesq ocean climate model since, |
---|
| 1938 | with the exception of only a small percentage of the ocean, density in the World Ocean varies by no more than |
---|
[11263] | 1939 | 2$\%$ from this value (\cite{gill_bk82}, page 47). |
---|
[2541] | 1940 | |
---|
[10354] | 1941 | Second, we have assumed here that the total ocean surface, $\mathcal{A}$, |
---|
| 1942 | does not change when the sea level is changing as it is the case in all global ocean GCMs |
---|
[9413] | 1943 | (wetting and drying of grid point is not allowed). |
---|
[11512] | 1944 | |
---|
[10354] | 1945 | Third, the discretisation of \autoref{eq:steric_Bq} depends on the type of free surface which is considered. |
---|
[11512] | 1946 | In the non linear free surface case, \ie\ \np{ln\_linssh}\forcode{ = .true.}, it is given by |
---|
[2541] | 1947 | |
---|
[10414] | 1948 | \[ |
---|
| 1949 | \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t} e_{2t} e_{3t} }{ \sum_{i,\,j,\,k} e_{1t} e_{2t} e_{3t} } |
---|
| 1950 | % \label{eq:discrete_steric_Bq_nfs} |
---|
| 1951 | \] |
---|
[9413] | 1952 | |
---|
[10354] | 1953 | whereas in the linear free surface, |
---|
| 1954 | the volume above the \textit{z=0} surface must be explicitly taken into account to |
---|
| 1955 | better approximate the total ocean mass and thus the steric sea level: |
---|
[9413] | 1956 | |
---|
[10414] | 1957 | \[ |
---|
| 1958 | \eta_s = - \frac{ \sum_{i,\,j,\,k} d_a\; e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} d_a\; e_{1t}e_{2t} \eta } |
---|
| 1959 | { \sum_{i,\,j,\,k} e_{1t}e_{2t}e_{3t} + \sum_{i,\,j} e_{1t}e_{2t} \eta } |
---|
| 1960 | % \label{eq:discrete_steric_Bq_fs} |
---|
| 1961 | \] |
---|
[9413] | 1962 | |
---|
[2541] | 1963 | The fourth and last remark concerns the effective sea level and the presence of sea-ice. |
---|
[9413] | 1964 | In the real ocean, sea ice (and snow above it) depresses the liquid seawater through its mass loading. |
---|
| 1965 | This depression is a result of the mass of sea ice/snow system acting on the liquid ocean. |
---|
[10354] | 1966 | There is, however, no dynamical effect associated with these depressions in the liquid ocean sea level, |
---|
[9413] | 1967 | so that there are no associated ocean currents. |
---|
[10354] | 1968 | Hence, the dynamically relevant sea level is the effective sea level, |
---|
[11512] | 1969 | \ie\ the sea level as if sea ice (and snow) were converted to liquid seawater \citep{campin.marshall.ea_OM08}. |
---|
| 1970 | However, in the current version of \NEMO\ the sea-ice is levitating above the ocean without mass exchanges between |
---|
[10354] | 1971 | ice and ocean. |
---|
| 1972 | Therefore the model effective sea level is always given by $\eta + \eta_s$, whether or not there is sea ice present. |
---|
[2541] | 1973 | |
---|
[9413] | 1974 | In AR5 outputs, the thermosteric sea level is demanded. |
---|
| 1975 | It is steric sea level due to changes in ocean density arising just from changes in temperature. |
---|
| 1976 | It is given by: |
---|
| 1977 | |
---|
[10414] | 1978 | \[ |
---|
| 1979 | \eta_s = - \frac{1}{\mathcal{A}} \int_D d_a(T,S_o,p_o) \,dv |
---|
| 1980 | % \label{eq:thermosteric_Bq} |
---|
| 1981 | \] |
---|
[9413] | 1982 | |
---|
[2541] | 1983 | where $S_o$ and $p_o$ are the initial salinity and pressure, respectively. |
---|
| 1984 | |
---|
[11353] | 1985 | Both steric and thermosteric sea level are computed in \mdl{diaar5}. |
---|
[2541] | 1986 | |
---|
[6497] | 1987 | % ------------------------------------------------------------------------------------------------------------- |
---|
| 1988 | % Other Diagnostics |
---|
| 1989 | % ------------------------------------------------------------------------------------------------------------- |
---|
[11353] | 1990 | \section[Other diagnostics] |
---|
| 1991 | {Other diagnostics} |
---|
[9407] | 1992 | \label{sec:DIA_diag_others} |
---|
[6497] | 1993 | |
---|
[9413] | 1994 | Aside from the standard model variables, other diagnostics can be computed on-line. |
---|
| 1995 | The available ready-to-add diagnostics modules can be found in directory DIA. |
---|
[6497] | 1996 | |
---|
[11263] | 1997 | \subsection[Depth of various quantities (\textit{diahth.F90})] |
---|
| 1998 | {Depth of various quantities (\protect\mdl{diahth})} |
---|
[6497] | 1999 | |
---|
[10354] | 2000 | Among the available diagnostics the following ones are obtained when defining the \key{diahth} CPP key: |
---|
[6497] | 2001 | |
---|
[11263] | 2002 | - the mixed layer depth (based on a density criterion \citep{de-boyer-montegut.madec.ea_JGR04}) (\mdl{diahth}) |
---|
[6497] | 2003 | |
---|
| 2004 | - the turbocline depth (based on a turbulent mixing coefficient criterion) (\mdl{diahth}) |
---|
| 2005 | |
---|
[10442] | 2006 | - the depth of the 20\deg{C} isotherm (\mdl{diahth}) |
---|
[6497] | 2007 | |
---|
| 2008 | - the depth of the thermocline (maximum of the vertical temperature gradient) (\mdl{diahth}) |
---|
| 2009 | |
---|
| 2010 | |
---|
| 2011 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[10354] | 2012 | \begin{figure}[!t] |
---|
| 2013 | \begin{center} |
---|
[11263] | 2014 | \includegraphics[width=\textwidth]{Fig_mask_subasins} |
---|
[10414] | 2015 | \caption{ |
---|
| 2016 | \protect\label{fig:mask_subasins} |
---|
[10354] | 2017 | Decomposition of the World Ocean (here ORCA2) into sub-basin used in to |
---|
| 2018 | compute the heat and salt transports as well as the meridional stream-function: |
---|
| 2019 | Atlantic basin (red), Pacific basin (green), Indian basin (bleue), Indo-Pacific basin (bleue+green). |
---|
| 2020 | Note that semi-enclosed seas (Red, Med and Baltic seas) as well as Hudson Bay are removed from the sub-basins. |
---|
[10414] | 2021 | Note also that the Arctic Ocean has been split into Atlantic and Pacific basins along the North fold line. |
---|
| 2022 | } |
---|
| 2023 | \end{center} |
---|
[11512] | 2024 | \end{figure} |
---|
[6497] | 2025 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 2026 | |
---|
| 2027 | % ----------------------------------------------------------- |
---|
[11512] | 2028 | % CMIP specific diagnostics |
---|
[6497] | 2029 | % ----------------------------------------------------------- |
---|
[11353] | 2030 | \subsection[CMIP specific diagnostics (\textit{diaar5.F90}, \textit{diaptr.F90})] |
---|
[11263] | 2031 | {CMIP specific diagnostics (\protect\mdl{diaar5})} |
---|
[6497] | 2032 | |
---|
[11353] | 2033 | A series of diagnostics has been added in the \mdl{diaar5} and \mdl{diaptr}. |
---|
| 2034 | In \mdl{diaar5} they correspond to outputs that are required for AR5 simulations (CMIP5) |
---|
[9413] | 2035 | (see also \autoref{sec:DIA_steric} for one of them). |
---|
[11512] | 2036 | The module \mdl{diaar5} is active when one of the following outputs is required : |
---|
| 2037 | global total volume (voltot), global mean ssh (sshtot), global total mass (masstot), global mean temperature (temptot), |
---|
| 2038 | global mean ssh steric (sshsteric), global mean ssh thermosteric (sshthster), global mean salinity (saltot), |
---|
| 2039 | sea water pressure at sea floor (botpres), dynamic sea surface height (sshdyn). |
---|
[6497] | 2040 | |
---|
[11512] | 2041 | In \mdl{diaptr} when \np{ln\_diaptr}\forcode{ = .true.} |
---|
| 2042 | (see the \nam{ptr} namelist below) can be computed on-line the poleward heat and salt transports, |
---|
| 2043 | their advective and diffusive component, and the meriodional stream function . |
---|
[11353] | 2044 | When \np{ln\_subbas}\forcode{ = .true.}, transports and stream function are computed for the Atlantic, Indian, |
---|
| 2045 | Pacific and Indo-Pacific Oceans (defined north of 30\deg{S}) as well as for the World Ocean. |
---|
| 2046 | The sub-basin decomposition requires an input file (\ifile{subbasins}) which contains three 2D mask arrays, |
---|
| 2047 | the Indo-Pacific mask been deduced from the sum of the Indian and Pacific mask (\autoref{fig:mask_subasins}). |
---|
| 2048 | |
---|
| 2049 | %------------------------------------------namptr----------------------------------------- |
---|
| 2050 | |
---|
[11512] | 2051 | \nlst{namptr} |
---|
[11353] | 2052 | %----------------------------------------------------------------------------------------- |
---|
| 2053 | |
---|
[6497] | 2054 | % ----------------------------------------------------------- |
---|
[11512] | 2055 | % 25 hour mean and hourly Surface, Mid and Bed |
---|
[6497] | 2056 | % ----------------------------------------------------------- |
---|
[9393] | 2057 | \subsection{25 hour mean output for tidal models} |
---|
[6497] | 2058 | |
---|
| 2059 | %------------------------------------------nam_dia25h------------------------------------- |
---|
[10146] | 2060 | |
---|
| 2061 | \nlst{nam_dia25h} |
---|
[6497] | 2062 | %----------------------------------------------------------------------------------------- |
---|
| 2063 | |
---|
| 2064 | A module is available to compute a crudely detided M2 signal by obtaining a 25 hour mean. |
---|
| 2065 | The 25 hour mean is available for daily runs by summing up the 25 hourly instantananeous hourly values from |
---|
| 2066 | midnight at the start of the day to midight at the day end. |
---|
[10354] | 2067 | This diagnostic is actived with the logical $ln\_dia25h$. |
---|
[6497] | 2068 | |
---|
| 2069 | % ----------------------------------------------------------- |
---|
| 2070 | % Top Middle and Bed hourly output |
---|
| 2071 | % ----------------------------------------------------------- |
---|
[9393] | 2072 | \subsection{Top middle and bed hourly output} |
---|
[6497] | 2073 | |
---|
| 2074 | %------------------------------------------nam_diatmb----------------------------------------------------- |
---|
[10146] | 2075 | |
---|
| 2076 | \nlst{nam_diatmb} |
---|
[6497] | 2077 | %---------------------------------------------------------------------------------------------------------- |
---|
| 2078 | |
---|
[10354] | 2079 | A module is available to output the surface (top), mid water and bed diagnostics of a set of standard variables. |
---|
| 2080 | This can be a useful diagnostic when hourly or sub-hourly output is required in high resolution tidal outputs. |
---|
[9413] | 2081 | The tidal signal is retained but the overall data usage is cut to just three vertical levels. |
---|
| 2082 | Also the bottom level is calculated for each cell. |
---|
[10354] | 2083 | This diagnostic is actived with the logical $ln\_diatmb$. |
---|
[6497] | 2084 | |
---|
| 2085 | % ----------------------------------------------------------- |
---|
| 2086 | % Courant numbers |
---|
| 2087 | % ----------------------------------------------------------- |
---|
| 2088 | \subsection{Courant numbers} |
---|
| 2089 | |
---|
[9413] | 2090 | Courant numbers provide a theoretical indication of the model's numerical stability. |
---|
| 2091 | The advective Courant numbers can be calculated according to |
---|
[6497] | 2092 | |
---|
[10414] | 2093 | \[ |
---|
| 2094 | C_u = |u|\frac{\rdt}{e_{1u}}, \quad C_v = |v|\frac{\rdt}{e_{2v}}, \quad C_w = |w|\frac{\rdt}{e_{3w}} |
---|
| 2095 | % \label{eq:CFL} |
---|
| 2096 | \] |
---|
[6497] | 2097 | |
---|
[9413] | 2098 | in the zonal, meridional and vertical directions respectively. |
---|
[10354] | 2099 | The vertical component is included although it is not strictly valid as the vertical velocity is calculated from |
---|
| 2100 | the continuity equation rather than as a prognostic variable. |
---|
[9413] | 2101 | Physically this represents the rate at which information is propogated across a grid cell. |
---|
[10354] | 2102 | Values greater than 1 indicate that information is propagated across more than one grid cell in a single time step. |
---|
[2541] | 2103 | |
---|
[11512] | 2104 | The variables can be activated by setting the \np{nn\_diacfl} namelist parameter to 1 in the \nam{ctl} namelist. |
---|
[9413] | 2105 | The diagnostics will be written out to an ascii file named cfl\_diagnostics.ascii. |
---|
[10354] | 2106 | In this file the maximum value of $C_u$, $C_v$, and $C_w$ are printed at each timestep along with the coordinates of |
---|
| 2107 | where the maximum value occurs. |
---|
| 2108 | At the end of the model run the maximum value of $C_u$, $C_v$, and $C_w$ for the whole model run is printed along |
---|
| 2109 | with the coordinates of each. |
---|
[11512] | 2110 | The maximum values from the run are also copied to the ocean.output file. |
---|
[2541] | 2111 | |
---|
[9413] | 2112 | % ================================================================ |
---|
[2541] | 2113 | |
---|
[10414] | 2114 | \biblio |
---|
| 2115 | |
---|
[10442] | 2116 | \pindex |
---|
| 2117 | |
---|
[6997] | 2118 | \end{document} |
---|