Installing wflow
Wflow can be used in two different ways, depending on the required use of the code:
- If you want to stay up-to-date with the latest version, explore and modify the model code, and write your own Julia scripts around the wflow package, we recommend installing wflow as a Julia package.
- If you don’t need extra features, but just want to run simulations, a compiled executable version is available. This version includes a single executable,
wflow_cli, which allows you to run the model via the command line.
Below we describe how to install both versions of wflow.
Installing as Julia package
Wflow is a Julia package that can be installed in several ways. Below, we show how to install wflow from Julia’s package repository and how to install the latest version from GitHub.
First, download and install the current stable release of Julia.
If you are new to Julia, it might be a good idea to check out the REPL. You can also find additional learning resources at julialang.org/learning.
Install from Julia’s package repository
To access Julia’s package manager, press ] in the Julia REPL. To get back to the Julia REPL, press backspace or ^C.
If you haven’t used Julia in a while, it’s a good idea to run up to update your packages.
pkg> upTo access Julia’s package manager and install wflow, use:
pkg> add WflowThis process can take a while, especially on the first run, as compatible dependencies are automatically resolved and installed from the Pkg General registry.
Install from GitHub
You can also install wflow from the master branch on the repository as follows:
pkg> add Wflow:Wflow#masterThis command tracks the master branch and updates to the latest commit on that branch when you run update, or simply up, in the Pkg REPL. The add installs wflow in your home directory under .julia/packages/Wflow. Note that packages installed under packages by add should not be changed in the directory, as the change could disrupt Pkg’s automatic dependency handling.
If you want to modify any files in the repository, you need to do a development install. This can be done using:
pkg> dev Wflow:WflowThis will clone the git repository, place it under your home directory in .julia/dev/Wflow, and add the wflow package to your project environment. To receive updates, you’ll need to pull the latest changes manually using git pull. Additionally, the --local option can be passed to ensure that the package is installed in the current project environment (instead of the .julia/dev/Wflow folder).
Check installation of wflow
Finally, go back to the Julia REPL and try to load wflow:
julia> using WflowThe first time you do this, it may take longer as any new or changed packages need to be precompiled to enable faster loading on subsequent uses. No error messages should appear, which indicates that you have successfully installed wflow.
Before concluding this section, we recommend a few tools that can make using and developing Julia code easier.
There is a section on editors and IDEs for Julia on https://julialang.org/, scroll down to see it. We use and recommend Microsoft’s free and open source Visual Studio Code. When combined with the Julia extension it provides a powerful and interactive development experience.
If you plan to modify the code of wflow, we recommend installing the Revise.jl package. This package allows you to modify code and use the changes without restarting Julia. Install it with add Revise from the Pkg REPL. Then create a file called .julia/config/startup.jl, and put using Revise there. This will load Revise every time you start a Julia session.
Installing the compiled executable
Binaries of wflow_cli can be downloaded from our website download.deltares.nl, and are currently available for Windows. Download and install the .msi file. After installation, you will see two folders in the installation directory. Only the bin/wflow_cli is used. The artifacts folder contains binary dependencies such as netCDF.
artifacts\
bin\wflow_cliTo verify whether the installation was completed successfully, run wflow_cli with no arguments in the command line. This will display the following message:
Usage: wflow_cli 'path/to/config.toml'