source: NEMO/trunk/INSTALL.rst @ 10187

Last change on this file since 10187 was 10187, checked in by nicolasmartin, 2 years ago

Push draft versions of RST root files

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