Creating a model

GEB init

To initialize a new model, we first need to create a new folder for the model. This folder will contain all the files and data required for the model. Then in the folder, run the following command:

geb init

This will copy the default model configuration files from the examples folder in the GEB repository to the current folder. You can pass a custom subbasin ID or geom to the command to create a model for a specific region. See the section below for more information on how to specify the study region. If you do not specify a subbasin ID or geom, the default model configuration files will be copied.

geb init --subbasin-id 23011134

For more options, you can call the command with the –help flag:

… code-block:: python

geb init –help

Study region

The model.yml-file specifies the configuration of the model, including the location of the model. An example of the model.yml-file is given in the examples folder in the GEB repository. Please refer to the yaml-section general:region. Examples are given below.

Subbasin

The subbasin option allows you to define your study region based on a hydrological basin. When using this option, the following parameter is required:

  • subbasin: The subbasin ID of the model. This is the ID of the subbasin in the MERIT-BASINS dataset (version MERIT-Hydro v0.7/v1.0). This can be either a single subbasin or list of subbasins. All upstream basins are automatically included in the model, so only the most downstream subbasin of a specific catchments needs to be specified.

general:
  region:
    subbasin: 23011134

or

general:
  region:
    subbasin:
    - 23011134
    - 23011135
    - 23011136

geom

The name of a dataset specified in the data_catalog.yml (e.g., GADM_level0) or any other region or path that can be loaded in geopandas. Using the column and key parameters, a subset of data can be specified, for example:

general:
  region:
    geom: GADM_level0
    column: GID_0
    key: FRA

outflow

The outflow option allows you to define your study region based on a specific outflow point using lat, lon coordinates:

general:
  region:
    outflow:
      lat: 48.8566
      lon: 2.3522

GEB build

GEB has a build module to preprocess all input data for the specified region. This command creates a new folder “input” with all input files for the model.

Obtaining the raw input data

Most of the data that the build module uses to create the input data for GEB is downloaded by the tool itself when it is run. However, some data needs to be aquired seperately. To obtain this data, please send an email to Jens de Bruijn (jens.de.bruijn@vu.nl).

Configuration

Some of the data that is obtained from online sources and APIs requires keys. You should take the following steps:

  1. Request access to MERIT Hydro dataset MERIT Hydro, and create a “.env”-file in the GEB repository with the following content:

MERIT_USERNAME=<your_username>
MERIT_PASSWORD=<your_password>
  1. To set up the model with ERA5-Land forcing data using the build-method setup_forcing_era5, create an account on Destination Earth and copy your personal access token to a .netrc file, located in your home directory. You can find the personal access token here.

Building to model

The build.yml-file contains the name of functions that should be run to preprocess the data. You can build the model using the following command, assuming you are in the working directory of the model which contains the model.yml-file and build.yml-file:

geb build

This will preprocess all the data required for the model. The data will be stored in the “input” folder in the working directory. The data is stored in a format that is compatible with the GEB model. Optionally, you can specify the path to the build.yml-file using the -b/–build-config flag, and the path to the model.yml-file using the -c/–config flag. You can find more information about the flags by running:

geb build --help

Updating the model

It is also possible to update an already existing model by running the following command.

geb update

This assumes you have a “update.yml”-file in the working directory. The update.yml-file contains the name of functions that should be run to update the data. The functions are defined in the “geb” plugin of HydroMT. The data will be updated in the “input” folder in the working directory. The data is stored in a format that is compatible with the GEB model.

For example to update the forcing data of the model, your “update.yml”-file could look like this:

setup_forcing_era5:

Optionally, you can specify the path to the “update.yml”-file using the -b/–build-config flag, and the path to the model.yml-file using the -c/–config flag. You can find more information about the flags by running:

geb update --help