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