East Coast MEOPAR project documentation¶
This is a collection of documentation on ocean modeling using NEMO.
Contents¶
Compiling NEMOv3.6¶
This is a document on compiling NEMO 3.6. It also includes which versions of required libraries are appropriate for this task. Example scripts for compiling the libraries are also provided. These scripts are based on Mercator-ocean’s scripts for compiling NEMOv3.5.
Installing Required libraries¶
Required libraries¶
To install NEMO v3.6, the following libraries are required:
- MPI
- HDF5
- NETCDF4
- XIOS
To compile NEMO3.6, XIOS IO server should be installed. XIOS needs NETCDF4 and if you want to use the “one_file” mode which means having one overall output instead of outputs for each processor, you will need the hdf/netcdf libraries properly compiled to allow parallel IO. In this document, sample scripts are provided for installing required libraries using Intel compilers.
Installing HDF5¶
Download the latest version of hdf5 from website: http://www.hdfgroup.org/HDF5/release/obtain5.html#obtain
I downloaded version 1.8.13. A sample script for installing this library can be found in Installing HDF5
Installing NETCDF4¶
To compile XIOS library we need NECTD4 and not NETCDF3. To Install NETCDF4, first download and install the developer version of netcdf-c from github:
https://github.com/Unidata/netcdf-c
As this version does not have a configuration file you first must make it by:
autoreconf -i -f
A sample script for installing netcdf-c is here: Installing NETCDF-C
The next step is to install netcdf-fortran. Download the latest stable version and install the library. A sample script can be found in Installing NETCDF-FORTRAN
NOTE: Do not download the latest stable version of netcdf-c (4.3.2). If you do, you will encounter errors while compiling with enable-parallel option. This is due to a bug which has been fixed in the developers version.
Installing XIOS¶
Obtain the latest revision of XIOS:
svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS
Follow instructions given here to install: http://forge.ipsl.jussieu.fr/ioserver/wiki/documentation
Installing HDF5¶
This is a sample script for installing HDF5 using intel compilers.
#!/bin/bash
export HDF5_Make_Ignore=yes
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
# Configure
./configure --prefix=/home/fateme/Opt/opt-install/HDF5/HDF5_ZLIB_MPICH \
--enable-fortran --enable-parallel --enable-hl --enable-shared \
2>&1 | tee fateme-configure_hdf5_zlib.log
# Make and install
make 2>&1 | tee fateme-make_hdf5_zlib.log
make check 2>&1 | tee fateme-make_check_hdf5_zlib.log
make install 2>&1 | tee fateme-install_hdf5_zlib.log
Installing NETCDF-C¶
This is a sample script for installing NETCDF4-C using intel compilers.
#Configuration options
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
export F77=mpif90
export F90=mpif90
export LD=mpif90
export CFLAGS='-O2 -fPIC '
export CXXFLAGS="-O2 -fPIC "
export F90FLAGS="-O2 -fPIC "
export FCFLAGS="-O2 -fPIC "
export FFLAGS="-O2 -fPIC "
export LDFLAGS="-O2 -fPIC -shared-intel "
# FLAGS FOR F90 TEST-EXAMPLES
export FCFLAGS_f90="-O2 -fPIC "
#Installation Directories
export HDF5DIR=home/fateme/Opt/opt-install/HDF5/HDF5_ZLIB_MPICH
export NETCDFDIR=/home/fateme/Opt/opt-install/NETCDF4/NETCDF4_hdf5_mpich
export CPPFLAGS="-I$HDF5DIR/include"
export LDFLAGS=" -shared-intel -L$HDF5DIR/lib"
export LD_LIBRARY_PATH=$HDF5DIR/lib:$LD_LIBRARY_PATH
# Compile, test and install
./configure \
--prefix=$NETCDFDIR \
--disable-dap --disable-dap-remote-tests --enable-netcdf4 \
--enable-shared --enable-parallel-tests \
2>&1 | tee fateme-configure.log
make 2>&1 | tee fateme-make.log
make check 2>&1 | tee fateme-check.log
make install 2>&1 | tee fateme-install.log
Installing NETCDF-FORTRAN¶
This is a sample script for installing NETCDF-FORTRAN using intel compilers.
#Installation Directories
export HDF5DIR=home/fateme/Opt/opt-install/HDF5/HDF5_ZLIB_MPICH
export NETCDFDIR=/home/fateme/Opt/opt-install/NETCDF4/NETCDF4_hdf5_mpich
#Configuration options
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
export F77=mpif90
export F90=mpif90
export LD=mpif90
export CFLAGS="-O2 -fPIC"
export CXXFLAGS="-O2 -fPIC"
export F90FLAGS="-O2 -fPIC"
export FCFLAGS="-O2 -fPIC"
export FFLAGS="-O2 -fPIC"
# FLAGS FOR F90 TEST-EXAMPLES
export FCFLAGS_f90="-O2 -fPIC"
export CPPFLAGS="-DNDEBUG -DpgiFortran -I$HDF5DIR/include -I$NETCDFDIR/include"
export LDFLAGS="-shared-intel -L$HDF5DIR/lib -L$NETCDFDIR/lib"
export LD_LIBRARY_PATH=$NETCDFDIR:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$HDF5DIR:$LD_LIBRARY_PATH
export LIBS="-lnetcdf"
# Compile, test and install
./configure \
--prefix=$NETCDFDIR \
--disable-dap --disable-dap-remote-tests --enable-netcdf4 \
--enable-shared --enable-parallel-tests \
2>&1 | tee fateme-configure.log
make 2>&1 | tee fateme-make.log
make check 2>&1 | tee fateme-check.log
make install 2>&1 | tee fateme-install.log
Compiling NEMOv3.6¶
Getting the code¶
Download the latest version from the trunk repository:
svn --username yourusername co http://forge.ipsl.jussieu.fr/nemo/svn/trunk/NEMOGCM
Your username is the same as the one you use for http://www.nemo-ocean.eu/ website
Compiling code¶
To compile NEMOv3.6 you first need to create an architecture file compatible with your machine which also indicates the path to NETCDF4 and XIOS libraries. You can find example architecture files in NEMOGCM/ARCH folder.
After creating the architecture file, compile and create executable using an existing configuration. For example to use GYRE configuration and create a configuration called MY_GYRE:
cd NEMOGCM/CONFIG
./makenemo –m your_architecture –r GYRE -n MY_GYRE
Please refer to http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/NEMO-Quick-Start-Guide for further details