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 or mamba (recommended)


1. Download anaconda here or mamba here, and install it.

Replace mamba by conda in the following if you are using anaconda. You may also need to specify the channel with -c conda-forge.

2. Create a cesam environment:

mamba create -n cesam python=3.12
mamba activate cesam

3. Install the python packages:

mamba install numpy scipy matplotlib traitsui=8.0.0 h5py pyface=8.0.0 emcee corner ipython tqdm

4. Install the jupyter packages (optional):

mamba install ipympl

5. Install the gfortran (optional, only if gfortran is not already installed on your system):

mamba install gfortran=12.1.0
mamba install binutils
mamba install ncurses

6. Add to your .bashrc the following lines:

export PATH_HDF5="/home/USERNAME/.local/share/mamba/envs/cesam/"
export LD_LIBRARY_PATH="/home/USERNAME/.local/share/mamba/envs/cesam/lib:$LD_LIBRARY_PATH"

7. Source and activate:

source .bashrc
mamba activate cesam

Tutorial


A short tutorial can be downloaded below: