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.
Changeset 11954 for NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/cfgs/SHARED/README.rst – NEMO

Ignore:
Timestamp:
2019-11-22T17:15:18+01:00 (4 years ago)
Author:
acc
Message:

Branch 2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles. Merge in trunk changes up to 11943 in preparation for end of year merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/cfgs/SHARED/README.rst

    r10598 r11954  
    33*********** 
    44 
     5.. todo:: 
     6 
     7 
     8 
    59.. contents:: 
    6            :local: 
     10   :local: 
    711 
    812Output of diagnostics in NEMO is usually done using XIOS. 
    9 This is an efficient way of writing diagnostics because the time averaging, file writing and even some simple arithmetic or regridding is carried out in parallel to the NEMO model run. 
     13This is an efficient way of writing diagnostics because 
     14the time averaging, file writing and even some simple arithmetic or regridding is carried out in 
     15parallel to the NEMO model run. 
    1016This page gives a basic introduction to using XIOS with NEMO. 
    11 Much more information is available from the XIOS homepage above and from the NEMO manual. 
     17Much more information is available from the :xios:`XIOS homepage<>` above and from the NEMO manual. 
    1218 
    13 Use of XIOS for diagnostics is activated using the pre-compiler key ``key_iomput``.  
     19Use of XIOS for diagnostics is activated using the pre-compiler key ``key_iomput``. 
    1420 
    1521Extracting and installing XIOS 
    16 ------------------------------ 
     22============================== 
    1723 
    18241. Install the NetCDF4 library. 
    19    If you want to use single file output you will need to compile the HDF & NetCDF libraries to allow parallel IO. 
    20 2. Download the version of XIOS that you wish to use. The recommended version is now XIOS 2.5: 
    21     
    22 .. code-block:: console 
     25   If you want to use single file output you will need to compile the HDF & NetCDF libraries to 
     26   allow parallel IO. 
     272. Download the version of XIOS that you wish to use. 
     28   The recommended version is now XIOS 2.5: 
    2329 
    24    $ svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 xios-2.5 
     30   .. code-block:: console 
    2531 
    26 and follow the instructions in `XIOS documentation <http://forge.ipsl.jussieu.fr/ioserver/wiki/documentation>`_ to compile it. 
    27    If you find problems at this stage, support can be found by subscribing to the `XIOS mailing list <http://forge.ipsl.jussieu.fr/mailman/listinfo.cgi/xios-users>`_ and sending a mail message to it.  
     32      $ svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 
     33 
     34and follow the instructions in :xios:`XIOS documentation <wiki/documentation>` to compile it. 
     35If you find problems at this stage, support can be found by subscribing to 
     36the :xios:`XIOS mailing list <../mailman/listinfo.cgi/xios-users>` and sending a mail message to it. 
    2837 
    2938XIOS Configuration files 
    3039------------------------ 
    3140 
    32 XIOS is controlled using xml input files that should be copied to your model run directory before running the model. 
    33 Examples of these files can be found in the reference configurations (``cfgs``). The XIOS executable expects to find a file called ``iodef.xml`` in the model run directory. 
    34 In NEMO we have made the decision to use include statements in the ``iodef.xml`` file to include ``field_def_nemo-oce.xml`` (for physics), ``field_def_nemo-ice.xml`` (for ice), ``field_def_nemo-pisces.xml`` (for biogeochemistry) and ``domain_def.xml`` from the /cfgs/SHARED directory. 
    35 Most users will not need to modify ``domain_def.xml`` or ``field_def_nemo-???.xml`` unless they want to add new diagnostics to the NEMO code. 
    36 The definition of the output files is organized into separate ``file_definition.xml`` files which are included in the ``iodef.xml`` file. 
     41XIOS is controlled using XML input files that should be copied to 
     42your model run directory before running the model. 
     43Examples of these files can be found in the reference configurations (:file:`./cfgs`). 
     44The XIOS executable expects to find a file called :file:`iodef.xml` in the model run directory. 
     45In NEMO we have made the decision to use include statements in the :file:`iodef.xml` file to include: 
     46 
     47- :file:`field_def_nemo-oce.xml` (for physics), 
     48- :file:`field_def_nemo-ice.xml` (for ice), 
     49- :file:`field_def_nemo-pisces.xml` (for biogeochemistry) and 
     50- :file:`domain_def.xml` from the :file:`./cfgs/SHARED` directory. 
     51 
     52Most users will not need to modify :file:`domain_def.xml` or :file:`field_def_nemo-???.xml` unless 
     53they want to add new diagnostics to the NEMO code. 
     54The definition of the output files is organized into separate :file:`file_definition.xml` files which 
     55are included in the :file:`iodef.xml` file. 
    3756 
    3857Modes 
    39 ----- 
     58===== 
    4059 
    4160Detached Mode 
     
    4463In detached mode the XIOS executable is executed on separate cores from the NEMO model. 
    4564This is the recommended method for using XIOS for realistic model runs. 
    46 To use this mode set ``using_server`` to ``true`` at the bottom of the ``iodef.xml`` file: 
     65To use this mode set ``using_server`` to ``true`` at the bottom of the :file:`iodef.xml` file: 
    4766 
    4867.. code-block:: xml 
    4968 
    50    <variable id="using_server" type="boolean">true</variable> 
     69   <variable id="using_server" type="boolean">true</variable> 
    5170 
    52 Make sure there is a copy (or link to) your XIOS executable in the working directory and in your job submission script allocate processors to XIOS. 
     71Make sure there is a copy (or link to) your XIOS executable in the working directory and 
     72in your job submission script allocate processors to XIOS. 
    5373 
    5474Attached Mode 
     
    5676 
    5777In attached mode XIOS runs on each of the cores used by NEMO. 
    58 This method is less efficient than the detached mode but can be more convenient for testing or with small configurations. 
    59 To activate this mode simply set ``using_server`` to false in the ``iodef.xml`` file 
     78This method is less efficient than the detached mode but can be more convenient for testing or 
     79with small configurations. 
     80To activate this mode simply set ``using_server`` to false in the :file:`iodef.xml` file 
    6081 
    6182.. code-block:: xml 
    6283 
    63    <variable id="using_server" type="boolean">false</variable> 
     84   <variable id="using_server" type="boolean">false</variable> 
    6485 
    6586and don't allocate any cores to XIOS. 
    66 Note that due to the different domain decompositions between XIOS and NEMO if the total number of cores is larger than the number of grid points in the j direction then the model run will fail. 
     87 
     88.. note:: 
     89 
     90   Due to the different domain decompositions between XIOS and NEMO, 
     91   if the total number of cores is larger than the number of grid points in the ``j`` direction then 
     92   the model run will fail. 
    6793 
    6894Adding new diagnostics 
    69 ---------------------- 
     95====================== 
    7096 
    7197If you want to add a NEMO diagnostic to the NEMO code you will need to do the following: 
    7298 
    73991. Add any necessary code to calculate you new diagnostic in NEMO 
    74 2. Send the field to XIOS using ``CALL iom_put( 'field_id', variable )`` where ``field_id`` is a unique id for your new diagnostics and variable is the fortran variable containing the data. 
    75    This should be called at every model timestep regardless of how often you want to output the field. No time averaging should be done in the model code.  
    76 3. If it is computationally expensive to calculate your new diagnostic you should also use "iom_use" to determine if it is requested in the current model run. For example, 
    77     
    78 .. code-block:: fortran 
     1002. Send the field to XIOS using ``CALL iom_put( 'field_id', variable )`` where 
     101   ``field_id`` is a unique id for your new diagnostics and 
     102   variable is the fortran variable containing the data. 
     103   This should be called at every model timestep regardless of how often you want to output the field. 
     104   No time averaging should be done in the model code. 
     1053. If it is computationally expensive to calculate your new diagnostic 
     106   you should also use "iom_use" to determine if it is requested in the current model run. 
     107   For example, 
    79108 
    80       IF iom_use('field_id') THEN 
    81          !Some expensive computation 
    82          !... 
    83          !... 
    84          iom_put('field_id', variable) 
    85       ENDIF 
     109   .. code-block:: fortran 
    86110 
    87 4. Add a variable definition to the ``field_def_nemo-???.xml`` file. 
    88 5. Add the variable to the ``iodef.xml`` or ``file_definition.xml`` file. 
     111      IF iom_use('field_id') THEN 
     112         !Some expensive computation 
     113         !... 
     114         !... 
     115    iom_put('field_id', variable) 
     116      ENDIF 
     117 
     1184. Add a variable definition to the :file:`field_def_nemo-???.xml` file. 
     1195. Add the variable to the :file:`iodef.xml` or :file:`file_definition.xml` file. 
Note: See TracChangeset for help on using the changeset viewer.