New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Users/ModelInstall (diff) – NEMO

Changes between Version 9 and Version 10 of Users/ModelInstall


Ignore:
Timestamp:
2017-05-03T19:45:24+02:00 (7 years ago)
Author:
gmattia
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Users/ModelInstall

    v9 v10  
    1212== 2. Extract and install XIOS 
    1313 
    14 {{{#!div class="important" 
    15 (Nicolas) '''Will not be online after the switch!!!''' 
     141 - Install the NetCDF4 library: 
     15XIOS needs NetCDF4 (not NetCDF3). In addition, if you want to use the "one_file" mode (see bellow), you will need the hdf/netcdf flibraries properly compiled to allow parallel IO. 
    1616 
    17 [http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/XIOS-IO-server-installation-and-use Document here] (and come back to this page afterwards to create NEMO executable!) 
    18 }}} 
     17Note that NetCDF files created by XIOS are not compatible with NetCDF3. The softwares you use to see or analyze NEMO outputs needs to be linked with NetCDF4 and not NetCDF3. 
     18 
     192 - Download XIOS 
     20The up to date version of XIOS is XIOS2 (previoulsy XIOS1). 
     21XIOS uses xml input files. Those are slightly different from XIOS1 to XIOS2. For the moment, interface for both XIOS1 and XIO2 are available in NEMO, so as the xml files for both. 
     22From nemo_v3_6_STABLE and further, use of XIOS2 is now strongly suggested. 
     23 
     24Download the XIOS2 software (this will create your xios-2.0 directory): 
     25cd $HOME 
     26svn co -r 819 http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk xios-2.0 
     27ln -s xios-2.0 XIOS 
     28 
     29Install the XIOS library and executable: 
     30Follow the documentation available here: http://forge.ipsl.jussieu.fr/ioserver/wiki/documentation 
     31 
     32Compile NEMO (see NEMO quickstart guide) using appropriate directives : 
     33- NEMO must be compiled with with following cpp keys (see your NEMOCGM/CONFIG/"MY_CONFIG"/cpp*.fcm file: 
     34 
     35  key_iomput and key_mpp_mpi 
     36and also (if using XIOS2) 
     37 
     38 key_xios2 
     39- you need to set appropriate PATHS for XIOS libraries in your ARCH/arch-xxxx.fcm file, 
     40 
     41see for example in NEMOGCM/ARCH, the arch files: arch-macport_osx.fcm, arch-PW6_VARGAS.fcm, arch-X64_CURIE.fcm or NOC  
     42Input files for XIOS: 
     43You need the following files: 
     44 
     45domain_def.xml 
     46field_def.xml 
     47iodef.xml 
     48Templates can be found here: 
     49 
     50NEMOGCM/CONFIG/SHARED for field_def.xml and domain_def.xml 
     51see NEMOGCM/CONFIG/ORCA2_LIM for examples of iodef*.xml 
     52 
     53(Templates for XIOS2 version are different from XIOS1 and can be found here: 
     54 
     55NEMOGCM/CONFIG/NEMOGCM/CONFIG/GYRE_XIOS for field_def.xml, file_def.xml, domain_def.xml, and example of iodef.xml) 
     56 
     57Run XIOS in attached mode: XIOS used as a library in NEMO, NEMO is the unique executable 
     58This mode has bad performances but is convenient as you have only one executable. It is suitable if you use a relatively low number of cores. 
     59 
     60Define the attached mode in iodef.xml: 
     61 
     62      <variable id="using_server" type="boolean">false</variable> 
     63Choose the number of files created: 
     64 
     65You can create as many files as NEMO cores or produce directly 1 file for all NEMO cores, by choosing the attribute type of the tag "file_definition" in iodef.xml 
     66 
     67 - As many files as NEMO cores : 
     68 
     69    <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     70Note that in this case, the files you will get are not located on the subdomains used in the mpi domain decomposition of NEMO. XIOS (even when it is used as a library) creates its own mpi domain decomposition in order to have subdomains containing complete lines (better for IO performances). 
     71 
     72 - A unique file for all NEMO cores: 
     73 
     74    <file_definition type="one_file" sync_freq="1d" min_digits="4"> 
     75Note that this mode is not available if you compiled XIOS with the option "--netcdf_lib netcdf4_seq" or if the hdf/netcdf flibraries are not properly compiled to allow parallel IO. 
     76 
     77Check and eventually change the buffer_size 
     78 
     79The buffer size is defined in iodef.xml according to your domain size, the number of cores you use and the memory available on your machine. 
     80Note that you will get a clear error message if this buffer is too small: 
     81 
     82      <variable id="buffer_size" type="integer">10000000</variable> 
     83 Buffer_size must be bigger than jpi*jpj*jpk*8*3 (with jpi(not jpiglo) and jpj(not jpjglo) NEMO subdomain size) 
     84 
     85Run NEMO: 
     86 
     87mpirun -np x ./opa 
     88Run XIOS in detached (or server) mode: XIOS used as a library in NEMO and as an external executable. 
     89This mode has the best performances but is less convenient as you have to deal with two executables (NEMO and XIOS). 
     90 
     91Define the mode in iodef.xml: 
     92 
     93      <variable id="using_server"              type="boolean">true</variable> 
     94Choose the number of files created: 
     95 
     96If you want to create 1 file per XIOS core or produce directly 1 file for all XIOS cores by choosing the attribute type of the tag "file_definition" in iodef.xml 
     97 - One file per XIOS core : 
     98 
     99    <file_definition type="multiple_file" sync_freq="1d" min_digits="4"> 
     100 - A unique file for all XIOS cores: 
     101 
     102    <file_definition type="one_file" sync_freq="1d" min_digits="4"> 
     103Note that this mode is not available if you compiled XIOS with the option "--netcdf_lib netcdf4_seq" or if the hdf/netcdf flibraries are not properly compiled to allow parallel IO. 
     104 
     105Check and eventually change the buffer_size 
     106 
     107The buffer size is defined in iodef.xml according to your domain size, the number of cores you use and the memory available on your machine. 
     108Note that you will get a clear error message if this buffer is too small: 
     109 
     110      <variable id="buffer_size"               type="integer">10000000</variable> 
     111 Buffer_size must be bigger than jpi*jpj*jpk*8*3 (with jpi(not jpiglo) and jpj(not jpjglo) the subdomain size) 
     112 
     113Copy xios executable in the directory to run NEMO: 
     114 
     115 cp XIOS/bin/xios_server.exe . 
     116Create once for all app.txt file: 
     117 
     118cat >app.txt 
     119-np x ./opa             # nemo will run on x cores 
     120-np y ./xios_server.exe # xios will run on y cores 
     121Run NEMO: 
     122 
     123mpirun --app app.txt 
     124Advanced options: 
     125 
     126From version 482 of XIOS onwards, several advanced features have been added to the server's capabilities. These include: the ability to perform computations with combinations of output fields; the ability to change the precision of output variables and the ability to add user-defined attributes. The following PDF document contains details and some worked examples: 
     127* Documentation: [attachment:wiki:Users/ModelInstall:newxios_functions_zooms.pdf] 
     128 
    19129 
    20130== 3. Compile and create NEMO executable