Skip to content

Setup

This guide covers the complete setup process for running VECTRI, including WSL installation for Windows users and the VECTRI model installation on Ubuntu.


๐Ÿ–ฅ๏ธ VECTRI and WSL installation

Follow the WSL Installation tab first to set up Windows Subsystem for Linux, then proceed to the VECTRI Installation tab.

Skip directly to the VECTRI Installation tab if you're already running Ubuntu 22.04 LTS.


๐ŸชŸ Windows Subsystem for Linux (WSL)

What is WSL?

Windows Subsystem for Linux (WSL) is a feature of Windows that allows you to run a Linux environment directly on Windows, without the need for a separate virtual machine or dual booting.

Why Use WSL for VECTRI?

  • Native Linux Environment


    Run Linux commands, tools, and applications directly on Windows without modification.

  • High Performance


    WSL 2 uses a real Linux kernel, providing near-native performance for scientific computing.

  • Seamless Integration


    Access Windows files from Linux and vice versa. Use VS Code with WSL backend.

  • Full Compatibility


    Install and run VECTRI, NetCDF libraries, and all Linux-based scientific tools.

WSL 2 Recommended

WSL 2 is the recommended version for VECTRI as it provides:

  • Full Linux kernel compatibility
  • Better file system performance
  • Full system call compatibility
  • Support for Docker and other Linux tools

Prerequisites

Before you start, ensure you have:

  • โœ… Administrator access on your PC
  • โœ… Hardware virtualization enabled in BIOS/UEFI (Intel VT-x / AMD-V)
  • โœ… A reasonably up-to-date Windows build (Windows 10 version 2004+ or Windows 11)

Step 0: Enable Windows Features (GUI Method)

Before installing WSL, you can manually enable the required Windows features:

Enable WSL via Control Panel

  1. Navigate to Control Panel
  2. Press Win + R, type control, press Enter
  3. Or search "Control Panel" in the Start menu

  4. Open Programs and Features

  5. Click on Programs
  6. Click on Programs and Features

  7. Turn Windows Features On or Off

  8. In the left sidebar, click Turn Windows features on or off
  9. A dialog box will appear

  10. Enable Required Features

  11. โœ… Tick Virtual Machine Platform
  12. โœ… Tick Windows Subsystem for Linux
  13. Click OK

  14. Restart Your Computer

  15. Windows will apply the changes
  16. Restart when prompted

How to Open CMD as Administrator

  1. Press Start (Windows key)
  2. Type cmd
  3. Right-click Command Prompt
  4. Select Run as administrator

Installation Instructions

Windows 11 typically supports the simplest installation path.

Step 1: Install WSL

Open CMD as Administrator and run:

wsl --install

This command:

  • โœ… Enables required Windows features
  • โœ… Installs the WSL kernel
  • โœ… Installs Ubuntu (default distribution)

Step 2: Restart Your Computer

Restart Windows to complete the installation.

Step 3: First Launch

  1. Open Ubuntu from the Start menu
  2. Create your Linux username
  3. Create your Linux password

Step 4: Verify Installation

wsl --status
wsl -l -v

โœ… Confirm your distro shows VERSION 2.

wsl --update
wsl --list --online
wsl --install -d Ubuntu-22.04

Step 1: Install WSL

Open CMD as Administrator and run:

wsl --install

This command:

  • โœ… Enables required Windows features
  • โœ… Installs the WSL kernel
  • โœ… Installs Ubuntu (default distribution)

Step 2: Restart Your Computer

Restart Windows to complete the installation.

Step 3: First Launch

  1. Open Ubuntu from the Start menu
  2. Create your Linux username
  3. Create your Linux password

Step 4: Verify WSL Version

wsl --status
wsl -l -v

โœ… Confirm your distro shows VERSION 2.


Manual Install (If Quick Install Fails)

Use this method if:

  • Your Windows 10 build is older
  • The one-command install is blocked by policy

Step 1: Enable WSL Feature

Open CMD as Administrator:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2: Enable Virtual Machine Platform

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 3: Restart Your Computer

Restart Windows.

Step 4: Set WSL 2 as Default

wsl --set-default-version 2

Step 5: Install Ubuntu

  1. Open Microsoft Store
  2. Search for Ubuntu
  3. Install Ubuntu 22.04 LTS (recommended)

Step 6: Launch and Configure

  1. Open Ubuntu from Start menu
  2. Create your Linux username and password

๐Ÿ”ง Troubleshooting

Virtualization is Disabled

Symptoms:

  • WSL 2 won't start
  • Errors referencing Hyper-V or virtualization

Fix:

  1. Restart your computer and enter BIOS/UEFI settings
  2. Enable Intel VT-x or AMD-V (virtualization)
  3. Save and exit BIOS
  4. Run these commands again:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  1. Restart Windows
Distro Installed as WSL 1

Check your distro version:

wsl -l -v

Convert to WSL 2:

wsl --set-version Ubuntu-22.04 2

Set WSL 2 as default for future installs:

wsl --set-default-version 2
Common WSL Commands

List all installed distros:

wsl -l -v

Shut down all WSL instances:

wsl --shutdown

Update WSL:

wsl --update

Uninstall a distro (deletes its data):

wsl --unregister Ubuntu-22.04

๐Ÿ“ฆ Post-Install: Prepare Ubuntu for VECTRI

Once inside your Ubuntu terminal, update packages and install essential tools:

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git curl wget unzip gfortran

๐Ÿ“š Quick Reference: WSL Commands

Command Description
wsl --install Install WSL + default distro
wsl --list --online List available distros
wsl --install -d Ubuntu-22.04 Install specific distro
wsl -l -v Check installed distros and versions
wsl --set-default-version 2 Set WSL 2 as default
wsl --set-version <Distro> 2 Convert distro to WSL 2
wsl --update Update WSL
wsl --shutdown Shutdown all WSL instances
wsl --unregister <Distro> Remove a distro

๐Ÿ“– Additional Resources

For more detailed WSL tutorials and guides, visit:


WSL Installation Complete!

You now have Ubuntu running on Windows. Proceed to the WSL Post-Install tab for Python/Data Science setup, or go directly to the VECTRI Installation tab.

๐Ÿ WSL Post-Install Data Science Setup

Focused on Python, Conda/Mamba, Jupyter, VS Code Remote WSL, and NetCDF/xarray

Prerequisites

This guide assumes you already installed Ubuntu 22.04 LTS via WSL 2 (see the WSL Installation tab).


1๏ธโƒฃ Update Ubuntu Packages

Open your Ubuntu terminal:

sudo apt update
sudo apt upgrade -y

Install core build and utility tools:

sudo apt install -y build-essential git curl wget unzip ca-certificates

Download Miniconda:

cd ~
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

Install:

bash Miniconda3-latest-Linux-x86_64.sh

Follow prompts, then restart the terminal or run:

source ~/.bashrc

Mamba is a faster drop-in replacement for conda:

conda install -n base -c conda-forge mamba -y

4๏ธโƒฃ Create a Data Science Environment

mamba create -n ds python=3.11 -y
conda activate ds

Install the core scientific stack:

mamba install -c conda-forge -y numpy pandas scipy scikit-learn
mamba install -c conda-forge -y matplotlib seaborn
mamba install -c conda-forge -y jupyterlab ipykernel
mamba install -c conda-forge -y xarray netcdf4 h5netcdf dask
mamba install -c conda-forge -y cftime bottleneck
mamba install -c conda-forge -y cartopy geopandas rasterio rioxarray
mamba install -c conda-forge -y cfgrib eccodes

Package Notes

  • cartopy, rasterio, and geospatial libs can be heavy; remove them for a lighter environment
  • cfgrib + eccodes helps with GRIB workflows

Register the Jupyter kernel:

python -m ipykernel install --user --name ds --display-name "Python (WSL ds)"

5๏ธโƒฃ Install Node.js (Optional)

Required for some Jupyter extensions:

sudo apt install -y nodejs npm

6๏ธโƒฃ JupyterLab Quick Start

jupyter lab

WSL usually auto-forwards localhost links to Windows.
If not, copy the URL and open it in your Windows browser.


7๏ธโƒฃ VS Code + Remote WSL Workflow

On Windows

  1. Install Visual Studio Code from code.visualstudio.com
  2. Install the WSL extension from the Extensions tab

From Ubuntu

Open any folder in VS Code using the WSL backend:

code .

This opens the current folder in Windows VS Code, connected to WSL.


Create organized directories inside Ubuntu:

mkdir -p ~/projects ~/data ~/notebooks
Folder Purpose
~/projects Code repositories and scripts
~/data Climate data, NetCDF files
~/notebooks Jupyter notebooks

9๏ธโƒฃ Accessing Windows Files

Your Windows drives are mounted under /mnt/:

Access C: drive:

cd /mnt/c

Access your Windows Documents folder:

cd /mnt/c/Users/<YourWindowsUser>/Documents

Best Practice

For performance and fewer path issues, keep active projects in the Linux filesystem (e.g., ~/projects) and only move final outputs to /mnt/c.


๐Ÿ”Ÿ Climate/Geo Add-ons

Additional packages for climate and geospatial analysis:

mamba install -c conda-forge -y xclim xesmf regionmask
mamba install -c conda-forge -y intake intake-xarray
mamba install -c conda-forge -y zarr kerchunk
mamba install -c conda-forge -y metpy

1๏ธโƒฃ1๏ธโƒฃ Quick Test Script

Verify your installation:

import xarray as xr
import numpy as np
print("xarray:", xr.__version__)
da = xr.DataArray(np.random.rand(10, 5, 5), dims=("time", "lat", "lon"))
print("Random data mean:", da.mean().item())

1๏ธโƒฃ2๏ธโƒฃ GPU Support in WSL (Optional)

For machine learning with GPU acceleration:

Requirements

  • Compatible NVIDIA GPU
  • Latest Windows GPU drivers
  • NVIDIA CUDA support for WSL

Create a separate environment:

mamba create -n torch python=3.11 -y
conda activate torch
mamba install -c pytorch -c nvidia pytorch torchvision torchaudio pytorch-cuda=12.1 -y

Test GPU availability:

python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print(torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'No GPU')"

๐Ÿ”ง Common Fixes

SSL/Certificate Issues
sudo apt install -y ca-certificates
sudo update-ca-certificates
Time Sync Issues

Restart WSL from Windows CMD:

wsl --shutdown
Then reopen Ubuntu.


1๏ธโƒฃ3๏ธโƒฃ Minimal Alternative (Lighter Environment)

For a lighter setup without geospatial libraries:

mamba create -n light python=3.11 -y
conda activate light
mamba install -c conda-forge -y numpy pandas matplotlib xarray netcdf4 dask jupyterlab

๐Ÿ“š Environment Summary

Environment Purpose Key Packages
ds Full data science numpy, pandas, xarray, cartopy, geopandas
light Minimal setup numpy, pandas, xarray, matplotlib
torch Machine learning PyTorch with CUDA support

Post-Install Complete!

Your WSL environment is now ready for data science and climate analysis. Proceed to the VECTRI Installation tab to install the malaria model.

๐Ÿณ Docker on WSL 2

Docker enables containerized applications, making it easy to run reproducible environments for scientific computing and VECTRI workflows.

Prerequisites

This guide assumes you already have WSL 2 installed with Ubuntu 22.04 LTS (see the WSL Installation tab).


Confirm WSL 2 is Ready

Open Windows CMD as Administrator:

wsl --status
wsl -l -v

โœ… Your distro should show VERSION 2.


Choose Your Installation Path

  • Path A: Docker Desktop (Recommended)


    Easiest setup with GUI management. Best for most users.

    Jump to Path A

  • Path B: Docker Engine Only


    Lightweight, command-line only. For advanced users.

    Jump to Path B


Step 1: Remove Old Docker (Optional)

If you have old Docker installations inside WSL, remove them first:

sudo apt remove -y docker docker-engine docker.io containerd runc docker-compose docker-compose-v2 docker-doc podman-docker

Step 2: Install Docker Desktop on Windows

  1. Download Docker Desktop for Windows from docker.com/products/docker-desktop
  2. Run the installer
  3. Start Docker Desktop

Step 3: Enable WSL 2 Engine

In Docker Desktop:

  1. Go to Settings โ†’ General
  2. โœ… Check Use the WSL 2 based engine
  3. Click Apply & Restart

Step 4: Enable WSL Integration

In Docker Desktop:

  1. Go to Settings โ†’ Resources โ†’ WSL Integration
  2. โœ… Enable your Ubuntu distro
  3. Click Apply & Restart

Step 5: Test Docker in Ubuntu

Open your Ubuntu terminal and run:

docker --version
docker compose version
docker run hello-world

โœ… If hello-world succeeds, Docker is ready!


Best Performance Tip

Always work in the Linux filesystem for best Docker performance:

mkdir -p ~/projects
cd ~/projects

Why Linux Filesystem?

Docker containers accessing /mnt/c (Windows files) are significantly slower than accessing ~/ (Linux files).


Path B: Docker Engine Inside WSL (Advanced)

This installs Docker directly inside WSL without Docker Desktop.

Step 1: Install Docker Engine

Update packages:

sudo apt update && sudo apt upgrade -y

Install prerequisites:

sudo apt-get install -y ca-certificates curl gnupg

Add Docker's official GPG key:

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Add Docker repository:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine:

sudo apt update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 2: Start Docker Daemon

sudo service docker start

Step 3: Run Docker Without Sudo (Optional)

Add your user to the docker group:

sudo usermod -aG docker $USER

Restart WSL from Windows CMD:

wsl --shutdown

Then reopen Ubuntu.


Step 4: Test Docker

docker run hello-world

โœ… If successful, Docker Engine is ready!


๐Ÿ”ง Troubleshooting

Cannot connect to the Docker daemon

Docker Desktop Path:

  1. Ensure Docker Desktop is running (check system tray)
  2. Verify WSL Integration is enabled in Settings

Docker Engine Path:

sudo service docker start
Permission denied

If you get permission errors:

sudo usermod -aG docker $USER

Then restart WSL:

wsl --shutdown
Docker Desktop vs Docker Engine
Feature Docker Desktop Docker Engine
GUI โœ… Yes โŒ No
Resource management โœ… Easy Manual
Kubernetes โœ… Built-in Separate install
Memory usage Higher Lower
Best for Most users Advanced/servers

๐Ÿ“š Essential Docker Commands

Command Description
docker ps List running containers
docker ps -a List all containers
docker images List downloaded images
docker run <image> Run a container
docker stop <container> Stop a container
docker rm <container> Remove a container
docker rmi <image> Remove an image
docker compose up -d Start services (detached)
docker compose down Stop services
docker system prune Clean up unused resources

๐Ÿš€ Quick Start Examples

Run Ubuntu Container

docker run -it ubuntu:22.04 bash

Run Python Container

docker run -it python:3.11 python

Run Jupyter Notebook

docker run -p 8888:8888 jupyter/scipy-notebook

Then open the URL shown in the terminal.


๐Ÿ“– Additional Resources


Docker Setup Complete!

You now have Docker running on WSL 2. You can use containers for reproducible scientific environments and VECTRI workflows.

๐Ÿงฌ VECTRI Installation Guide

Target OS: Ubuntu 22.04 LTS (native or via WSL)
Purpose: Install all required libraries and build the VECTRI malaria model


1๏ธโƒฃ Set Compilers and Flags

Check compiler availability:

which gcc g++ gfortran
gcc --version
gfortran --version

Export compiler environment variables:

export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran

Enable Fortran-10+ argument compatibility flags:

gcc_version=$(gcc -dumpversion | cut -d. -f1)
if [ "$gcc_version" -ge 10 ]; then
  export fallow_argument="-fallow-argument-mismatch"
  export boz_argument="-fallow-invalid-boz"
else
  export fallow_argument=""
  export boz_argument=""
fi
export FFLAGS="$fallow_argument $boz_argument"
export FCFLAGS="$fallow_argument $boz_argument"

2๏ธโƒฃ Create Installation Prefix Directories

Create a workspace for source downloads:

cd ~
mkdir -p ~/download_lib
cd ~/download_lib
sudo apt update
sudo mkdir -p /opt/apps/libs
BASE_DIR=/opt/apps/libs

Set shared prefix for each library:

ZPFX=$BASE_DIR/zlib/1.2.12
SPFX=$BASE_DIR/szip/2.1.1
JPFX=$BASE_DIR/jasper/1.900.1
HPFX=$BASE_DIR/hdf5/1.12.2
NPFX=$BASE_DIR/netcdf/4.9.0

Create the prefix directories:

sudo mkdir -p $ZPFX $SPFX $JPFX $HPFX $NPFX

3๏ธโƒฃ Download Sources

cd ~/download_lib

Download ZLIB:

wget -c -4 https://github.com/madler/zlib/archive/refs/tags/v1.2.12.tar.gz

Download SZIP:

wget -c -4 https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz

Download JasPer (JPEG-2000):

wget -c -4 https://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip

Download HDF5:

wget -c -4 https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz

Download NetCDF-C:

wget -c -4 https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.0.tar.gz

Download NetCDF-Fortran:

wget -c -4 https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.0.tar.gz

4๏ธโƒฃ Build and Install Each Library

๐Ÿ”น ZLIB

tar xf v1.2.12.tar.gz
cd zlib-1.2.12
./configure --prefix=$ZPFX
make 
sudo make install
cd ..

๐Ÿ”น SZIP

tar xf szip-2.1.1.tar.gz
cd szip-2.1.1
./configure --prefix=$SPFX
make 
sudo make install
cd ..

๐Ÿ”น JasPer

unzip jasper-1.900.1.zip
cd jasper-1.900.1

Regenerate configure scripts:

autoreconf -i
./configure --prefix=$JPFX
make
sudo make install
cd ..

๐Ÿ”น HDF5 (Serial build)

tar xf hdf5-1_12_2.tar.gz
cd hdf5-hdf5-1_12_2
export CPPFLAGS="-I$ZPFX/include -I$SPFX/include"
export LDFLAGS="-L$ZPFX/lib -L$SPFX/lib"
./configure --prefix=$HPFX --enable-hl --enable-fortran --with-zlib=$ZPFX --with-szlib=$SPFX
make
sudo make install
cd ..

๐Ÿ”น NetCDF-C

tar xf v4.9.0.tar.gz
cd netcdf-c-4.9.0
export CPPFLAGS="-I$HPFX/include"
export LDFLAGS="-L$HPFX/lib -L$ZPFX/lib -L$SPFX/lib"
./configure --prefix=$NPFX --enable-netcdf-4 --disable-dap
make 
sudo make install
cd ..

๐Ÿ”น NetCDF-Fortran

tar xf v4.6.0.tar.gz
cd netcdf-fortran-4.6.0
export CPPFLAGS="-I$NPFX/include"
export LDFLAGS="-L$NPFX/lib -Wl,-rpath,$NPFX/lib"
./configure --prefix=$NPFX
make 
sudo make install
cd ..

5๏ธโƒฃ Set Environment Variables

Add the following to your ~/.bashrc to make the libraries available:

cat <<'EOF' >> ~/.bashrc
# NetCDF libraries for VECTRI
export PATH=/opt/apps/libs/netcdf/4.9.0/bin:$PATH
export LD_LIBRARY_PATH=/opt/apps/libs/netcdf/4.9.0/lib:/opt/apps/libs/hdf5/1.12.2/lib:/opt/apps/libs/zlib/1.2.12/lib:/opt/apps/libs/szip/2.1.1/lib:$LD_LIBRARY_PATH
export CPATH=/opt/apps/libs/netcdf/4.9.0/include:$CPATH
EOF
source ~/.bashrc

Verify Installation

which nc-config
which nf-config
nc-config --version
nf-config --version

6๏ธโƒฃ VECTRI Model Installation

Download VECTRI

cd ~
git clone https://gitlab.com/tompkins/vectri.git
cd vectri
ls

Set Environment Variables

export VECTRI="$HOME/vectri"
export NETCDF_LIB="$(nf-config --flibs)"
export NETCDF_INCLUDE="$(nf-config --fflags)"
export FC="$(nf-config --fc)"

Verify the variables:

echo $VECTRI

Persist Across Logins

Append to ~/.bashrc:

cat <<'EOF' >> ~/.bashrc
export VECTRI="$HOME/vectri"
export NETCDF_LIB="$(nf-config --flibs)"
export NETCDF_INCLUDE="$(nf-config --fflags)"
export FC="$(nf-config --fc)"
EOF
source ~/.bashrc

Create a Separate Workspace and Run

Why a Separate Workspace?

Running inside the repo pollutes the git tree and makes future git pull painful. VECTRI's run wrapper will also try to guard against this.

cd ~
mkdir -p ~/run
cd run

View command line options:

$VECTRI/vectri

Run example simulation:

$VECTRI/vectri -c $VECTRI/data/example_sys5.nc -d $VECTRI/data/example_data.nc

If the model compiles successfully, you should see:

  • A compile phase producing vectri.exe
  • Runtime logs (vector/disease, climate variable aliases, etc.)
  • Simulation progress and completion status

simulation progress and completion status

  • If successful ๐ŸŽ‰, typing ls should show the output file vectri.nc

vectri output file


7๏ธโƒฃ Verification and Troubleshooting

Check Expected Result
which nc-config /opt/apps/libs/netcdf/4.9.0/bin/nc-config
ldd vectri \| grep netcdf Links to your local libraries
echo $LD_LIBRARY_PATH Contains all library paths

Libraries Not Found?

  1. Verify paths in ~/.bashrc
  2. Run source ~/.bashrc
  3. Check that all libraries compiled without errors

๐Ÿ“– Additional Resources


โœ… VECTRI Setup Complete!

You now have a fully configured scientific environment for VECTRI on Ubuntu 22.04 LTS.

๐Ÿณ VECTRI Docker Image โ€“ User Guide

Run the VECTRI malaria transmission model using Docker

Image yonasmersha/vectri:latest
Repository hub.docker.com/r/yonasmersha/vectri

๐Ÿ“Œ Overview

This Docker image provides a clean, reproducible environment for running the VECTRI malaria model.

  • Preinstalled VECTRI


    Ready-to-run VECTRI executable with all dependencies configured.

  • Required Libraries


    NetCDF, HDF5, and Fortran libraries pre-installed and linked.

  • Example Datasets


    Sample climate and population data included for testing.

  • Safe Execution


    Non-root vectriuser configured for secure container operation.

Why Use Docker?

  • No installation required โ€“ Skip the library compilation process
  • Reproducible โ€“ Same environment on any machine
  • Portable โ€“ Works on Windows, macOS, and Linux
  • Isolated โ€“ Doesn't affect your system configuration

โœ… 1. Pull the VECTRI Docker Image

Use this command to download the latest stable build:

docker pull yonasmersha/vectri:latest

Verify the image was downloaded:

docker images | grep vectri

Expected output:

yonasmersha/vectri   latest   abc123def456   2 days ago   1.2GB

๐Ÿ“‚ 2. Prepare a Working Directory

VECTRI writes outputs to a run directory. Create one on your host machine:

mkdir -p vectri_runs
cd vectri_runs

This directory will be mounted inside the container, allowing you to:

  • Pass input files to VECTRI
  • Retrieve output files after the simulation

โ–ถ๏ธ 3. Start the VECTRI Docker Container

Run an interactive shell inside the image and mount your vectri_runs directory:

docker run --rm -it -v "$PWD:/home/vectriuser/runs" yonasmersha/vectri:latest
docker run --rm -it -v "${PWD}:/home/vectriuser/runs" yonasmersha/vectri:latest
docker run --rm -it -v "%cd%:/home/vectriuser/runs" yonasmersha/vectri:latest

You should now see a prompt like:

