Quickstart





Prerequisites, configuration and compilation


1. To check if you have all the required software, type (in the cesam2k20 root directory)

./check_deps.sh
Install what is missing.

If you are looking for an easy way to build an environment dedicated to Cesam2k20, follow the instruction here.

2. Then, configure your Makefiles:

./configure.sh conf

where conf is one of:
We strongly recommend using gfortran_h5 or gfortran as the ifort configuration file was designed for an old version of ifortran.
If you use another system or compiler, you need to create a file compiler_system.mk using one of the examples (gfortran_linux.mk, for example) as inspiration. Share the file with us if it works!

3. Add the following lines to your .bashrc or equivalent:

export CESDIR="cesam_root_folder"

if [ -z ${LD_LIBRARY_PATH} ]
then
    export LD_LIBRARY_PATH="${CESDIR}/lib"
else
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${CESDIR}/lib"
fi

export PATH="$PATH:${CESDIR}/bin/"
export PATH="$PATH:${CESDIR}/vicmodels/bin/"

export aprgdir="${CESDIR}/adipack/"
export PATH="$PATH:${aprgdir}/bin/"

export cesacordir="${CESDIR}/ACOR/"
export PATH="$PATH:${cesacordir}/bin/"
(replace cesam_root_folder with your actual Cesam2k20 root directory!).

4. You can now compile Cesam2k20. Type make install and you're done!




Known issues with the installation



Running and testing


Setup a directory to compute a model and type
run_cesam2k20.py model_name
in that directory to run cesam2k20. You can replace model_name with any name you wish. A GUI appears where you can choose your parameters. Click OK to calculate the model. In the end, you should have a message with the end status of your calculation.

Successful calculations end with several files in your directory:

Compile Cesam2k20 for HDF5 outputs



Create an environment with anaconda


1. Download anaconda here, and install it.

2. Create a cesam environment:

conda create -n cesam python=3.9.12
conda activate cesam

3. Install the python packages:

conda install -c conda-forge numpy=1.21.5 scipy=1.7.3 matplotlib traits=6.2.0 traitsui=8.0.0 h5py pyface=8.0.0 emcee corner ipython tqdm

4. Install the jupyter packages:

conda install -c conda-forge ipympl

5. Install the gfortran:

conda install -c conda-forge gfortran=12.1.0
conda install -c conda-forge binutils
conda install -c conda-forge ncurses

6. Add to your .bashrc the following lines:

export PATH_HDF5=/home/USERNAME/anaconda3/envs/cesam/
export LD_LIBRARY_PATH="/home/USERNAME/anaconda3/envs/cesam/lib:$LD_LIBRARY_PATH"

7. Source and activate:

source .bashrc
conda activate cesam

Tutorial


A short tutorial can be downloaded below: