Version 40 (modified by nicolasmartin, 3 years ago) (diff)

Install the modelling framework (NEMO and XIOS)

Last edition: 10/15/18 16:28:03 by nemo

1. Extract the NEMO code

Using your my_login /pw registered here:

svn --username 'mylogin' co

Description of directory tree

The image below shows the directory tree:


Compilation option files, with format arch_compiler.fcm, the compiler name has to be provided with –m option


All configurations and a cpp.fcm file containing the list of CPP keys to each configuration


Package to implement an embedded model (AGRIF)


FORTRAN source codes in several sub-directories


Package to make tests to ensure the reproducibility and restartability of the code after changes


Useful softwares to different utilities

2. Extract and install XIOS

Diagnostic outputs from NEMO are handled by the third party XIOS library.

Important notice: XIOS needs to be compiled before NEMO, since the libraries are needed to successfully create NEMO executable.
Instructions on how to obtain and install the software, see Users/Model Interfacing/Inputs Outputs.

When you compile NEMO you will need to specify the following CPP keys:

  • key_iomput
  • key_mpp_mpi (if you want to use "detached mode")
  • key_xios2 if you wish to use XIOS2 in nemo_v3_6_STABLE. XIOS2 is the only version available in the trunk.

3. Setup your ARCH file

All compiler options in NEMO are controlled using files in NEMOGCM/ARCH/arch-my_arch.fcm where my_arch is the name of your architecture FCM file.
It is recommended to copy and rename an ARCH file from an architecture similar to your own architecture. You will need to set appropriate values for all of the variables in the file. The FCM variables %NCDF_HOME, %HDF5_HOME and %XIOS_HOME should be set to the installation directories used above.

Error: Macro IncludeSource(/branches/2015/nemo_v3_6_STABLE/NEMOGCM/ARCH/arch-macport_osx.fcm, start=42, end=45, mimetype=application/x-shellscript, line_numbers=0) failed
No node /branches/2015/nemo_v3_6_STABLE/NEMOGCM/ARCH/arch-macport_osx.fcm at revision 13248

4. Compile and create NEMO executable

The main script to compile and create executable is called makenemo and located in the CONFIG directory. To identify the source code you need, to build the makefile and run it.
As an example, compile GYRE with my_arch to create a MY_GYRE configuration:

cd NEMOGCM/CONFIG; ./makenemo –m 'my_arch' –r GYRE -n 'MY_GYRE'

After successful execution of makenemo command, the executable called opa is created in the EXP00 directory (in the example above, the executable is created in CONFIG/MY_GYRE/EXP00)

The image below shows the directory tree characterized by "MY_CONFIG" new 'branch'. All directories and fundamental files created by makenemo are highlighted in green. In particular, even if not shown in the figure, WORK folder contains links to the compiled routines.





More options

Error: Macro IncludeSource(/branches/2015/nemo_v3_6_STABLE/NEMOGCM/CONFIG/makenemo, start=131, end=143, mimetype=application/x-shellscript) failed
No node /branches/2015/nemo_v3_6_STABLE/NEMOGCM/CONFIG/makenemo at revision 13248

Default behavior

At the first use, you need the -m option to specify compiler, its options and libraries, then for next compilation, it is assumed you will be using the same compiler.
If –n option is not specified, ORCA2_LIM is the default configuration used. -d option has been implemented for use in non-interactive shell. The WORK directory is created under each configuration directory.

Tools used during the process

  • : bash functions used by makenemo, for instance to create the WORK directory
  • cfg.txt : text list of configurations and source directories
  • bld.cfg : FCM rules to compile


Error: Macro IncludeSource(/branches/2015/nemo_v3_6_STABLE/NEMOGCM/CONFIG/makenemo, start=145, end=166, mimetype=application/x-shellscript) failed
No node /branches/2015/nemo_v3_6_STABLE/NEMOGCM/CONFIG/makenemo at revision 13248

5. Running the model

Once makenemo has run successfully, the opa executable is available in CONFIG/"MY_CONFIG"/EXP00
For the reference configurations, the EXP00directory also contains the small ASCII input file (namelists, *xml files for the IOs…). If the configuration also needs NetCDF input files, this should be downloaded into the EXP00 directory from the corresponding tarfile, see Users/Reference Configurations

mpirun -n $NPROCS ./opa    # $NPROCS is the number of processes ; mpirun is your MPI wrapper

6. Viewing and changing list of active CPP keys

For a given configuration (here called MY_CONFIG), the list of active CPP keys can be found in


This text file can be edited to change the list of active CPP keys. Once changed, one needs to recompile NEMO using makenemo command in order for this change to be taken in account.

Attachments (2)

Download all attachments as: .zip