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 OSVASENV, 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), 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
This will:
OSVASHARP conda environment 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. The workflow expects:
profile_surfex-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0) that sets up the compilation environmentRecommended SURFEX versions:
surfex_home variable).Currently, the PATH to your SURFEX setup, executables, profile names, etc, need to be hardcoded in step3 block of the Python launcher script, like this:
# SURFEX paths
surfex_parent = os.path.expanduser('~')
surfex_ver = 'SURFEX_ACCORD'
surfex_home = f"{surfex_parent}/{surfex_ver}"
surfex_profile = 'profile_surfex-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0'
surfex_exe = f"{surfex_home}/src/dir_obj-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0/MASTER/"
os.environ['PATH'] = f"{surfex_exe}:{os.environ['PATH']}"
paramfiles = f"{surfex_home}/MY_RUN/ECOCLIMAP/"
dirfiles = f"{os.path.expanduser('~')}/PHYSIO/"
If you plan to use ECOCLIMAP files for any paremeter not resolved by namelist, make sure to have the corresponding version available in $dirfiles
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 to override the defaults:
export STATION_NAME=Majadas_del_tietar # Station to process (required)
export OSVAS=$HOME/OSVASgh # OSVAS root (auto-detected if not set)
export CONDAENV=OSVASENV # Conda environment name (default: OSVHARP)
export HARPSCRIPTS=$OSVAS/HARPSCRIPTS # HARP scripts path (auto-detected if not set)
Typical usage:
In most cases, you only need to set STATION_NAME. The launcher scripts will automatically:
OSVAS from their location in scripts/python_scripts/HARPSCRIPTS to $OSVAS/HARPSCRIPTSOSVHARP as the default conda environmentCommand line override: You can also pass these as command line arguments:
python surfex_OSVAS_run_linux.py --stations Cabauw Loobos --osvas /path/to/osvas --harpscripts /path/to/harpscripts