Skip to content
Snippets Groups Projects
Commit 1e9e3d10 authored by Katherine Hutchinson's avatar Katherine Hutchinson
Browse files

Resolve "Seb and Kat - last changes to user guide for 4.2.1 release"

parent c064b68b
No related branches found
No related tags found
1 merge request!18Resolve "Seb and Kat - last changes to user guide for 4.2.1 release"
......@@ -84,12 +84,8 @@ Install XIOS library
With the sole exception of running NEMO without MPI
(in which case output options are limited to the default minimum),
diagnostic outputs from NEMO are handled by the third party ``XIOS`` library.
It can be used in two different modes:
:*attached*: Each NEMO process directly deals with its own output.
:*detached*: You have separate XIOS processes that deal with the output.
For both of these options, you can activate the option for "one_file" or "multiple_file" mode. For the former, output is collected and collated to directly produce one single file for your domain. For the latter option, you will have as many output files as your number of NEMO processes (if in attached) or XIOS processes (if in detatched).
For more details, refer the to section on configuring XIOS outputs below.
Instructions on how to install XIOS can be found on its :xios_doc:`wiki<>`.
......@@ -127,7 +123,7 @@ modifications, can clone the repository at the release tag:
git clone --branch 4.2.1 https://forge.nemo-ocean.eu/nemo/nemo.git nemo_4.2.1
Experienced developers who may wish to experiment with other branches or code more recent than the
release -perhaps with a view to returning developements to the system, can clone the main repository
release (perhaps with a view to returning developements to the system), can clone the main repository
and then switch to the tagged release:
.. code:: console
......@@ -178,6 +174,8 @@ All compiler options in NEMO are controlled using files in :file:`./arch/arch-'m
If you want further help on how to use this functionality: ./build_arch-auto.sh -h
The build_arch-auto.sh will create an arch file called arch-auto.fcm
Alternatively, you can copy, rename and edit a configuration file from an architecture similar to your own.
You will need to set appropriate values for all of the variables in the file.
In particular the variables:
......@@ -199,30 +197,31 @@ Preparing an experiment
Create and compile a new configuration
--------------------------------------
The main script to {re}compile and create executable is called :file:`makenemo` located at
The main script to {re}compile and create an executable is called :file:`makenemo`, it is located at
the root of the working copy.
It is used to identify the routines you need from the source code, to build the makefile and run it.
As an example, compile a :file:`MY_GYRE` configuration from GYRE with 'my_arch':
As an example, compile a :file:`MY_GYRE` configuration from GYRE, which can be found in the ``cfgs`` directory (more information on GYRE can be found in the `NEMO Reference Manual <https://doi.org/10.5281/zenodo.6334656>`_). The following example uses the 'auto' arch file (if you used the automatic build):
.. code-block:: sh
./makenemo –m 'my_arch' –r GYRE -n 'MY_GYRE'
./makenemo -h # This is for help
./makenemo –m 'auto' –r GYRE -n 'MY_GYRE'
Then at the end of the configuration compilation,
:file:`MY_GYRE` directory will have the following structure.
the :file:`MY_GYRE` directory will have the following structure.
+------------+----------------------------------------------------------------------------+
| Directory | Purpose |
+============+============================================================================+
| ``BLD`` | BuiLD folder: target executable, headers, libs, preprocessed routines, ... |
| ``BLD`` | BuiLD folder: target executable, libraries, preprocessed routines, ... |
+------------+----------------------------------------------------------------------------+
| ``EXP00`` | Run folder: link to executable, namelists, ``*.xml`` and IOs |
| ``EXP00`` | Run folder: link to executable, namelists, ``*.xml`` and IOs |
+------------+----------------------------------------------------------------------------+
| ``EXPREF`` | Files under version control only for :doc:`official configurations <cfgs>` |
+------------+----------------------------------------------------------------------------+
| ``MY_SRC`` | New routines or modified copies of NEMO sources |
| ``MY_SRC`` | Your new routines or your modified copies of NEMO sources |
+------------+----------------------------------------------------------------------------+
| ``WORK`` | Links to all raw routines from :file:`./src` considered |
| ``WORK`` | Links to all fortran routines that you will compile. |
+------------+----------------------------------------------------------------------------+
After successful execution of :file:`makenemo` command,
......@@ -232,42 +231,49 @@ the executable called `nemo` is available in the :file:`EXP00` directory
Viewing and changing list of active CPP keys
--------------------------------------------
For a given configuration (here called ``MY_CONFIG``),
A CPP key is used to activate/disactivate certain parts of the code at the pre-compilation stage.
For a given configuration located in the ``cfgs`` directory (here called ``MY_CONFIG``),
the list of active CPP keys can be found in :file:`./cfgs/'MYCONFIG'/cpp_MY_CONFIG.fcm`
This text file can be edited by hand or with :file:`makenemo` to change the list of active CPP keys.
Once changed, one needs to recompile ``nemo`` in order for this change to be taken in account.
Once changed, one needs to recompile ``nemo`` in order for this change to be taken into account.
Note that most NEMO configurations will need to specify the following CPP keys:
``key_xios`` for IOs. MPI parallelism is activated by default. Use ``key_mpi_off`` to compile without MPI.
.. code-block:: sh
./makenemo –m 'auto' -r 'MY_CONFIG' add_key 'key_mykey1 key_mykey2' del_key 'key_notwanted'
Configure XIOS outputs
----------------------
XIOS allows for an efficient management of diagnostic outputs as
the time averaging, file writing and even some simple arithmetic or regridding are carried out in
parallel to the NEMO model run.
XIOS allows for an efficient management of diagnostic outputs.
This page gives a basic introduction to using XIOS with NEMO.
Additional information are available at the XIOS :xios:`wiki<>` and in the NEMO reference manual.
Use of XIOS for NEMO IOs is activated using the pre-compiler key ``key_xios``.
XIOS is controlled by means of XML input files that should be copied to your model run directory before running the model.
Examples of these files can be found in the reference configurations (:file:`./cfgs`).
Examples of these files can be found in the reference configurations' subdirectories (:file:`./cfgs`).
The XIOS executable expects to find a file called :file:`iodef.xml` in the model run directory.
In NEMO we have made the decision to use include statements in the :file:`iodef.xml` file to include:
To improve readability, NEMO has the following 'include' statements in the :file:`iodef.xml` file:
- :file:`field_def_nemo-oce.xml` (for physics),
- :file:`field_def_nemo-ice.xml` (for ice),
- :file:`field_def_nemo-pisces.xml` (for biogeochemistry) and
- :file:`domain_def.xml` from the :file:`./cfgs/SHARED` directory.
- :file:`field_def_nemo-oce.xml` (potential output variable definition for physics)
- :file:`field_def_nemo-ice.xml` (potential output variable definition for ice)
- :file:`field_def_nemo-pisces.xml` (potential output variable definition for biogeochemistry)
- :file:`domain_def.xml` and :file:`axis_def.xml` (horizontal and vertical grid information)
Most users will not need to modify :file:`domain_def.xml` or :file:`field_def_nemo-???.xml` unless
they want to add new diagnostics to the NEMO code.
The definition of the output files is organized into separate :file:`file_definition.xml` files which
are included in the :file:`iodef.xml` file.
All these files are available in the :file:`./cfgs/SHARED` directory.
.. note::
| Most users will not modify the above xml files unless they want to add new diagnostics to the NEMO code.
| The user, instead, defines the selection of output files that is of interest to them in :file:`file_def_nemo-oce/ice/pisces.xml` files.
XIOS be used along with NEMO with two different modes:
XIOS can be used along with NEMO in two different modes:
Detached Mode
^^^^^^^^^^^^^
......@@ -291,6 +297,9 @@ This method is less efficient than the detached mode but can be more convenient
with small configurations.
To activate this mode simply set ``using_server`` to false in the :file:`iodef.xml` file
.. note::
| For both of these options, you can activate the option for "one_file" or "multiple_file" mode. For the former, output is collected and collated to directly produce one single file for your domain. For the latter option, you will have as many output files as your number of NEMO processes (if in attached) or XIOS processes (if in detatched).
More :file:`makenemo` options
-----------------------------
......@@ -312,16 +321,15 @@ For example:
./makenemo –m 'my_arch' –r GYRE -n 'MY_GYRE' -j 8
will compile up to 8 processes simultaneously.
will compile with up to 8 processes simultaneously.
Default behaviour
-----------------
At the first use,
The first time you call ``makenemo``,
you need the ``-m`` option to specify the architecture configuration file
(compiler and its options, routines and libraries to include),
then for next compilation, it is assumed you will be using the same compiler.
If the ``-n`` option is not specified the last compiled configuration will be used.
then for next compilation, it is assumed that you will be using the same compiler.
Tools used during the process
-----------------------------
......@@ -330,11 +338,11 @@ The various bash scripts used by ``makenemo`` (for instance, to create the
``WORK`` directory) are located in the ``mk`` subdirectory. In most cases, there
should be no need for user intervention with these scripts. Occasionally,
incomplete builds can leave the environment in a indeterminate state. If
problems are experienced with subsequent attempts then running:
problems are experienced with subsequent attempts then try running:
.. code-block:: sh
./makenemo –m 'my_arch' –r GYRE -n 'MY_GYRE' clean
./makenemo –m 'my_arch' –r 'MY_GYRE' clean
will prepare the directories for a fresh attempt and remove any intermediate files
that may be causing issues.
......@@ -375,10 +383,3 @@ If the configuration needs other input files, they have to be placed here.
mpirun -n $NPROCS ./nemo # $NPROCS is the number of processes
# mpirun is your MPI wrapper
If you are completely new to NEMO or this is your first experience of running MPI-based
ocean models, then you may wish to consider activating the ``SETTE`` testing framework. If
your HPC environment matches or is similar to one of the supported environments then you
may find it simpler to activate one of the reference configurations this way since SETTE
includes example submission scripts for common batch environments and scripts to fetch
all the input files for the more realistic reference configurations. See the
:doc:`SETTE <sette>` section of this guide for more details.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment