Changeset 10562
- Timestamp:
- 2019-01-23T17:26:33+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/cfgs/SHARED/README.rst
r10460 r10562 1 *********** 2 Diagnostics 3 *********** 1 DIAGNOSTICS 2 =========== 4 3 5 4 .. contents:: 6 5 :local: 7 6 8 | Output 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 10 some simple arithmetic or regridding is carried out in parallel to the NEMO model run. 11 | This page gives a basic introduction to using XIOS with NEMO. 12 Much more information is available from the XIOS homepage above and from the `NEMO manual`_. 7 Output of diagnostics in NEMO is usually done using XIOS. 8 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. 9 This page gives a basic introduction to using XIOS with NEMO. 10 Much more information is available from the XIOS homepage above and from the NEMO manual. 13 11 14 Use of XIOS for diagnostics is activated using the pre-compiler key ``key_iomput``. 15 The default version of XIOS is the 2.0 release. 12 Use of XIOS for diagnostics is activated using the pre-compiler key ``key_iomput``. 16 13 17 14 Extracting and installing XIOS 18 ============================== 15 ------------------------------ 19 16 20 17 1. Install the NetCDF4 library. 21 18 If you want to use single file output you will need to compile the HDF & NetCDF libraries to allow parallel IO. 22 2. Download the version of XIOS that you wish to use. 23 The recommended version is now XIOS 2.0: 19 2. Download the version of XIOS that you wish to use. The recommended version is now XIOS 2.5: 24 20 25 21 .. code-block:: console 26 22 27 $ svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.0 xios-2.023 $ svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 xios-2.5 28 24 29 and follow the instructions in :xios:`XIOS documentation <wiki/documentation>` to compile it. 30 If you find problems at this stage, support can be found by subscribing to the `XIOS mailing list 31 <http://forge.ipsl.jussieu.fr/mailman/listinfo.cgi/xios-users>`_ 32 and sending a mail message to it. 25 and follow the instructions in `XIOS documentation <http://forge.ipsl.jussieu.fr/ioserver/wiki/documentation>`_ to compile it. 26 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. 33 27 34 Namelists35 ========= 28 XIOS Configuration files 29 ------------------------ 36 30 37 XIOS is controlled using xml input files that should be copied to your model run directory before 38 running the model. 39 The exact setup differs slightly between 1.0 and 2.0 releases. 40 41 An ``iodef.xml`` file is still required in the run directory. 42 For XIOS 2.0 the ``field_def.xml`` file has been further split into ``field_def-oce.xml`` (for physics), 43 ``field_def-ice.xml`` (for ice) and ``field_def-bgc.xml`` (for biogeochemistry). 44 Also the definition of the output files has been moved from the ``iodef.xml`` file into 45 separate ``file_definition.xml`` files which are included in the ``iodef.xml`` file. 46 Note that the ``domain_def.xml`` file is also different for XIOS 2.0. 31 XIOS is controlled using xml input files that should be copied to your model run directory before running the model. 32 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. 33 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. 34 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. 35 The definition of the output files is organized into separate ``file_definition.xml`` files which are included in the ``iodef.xml`` file. 47 36 48 37 Modes 49 ===== 38 ----- 50 39 51 40 Detached Mode … … 60 49 <variable id="using_server" type="boolean">true</variable> 61 50 62 Make sure there is a copy (or link to) your XIOS executable in the working directory and 63 in your job submission script allocate processors to XIOS. 51 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. 64 52 65 53 Attached Mode … … 67 55 68 56 In attached mode XIOS runs on each of the cores used by NEMO. 69 This method is less efficient than the detached mode but can be more convenient for testing or 70 with small configurations. 57 This method is less efficient than the detached mode but can be more convenient for testing or with small configurations. 71 58 To activate this mode simply set ``using_server`` to false in the ``iodef.xml`` file 72 59 … … 76 63 77 64 and don't allocate any cores to XIOS. 78 Note that due to the different domain decompositions between XIOS and NEMO if 79 the total number of cores is larger than the number of grid points in the j direction then the model run will fail. 65 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. 80 66 81 67 Adding new diagnostics 82 ====================== 68 ---------------------- 83 69 84 70 If you want to add a NEMO diagnostic to the NEMO code you will need to do the following: 85 71 86 72 1. Add any necessary code to calculate you new diagnostic in NEMO 87 2. Send the field to XIOS using ``CALL iom_put( 'field_id', variable )`` where ``field_id`` is a unique id for 88 your new diagnostics and variable is the fortran variable containing the data. 89 This should be called at every model timestep regardless of how often you want to output the field. 90 No time averaging should be done in the model code. 91 3. If it is computationally expensive to calculate your new diagnostic you should also use "iom_use" to 92 determine if it is requested in the current model run. For example, 73 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. 74 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. 75 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, 93 76 94 77 .. code-block:: fortran 95 78 96 79 IF iom_use('field_id') THEN … … 101 84 ENDIF 102 85 103 4. Add a variable definition to the ``field_def .xml`` (or ``field_def-???.xml``) file86 4. Add a variable definition to the ``field_def_nemo-???.xml`` file. 104 87 5. Add the variable to the ``iodef.xml`` or ``file_definition.xml`` file.
Note: See TracChangeset
for help on using the changeset viewer.