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.
INSTALL.rst in NEMO/trunk – NEMO

source: NEMO/trunk/INSTALL.rst @ 10227

Last change on this file since 10227 was 10201, checked in by nicolasmartin, 5 years ago

Various modifications related to the setting of a NEMO Quick Start Guide

  • Add missing namelist blocks from ICE and TOP
  • Create a hidden .global.rst to gather common URL links
  • Convert animated gif to frames images for PDF export
  • Place different README.rst appropriately in the code structure and refer to them with symbolic links in doc/rst/source
File size: 9.3 KB
Line 
1=====================
2Install the framework
3=====================
4
5.. include:: .global.rst
6
7.. contents:: \
8   :local:
9     
10Dependencies
11============
12
13| The NEMO source code is written in Fortran 95 and part of its dependencies are already included (``./ext``):
14  AGRIF preprocessing program "conv", FCM build system and IOIPSL library for outputs.
15| And some Perl 5, Fortran compiler (ifort, gfortran, pgfortran, ...), MPI library (Open MPI or MPICH)
16
17But The following dependencies should be from the official repositories of your Linux distribution but
18you will probably have to compile them from source for enabling parallel I/O support.
19
20- `HDF5`_   (C library)
21- `NetCDF`_ (C and Fortran libraries)
22
23Extract the source code
24=======================
25
26Download the source code
27
28.. code:: console
29
30   $ svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/release-4.0
31
32Description of directory tree
33=============================
34
35+-----------+---------------------------------------------------------------+
36| Folder    | Purpose                                                       |
37+===========+===============================================================+
38| ``arch``  | Settings (per architecture-compiler pair)                     |
39+-----------+---------------------------------------------------------------+
40| ``cfgs``  | Reference configurations                                      |
41+-----------+---------------------------------------------------------------+
42| ``doc``   | - ``latex``: reference manuals for NEMO, SI\ :sup:`3`\  & TOP |
43|           | - ``rst``:   quick start guide                                |
44+-----------+---------------------------------------------------------------+
45| ``ext``   | Dependencies included (AGRIF, FCM & IOIPSL)                   |
46+-----------+---------------------------------------------------------------+
47| ``mk``    | Building  routines                                            |
48+-----------+---------------------------------------------------------------+
49| ``src``   | Modelling routines                                            |
50|           |                                                               |
51|           | - ``ICE``: SI\ :sup:`3`\ for sea ice                          |
52|           | - ``NST``: AGRIF         for embedded zooms                   |
53|           | - ``OCE``: OPA           for ocean dynamics                   |
54|           | - ``MBG``: TOP           for tracers                          |
55+-----------+---------------------------------------------------------------+
56| ``tests`` | Test cases                                                    |
57+-----------+---------------------------------------------------------------+
58| ``tools`` | Utilities to [pre|post]process data                           |
59+-----------+---------------------------------------------------------------+
60
61Extract and install XIOS
62========================
63
64Diagnostic outputs from NEMO are handled by the third party XIOS library.
65
66Important notice: XIOS needs to be compiled before NEMO, since the libraries are needed to successfully create NEMO executable.
67Instructions on how to obtain and install the software, see Users/Model Interfacing/Inputs Outputs.
68
69When you compile NEMO you will need to specify the following CPP keys:
70 
71    key_iomput
72    key_mpp_mpi (if you want to run with multiple processes and/or use "detached mode" for the IOs system XIOS)
73    for nemo_v3_6_STABLE only: you can add key_xios2 if you wish to use the most recent XIOS2 release of XIOS. Doing so, you will have to change the xml files used as input for XIOS : in this release, the xml files are only XIOS1 compatible. If you add key_xios2 you can use xml files located in GYRE_XIOS/EXP00 as first templates. In future releases of NEMO XIOS2 will be the default XIOS release in use.
74
75Setup your architecture configuration file
76==========================================
77
78All compiler options in NEMO are controlled using files in NEMOGCM/ARCH/arch-'my_arch'.fcm where 'my_arch' is the name of the computing architecture.
79It is recommended to copy and rename an configuration file from an architecture similar to your owns. You will need to set appropriate values for all of the variables in the file. In particular the FCM variables %NCDF_HOME, %HDF5_HOME and %XIOS_HOME should be set to the installation directories used for XIOS installation.
80
81%NCDF_HOME           /opt/local
82%HDF5_HOME           /opt/local
83%XIOS_HOME           /Users/$( whoami )/xios-1.0
84%OASIS_HOME          /not/defined
85
86Compile and create NEMO executable
87==================================
88
89The main script to compile and create executable is called makenemo and located in the CONFIG directory, it is used to identify the routines you need from the source code, to build the makefile and run it.
90As an example, compile GYRE with 'my_arch' to create a 'MY_GYRE' configuration:
91
92.. code-block:: sh
93
94   ./makenemo –m 'my_arch' –r GYRE -n 'MY_GYRE'
95
96The image below shows the structure and some content of "MY_CONFIG" directory from the launching of the configuration creation (directories and fundamental files created by makenemo).
97
98+------------+----------------------------------------------------+
99| Folder     | Purpose                                            |
100+============+====================================================+
101| ``BLD``    |                                                    |
102+------------+----------------------------------------------------+
103| ``EXP00``  |                                                    |
104+------------+----------------------------------------------------+
105| ``EXPREF`` |                                                    |
106+------------+----------------------------------------------------+
107| ``MY_SRC`` |                                                    |
108+------------+----------------------------------------------------+
109| ``WORK``   |                                                    |
110+------------+----------------------------------------------------+
111
112Folder with the symbolic links to all unpreprocessed routines considered in the configuration
113Compilation folder (executables, headers files, libraries, preprocessed routines, flags, …)
114Computation folder for running the model (namelists, xml, executables and inputs-outputs)
115Folder intended to contain your customised routines (modified from initial ones or new entire routines)
116
117After 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).
118More options
119
120..
121   .. literalinclude::
122
123-----------------
124Default behaviour
125-----------------
126
127    At the first use, 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.
128    If –n option is not specified, ORCA2_LIM is the default configuration used.
129
130-----------------------------
131Tools used during the process
132-----------------------------
133
134    functions.sh : bash functions used by makenemo, for instance to create the WORK directory
135    cfg.txt : text list of configurations and source directories
136    bld.cfg : FCM rules to compile
137
138--------
139Examples
140--------
141
142        echo "Example to install a new configuration MY_CONFIG";
143        echo "with OPA_SRC and LIM_SRC_2 ";
144        echo "makenemo -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\"";
145        echo "";
146        echo "Available configurations :"; cat ${CONFIG_DIR}/cfg.txt;
147        echo "";
148        echo "Available unsupported (external) configurations :"; cat ${CONFIG_DIR}/uspcfg.txt;
149        echo "";
150        echo "Example to remove bad configuration ";
151        echo "./makenemo -n MY_CONFIG clean_config";
152        echo "";
153        echo "Example to clean ";
154        echo "./makenemo clean";
155        echo "";
156        echo "Example to list the available keys of a CONFIG ";
157        echo "./makenemo list_key";
158        echo "";
159        echo "Example to add and remove keys";
160        echo "./makenemo add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" ";
161        echo "";
162        echo "Example to add and remove keys for a new configuration, and do not compile";
163        echo "./makenemo -n MY_CONFIG -j0 add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" ";
164
165-----------------
166Running the model
167-----------------
168
169Once makenemo has run successfully, the opa executable is available in ``CONFIG/MY_CONFIG/EXP00``
170For the reference configurations, the EXP00 folder also contains the initial input files (namelists, \*xml files for the IOs…). If the configuration also needs NetCDF input files, this should be downloaded here from the corresponding tar file, see Users/Reference Configurations
171
172   cd 'MY_CONFIG'/EXP00
173   mpirun -n $NPROCS ./opa    # $NPROCS is the number of processes ; mpirun is your MPI wrapper
174
175--------------------------------------------
176Viewing and changing list of active CPP keys
177--------------------------------------------
178
179For a given configuration (here called MY_CONFIG), the list of active CPP keys can be found in::
180
181   NEMOGCM/CONFIG/'MYCONFIG'/cpp_'MY_CONFIG'.fcm
182
183This text file can be edited to change the list of active CPP keys. Once changed, one needs to recompile opa executable using makenemo command in order for this change to be taken in account.
184
185.. _HDF5:   http://www.hdfgroup.org/downloads/hdf5
186.. _NetCDF: http://www.unidata.ucar.edu/downloads/netcdf
Note: See TracBrowser for help on using the repository browser.