NEMO 安装
# Prerequisites
Suggestion from J Mak[4]:
Get someone who knows what they are doing to do it for you! Compiling the following from scratch is not the most interesting activity and is actually quite fiddly (especially the HDF5 and NetCDF4 stuff)…if you don’t have access to people who can do that, then try.
Before installing these, run which h5copy
and which nc-config
to see if hdf5 and netcdf are already available. If so, we can skip installing them and zlib.
# zlib
When I was trying to install Netcdf, I found this requirement in its INSTALL.md
file. After downloading packages from server, build it like:
./configure --prefix=/usr/local/pnetcdf | |
make check install |
# hdf5
Specifying the location of the zlib library:
CC=/.../mpicc ./configure --with-zlib=/usr/local/pnetcdf/lib --prefix=/usr/local/pnetcdf --enable-parallel --enable-shared | |
make check install |
Just add [--{enable-fortran,disable-shared,enable-parallel}]
from offical documentation of NEMO[1] may bring some problems.
# netcdf
After HDF5 is done, build netcdf, specifying the location of the HDF5, zlib, and libraries in the CPPFLAGS and LDFLAGS environment variables. For example:
CC=/.../mpicc CPPFLAGS=-I/usr/local/pnetcdf/include LDFLAGS=-L/usr/local/pnetcdf/lib ./configure --prefix=/usr/local/pnetcdf --enable-parallel-tests --disable-dap | |
make check install |
You can check the output or setting file in lib
to see whether parallel IO is on. Or use nc-config --all
.
Then build netcdf-fortran like:
CPPFLAGS=-I/usr/local/pnetcdf/include LDFLAGS=-L/usr/local/pnetcdf/lib ./configure --prefix=/usr/local/pnetcdf --enable-parallel-tests | |
make | |
make install | |
make check |
Could try adding LIBS='-hdf5 -lhdf5_hl -lz'
if something go wrong.
# Errors and fixes
checking for library containing H5Fflush… no
We need to build HDF5 lib as shared, so add flag --enable-shared
when building HDF5.
undefined reference to `H5Pset_fapl_mpiposix’
Edit file libsrc4/nc4file.c
. See this commit.
# ncview
It is not necessary, but it’s a easy tool to check the nc file.
First install Xaw using sudo yum install libXaw-devel
.
Then just following [6].
./configure --prefix=${HOME}/study/software/ncview/ --with-udunits2_incdir=${HOME}/study/software/udunits/include/ --with-udunits2_libdir=${HOME}/study/software/udunits/lib/ --with-png_incdir=${HOME}/study/software/libpng/include/ --with-png_libdir=${HOME}/study/software/libpng/lib/ |
Or, just run yum install ncview
.
# XIOS
Refer to wiki[2] and J Mak’s notes[4], first
svn checkout http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.0 xios-2.0 |
NEMO has requirements for the XIOS version, remember to check that.
Then modify files arch-GCC_LINUX.*
in arch
, add the -ldl
flag to HDF5_LIB
in arch-GCC_local.path
if build hdf5 library as a not shareable.
The boost_dir
and OASIS_dir
are not necessary, just leave them.
Finally, run
./make_xios --arch GCC_LINUX |
# NEMO
Copy and rename an configuration file as arch-my_arch.fcm
from an architecture similar to our own. Set the following variables:
%NCDF_HOME /usr/local/path/to/netcdf | |
%HDF5_HOME /usr/local/path/to/hdf5 | |
%XIOS_HOME /home/$( whoami )/path/to/xios-trunk |
Compile a reference configuration:
./makenemo –m 'my_arch' –r GYRE_PISCES |
And find nemo
in cfgs/GYRE_PISCES/EXP00
.
# Good luck!
Hope you can find nemo soon.
._ ._ ._ ._ ._ | |
_.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ | |
o _, _, | |
o .' ( .-' / | |
o _/..._'. .' / | |
( o .-'` ` '-./ _.' | |
) ( o) ;= <_ ( | |
( '-.,\\__ __.-;`\ '. ) | |
) ) \) |`\ \) '. \ ( ( | |
( ( \_/ '-._\ ) ) | |
) ) jgs ` ( ( | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
# Reference
- NEMO documentation
- XIOS wiki
- Kunpeng NEMO transplant
- J Mak NEMO notes
- NEMO Reference configurations inputs
- NCVIEW installation