mkdir OSVAS
cd OSVAS
git clone https://github.com/ACCORD-NWP/OSVAS.git .
After cloning the OSVAS repository, run the installation setup script to automatically clone the HARP verification scripts:
cd OSVAS
./scripts/bash_scripts/setup_osvas_installation.sh
This script will:
git@github.com:harphub/oper-harp-verif.git into $OSVAS/HARPSCRIPTS/.bashrc or .bash_profile)Typical usage:
# Basic usage (auto-detects OSVAS from script location)
./scripts/bash_scripts/setup_osvas_installation.sh
# Or specify OSVAS directory explicitly
./scripts/bash_scripts/setup_osvas_installation.sh --osvas /path/to/OSVAS
After running the script, you can set the environment variables in your shell by copying the suggested export commands, or by adding them to your ~/.bashrc file.
Note: The launcher scripts automatically detect the OSVAS root directory from their script location, so you typically only need to set the environment variables if you plan to call the scripts from a different directory.
module load conda/24.11.3-2
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
After installing Miniconda, you will be prompted to initialize conda for your shell. We recommend accepting this. To avoid auto-activating the base environment when opening a new terminal, you can disable it:
conda config --set auto_activate_base false
After conda is available, next step is to create the OSVAS conda environment OSVHARP,
including the installation of HARP’s R libraries inside an Renv. This is done by the bash script create_conda_and_R_envs.sh which, after installing the condas environment (called OSVHARP by default — see below for how to override this), runs the script ( renv_{atos,ubuntu}/renv_setup.R) for generating the Renv and installing all the harp packages.
This installation can take about 30-60 minutes ( it actually compiles HARP packages; in the future this will be avoided by installing pre-compiled packages). Since there is a strict rate limit on “anonymous” installs of R libraries from CRAN mirrors, renv_setup.R must be edited to add your personal github PAT:
```# Optional: set your GitHub PAT to avoid rate-limiting on installs
Sys.setenv(GITHUB_PAT = “Put_your_github_personal_access_token_here”)
If you don't have a Personal Access Token, you can either create one in your github (settings-developer_settings-personal_access_tokens, borrow one from a colleague or repeat the next step a few times after it fails due to this rate limit (waiting for some time between tries to complete the compilation of R libraries).
Now simply run the script to complete the installation with conda & R environments:
```bash
cd scripts/bash_scripts
./create_conda_and_R_envs.sh
By default this creates a conda environment named OSVHARP. If you want to use a different name, pass it as an argument to the script:
./create_conda_and_R_envs.sh MY_ENV_NAME
This will:
OSVHARP conda environment (or the name you passed as an argument) with Python 3.11 and required packagesrequirements.txtThe conda environment includes:
The OSVAS workflow is orchestrated by two Python launcher scripts in scripts/python_scripts/:
surfex_OSVAS_run_linux.py — Runs on local Linux systemssurfex_OSVAS_run_atos.py — Runs on ATOS HPCThese scripts execute Jupyter notebooks for data processing steps:
scripts/notebooks/WRITE_Station_forcing.ipynb — Generates forcing from ICOS datascripts/notebooks/Flux_downloader.ipynb — Downloads and processes validation data & performs optional soil initializationNotebook execution modes:
jupyter nbconvert and executes them. This supports headless environments and doesn’t require a Jupyter server..py versions are available (WRITE_Station_forcing.py, Flux_downloader.py) and can be executed standalone. This is activated by setting jupyter = True in the relevant line of the Python launcher scripts.jupyter notebook or jupyter lab for development and debugging.HARP installation:
renv_atos/ or renv_ubuntu/.HARP verification scripts (oper-harp-verif):
The oper-harp-verif repository (https://github.com/harphub/oper-harp-verif.git) is automatically cloned during installation into $OSVAS/HARPSCRIPTS/ by the setup_osvas_installation.sh script, and “patched” to include a few modifications that will make possible to visualize verification results month by month. These scripts include:
point_verif.R)Automatic path detection:
The launcher scripts (surfex_OSVAS_run_linux.py and surfex_OSVAS_run_atos.py) automatically:
HARPSCRIPTS to $OSVAS/HARPSCRIPTSYou can override these defaults by:
export OSVAS=/path/to/osvas and export HARPSCRIPTS=/path/to/harpscripts--osvas and --harpscriptsExtra required R packages for HARP (for manual installation if the Renv way is not used):
pkg_list <- c("here","argparse","yaml","dplyr","tidyr",
"purrr","forcats","stringr","RColorBrewer","grid",
"gridExtra","pracma","RSQLite","scales","pals",
"shiny","shinyWidgets","lubridate","scico","cowplot")
for (pkg in pkg_list) {
install.packages(pkg)
}
Once setup is complete, activate the environment:
conda activate OSVHARP
A functional SURFEX installation is required, including its compiled executables and profile script. Before each run, OSVAS sources the configured profile to set up the environment and adds the configured executable directory to PATH.
Recommended SURFEX versions:
config_files/SURFEX/surfex_configuration.yaml; the launchers no longer require edits to set installation paths. The general block provides shared defaults, while platforms.linux and platforms.atos provide runner-specific settings. surfex_exe and paramfiles can be specified relative to surfex_home. physiography_paths is an optional list of additional directories whose files are linked into each run directory.Example layout:
general:
surfex_home: "${HOME}/SURFEX_ACCORD_5th"
surfex_profile: profile_surfex-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0
surfex_exe: src/dir_obj-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0/MASTER
paramfiles: MY_RUN/ECOCLIMAP
physiography_paths:
- "${HOME}/PHYSIO"
platforms:
atos:
surfex_home: "${PERM:-/perm/sp3c}/SURFEX_ACCORD"
surfex_profile: profile_surfex-atos-gnu-SFX-V9-1-0-MPIAUTO-OMP-O2-X0
surfex_exe: src/dir_obj-atos-gnu-SFX-V9-1-0-MPIAUTO-OMP-O2-X0/MASTER
paramfiles: MY_RUN/ECOCLIMAP
physiography_paths:
- /ec/res4/hpcperm/hlam/data/climate/PGD
- /ec/res4/hpcperm/hlam/data/climate/ECOCLIMAP-SG
- /perm/sbu/gmted_carra2
- /perm/sbu/soilgrid_carra2
# Optional block named exactly like an entry in the station's OSVAS_steps.Expnames:
MY_EXPERIMENT:
surfex_profile: profile_for_this_experiment
paramfiles: /path/to/experiment/ECOCLIMAP
Settings are merged in this order: general, the selected platforms block, then the top-level block whose name exactly matches the experiment. Only keys specified in a later block are overridden. Experiment-specific settings are configured in this shared SURFEX YAML file (not in the station YAML). Paths support ~, $VAR, and ${VAR:-default} expansion; absolute surfex_exe or paramfiles paths can be used when they are outside surfex_home.
If you use ECOCLIMAP files that are not resolved by the namelist, include their directory in physiography_paths (or the configured paramfiles) so the files are available in the run directory.
To download ICOS data via the Python API, you must:
$OSVAS/icos_cookie.txt
Important: ICOS tokens expire after 27.8 hours (100,000 seconds) and must be renewed regularly.Important: To access the soil moisture datasets for Cabauw https://dataplatform.knmi.nl/dataset/cesar-soil-water-lb1-t10-v1-1, a special request must be addressed to opendata@knmi.nl
The launcher scripts automatically detect paths based on their script location. However, you can optionally set these environment variables manually or in your .bashrc to override the defaults:
export STATION_NAME=Majadas_del_tietar # Station to process
export OSVAS=$HOME/OSVAS # OSVAS root
export HARPSCRIPTS=$OSVAS/HARPSCRIPTS # HARP scripts path
Typical usage: First, activate the conda environment with
conda activate OSVHARP
Secondly, run the corresponding python launcher (ATOS or linux version). In most cases, you only need to set STATION_NAME. A list of stations is also possible. The launcher script will automatically:
OSVAS or use $OSVAS if set in the environmentHARPSCRIPTS to $OSVAS/HARPSCRIPTS or use $HARPSCRIPTS if set in the environmentExample:
cd $HOME/$OSVAS
python scripts/python_scripts/surfex_OSVAS_run_linux.py --stations Cabauw Loobos --harpscripts /path/to/harpscripts