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:
gfortran
gfortran_adipls
gfortran_h5
gfortran_h5_adipls
ifort
ifort_adipls
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
- As Cesam2k20 uses submodules, it needs a version of gfortran > 6.0 of ifort > 16.0. Check the compiler version with:
(replacesudo gfortran --version gfortran --version
gfortran
with your actual compiler). Are you calling the compiler you think you're calling ?
- If you are using Cesam2k20 on a server without root privileges, I may have a hard time installing Cesam2k20, either due to a wrong version of compiler or a wrong version of some library. MESA developers propose a package called mesa_sdk that contains everything you need (compiler, libraries, etc.) and can be installed locally. If after installation of mesa_sdk, gfortran cannot find a needed library (e.g. liblapack), please prepend the right path to the variable
(not$LIBRARY_PATH
$LD_LIBRARY_PATH
). For instance:export LIBRARY_PATH="/home/username/mesasdk/math-slots/default/lib/:$LIBRARY_PATH"
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:
model_name.don
, the input file with the parameters used;model_name.HR
, a file containing the evolution of global quantities;model_name.osc
, one or several files containing the internal structure of the last model or all models along the evolution.
Compile Cesam2k20 for HDF5 outputs
- You first need to have the hdf5 libraries installed. Either installed them using your usual package manager, or from source. If you choose to install it from source, here are the steps to follow for installation at location /usr/local/hdf5.
gunzip < hdf5-X.Y.Z.tar.gz | tar xf - cd hdf5-X.Y.Z ./configure --prefix=/usr/local/hdf5 --enable-fortran2003 --enable-cxx make make check # run test suite. make install make check-install # verify installation.
- Once you are done, add to your .bashrc the locations of your hdf5 installation:
export PATH_HDF5='/usr/local/hdf5' export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/hdf5/lib/'
- source your .bashrc
source ~/.bashrc
- finally, go in the
cesam2k20
repository and runmake clean ./configure.sh gfortran_h5 make
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: