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:

  1. Download the source code: git clone https://github.com/UMR-CNRM/snowtools.git

  2. Create a virtual environment : python3 -m venv --system-site-packages <name_of_your_virtual_env>

  3. Enter in the virtual environment: source <name_of_your_virtual_env>/bin/activate

  4. 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.

  • On your PC at CEN, a pre-compiled binary is also provided on shared filesystems.

  • Otherwise (or if you want to use a custom version, e.g. for development) you will need to compile the interpol binaty and set the environment variable SNOWTOOLS_INTERPOL to point to the location of the interpol compiled binary. To do so, the procedure is detailed below.

To compile the interpol binary:

  1. go into the snowtools/interpolation folder

  2. On Meteo-France HPC only, load the necessary modules :

module purge
moudle load intel
module load intelmpi
  1. On external PC only (outside of Meteo-France), you need to have a Fortran90 compiler, a MPI compiler, openmpi, netcdf-parallel and netcdff libraries with headers availables. On Ubuntu, it means installing the following packages : build-essential libopenmpi-dev libnetcdf-mpi-dev libnetcdff-dev.

  2. Remove Makefile if defined with rm Makefile and then link to the correct one depending on your situation:

    • On Meteo-France HPC : ln -s Makefile_belenos Makefile

    • On Meteo-France PC : ln -s Makefile_pc_mf Makefile

    • On external PC : ln -s Makefile_pc_nomf Makefile

  3. You just have to run make. That’s all. You now have an interpol binary in the current folder.

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).

1(1,2)

To generate a new ssh key, go to your ~/.ssh folder (create if it does not exist) and run ssh-keygen -t rsa -b 4096 -f github. You will be asked for an optional password to protect your key. Once created, go to your github account, section SSH keys, click on “add a SSH key” and copy the content of the file ~/.ssh/github.pub in the “key” field. You may had to add to your .ssh/config the following lines:

Host github.com
    IdentityFile ~/.ssh/github