Install Snowtools¶
Note
If you are using snowtools on Meteo-France computers, go directly to the last section (Snowtools install for developers).
Dependencies¶
The snowtools project is mainly designed for a Linux environment.
The whole project requires at least python 3.6 and classical scientific packages (numpy
, netCDF4
…). Some specific parts of the code (especially tests, scores, documentation generation require an extended set of dependencies that are fully described in requirements.txt
. The vortex toolbox is also needed for run on Meteo-France super-computers.
Note
On Meteo-France computers, you do not have take care of dependecies that are already on your professional computer !
Install dependencies with pip¶
Most of the packages can easily be installed in a virtual environment with pip
(for instance with pip install -r requirements.txt
). This is useless if you plan to then install snowtools with pip
.
Only GDAL python binding need to be installed manually to be installed consistently with your installed libgdal-dev
version. Please install before the system packages ligdal
and libgdal-dev
(or similar) and run: pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="$(gdal-config --cflags)"
.
Snowtools install for users¶
If you are only a user of snowtools, you can install the package easily with pip in a virtual environment:
Download the source code:
git clone https://github.com/UMR-CNRM/snowtools.git
Create a virtual environment :
python3 -m venv --system-site-packages <name_of_your_virtual_env>
Enter in the virtual environment:
source <name_of_your_virtual_env>/bin/activate
Ensure you are at the root of the snowtools repository and install the package by running:
pip install .
Snowtools install for developers¶
Install dependencies¶
Please read requirements.txt
and install the necessary dependecies. On Meteo-France computers you only need to install bronx
, footprints
and epygram
packages with pip
(pip install bronx footprints epygram
).
Clone the git repository¶
Make sure you have a github account, linked to snowtools repository (send a mail to crocus at meteo dot fr) and that you have a SSH key attached to your github account [1]. You can then clone the git repository on your computer with :
git clone git@github.com:UMR-CNRM/snowtools.git
Install¶
Make sure you have a github account, linked to snowtools repository (send a mail to crocus at meteo dot fr) and that you have a SSH key attached to your github account [1]. You can then clone the git repository on your computer with :
git clone git@github.com:UMR-CNRM/snowtools.git
You have to add the install folder to your PYTHONPATH
. This can be done by adding these tho following lines to your .bashrc
or .bash-profile
:
export SNOWTOOLS_CEN=/yourpath/snowtools
export PYTHONPATH=$PYTHONPATH:$SNOWTOOLS_CEN
It is also recommended to create useful aliases for s2m command and proreader graphical user interface in the ~/.bashrc
file:
You have to add the install folder to your PYTHONPATH
. This can be done by adding these tho following lines to your .bashrc
or .bash-profile
:
export SNOWTOOLS_CEN=/yourpath/snowtools
export PYTHONPATH=$PYTHONPATH:$SNOWTOOLS_CEN
It is also recommended to create useful aliases for s2m command and proreader graphical user interface in the ~/.bashrc
file:
alias s2m="python $SNOWTOOLS_CEN/snowtools/tasks/s2m_command.py"
alias proplotter="python3 $SNOWTOOLS_CEN/snowtools/plots/stratiprofile/proplotter.py"
alias procompare="python3 $SNOWTOOLS_CEN/snowtools/plots/stratiprofile/procompare.py"
alias put="$SNOWTOOLS_CEN/cenutils/put"
Optional installations¶
Vortex package¶
Only Météo-France users who need to either extract operational S2M files either to run their own experiments on the HPC system need to install the vortex package by following this link Install VORTEX.
Spatial interpolator for SAFRAN¶
On Meteo-France super-computers, a precompiled binary is provided in the CEN uenv environment. Therefore, this step is not required unless you need to modify the interpolation software. If you want to use your own version :
cd $SNOWTOOLS_CEN/snowtools/interpolation/
module purge
module load intel
module load intelmpi
ln -sf Makefile_belenos Makefile
make
Running the code does not require any module load command. It is much safer to purge all modules before running. Do never add module load commands in your .bashrc or .bash_profile files to avoid very tricky bugs. Do absolutely never load netcdf module before running the code as this would load conflictual library versions with the ones used for compilation
On your PC, if you need the interpolation software of SAFRAN meteorological fields on list of points or regular grids, you need to compile the corresponding Fortran application even if you do not modify the code:
cd $SNOWTOOLS_CEN/snowtools/interpolation/
ln -s Makefile_pc Makefile
make
At CEN, Netcdf with parallel support must be installed in /opt/netcdf4-parallel (ask Cyril if not available)
eval `ssh-agent -s`
ssh-add ~/.ssh/github
on your computer in order to define the key location on your computer.
CRPS scores¶
If you need to use CRPS scoring tools, which parts are written in Fortran, you need to compile them.
For CRPS scores, go to the snowtools/scores
, and run ./install_ubuntu.sh
(or ./install_belenos.sh
if you are on a Meteo-France super computer).