Compiling SURFEX
Compilation must be done in the src/ directory. Go to the src/ directory. For the installation process, you could now use the ./configure script. Compilation options by default are:
- the compiler choosen to be "gfortran" => ARCH=LXgfortran
- the MPI library to be the MPIAUTO => VER_MPI=MPIAUTO
- the level of optimization for the compiler => OPTLEVEL=O2
To change these options, please refer to the section dedicated to the compilation options.
./configure
This will create a configuration file "profile_surfex-***" with an extension reflecting the different "choices" made automatically to match the computer on which you want to install SURFEX. The name of the profile created is indicated on your screen at the end of the execution of the ./configure (this exemple of compilation is indicated with default options of compilation).
. ../conf/profile_surfex-LXgfortran-SFX-V9-0-0-MPIAUTO-OMP-O2-X0
Run the compilation by executing ’make’ (if you have a multi-processor machine you can speedup the compilation, for example on four cores, with make -j 4)
make
The object files "*.o" & main executables of SURFEX (PGD, PREP, OFFLINE, SODA) are compiled in one step and created in the directory dir_obj-$(ARCH).../MASTER/ . The exact name of this "dir_obj..." depends on the different environnement variables set by the "profile_surfex...." which you have loaded before the compilation.
This allows by loading different "profile_surfex.." files to compile in the same source/installation directory different versions of SURFEX, with different compilers, different versions of MPI, different USER sources... To install the new compiled program in the "$SRC_SURFEX/exe" directory, after compilation, just run :
make installmaster
The executables with their full name, including $ARCH, compiler, MPI and level of optimization, will be linked in the "../exe" directory.
The "make installmaster" need to be done only one time by "version". If you only change/add source, you have to do "make".

