- Timestamp:
- 2018-03-06T17:12:34+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_merge_2017/DOC/texfiles/chapters/chap_DIA.tex
r9373 r9376 82 82 in a very easy way. All details of iomput functionalities are listed in the following subsections. 83 83 Examples of the XML files that control the outputs can be found in: 84 \begin{alltt} 85 \begin{verbatim} 86 NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml 87 NEMOGCM/CONFIG/SHARED/field_def.xml 88 and 89 NEMOGCM/CONFIG/SHARED/domain_def.xml. 90 \end{verbatim} 91 \end{alltt} 84 \path{NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef.xml}, \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and 85 \path{NEMOGCM/CONFIG/SHARED/domain_def.xml}. 92 86 93 87 The second functionality targets output performance when running in parallel (\key{mpp\_mpi}). … … 201 195 See the installation guide on the \href{http://forge.ipsl.jussieu.fr/ioserver/wiki}{XIOS} wiki for help and guidance. 202 196 NEMO will need to link to the compiled XIOS library. 203 The \href{http ://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/XIOS-IO-server-installation-and-use}{XIOS with NEMO}197 The \href{https://forge.ipsl.jussieu.fr/nemo/wiki/Users/ModelInterfacing/InputsOutputs#Inputs-OutputsusingXIOS}{XIOS with NEMO} 204 198 guide provides an example illustration of how this can be achieved. 205 199 … … 223 217 For example: 224 218 \vspace{-20pt} 225 \begin{alltt} {{\scriptsize 226 \begin{verbatim} 219 \begin{xmlcode} 227 220 <field_definition> 228 221 <!-- T grid --> … … 233 226 ... 234 227 </field_definition> 235 \end{verbatim} 236 }}\end{alltt} 228 \end{xmlcode} 237 229 Note your definition must be added to the field\_group whose reference grid is consistent 238 230 with the size of the array passed to iomput. … … 241 233 or defined in the domain\_def.xml file. $e.g.$: 242 234 \vspace{-20pt} 243 \begin{alltt} {{\scriptsize 244 \begin{verbatim} 235 \begin{xmlcode} 245 236 <grid id="grid_T_3D" domain_ref="grid_T" axis_ref="deptht"/> 246 \end{verbatim} 247 }}\end{alltt} 237 \end{xmlcode} 248 238 Note, if your array is computed within the surface module each nn\_fsbc time\_step, 249 239 add the field definition within the field\_group defined with the id ''SBC'': $<$field\_group id=''SBC''...$>$ … … 252 242 \item[4.] add your field in one of the output files defined in iodef.xml (again see subsequent sections for syntax and rules) \\ 253 243 \vspace{-20pt} 254 \begin{alltt} {{\scriptsize 255 \begin{verbatim} 244 \begin{xmlcode} 256 245 <file id="file1" .../> 257 246 ... … … 259 248 ... 260 249 </file> 261 \end{verbatim} 262 }}\end{alltt} 250 \end{xmlcode} 263 251 264 252 \end{description} … … 394 382 395 383 \noindent In NEMO, by default, the field and domain definition is done in 2 separate files: 396 {\scriptsize \tt 397 \begin{verbatim} 398 NEMOGCM/CONFIG/SHARED/field_def.xml 399 and 400 NEMOGCM/CONFIG/SHARED/domain_def.xml 401 \end{verbatim} 402 } 384 \path{NEMOGCM/CONFIG/SHARED/field_def.xml} and \path{NEMOGCM/CONFIG/SHARED/domain_def.xml} 385 403 386 \noindent that are included in the main iodef.xml file through the following commands: \\ 404 387 {\scriptsize \verb? <field_definition src="./field_def.xml" /> ? \\ … … 415 398 example 1: Direct inheritance. 416 399 \vspace{-20pt} 417 \begin{alltt} {{\scriptsize 418 \begin{verbatim} 400 \begin{xmlcode} 419 401 <field_definition operation="average" > 420 402 <field id="sst" /> <!-- averaged sst --> 421 403 <field id="sss" operation="instant"/> <!-- instantaneous sss --> 422 404 </field_definition> 423 \end{verbatim} 424 }}\end{alltt} 425 405 \end{xmlcode} 426 406 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''average'' 427 407 of the attribute ''operation'' from its parent. Note that a child can overwrite … … 431 411 example 2: Inheritance by reference. 432 412 \vspace{-20pt} 433 \begin{alltt} {{\scriptsize 434 \begin{verbatim} 413 \begin{xmlcode} 435 414 <field_definition> 436 415 <field id="sst" long_name="sea surface temperature" /> … … 444 423 </file> 445 424 </file_definition> 446 \end{verbatim} 447 }}\end{alltt} 425 \end{xmlcode} 448 426 Inherit (and overwrite, if needed) the attributes of a tag you are refering to. 449 427 … … 455 433 Note that for the field ''toce'', we overwrite the grid definition inherited from the group by ''grid\_T\_3D''. 456 434 \vspace{-20pt} 457 \begin{alltt} {{\scriptsize 458 \begin{verbatim} 435 \begin{xmlcode} 459 436 <field_group id="grid_T" grid_ref="grid_T_2D"> 460 437 <field id="toce" long_name="temperature" unit="degC" grid_ref="grid_T_3D"/> … … 463 440 <field id="ssh" long_name="sea surface height" unit="m" /> 464 441 ... 465 \end{verbatim} 466 }}\end{alltt} 442 \end{xmlcode} 467 443 468 444 Secondly, the group can be used to replace a list of elements. … … 470 446 For example, a short list of the usual variables related to the U grid: 471 447 \vspace{-20pt} 472 \begin{alltt} {{\scriptsize 473 \begin{verbatim} 448 \begin{xmlcode} 474 449 <field_group id="groupU" > 475 450 <field field_ref="uoce" /> … … 477 452 <field field_ref="utau" /> 478 453 </field_group> 479 \end{verbatim} 480 }}\end{alltt} 454 \end{xmlcode} 481 455 that can be directly included in a file through the following syntax: 482 456 \vspace{-20pt} 483 \begin{alltt} {{\scriptsize 484 \begin{verbatim} 457 \begin{xmlcode} 485 458 <file id="myfile_U" output_freq="1d" /> 486 459 <field_group group_ref="groupU"/> 487 460 <field field_ref="uocetr_eff" /> <!-- add another field --> 488 461 </file> 489 \end{verbatim} 490 }}\end{alltt} 462 \end{xmlcode} 491 463 492 464 \subsection{Detailed functionalities } … … 501 473 of a 5 by 5 box with the bottom left corner at point (10,10). 502 474 \vspace{-20pt} 503 \begin{alltt} {{\scriptsize 504 \begin{verbatim} 475 \begin{xmlcode} 505 476 <domain_group id="grid_T"> 506 477 <domain id="myzoom" zoom_ibegin="10" zoom_jbegin="10" zoom_ni="5" zoom_nj="5" /> 507 \end{verbatim} 508 }}\end{alltt} 478 \end{xmlcode} 509 479 The use of this subdomain is done through the redefinition of the attribute domain\_ref of the tag family field. For example: 510 480 \vspace{-20pt} 511 \begin{alltt} {{\scriptsize 512 \begin{verbatim} 481 \begin{xmlcode} 513 482 <file id="myfile_vzoom" output_freq="1d" > 514 483 <field field_ref="toce" domain_ref="myzoom"/> 515 484 </file> 516 \end{verbatim} 517 }}\end{alltt} 485 \end{xmlcode} 518 486 Moorings are seen as an extrem case corresponding to a 1 by 1 subdomain. 519 487 The Equatorial section, the TAO, RAMA and PIRATA moorings are alredy registered in the code … … 523 491 by ''T'' (for example: ''8s137eT'', ''1.5s80.5eT'' ...) 524 492 \vspace{-20pt} 525 \begin{alltt} {{\scriptsize 526 \begin{verbatim} 493 \begin{xmlcode} 527 494 <file id="myfile_vzoom" output_freq="1d" > 528 495 <field field_ref="toce" domain_ref="0n180wT"/> 529 496 </file> 530 \end{verbatim} 531 }}\end{alltt} 497 \end{xmlcode} 532 498 Note that if the domain decomposition used in XIOS cuts the subdomain in several parts and if you use the ''multiple\_file'' type for your output files, you will endup with several files you will need to rebuild using unprovided tools (like ncpdq and ncrcat, \href{http://nco.sourceforge.net/nco.html#Concatenation}{see nco manual}). We are therefore advising to use the ''one\_file'' type in this case. 533 499 … … 535 501 Vertical zooms are defined through the attributs zoom\_begin and zoom\_end of the tag family axis. It must therefore be done in the axis part of the XML file. For example, in NEMOGCM/CONFIG/ORCA2\_LIM/iodef\_demo.xml, we provide the following example: 536 502 \vspace{-20pt} 537 \begin{alltt} {{\scriptsize 538 \begin{verbatim} 503 \begin{xmlcode} 539 504 <axis_group id="deptht" long_name="Vertical T levels" unit="m" positive="down" > 540 505 <axis id="deptht" /> 541 506 <axis id="deptht_myzoom" zoom_begin="1" zoom_end="10" /> 542 \end{verbatim} 543 }}\end{alltt} 507 \end{xmlcode} 544 508 The use of this vertical zoom is done through the redefinition of the attribute axis\_ref of the tag family field. For example: 545 509 \vspace{-20pt} 546 \begin{alltt} {{\scriptsize 547 \begin{verbatim} 510 \begin{xmlcode} 548 511 <file id="myfile_hzoom" output_freq="1d" > 549 512 <field field_ref="toce" axis_ref="deptht_myzoom"/> 550 513 </file> 551 \end{verbatim} 552 }}\end{alltt} 514 \end{xmlcode} 553 515 554 516 \subsubsection{Control of the output file names} … … 556 518 The output file names are defined by the attributs ''name'' and ''name\_suffix'' of the tag family file. for example: 557 519 \vspace{-20pt} 558 \begin{alltt} {{\scriptsize 559 \begin{verbatim} 520 \begin{xmlcode} 560 521 <file_group id="1d" output_freq="1d" name="myfile_1d" > 561 522 <file id="myfileA" name_suffix="_AAA" > <!-- will create file "myfile_1d_AAA" --> … … 566 527 </file> 567 528 </file_group> 568 \end{verbatim} 569 }}\end{alltt} 529 \end{xmlcode} 570 530 However it is often very convienent to define the file name with the name of the experiment, the output file frequency and the date of the beginning and the end of the simulation (which are informations stored either in the namelist or in the XML file). To do so, we added the following rule: if the id of the tag file is ''fileN''(where N = 1 to 999 on 1 to 3 digits) or one of the predefined sections or moorings (see next subsection), the following part of the name and the name\_suffix (that can be inherited) will be automatically replaced by:\\ 571 531 \\ … … 653 613 654 614 \vspace{-20pt} 655 \begin{alltt} {{\scriptsize 656 \begin{verbatim} 615 \begin{xmlcode} 657 616 <field field\_ref="sst" name="tosK" unit="degK" > sst + 273.15 </field> 658 617 <field field\_ref="taum" name="taum2" unit="N2/m4" long\_name="square of wind stress module" > taum * taum </field> 659 618 <field field\_ref="qt" name="stupid\_check" > qt - qsr - qns </field> 660 \end{verbatim} 661 }}\end{alltt} 619 \end{xmlcode} 662 620 663 621 (2) Simple computation: define a new variable and use it in the file definition. … … 665 623 in field\_definition: 666 624 \vspace{-20pt} 667 \begin{alltt} {{\scriptsize 668 \begin{verbatim} 625 \begin{xmlcode} 669 626 <field id="sst2" long\_name="square of sea surface temperature" unit="degC2" > sst * sst </field > 670 \end{verbatim} 671 }}\end{alltt} 627 \end{xmlcode} 672 628 in file\_definition: 673 629 \vspace{-20pt} 674 \begin{alltt} {{\scriptsize 675 \begin{verbatim} 630 \begin{xmlcode} 676 631 <field field\_ref="sst2" > sst2 </field> 677 \end{verbatim} 678 }}\end{alltt} 632 \end{xmlcode} 679 633 Note that in this case, the following syntaxe $<$field field\_ref="sst2" /$>$ is not working as sst2 won't be evaluated. 680 634 … … 682 636 683 637 \vspace{-20pt} 684 \begin{alltt} {{\scriptsize 685 \begin{verbatim} 638 \begin{xmlcode} 686 639 <!-- force to keep real 8 --> 687 640 <field field\_ref="sst" name="tos\_r8" prec="8" /> 688 641 <!-- integer 2 with add\_offset and scale\_factor attributes --> 689 642 <field field\_ref="sss" name="sos\_i2" prec="2" add\_offset="20." scale\_factor="1.e-3" /> 690 \end{verbatim} 691 }}\end{alltt} 643 \end{xmlcode} 692 644 Note that, then the code is crashing, writting real4 variables forces a numerical convection from real8 to real4 which will create an internal error in NetCDF and will avoid the creation of the output files. Forcing double precision outputs with prec="8" (for example in the field\_definition) will avoid this problem. 693 645 … … 695 647 696 648 \vspace{-20pt} 697 \begin{alltt} {{\scriptsize 698 \begin{verbatim} 649 \begin{xmlcode} 699 650 <file\_group id="1d" output\_freq="1d" output\_level="10" enabled=".TRUE."> <!-- 1d files --> 700 651 <file id="file1" name\_suffix="\_grid\_T" description="ocean T grid variables" > … … 707 658 </file> 708 659 </file\_group> 709 \end{verbatim} 710 }}\end{alltt} 660 \end{xmlcode} 711 661 712 662 (5) use of the ``@'' function: example 1, weighted temporal average … … 714 664 - define a new variable in field\_definition 715 665 \vspace{-20pt} 716 \begin{alltt} {{\scriptsize 717 \begin{verbatim} 666 \begin{xmlcode} 718 667 <field id="toce\_e3t" long\_name="temperature * e3t" unit="degC*m" grid\_ref="grid\_T\_3D" > toce * e3t </field > 719 \end{verbatim} 720 }}\end{alltt} 668 \end{xmlcode} 721 669 - use it when defining your file. 722 670 \vspace{-20pt} 723 \begin{alltt} {{\scriptsize 724 \begin{verbatim} 671 \begin{xmlcode} 725 672 <file\_group id="5d" output\_freq="5d" output\_level="10" enabled=".TRUE." > <!-- 5d files --> 726 673 <file id="file1" name\_suffix="\_grid\_T" description="ocean T grid variables" > … … 728 675 </file> 729 676 </file\_group> 730 \end{verbatim} 731 }}\end{alltt} 677 \end{xmlcode} 732 678 The freq\_op="5d" attribute is used to define the operation frequency of the ``@'' function: here 5 day. The temporal operation done by the ``@'' is the one defined in the field definition: here we use the default, average. So, in the above case, @toce\_e3t will do the 5-day mean of toce*e3t. Operation="instant" refers to the temporal operation to be performed on the field''@toce\_e3t / @e3t'': here the temporal average is alreday done by the ``@'' function so we just use instant to do the ratio of the 2 mean values. field\_ref="toce" means that attributes not explicitely defined, are inherited from toce field. Note that in this case, freq\_op must be equal to the file output\_freq. 733 679 … … 736 682 - define a new variable in field\_definition 737 683 \vspace{-20pt} 738 \begin{alltt} {{\scriptsize 739 \begin{verbatim} 684 \begin{xmlcode} 740 685 <field id="ssh2" long\_name="square of sea surface temperature" unit="degC2" > ssh * ssh </field > 741 \end{verbatim} 742 }}\end{alltt} 686 \end{xmlcode} 743 687 - use it when defining your file. 744 688 \vspace{-20pt} 745 \begin{alltt} {{\scriptsize 746 \begin{verbatim} 689 \begin{xmlcode} 747 690 <file\_group id="1m" output\_freq="1m" output\_level="10" enabled=".TRUE." > <!-- 1m files --> 748 691 <file id="file1" name\_suffix="\_grid\_T" description="ocean T grid variables" > … … 750 693 </file> 751 694 </file\_group> 752 \end{verbatim} 753 }}\end{alltt} 695 \end{xmlcode} 754 696 The freq\_op="1m" attribute is used to define the operation frequency of the ``@'' function: here 1 month. The temporal operation done by the ``@'' is the one defined in the field definition: here we use the default, average. So, in the above case, @ssh2 will do the monthly mean of ssh*ssh. Operation="instant" refers to the temporal operation to be performed on the field ''sqrt( @ssh2 - @ssh * @ssh )'': here the temporal average is alreday done by the ``@'' function so we just use instant. field\_ref="ssh" means that attributes not explicitely defined, are inherited from ssh field. Note that in this case, freq\_op must be equal to the file output\_freq. 755 697 … … 758 700 - define 2 new variables in field\_definition 759 701 \vspace{-20pt} 760 \begin{alltt} {{\scriptsize 761 \begin{verbatim} 702 \begin{xmlcode} 762 703 <field id="sstmax" field\_ref="sst" long\_name="max of sea surface temperature" operation="maximum" /> 763 704 <field id="sstmin" field\_ref="sst" long\_name="min of sea surface temperature" operation="minimum" /> 764 \end{verbatim} 765 }}\end{alltt} 705 \end{xmlcode} 766 706 - use these 2 new variables when defining your file. 767 707 \vspace{-20pt} 768 \begin{alltt} {{\scriptsize 769 \begin{verbatim} 708 \begin{xmlcode} 770 709 <file\_group id="1m" output\_freq="1m" output\_level="10" enabled=".TRUE." > <!-- 1m files --> 771 710 <file id="file1" name\_suffix="\_grid\_T" description="ocean T grid variables" > … … 773 712 </file> 774 713 </file\_group> 775 \end{verbatim} 776 }}\end{alltt} 714 \end{xmlcode} 777 715 The freq\_op="1d" attribute is used to define the operation frequency of the ``@'' function: here 1 day. The temporal operation done by the ``@'' is the one defined in the field definition: here maximum for sstmax and minimum for sstmin. So, in the above case, @sstmax will do the daily max and @sstmin the daily min. Operation="average" refers to the temporal operation to be performed on the field ``@sstmax - @sstmin'': here monthly mean (of daily max - daily min of the sst). field\_ref="sst" means that attributes not explicitely defined, are inherited from sst field. 778 716 … … 1114 1052 1115 1053 %------------------------------------------namnc4---------------------------------------------------- 1116 \ namdisplay{namnc4}1054 \fortranfile{namelists/namnc4} 1117 1055 %------------------------------------------------------------------------------------------------------------- 1118 1056 … … 1142 1080 1143 1081 \vspace{-20pt} 1144 \begin{alltt} {{\scriptsize 1145 \begin{verbatim} 1082 \begin{fortrancode} 1146 1083 ichunksz(1) = MIN( idomain_size,MAX( (idomain_size-1)/nn_nchunks_i + 1 ,16 ) ) 1147 1084 ichunksz(2) = MIN( jdomain_size,MAX( (jdomain_size-1)/nn_nchunks_j + 1 ,16 ) ) 1148 1085 ichunksz(3) = MIN( kdomain_size,MAX( (kdomain_size-1)/nn_nchunks_k + 1 , 1 ) ) 1149 1086 ichunksz(4) = 1 1150 \end{verbatim} 1151 }}\end{alltt} 1087 \end{fortrancode} 1152 1088 1153 1089 \noindent As an example, setting: 1154 1090 \vspace{-20pt} 1155 \begin{alltt} {{\scriptsize 1156 \begin{verbatim} 1091 \begin{fortrancode} 1157 1092 nn_nchunks_i=4, nn_nchunks_j=4 and nn_nchunks_k=31 1158 \end{verbatim} 1159 }}\end{alltt} \vspace{-10pt} 1093 \end{fortrancode} 1160 1094 1161 1095 \noindent for a standard ORCA2\_LIM configuration gives chunksizes of {\small\tt 46x38x1} … … 1222 1156 1223 1157 %------------------------------------------namtrd---------------------------------------------------- 1224 \ namdisplay{namtrd}1158 \fortranfile{namelists/namtrd} 1225 1159 %------------------------------------------------------------------------------------------------------------- 1226 1160 … … 1261 1195 \label{FLO} 1262 1196 %--------------------------------------------namflo------------------------------------------------------- 1263 \ namdisplay{namflo}1197 \fortranfile{namelists/namflo} 1264 1198 %-------------------------------------------------------------------------------------------------------------- 1265 1199 … … 1341 1275 1342 1276 \vspace{-30pt} 1343 \begin{alltt} {{\scriptsize 1344 \begin{verbatim} 1345 1277 \begin{xmlcode} 1346 1278 <group id="1d\_grid\_T" name="auto" description="ocean T grid variables" > } 1347 1279 <file id="floats" description="floats variables"> }\\ … … 1355 1287 </file>} 1356 1288 </group>} 1357 1358 \end{verbatim} 1359 }}\end{alltt} 1289 \end{xmlcode} 1360 1290 1361 1291 … … 1375 1305 1376 1306 %------------------------------------------namdia_harm---------------------------------------------------- 1377 \namdisplay{namdia_harm}1307 %\fortranfile{namelists/namdia_harm} 1378 1308 %---------------------------------------------------------------------------------------------------------- 1379 1309 … … 1417 1347 1418 1348 %------------------------------------------namdct---------------------------------------------------- 1419 \ namdisplay{namdct}1349 \fortranfile{namelists/namdct} 1420 1350 %------------------------------------------------------------------------------------------------------------- 1421 1351 … … 1746 1676 1747 1677 %------------------------------------------namptr----------------------------------------- 1748 \ namdisplay{namptr}1678 \fortranfile{namelists/namptr} 1749 1679 %----------------------------------------------------------------------------------------- 1750 1680 … … 1789 1719 1790 1720 %------------------------------------------nam_dia25h------------------------------------- 1791 \ namdisplay{nam_dia25h}1721 \fortranfile{namelists/nam_dia25h} 1792 1722 %----------------------------------------------------------------------------------------- 1793 1723 … … 1804 1734 1805 1735 %------------------------------------------nam_diatmb----------------------------------------------------- 1806 \ namdisplay{nam_diatmb}1736 \fortranfile{namelists/nam_diatmb} 1807 1737 %---------------------------------------------------------------------------------------------------------- 1808 1738
Note: See TracChangeset
for help on using the changeset viewer.