(1) Overview
Introduction
Research in water-energy-land systems (WEL) [, ] and understanding the implications of water scarcity on WEL systems [, , ] is rapidly progressing. Additional impacts to water resource management are now also being considered when addressing supply-demand cycles and reservoir effects from potential water shortages []. Xanthos 2 was created to accommodate these progressive advancements in water-energy-land science that support cutting-edge research in human-Earth systems interactions. Currently, Xanthos 2 provides water supply, accessibility, and hydropower potential to the Global Change Assessment Model (GCAM) which is an integrated human-Earth systems model [, , ]. Xanthos 2 was built upon previous development by Li et al. [] by creating a Python framework where core components of the model (potential evapotranspiration (PET), runoff generation, and river routing) can be interchanged or extended without having to start from scratch. Xanthos 2 utilizes a component-style architecture which enables researchers to quickly incorporate and test cutting-edge research in a stable modeling environment prebuilt with diagnostics to keep up with advancing science objectives. The new default configuration of Xanthos now supports the Penman-Monteith [, ] PET module which incorporates more comprehensive climate drivers as well as dynamic land cover data to allow land atmosphere interactions. The abcd water balance module was also added as the default runoff component to account for groundwater recharge and baseflow in runoff estimates []. Additionally, the following enhancements were also made: improved water velocity considerations for the Modified River Transport Model (MRTM) routing module [, ], hydropower production assessment and potential capacity modules, and a built-in differential evolution optimization module to calibrate abcd parameters based on benchmark global runoff.
Implementation and architecture
Xanthos 2 was created as a Python package to facilitate reuse. Xanthos runs are setup using a configuration file to describe which components of the model are used, data parameterization, run-specific settings, and more. A GitHub Wiki explaining how to set up a Xanthos run, and the required project level settings of the configuration file is available on the Xanthos GitHub website. A list of available components with references to the algorithms from which they are derived is described in Table 1; though, the GitHub Wiki details each component’s configuration settings and variable descriptions for all additional model components. The following is a simple example of how to call and run Xanthos in a Python script after it has been setup:
from xanthos import Xanthos
def run(ini):
# instantiate model
xth = Xanthos(ini)
# run intended configuration
xth.execute()
return xth
if __name__ == “__main__”:
# full path to parameterized config file
ini = ‘<the directory path to your example
directory>/pm_abcd_mrtm.ini’
# run the model
xth = run(ini)
Component | Type | Algorithm Reference |
---|---|---|
Penman-Monteith | PET | McMahon et al. 2012; Monteith 1965 [, ] |
Hargreaves-Samani | PET | Hargreaves and Samani 1982 [] |
Hargreaves | PET | Hargreaves et al. 1985 [] |
Thornthwaite | PET | Thornthwaite 1948 [] |
abcd | Runoff | Liu et al. 2018 [] |
Global Water Availability Model (GWAM) | Runoff | Hejazi et al. 2014 [] |
Modified River Transport Model (MRTM) | Routing | Zhou et al. 2015; Li et al. 2015 [, ] |
Diagnostics | Post-processing | Li et al. 2017 [] |
Time Series Plotting | Post-processing | Li et al. 2017 [] |
Accessible Water | Post-processing | Kim et al. 2016 [] |
Hydropower – Potential | Post-processing | Zhou et al. 2015 [] |
Hydropower – Actual | Post-processing | Turner et al. 2017a; Turner et al. 2017b [, ] |
Calibration – abcd | Ancillary | Storn and Price 1997 [] |
Calling the execute() method after instantiating the Xanthos class will start a run and initialize the logger. The user will be updated as the model progresses through each step and as outputs are generated. Table 2 describes the expected outputs of a Xanthos run using the default core configuration and the accessible water, hydropower, diagnostics, and time series plots post-processing modules.
Output | Source | Units |
---|---|---|
Potential Evapotranspiration (PET) per grid cell | PET | Monthly or annually; mm/time or km3/time |
Actual Evapotranspiration (AET) per grid cell | Runoff | Monthly or annually; mm/time or km3/time |
Gridded runoff per grid cell | Runoff | Monthly or annually; mm/time or km3/time |
Aggregated total runoff per basin | Runoff | Monthly or annually; mm/time or km3/time |
Aggregated total runoff per GCAM country | Runoff | Monthly or annually; mm/time or km3/time |
Aggregated total runoff per GCAM region | Runoff | Monthly or annually; mm/time or km3/time |
Soil moisture per grid cell | Runoff | Monthly or annually; mm/time or km3/time |
Average channel flow per grid cell | Routing | Monthly; m3/second |
Accessible water | Accessible water | Monthly or annually; mm/time or km3/time |
Exploitable hydropower potential by GCAM region | Hydropower – Potential | Monthly or annually; EJ/time |
Technical hydropower potential by GCAM region | Hydropower – Potential | Monthly or annually; EJ/time |
Actual hydropower production | Hydropower – Actual | Monthly or annually; EJ/time |
Diagnostics – runoff by basin | Diagnostics | Annually; km3/year |
Diagnostics – runoff by GCAM country | Diagnostics | Annually; km3/year |
Diagnostics – runoff by GCAM region | Diagnostics | Annually; km3/year |
Time series plots – streamflow by basin | Time Series Plots | Monthly or annually; mm/time or km3/time |
Time series plots – streamflow by GCAM country | Time Series Plots | Monthly or annually; mm/time or km3/time |
Time series plots – streamflow by GCAM region | Time Series Plots | Monthly or annually; mm/time or km3/time |
Xanthos 2 provides an extensible framework to interchange or add additional PET, runoff, and routing components of the core monthly water balance module (Figure 1). Post-processing modules (e.g., accessible water, hydropower potential, etc.) can also be added to create output products. A complete workflow for integrating a new component into Xanthos is provided in detail in an associated GitHub Wiki.
Calibration module
The new default configuration of Xanthos contains the abcd water balance module to generate runoff as interpreted by Liu et al. []. The abcd module is driven by five aptly-named parameters: a which controls the amount of runoff that occurs when soils are under-saturated; b which controls the saturation level of the soil; c which defines the degree of recharge to groundwater; d which controls the rate of groundwater discharge; and m for snowpack accumulation and snowmelt estimates which was added by Martinez and Gupta []. The performance of the abcd module is influenced by per-basin a, b, c, d, m parameters which need to be calibrated based on the chosen climate forcing, PET, and runoff routines.
To accommodate the need for recalibration depending on experimental design, we chose to include a preconfigured calibration module in Xanthos 2 that uses SciPy’s differential evolution (DE) optimization function [] based off of the algorithm presented in Storn and Price []. The DE method is useful for global optimization problems and is a stochastic population-based optimization method []. The objective function provided in Xanthos 2 evaluates the Kling-Gupta efficiency (KGE) which is a goodness-of-fit measure between simulated and observed runoff []; however, alternate methods could be utilized.
Figure 2 demonstrates the optimization module’s ability to calibrate Xanthos 2 runoff to the complex Variable Infiltration Capacity (VIC) model’s monthly runoff projections [] when forced by WATer and global Change (WATCH) [] climate data for years 1971–1991. The resulting median KGE for all basins was a respectable 0.9 which is an improvement to the calibration results of 0.79 generated by Liu et al. [] when using MATLAB’s built-in genetic algorithm (GA) []. A tutorial describing how to setup and use the calibration module in Xanthos can be viewed on our GitHub repository.
Installation
Xanthos can be installed using the following steps:
- This repository uses the Git Large File Storage (LFS) extension (see https://git-lfs.github.com/ for details). Please install GitLFS and run the following command before cloning if you do not already have Git LFS initialized: git lfs install.
- Clone Xanthos into your desired location git clone https://github.com/JGCRI/xanthos.git. Some Windows users have had better luck with git lfs clone https://github.com/JGCRI/xanthos.git.
- Make sure that setuptools is installed for your Python version. This is what will be used to support the installation of the Xanthos package.
- From the directory you cloned Xanthos into run python setup.py install. This will install Xanthos as a Python package on your machine and install the needed dependencies. If installing in a high-performance computing environment, a community user advised that it is best to install the anaconda environment before running the installation command. HPC environments may also require the use of the --user flag in the install command to avoid permissions errors.
- Setup your configuration file (.ini). Examples are located in the “example” directory. Be sure to change the root directory to the directory that holds your data (use the “xanthos/example” directory as an example).
- If running Xanthos from an IDE: Be sure to include the path to your config file. See the “xanthos/example/example.py” script as a reference.
- If running Xanthos from terminal: Run model.py found in xanthos/xanthos/model.py, which passes the full path to the config file as the only argument. (e.g., python model.py <dirpath>/config.ini).
Quality control
Xanthos has been functionally tested on Linux, Mac OSX, and Windows to ensure model reusability. Xanthos has a built-in diagnostics module that compares model outputs to expected output from other mainstream hydrologic models when forced by the same climate assumptions. The calibration module output has also been evaluated as described in the “Calibration module” section of this paper. Exception handling is present throughout the model to ensure data consistency and provide informed feedback to the user for cases where an assumption has been violated. Extensive tests are built-in that validate the configuration file, and the contents thereof, that is provided by the user. Both expected inputs and outputs for each component have been provided as a baseline for comparability if the user decides to extend or alter the code for an intended purpose.
(2) Availability
Operating system
Linux, Mac OSX, Windows 7 and 2012 server.
Programming language
Python 2.7, Python 3
Additional system requirements
We recommend a minimum RAM of 8GB due to routinely processing large datasets.
Dependencies
The following Python 3 packages are required for Xanthos:
- numpy >= 1.11
- scipy >= 0.18
- matplotlib>=1.3.1,<3.0
- pandas >= 0.19
- configobj >= 5.0.6
- joblib >= 0.11
- setuptools >= 24.2.0
Software location
Archive
Name: Zenodo
Persistent identifier:https://doi.org/10.5281/zenodo.2035720
Licence: BSD 2-Clause
Publisher: Chris R. Vernon
Version published: v2.2.0
Date published: December 7, 2018
Code repository
Name: GitHub
Identifier:https://github.com/JGCRI/xanthos/tree/v2.2.0
Licence: BSD 2-Clause
Date published: December 7, 2018
Language
English
(3) Reuse potential
Xanthos 2 was created to be extensible by design. Users can provide their own core and/or post-processing components as described in our GitHub Wiki. For example, a new PET module could be added into Xanthos and used instead of the default configuration. This allows those who are advancing the science of WEL research to both test their alternate process through integrated testing with the other core components of Xanthos, and then compare their results against the default Xanthos configuration and validate performance using the built-in diagnostics module. The core components of Xanthos are also interchangeable to accommodate research objectives. An example of extending a post-processing component could be adding a drought module that would use runoff as generated by Xanthos and any other required inputs to examine timing and duration droughts through seamless and citable integration.
Xanthos provides a custom issue template, Extending Xanthos Issues, which guides the user to provide information that our team can use to quickly address any questions that may arise when extending Xanthos.