vectriuser@<container-id>:~$
Flag Description
--rm Automatically remove container when it exits
-it Interactive terminal mode
-v Mount host directory to container

๐Ÿงช 4. Run a Sample VECTRI Simulation

Inside the container, navigate to your mounted run directory:

cd ~/runs
mkdir demo_run
cd demo_run

Run VECTRI using example input files included in the image:

vectri -c $VECTRI/data/example_sys5.nc -d $VECTRI/data/example_data.nc -o vectri_output.nc

When successful, your folder will contain:

vectri_output.nc

Output Location

This file is saved both in the container and on your host inside vectri_runs/demo_run/. After exiting the container, you can access the output directly from your host machine.


๐Ÿงพ 5. Understanding Input and Output Files

Input Files

File Description
example_sys5.nc Example climate forcing (temperature, precipitation)
example_data.nc Example demographic/environment data (population, land cover)

Output File

File Description
vectri_output.nc Model results including EIR, vector density, etc.

Inspect Output (Optional)

View the output file structure:

ncdump -h vectri_output.nc

Or use Python (if available on your host):

import xarray as xr
ds = xr.open_dataset("vectri_runs/demo_run/vectri_output.nc")
print(ds)

๐Ÿ” 6. Run VECTRI With Your Own Input Files

Step 1: Place Your Files in the Mounted Directory

On your host machine, copy your input files to vectri_runs/:

vectri_runs/
 โ”œโ”€โ”€ my_climate.nc
 โ”œโ”€โ”€ my_population.nc
 โ””โ”€โ”€ ...

Step 2: Start the Container

docker run --rm -it -v "$PWD:/home/vectriuser/runs" yonasmersha/vectri:latest

Step 3: Run VECTRI

Inside the container:

cd ~/runs
vectri -c ~/runs/my_climate.nc -d ~/runs/my_population.nc -o my_vectri_results.nc

Step 4: Access Results

Exit the container (exit or Ctrl+D) and find your results in:

vectri_runs/my_vectri_results.nc

โš ๏ธ 7. Troubleshooting

Permission Denied When Creating Directory

This happens if you try to run VECTRI outside /home/vectriuser/runs.

Solution: Always work inside the mounted directory:

cd ~/runs
Output File Missing

Possible causes:

  1. The -o argument path is invalid
  2. The output directory doesn't exist
  3. VECTRI encountered an error during simulation

Solution: Check the console output for error messages and ensure you're in a writable directory.

Cannot Write to /opt/apps/vectri

This folder is read-only by design. It contains the VECTRI installation and example data.

Solution: Never run VECTRI simulations inside /opt/apps/vectri. Always use ~/runs.

Container Exited Unexpectedly

If the container exits immediately:

  1. Check Docker is running: docker info
  2. Try running without -it: docker run --rm yonasmersha/vectri:latest ls
  3. Check available disk space

๐Ÿงน 8. Manage Docker Resources

Remove the VECTRI Image

docker rmi yonasmersha/vectri:latest

Clean Up Unused Docker Resources

docker system prune

Check Disk Usage

docker system df

๐Ÿ“š Quick Reference

Task Command
Pull image docker pull yonasmersha/vectri:latest
Start container docker run --rm -it -v "$PWD:/home/vectriuser/runs" yonasmersha/vectri:latest
Run example vectri -c $VECTRI/data/example_sys5.nc -d $VECTRI/data/example_data.nc -o output.nc
Exit container exit or Ctrl+D
Remove image docker rmi yonasmersha/vectri:latest

๐Ÿ“– Citation

If you use VECTRI in research, please cite the original authors:

VECTRI Citation

Tompkins, A. M., and F. Di Giuseppe (2015), Potential predictability of malaria in Africa using ECMWF monthly and seasonal climate forecasts, Journal of Applied Meteorology and Climatology, 54(3), 521-540.

VECTRI โ€“ A dynamical malaria transmission model
International Centre for Theoretical Physics (ICTP)


๐Ÿ‘ค Contact


VECTRI Docker Ready!

You can now run VECTRI simulations without installing any dependencies. For manual installation (building from source), see the VECTRI Installation tab.

In Partnership With