2022/120 Supported by K NKONW A A WELDEGDEG E OL N ONTOET E S ESREI R E ISE S F OFRO R P R&A C T HTEH E NEENREGRYG Y ETX ITCREA C T I V E S G L O B A L P R A C T I C E THE BOTTOM LINE Agrodem: An Open-Source Model That Quantifies the Sustainable Development Goal 7 (SDG 7) aims to ensure access to Electricity Requirements of Irrigation modern energy for all by 2030. Reaching the goal depends on Why was the Agrodem model developed? sector growth, productivity, and welfare, particularly in rural ramping up electrification efforts. communities. Most of the geospatial models Most geospatial electrification models provide This Live Wire introduces Agrodem, an open-source model that developed to date to identify inadequate coverage of electricity requirements uses publicly available data to simulate climatic conditions, crop-yield priority areas for energy access stemming from agricultural activities distribution, and other agro-ecological features to generate estimates efforts focus on the electrification of the water and electricity required for irrigation. The estimates can Achieving Sustainable Development Goal 7 (SDG 7), which aims of households, giving short shrift to be integrated into other geospatial electrification modeling efforts, for to ensure access to affordable, reliable, sustainable, and modern industrial and agricultural activities. example, the Global Electrification Platform (GEP).1 energy for all by 2030, depends on ramping up electrification efforts But loads from those activities can The Agrodem framework was built on publicly available data and worldwide. To pinpoint energy access targets and the technolo- be substantial. When combined open-source software, including Python (Jupyter Notebooks) and Qgis gies, capacity, and investment best suited to meet them, several with residential loads, they can for all data preparation, modeling, data analysis, and visualizations. geospatial models have been developed over the past decade affect the least-cost technology It honors the principles of reproducible science (Rule et al. 2019) by (Moner-Girona et al. 2018; Morrissey 2019). Most focus on residential for electrification. Agrodem fills publishing all scripts on a public repository on GitHub. Supporting loads and electrification of households, often omitting, or covering the modeling gap. documentation, with a step-by-step guide on running the analysis only partially, loads from commercial and agricultural activities anew (or for a different geography), is also available online.2 (Korkovelos et al. 2019), which are known as productive loads. Alexandros Korkovelos But those loads can be substantial. When combined with residen- is a geospatial data tial loads, they can affect the least-cost technology for electrification. How does Agrodem work? analyst at the Energy Moreover, combining and diversifying the power load can create a The model consists of three main steps Sector Management stronger case for grid expansion in energy-poor regions or underpin Assistance Program The first step is the identification, collection, and processing of the development of business models for off-grid technologies, like (ESMAP) at the World Bank. available data. In the second step, the model is calibrated, scenarios minigrids, in other regions. Bryan Bonsuk Koo is are constructed, and the model is run. The third step consists of By 2030 the electricity requirements of Africa’s agricultural sector an energy specialist at analyzing the output, producing visualizations, and interpreting the could be as high as 9 GW, or double the 2013 level (Banerjee et al. ESMAP. results. The methodological flow is presented in figure 1; each step is 2017). Mapping the sector’s irrigation and electricity requirements then briefly described. together could illustrate how sustainable uses of water complement Kabir Malik is a sustainable uses of energy. The use of efficient and renewable energy senior economist at ESMAP. in agriculture—from irrigation to farm-gate enterprises—supports 1 GEP is a collaborative effort involving the World Bank’s ESMAP, KTH, and five other interna- tional institutions. It aims to serve as a hub of open data and models for geospatial electrifica- tion modeling. https://electrifynow.energydata.info/ 2 https://github.com/akorkovelos/agrodem; https://agrodem.readthedocs.io/en/latest/. 2 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N Figure 1. Methodological flow of the agrodem modeling framework Step 1. Data preparation Step 2. Modeling agricultural activities Step 3. Output analysis Data collection Calibration (GIS, EO, and RS) (expert opinion) Agrodem is an open-source model that uses publicly available data to simulate Parameterization The irrigation model Post-harvesting Total electricity Input data prepping (crop, year, etc.) “Agrodem” + activities requirement climatic conditions, crop yield distribution, and other agro-ecological features Downscaling Future scenarios Tabular data or maps to generate estimates of (optional) (economic profitability) the water and electricity required for irrigation. Validation (micro-data Post analysis and link with and statistical analysis) geospatial electrification Step 1: Data collection and processing. The first step involves These values are generally available in the literature, but they must data collection and curation as well as preparation of the input files be reviewed and calibrated on a case-by-case basis. The method- needed for the irrigation model. The key geospatial datasets are as ology is developed around FAO analyses of evapotranspiration and follows: other phenomena that determine the water requirements of a given • Crop extent and harvested area crop (FAO 1998; Kay and Hatcho 1992). Agrodem is flexible enough to • Distribution of surface water (rivers, lakes, and reservoirs) incorporate a range of changes in input data and can accommodate • Distribution and depth of groundwater study-specific constraints and assumptions. • Climate data (e.g., rainfall, temperature, wind) • Soil characteristics (e.g., water-storage capacity). Step 2: The irrigation model. The second step is to calibrate the irrigation model using the the quantitative and qualitative material Other parameters not generated by geographic information sys- collected in Step 1, and then to fine-tune its assumptions and tems are also used as inputs. These include crop attributes (e.g., crop parameters to the geospatial context. Once this is done, the model is calendar, yields), technology characteristics (e.g., field application and ready to estimate the electricity needed to pump ground and surface distribution efficiency, motor and electric efficacy), and water-man- water for irrigation. agement practices (e.g., irrigation schemes, pumping hours per day). The Step 2 processing pipeline has three phases (figure 2). 3 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N Figure 2. Step 2 of the Agrodem irrigation model Electricity requirements for irrigation are based on a three-phase model Agrodem is flexible enough • Reference evapotranspiration Phase 1 • Crop coefficient and crop evapotranspiration to incorporate a range of Estimating biophysical characteristics • Effective rainfall changes in input data and can accommodate study- specific constraints and • Net irrigation requirements (mm/month) assumptions. Phase 2 • Peak water demand in liters per second Estimating water requirements • Seasonal scheme water demand in cubic meters • Total dynamic head Phase 3 • Power (kW) and electricity (kWh) requirements Estimating electricity requirements • Annual electricity requirements (kWh/year) Source: World Bank; KTH-dES; Vivid Economics. In phase 1, the model estimates crop-specific evapotrans- In phase 2, the model estimates the total water requirements piration and effective rainfall at any given location by using the in a given locale, taking into account seasonal variations, irrigation crop calendar (planting, growing, and harvesting seasons) and the techniques, and water-management schemes. These may vary based corresponding climatological characteristics. Evapotranspiration is on agroecological zone, land conditions, or specific policies. The the process by which water moves from crops and soils into the output yields the total volume of water required in a given area over atmosphere. It includes the evaporation of water from plant and the modeling period (usually a year). soil surfaces, as well as transpiration of water through plant tissues. Finally, in phase 3, the model estimates the electricity (kWh) Evapotranspiration coefficients differ by crop and location. Together needed to supply the required water (figure 3, panel A). Electricity with local climatic conditions (e.g., rainfall, temperature, wind), they requirements depend on the morphology of the land, both under- are used to calculate the “effective rainfall”—the water remaining ground and aboveground, and on the application pressure levels of for the plant to use. Evapotranspiration is computed based on the different irrigation techniques and technologies. FAO-56 Penman-Monteith formula (FAO 1998, paper 56). 4 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N Step 3: Analysis, visualization, and interpretation of results. Figure 3. Sample visualizations of Agrodem model results, using Results are typically presented in .csv format, with each row showing Mozambique as an example the target location (e.g., farm) and each column an attribute of Panel A. Distribution of electricity requirements for irrigation of maize (top) the location (e.g., harvested area, rainfall, water and/or electricity and rice (bottom) requirement). The spatial resolution of the results depends on that The model estimates the of the inputs; it can range from kilometers down to meters, with 0–9,750 1 kilometer the typical resolution. Results can be transferred to any 9,750–19,501 total water requirements 19,501–29,251 GIS/OGC-compatible format (e.g., .shp, .csv, .gpkg, .tiff) for further in a given locale, taking 29,251–39,001 use. Results can also be aggregated, layering the combined electric- 39,001–48,751 into account seasonal ity requirements for multiple crops and regions (figure 3, panel B). Administrative level 2 variations, irrigation Three sample visualizations are depicted in figure 3. They are techniques, and water- samples only, not meant to be closely interpreted here, as the data points are generally too numerous and the axes of some of the management schemes. figures have been omitted. How can Agrodem help modelers, planners, and policy makers improve energy access? Electricity requirements for irrigation of maize kWh/year (for base year) Agrodem can be applied to inform planning related to agriculture and other productive uses of electricity Because Agrodem is spatially explicit—that is, its estimates cover a specific area of interest—it can quickly pinpoint geographic areas for priority intervention. It can also complement least-cost electrification plans, such as the ones appearing in GEP . Estimates of the electricity required to irrigate a given area can be combined with the residential, institutional, and industrial loads—which are also geographically estimated—for a more inclusive load profile. The underlying geospa- tial least-cost model can then be run to select the most affordable technology option for the target location—whether a settlement or a farm. Both GEP and OnSSET were developed to enable the generation and visualization of multiple scenarios (Korkovelos et al. 2019; KTH Electricity requirements for irrigation of rice et al. 2020; Mentis et al. 2017)—for example, to permit comparisons kWh/year (for base year) of the electrification mix with and without agricultural loads. Such comparative exercises address the feasibility issues posed by various Note: Only the northern half of the country is shown. electrification technologies. For example, does the agricultural load create a stronger case for grid expansion where agriculture’s energy 5 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N Panel B. Indicative electricity requirements (MWh/year) for irrigation of maize, cassava, and rice in Mozambique, as estimated by the Agrodem model, aggregated by administrative division -17,500 The spatial resolution of the results can range from kilometers down to meters. -15,000 -12,500 -10,000 -7,500 -5,000 -2,500 6 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N Panel C. Least-cost electrification options for 2,375 farms in water-deprived areas, mapped and graphed Least-cost electrification technology Stand-alone PV system National boundaries PV-diesel minigrid Sub-national boundaries Stand-alone PV: 1,479 kW Because Agrodem’s Grid densification/extension PV-diesel minigrid: 611 kW estimates cover a specific Grid connection: 92 kW Hydro minigrid Hydro minigrid: 30 kW area of interest, the model can quickly pinpoint geographic areas for Average additional capacity per location: 1.23 kW priority intervention. It can Average investment per location: US$3,893 also complement least- cost electrification plans. Estimates of the electricity required to irrigate a given area can be combined with Note: Only the northern half of the country is shown. the residential, institutional, and industrial loads—which are also geographically estimated—for a more requirements are high? Does it create a robust business case for What have we learned to date? minigrids? Does it indicate areas that would be better served by solar inclusive load profile. pumps? Basically, that it’s hard to estimate electricity The results shown in panel C of figure 3 indicate the electrifi- requirements for irrigation cation technology that can provide irrigation at the least cost in To do a better job, two elements in the methodology require special water-deprived agricultural areas in Mozambique. Most of the sites attention, and several caveats are in order. find PV-based systems as the least-cost option, whether in the form First, the unit of analysis must be aligned with the granularity of of standalone systems (solar pumps) or PV-diesel minigrids. Grid input data. connection was identified as the least-cost option in a small fraction Open access and spatial data showing the distribution of specific of locations, mostly where annual electricity requirements were crops, with pertinent attributes (e.g., volumes harvested or produced, very high. Hydro-based minigrids were selected for an even smaller by area), are available only at relatively low granularity (10 km). The fraction of sites. unit of analysis, therefore, will also be coarse. Although statistical 7 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N downscaling methods exist (and can generate more granular spatial To allow for that, Agrodem is structured transparently to allow input data for the irrigation model), they are time- and data-inten- flexibility in setting parameters while achieving replicability and sive exercises that need to be properly designed, executed, and reproducibility. That is, end users can easily adjust parameters to cross-validated. suit the local context. This allows multiple scenarios to be run in a Running times depend on the spatial granularity of the input data. relatively short period of time and used to assess the sensitivity of Agrodem is structured The model requires a couple of hours to run a typical 1 km2 input file primary or secondary parameters. transparently to allow of crop distribution. Lower-resolution input files (e.g., 10 km2) require Finally, several caveats should be borne in mind, at last until less time to run. Higher resolutions (e.g., 250 m2) demand consider- future work can resolve them. flexibility in setting ably more running time. The reported computation times are based The Agrodem model uses simplified assumptions to achieve parameters while on modeling exercises undertaken for Mozambique, which is used as flexibility, modularity, and reproducibility. For example, the model achieving replicability a reference case in this publication. assumes that water reservoirs (both surface and underground) have and reproducibility. End Analysis of model outputs would benefit from a vector polygon unlimited flow capacity. In reality, withdrawal limits do exist; these are layer, with each polygon representing a target field with the crop usually covered in hydrological models and analyses that are not yet users can easily adjust type, harvested area, and total production for a given year. Although part of Agrodem’s modeling process. Similarly, the modeling granular- parameters to suit the local not yet available at scale, this type of visual presentation would boost ity of crops’ physical properties, soil composition, climatic variability, context. the amount of data available to the model. Recent innovations with and projection is fairly low, a limitation that must be acknowledged remote-sensing techniques suggest that higher-resolution datasets both when deploying the model and when reviewing the results. In may soon become available. Land-cover products are now readily other words, the model is best at producing high-level insights from available at high granularity (e.g., 30 meters). These indicate cropland a variety of scenarios. It cannot provide a full-fledged engineering distribution but do not specify the type of crop or other features analysis of the subject parameters. required to estimate irrigation requirements. Other interesting The time framework is another aspect of the model and its analy- initiatives include AtlasAI (Tadlaoui 2021), Digital Earth Africa (n.d.), sis requiring attention—that is, the time period over which the model and the Radiant Earth Foundation, whose products are still under estimates the irrigation requirements. Agrodem can identify irrigation development and not available at scale. Such products would requirements for current crops and future ones with a modeling increase the granularity and thus the degree of insight obtainable component that enables users to explore hypothetical alternatives using the Agrodem model. of cropland expansion (“extensification”) so they can evaluate both Second, the model’s parameters and assumptions should be the effect of expected changes to crops and any impact policy customized to the local context. might have on extensification over time. The script is available, The modeling results are significantly affected by the selection but it needs additional work to properly develop such scenarios. and calibration of input parameters and assumptions. In Agrodem, Another component worthy of further exploration is “intensification,” changes in modeling inputs may drastically alter the results, and meaning the increased harvest, or yield, over the modeling period many of the parameters must factor in local context. Maize cultiva- in an area already under cultivation. Intensification analysis involves tion, for example, varies by location. Water-management techniques more complex energy inputs (e.g., fertilizer), which are not presently may vary, as well. The same is true of available irrigation technologies covered in Agrodem. and their specific characteristics. Although the literature provides a Finally, electrifying farm-gate activities (heating, drying, de-husk- good starting point, the modeling must engage local stakeholders ing, milling, pressing, cold storage) can also increase productivity. A from the energy and agriculture sectors and calibrate the exercise in modeling component within the Agrodem framework identifies the light of their knowledge and experience. electricity requirements of such activities, which can be spatially 8 A G R O D E M : A M O D E L T H AT Q UA N T I F I E S T H E E L E C T R I C I T Y R E Q U I R E M E N T S O F I R R I G AT I O N identified and roughly quantified. At this stage, however, estimating KTH Energy Systems and institutional partners. 2020. “Global MAKE FURTHER farm-gate activities and their energy requirements uses generic Electrification Platform (GEP),” Energydata.info, 2020. https:// CONNECTIONS assumptions about the potential yield and type of equipment used. electrifynow.energydata.info/ (accessed Mar. 15, 2020). In reality, sensible estimates of the energy demands of farm-gate Mentis, D., M. Howells, H. Rogner, and many others. 2017. “Lighting Live Wire 2014/20. “Scaling Up Access to activities require more detailed and informed methods capable of the world: The first application of an open source, spatial elec- Electricity: The Case of Lighting Africa,” by Daniel Murphy and Arsh Sharma. incorporating dynamic elements (e.g., logistics, supply chain, access trification tool (OnSSET) on Sub-Saharan Africa,” Environmental to market, etc.). Agrodem can therefore be used presently only for Research Letters 12(8). https://doi.org/10.1088/1748-9326/ Live Wire 2014/33. “Tracking Progress a quick screening analysis of the estimated power requirements of aa7b29. Toward Sustainable Energy for All in Sub-Saharan Africa,” by Elisa Portale and farm-gate activities. Even so, when combined with the requirements Moner-Girona, M., D. Puig, Y. Mulugetta, I. Kougias, J. AbdulRahman, Joeri de Wit. imposed by irrigation, the analysis can help delineate the spatial and S. Szabó. 2018. “Next generation interactive tool as a contours of electrification for productive agricultural uses. backbone for universal access to electricity,” WIREs Energy and Live Wire 2015/41. “Thirsty Energy: Understanding the Linkages between Environment 2018(7). https://doi.org/10.1002/wene.305. Energy and Water,” by Anna Delgado, References Morrissey, J. 2019. “Achieving universal electricity access at the Diego J. Rodriguez, and Antonia A. Sohns. lowest cost: A comparison of least-cost electrification models.” Banerjee, S. G., K. Malik, A. Tipping, J. Besnard, and J. D. Nash. 2017. Live Wire 2015/43. “Integrating Climate Energy for Sustainable Development 53: 81-96 Double Dividend: Power and Agriculture Nexus in Sub-Saharan Model Data into Power System Planning,” Rule, A., A. Birmingham, C. Zuniga, and many others. 2019. Africa. Washington, DC: World Bank Group. http://documents. by Debabrata Chattopadhyay and Rhonda “Ten simple rules for writing and sharing computational L. Jordan. worldbank.org/curated/en/561861491815768638/Double- analyses in Jupyter Notebooks,” PLOS Computational Biology dividend-power-and-agriculture-nexus-in-Sub-Saharan-Africa. Live Wire 2017/73. “Forecasting 15(7): e1007007, July 2019, https://doi.org/10.1371/journal. Digital Earth Africa. N.d. “Cropland extent map.” https://www. Electricity Demand: An Aid for pcbi.1007007. Practitioners,” by Jevgenijs Steinbuks, digitalearthafrica.org/. Tadlaoui, A. 2021. “Bridging the global agricultural data gap: one crop Joeri de Wit, Arthur Kochnakyan, and FAO (Food and Agriculture Organization). 1998. “FAO irrigation and Vivien Foster. at a time.” AtlasAI, Palo Alto, CA, USA, https://www.atlasai.co/ drainage papers 25 and 56,” Rome, 1992. https://www.fao.org/3/ blog/bridging-the-global-agricultural-data-gap-one-crop-at-a-time. Live Wire 2017/85. “A GIS Approach to X0490E/x0490e0r.htm#faotechnical papers. Electrification Planning in Afghanistan,” Kay, N., and M. Hatcho. 1992. “Small-scale pumped irrigation: Energy The Agrodem model was developed as part of a project funded by the World by Alexandros Korkovelos, Morgan and cost,” UN Food and Agriculture Organization, Rome. Bazilian, Dimitrios Mentis, and Mark Bank. The model was applied to Mozambique by the division of Energy Howells. Korkovelos, A., B. Khavari, A. Sahlberg, M. Howells, and C. Arderne. Systems at KTH Royal Institute of Technology, Sweden, in collaboration with 2019. “The role of open access data in geospatial electrification Vivid Economics, London, and with support from the Bank’s energy and Live Wire 2019/101. “How Do Enterprises planning and the achievement of SDG7. An OnSSET-Based Case agriculture teams. The authors thank all who contributed to the production Benefit from Grid Connection? The Case of the paper from which this Live Wire was drawn, especially Konstantinos of Rural Electrification in Bangladesh?” by Study for Malawi,” Energies 12(7): 1395. https://doi.org/10.3390/ Pegios, Mark Westcott, Neeraj Baruah, Youssef Almulla, Camilo Ramirez, Mark Hussain Samad and Elisa Portale. en12071395. Howells, Raluca Georgiana Golumbeanu, Juliette Besnard, Pieter Waalewijn, Live Wire 2019/106. “Planning Models Dilip R. Limaye, and Ghada Elabed. None of these individuals is responsible for for Electricity Access: Where Do We Go any errors of fact or interpretation. Any such errors are the sole responsibility from Here?” by Rahul Srinivasan and of the authors. Debabrata Chattopadhyay. Live Wire 2021/113. “Tracking Advances in Access to Electricity Using Satellit- Based Data,” by Milien Dhorne, Claire Nicolas, Christopher Arderne, and Juliette Besnard. Find these and the entire Live Wire archive at www.worldbank.org/energy/livewire.