Calibrate WaterGAP (under development)#
Rational#
WasterGAP is calibrated in a very simple basin-specific manner to match long-term mean annual observed streamflow at the outlet of 1509 drainage basins that cover ∼ 55 % of the global drainage area (except Antarctica and Greenland).
Calibration follows a four-step scheme with specific calibration status (CS) [1] [2] .
CS1: Adjust the basin-wide uniform parameter gamma \(γ\) (runoff coefficient) [1] in the range of [0.1–5.0] to match mean annual observed streamflow within ±1 %.
CS2: Adjust \(γ\) as for CS1 but within 10 % uncertainty range (90 %–110 % of observations).
CS3: As for CS2 but apply the areal correction factor, CFA (adjusts runoff and, to conserve the mass balance, actual evapotranspiration as the counterpart of each grid cell within the range of [0.5–1.5]), to match mean annual observed streamflow with 10 % uncertainty.
CS4: As for CS3 but apply the station correction factor, CFS (multiplies streamflow in the cell where the gauging station is located by an unconstrained factor), to match mean annual observed streamflow with 10 % uncertainty to avoid error propagate ion to the downstream basin.
Note
For each basin, calibration steps 2–4 are only performed if the previous step was not successful.
Step-by-step guide to calibrating the WaterGAP model#
Preparing climate and water use data#
See tutorials on where to download climate forcing and water use data.
Preparinging observed streamflow#
Download the observed streamflow data#
The observed streamflow data can be downloaded from zenodo as a zip file. Download all files of the current version and unpack the zip file. You will find all necessary files as well as a readme.md file, which explains the content of the files. The unzipped file contains files such as:
“WaterGAP22e_cal_stat.shp” contains the location of the calibration stations as point-shapefile.
The ESRI shapefile “WaterGAP22e_cal_bas.shp”” contains the basin outlines of the calibration stations
“json_annual”, which contains the annual streamflows for 1509 stations.
In the downloaded and unzipped folder, unzip the “json_annual.zip” file. Move the unzipped folder to the location of your choice. In this tutorial we are creating a folder in the ReWaterGAP folder under “/Users/Username/ReWaterGAP/calibration_stations” and placing the “json_annual” folder there.

Edit the path in the configuration file#
In the WaterGAP Configuration file “Config_ReWaterGAP.json” navigate to “Calibrate WaterGAP”. Under “path_to_observed_discharge” add the path to the “json_annual” folder you just saved and set “run_calib” to “true”.
WaterGAP is calibrated from the year 1901. Under “SimulationPeriod” set the start year to 1901 by changing the following values: “start”: “1901-01-01”, “end”: “2019-12-31”, “reservoir_start_year”: 1901, “reservoir_end_year”: 2019, “spinup_years”: 5
Modify the station file#
Define the latitude and longitude coordinates of the station in the stations.csv (an example for all 1509 stations is given here “/ReWaterGAP/input_data/static_input/stations.csv”). To run a calibration for a specific basin, users can input the latitude and longitude values for stations within a specific basin.
Run the WaterGAP calibration#
To run the calibration scheme use this command:
$ python3 run_calibration.py "location" "number of calibration regions"
“location”: “local” runs the program on your local server (default). “cluster” runs the program on high performing computer clusters (will be implemented soon).
“number of calibration regions”: During calibration, WaterGAP is run on multiple cores. Indipendent basins are divided between multiple cores during caibration. Larger basins are calculated by a single core, while smaller basins are grouped together and calculated by another single core. This ends up creating what is defined as calibration regions, with the maximum being 27 calibration regions, which are run in parallel using 27 cores.
Note
If you want to run the WaterGAP calibration on your local server for all 1509 station, we suggest you have 27 cores available, to enable faster runtimes.
To run watergap using the entire 1509 stations use this command:
$ python3 run_calibration.py local 27
When you run the command the following steps are exctuted:
1: Model is run with uncalibrated parameters to get actual net abstraction \({NA}_{s}\) and \({NA}_{g}\) for the period 1901 to 2019**(check information)**. Here the parameter \(γ\) is set to 2 for all calibration basins, CFA = 1 for all calibration basins and CFS = 1 for all stations.
2: Calibration is performed using the scheme described above [link scheme above _calibration_schemes_definitions]. Please note that the stations provided standard in the stations.csv file [link station file csv]are used for calibration. For the standard calibration, all 1509 stations are used. The model setup for calibration is a standard anthropogenic run with the neigboring cell water supply option switched off [link tutorial for this]. Calibration starts in upstream basins and proceeds to downstream basins, with the streamflow from the already calibrated upstream basin as inflow. The calibration uses a minimization algorithm for parameter calibration, the “Powell method” from SciPy
3: The calibrated γ values are regionalized to river basins without sufficient streamflow observations using a multiple linear regression approach that relates the natural logarithm of γ to basin descriptors (mean annual temperature, mean available soil water capacity, fraction of local and global lakes and wetlands, mean basin land surface slope, fraction of permanent snow and ice, aquifer-related groundwater recharge factor). [1] .