Package 'mrwater'

Title: madrat based MAgPIE water Input Data Library
Description: Provides functions for MAgPIE cellular input data generation and stand-alone water calculations.
Authors: Felicitas Beier [aut, cre], Jens Heinke [aut], Kristine Karstens [aut], Benjamin Leon Bodirsky [aut], Jan Philipp Dietrich [aut]
Maintainer: Felicitas Beier <[email protected]>
License: LGPL-3 | file LICENSE
Version: 1.13.5
Built: 2024-09-30 17:17:38 UTC
Source: https://github.com/pik-piam/mrwater

Help Index


mrwater: madrat based MAgPIE water Input Data Library

Description

Provides functions for MAgPIE cellular input data generation and stand-alone water calculations.

Author(s)

Maintainer: Felicitas Beier [email protected]

Authors:

See Also

Useful links:


calcActualIrrigWatRequirements

Description

This function calculates actual irrigation water requirements per cell given the chosen irrigation system

Usage

calcActualIrrigWatRequirements(
  selectyears,
  iniyear,
  lpjml,
  climatetype,
  irrigationsystem,
  multicropping
)

Arguments

selectyears

Years to be returned

iniyear

Initialization year (for weight by cropland)

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

See Also

calcIrrigationSystem, calcIrrigWatRequirements

Examples

## Not run: 
calcOutput("ActualIrrigWatRequirements", aggregate = FALSE)

## End(Not run)

calcAreaPotIrrig

Description

This function calculates land that is potentially available for irrigated agriculture

Usage

calcAreaPotIrrig(selectyears, comagyear, iniyear, landScen)

Arguments

selectyears

Years to be returned

comagyear

If NULL: total potential croparea is used; if !NULL: already irrigated area is subtracted; year specified here is the year of the initialization used for cropland area initialization in calcIrrigatedArea (e.g. NULL, 1995, 2010)

iniyear

Initialization year for current cropland area

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("AreaPotIrrig", aggregate = FALSE)

## End(Not run)

calcAvlWater

Description

This function calculates water availability for MAgPIE retrieved from LPJmL

Usage

calcAvlWater(
  lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop =
    "ggcmi_phase3_nchecks_9ca735cb"),
  climatetype = "GSWP3-W5E5:historical",
  cells = "lpjcell",
  stage = "harmonized2020",
  seasonality = "grper"
)

Arguments

lpjml

Defines LPJmL version for crop/grass and natveg specific inputs

climatetype

Switch between different climate scenarios

cells

Number of cells to be returned (select "magpiecell" for 59199 cells or "lpjcell" for 67420 cells)

stage

Degree of processing: raw, smoothed, harmonized, harmonized2020

seasonality

grper (default): water available in growing period per year; total: total water available throughout the year; monthly: monthly water availability (for further processing, e.g. in calcEnvmtlFlow)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Kristine Karstens, Abhijeet Mishra

Examples

## Not run: 
calcOutput("AvlWater", aggregate = FALSE)

## End(Not run)

calcBlueWaterConsumption

Description

This function calculates consumptive blue water use for the whole year based on LPJmL blue water consumption of crops and the difference between rainfed and irrigated evapotranspiration of grass

Usage

calcBlueWaterConsumption(
  selectyears,
  lpjml,
  climatetype,
  fallowFactor = 0.75,
  areaMask,
  output
)

Arguments

selectyears

Years to be returned

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Climate model (e.g., "MRI-ESM2-0:ssp370") or historical baseline (e.g., "GSWP3-W5E5:historical")

fallowFactor

Factor determining water requirement reduction in off season due to fallow period between harvest of first (main) season and sowing of second (off) season

areaMask

Multicropping area mask to be used "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification

output

output to be returned by the function: combination of crop type ("crops" or "grass") and season ("main" (LPJmL growing period), "year" (entire year)), separated by ":" ("crops:main", "crops:year", "grass:main", "grass:year")

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("BlueWaterConsumption", aggregate = FALSE)

## End(Not run)

calcCropareaAdjusted

Description

This returns croparea as reported by FAO and LUH for the initialization year and

Usage

calcCropareaAdjusted(iniyear, dataset = "LandInG", sectoral = "kcr")

Arguments

iniyear

initialization year

dataset

LUH or LandInG Note: once migration to Toolbox data is complete, this function can be replaced with calcCropareaLandInG

sectoral

crops to be reported: "kcr" for MAgPIE items, and "lpj" for LPJmL items

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("CropareaAdjusted", aggregate = FALSE)

## End(Not run)

calcCropAreaPotIrrig

Description

This function calculates croparea that is potentially available for irrigated agriculture per crop given a chosen cropmix

Usage

calcCropAreaPotIrrig(selectyears, comagyear, iniyear, cropmix, landScen)

Arguments

selectyears

Years to be returned

comagyear

If NULL: total potential croparea is used; if !NULL: already irrigated area is subtracted; year specified here is the year of the initialization used for cropland area initialization in calcIrrigatedArea (e.g. NULL, 1995, 2010)

iniyear

Initialization year for current cropland area

cropmix

Cropmix for which croparea share is calculated (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops as vector)

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("CropAreaPotIrrig", aggregate = FALSE)

## End(Not run)

calcCropAreaShare

Description

This function calculates the crop area share for a chosen cropmix

Usage

calcCropAreaShare(iniyear, cropmix)

Arguments

iniyear

Croparea initialization year

cropmix

Cropmix for which croparea share is calculated (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_rainf" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Benjamin L. Bodirsky

Examples

## Not run: 
calcOutput("CropAreaShare", aggregate = FALSE)

## End(Not run)

calcCropProductionRevenue

Description

calculates irrigated and rainfed production quantities or revenue on given crop areas under selected management scenario. It can return quantities in terms of the sum of crop biomass produced in tDM or production revenue in terms of monetary revenue achieved in USD

Usage

calcCropProductionRevenue(
  outputtype,
  scenario,
  management,
  area,
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  efrMethod,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  cropmix,
  comAg,
  transDist,
  fossilGW
)

Arguments

outputtype

"biomass": returns the production quantity in terms of crop biomass (in tDM) "revenue": returns the revenue in terms of price x quantity of crop production (in USD)

scenario

EFP and non-agricultural water use scenario separated with a "." (e.g. "on.ssp2")

management

management in terms of irrigation and multiple cropping practices consisting of multiple cropping scenario ("single", actMC", "potMC") and ("potential", "counterfactual") separated by ":" (e.g. "single:potential", "actMC:counterfactual") Multiple cropping practices: "single": single cropping assumed everywhere "actMC": multiple cropping as reported by LandInG data "potMC": multiple cropping practiced everywhere where it is possible Irrigation assumption: "potential": irrigation practiced where possible according to irrigation potentials or practiced according to area information (see param 'area') "counterfactual": production and revenue for counterfactual case that irrigated areas were managed under rainfed conditions

area

area scenario "actual": current cropland and currently irrigated areas or potentially irrigated areas following land availability defined in landScen scenario: consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years for which irrigatable area is calculated

iniyear

Initialization year for initial croparea

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, "hist_rainf" for historical rainfed cropmix, or selection of proxycrops)

comAg

If TRUE: currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("CropProductionRevenue", aggregate = FALSE)

## End(Not run)

calcCropYieldGain

Description

This function calculates the yield gains per crop through irrigation or multiple cropping relative to rainfed-single system production (including negatives)

Usage

calcCropYieldGain(
  lpjml,
  climatetype,
  yieldgaintype,
  priceAgg,
  iniyear,
  selectyears,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Climate scenarios or historical baseline "GSWP3-W5E5:historical"

yieldgaintype

Crop yield gain through multiple cropping under rainfed conditions "multicropping_rf", multiple cropping under irrigated conditions "multicropping_ir", irrigation under single cropping conditions "irrigation_singlecropping" irrigation and multiple cropping "irrigation_multicropping"

priceAgg

Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices, or "CONST" for same price for all crops

iniyear

initialization year for food price and cropmix area

selectyears

Years to be returned by the function

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("CropYieldGain", aggregate = FALSE)

## End(Not run)

calcDischargeAccessibilityShare

Description

This function calculates the share of discharge that is useable given the variability of monthly flows. If discharge is highly variable, it is harder to bring into productive use and therefore water availability (for human use) is reduced.

Usage

calcDischargeAccessibilityShare(
  lpjml,
  selectyears,
  climatetype,
  accessibilityrule
)

Arguments

lpjml

LPJmL version used

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year is inaccessible (e.g. Q:1 all discharge accessible, Q:0.75 0.75-quantile is accessible everything that is more variable inaccessible) or base value for exponential curve, separated by : (CV:2)

Value

magpie object in cellular resolution representing share of discharge that is accessible to humans

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("DischargeAccessibilityShare", aggregate = FALSE)

## End(Not run)

calcDischargeInaccessible

Description

This function calculates the discharge that is inaccessible to humans based on the variability of monthly flows and natural discharge.

Usage

calcDischargeInaccessible(lpjml, selectyears, climatetype, accessibilityrule)

Arguments

lpjml

LPJmL version required for respective inputs: natveg or crop

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

Value

magpie object in cellular resolution representing discharge that is inaccessible to humans

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("DischargeInaccessible", aggregate = FALSE)

## End(Not run)

calcDischargeInaccessibleAdd

Description

This function calculates water that is inaccessible to humans but not part of EFRs. Reason: Inacessible discharge is highly variable discharge that can also serve as high flow requirements (HFR) for EFRs. This has to be accounted in the Discharge Allocation Algorithm for the determination of potential irrigation.

Usage

calcDischargeInaccessibleAdd(
  selectyears = selectyears,
  lpjml = lpjml,
  climatetype = climatetype,
  accessibilityrule = accessibilityrule,
  efrMethod = efrMethod
)

Arguments

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("DischargeInaccessibleAdd", aggregate = FALSE)

## End(Not run)

calcEconOfIrrig

Description

calculates potentially irrigated area for different gainthresholds subject to land and water constraints

Usage

calcEconOfIrrig(
  scenario,
  output,
  gtrange,
  selectyears,
  iniyear,
  lpjml,
  climatetype,
  efrMethod,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  irrigationsystem,
  landScen,
  cropmix,
  transDist,
  fossilGW,
  comAg,
  multicropping
)

Arguments

scenario

non-agricultural water use scenario

output

output to be displayed: irrigated area "IrrigArea" or available water volume "wat_ag_ww" "wat_ag_wc"

gtrange

range of x-axis (gainthreshold) to be depicted on the curve

selectyears

years for which irrigatable area is calculated

iniyear

initialization year

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

comAg

if TRUE: the currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcEconOfIrrig(aggregate = FALSE)

## End(Not run)

calcEFRviolations

Description

This function calculates grid cell specific violation of environmental flow requirements

Usage

calcEFRviolations(
  lpjml,
  selectyears,
  climatetype,
  efrMethod,
  transDist,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  iniyear,
  landScen,
  cropmix,
  comAg,
  multicropping,
  scenario,
  cellular = TRUE
)

Arguments

lpjml

LPJmL version used

selectyears

Years for which irrigatable area is calculated

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

iniyear

Initialization year of irrigation system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

comAg

If TRUE: currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

scenario

Combination of EFP ("on", "off") and non-ag. water use scenario ("ssp2", "ISIMIP", ...) separated by "."

cellular

If TRUE: cellular data returned. If FALSE: aggregated to basins

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Benjamin Leon Bodirsky

Examples

## Not run: 
calcOutput("EFRviolations", aggregate = FALSE)

## End(Not run)

calcEnvmtlFlowRequirements

Description

This function calculates environmental flow requirements (EFR) based on EFR share calculated from LPJmL monthly discharge

Usage

calcEnvmtlFlowRequirements(lpjml, selectyears, climatetype, efrMethod)

Arguments

lpjml

LPJmL version used

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

Value

magpie object with EFRs, LFRs and HFRs in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("EnvmtlFlowRequirements", aggregate = FALSE)

## End(Not run)

calcEnvmtlFlowRequirementsInaccess

Description

This function calculates environmental flow requirements (EFR) that are inaccessible to humans based on EFRs and inaccessible discharge calculated from LPJmL monthly discharge

Usage

calcEnvmtlFlowRequirementsInaccess(
  lpjml,
  selectyears,
  climatetype,
  efrMethod,
  accessibilityrule
)

Arguments

lpjml

LPJmL version used

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

Value

magpie object with EFRs, LFRs and HFRs in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("calcEnvmtlFlowRequirementsInaccess", aggregate = FALSE)

## End(Not run)

calcEnvmtlFlowRequirementsShare

Description

This function calculates environmental flow requirements (EFR) (as share of discharge) based on LPJmL monthly discharge

Usage

calcEnvmtlFlowRequirementsShare(lpjml, climatetype, efrMethod)

Arguments

lpjml

LPJmL version used for monthly discharge

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair, PB:Rockstroem)

Value

magpie object in cellular resolution representing share of discharge that is reserved for environmental flows

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("EnvmtlFlowRequirementsShare", aggregate = FALSE)

## End(Not run)

calcFullIrrigationRequirement

Description

This function calculates the water requirements for full irrigation per cell per crop given potentially available land

Usage

calcFullIrrigationRequirement(
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  comagyear,
  irrigationsystem,
  landScen,
  cropmix,
  multicropping
)

Arguments

lpjml

LPJmL version used

climatetype

Climate model or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned

iniyear

Croparea initialization year

comagyear

if !NULL: already irrigated area is subtracted; if NULL: total potential land area is used; year specified here is the year of the initialization used for cropland area initialization in calcIrrigatedArea

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("FullIrrigationRequirement", aggregate = FALSE)

## End(Not run)

calcGrassET

Description

Calculates evapotranspiration (ET) of grassland under irrigated and rainfed conditions based on LPJmL inputs.

Usage

calcGrassET(selectyears, lpjml, climatetype, season)

Arguments

selectyears

Years to be returned

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

season

"wholeYear": grass et in the entire year (main + off season) "mainSeason": grass etP in the crop-specific growing period of LPJmL (main season)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("GrassET", aggregate = FALSE)

## End(Not run)

calcGrowingPeriod

Description

This function determines a mean sowing date and a mean growing period for each cell in order to determine when irrigation can take place.

Usage

calcGrowingPeriod(
  lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop =
    "ggcmi_phase3_nchecks_9ca735cb"),
  climatetype = "GSWP3-W5E5:historical",
  stage = "harmonized2020",
  yield_ratio = 0.1,
  cells = "lpjcell"
)

Arguments

lpjml

Defines LPJmL version for crop/grass and natveg specific inputs

climatetype

Switch between different climate scenarios

stage

Degree of processing: raw, smoothed, harmonized, harmonized2020

yield_ratio

threshold for cell yield over global average. crops in cells below threshold will be ignored

cells

Number of cells to be returned (select "magpiecell" for 59199 cells or "lpjcell" for 67420 cells)

Value

magpie object in cellular resolution

Author(s)

Kristine Karstens, Felicitas Beier

Examples

## Not run: 
calcOutput("GrowingPeriod", aggregate = FALSE)

## End(Not run)

calcIrrigAreaActuallyCommitted

Description

calculates area reserved for irrigation based on area irrigated in initialization and available water resources

Usage

calcIrrigAreaActuallyCommitted(
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  efrMethod,
  fossilGW,
  multicropping,
  transDist
)

Arguments

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

iniyear

Initialization year of irrigation system

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from readLandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigAreaActuallyCommitted", aggregate = FALSE)

## End(Not run)

calcIrrigAreaCommitted

Description

calculates area reserved for irrigation based on area irrigated in initialization year and depreciation parameter (set to 0.1)

Usage

calcIrrigAreaCommitted(selectyears, iniyear)

Arguments

selectyears

select years

iniyear

initialization year

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigAreaCommitted", aggregate = FALSE)

## End(Not run)

calcIrrigatableAreaUnlimited

Description

calculates area that can potentially be irrigated given chosen land scenario and gainthreshold

Usage

calcIrrigatableAreaUnlimited(
  selectyears,
  iniyear,
  landScen,
  lpjml,
  climatetype,
  cropmix,
  yieldcalib,
  irrigationsystem,
  unit,
  gainthreshold,
  multicropping
)

Arguments

selectyears

years for which irrigatable area is calculated

iniyear

initialization year

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

unit

Unit of yield improvement potential to be returned and level of price aggregation used, separated by ":". Unit: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices

gainthreshold

Threshold of yield improvement potential (in USD per hectare)

multicropping

Multicropping activated (TRUE) or not (FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigatableAreaUnlimited", aggregate = FALSE)

## End(Not run)

calcIrrigationSystem

Description

This function returns the irrigation system share initialization

Usage

calcIrrigationSystem(datasource)

Arguments

datasource

Data source to be used: Jaegermeyr (irrigation system share based on FAO 2014, ICID 2012 and Rohwer et al. 2007) or LPJmL (dominant irrigation system per country)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigationSystem", datasource = "Jaegermeyr", aggregate = FALSE)

## End(Not run)

calcIrrigCellranking

Description

This function calculates a cellranking for the river basin discharge allocation based on yield improvement potential through irrigation

Usage

calcIrrigCellranking(
  lpjml,
  climatetype,
  cellrankyear,
  iniyear,
  comagyear,
  irrigationsystem,
  landScen,
  method,
  cropmix,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical" for yields

cellrankyear

Year(s) for which cell rank is calculated

iniyear

Initialization year for price

comagyear

if !NULL: already irrigated area is subtracted; if NULL: total potential land area is used; year specified here is the year of the initialization used for cropland area initialization in calcIrrigatedArea

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

method

Rank and optimization method consisting of Unit according to which rank is calculated: tDM (tons per dry matter), USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices; and boolean indicating fullpotential (TRUE) or reduced potential (FALSE)

cropmix

Selected cropmix for which yield improvement potential is calculated (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops) NULL returns all crops individually

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigCellranking", aggregate = FALSE)

## End(Not run)

calcIrrigCropYieldGain

Description

This function calculates the yield gains per crop through irrigation (including negatives)

Usage

calcIrrigCropYieldGain(
  lpjml,
  climatetype,
  priceAgg,
  iniyear,
  selectyears,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Climate scenarios or historical baseline "GSWP3-W5E5:historical"

priceAgg

Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices, or "CONST" for same price for all crops

iniyear

initialization year for food price and cropmix area

selectyears

Years to be returned by the function

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigCropYieldGain", aggregate = FALSE)

## End(Not run)

calcIrrigSystemShr

Description

This function returns the share of the irrigation area under a specific irrigation system type (surface, sprinkler, drip) per crop type

Usage

calcIrrigSystemShr(iniyear)

Arguments

iniyear

Year to be used for irrigation system share initialization

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigSystemShr", aggregate = FALSE)

## End(Not run)

calcIrrigWatRequirements

Description

This function calculates irrigation water requirements based on LPJmL blue water consumption of crops and considering irrigation efficiencies

Usage

calcIrrigWatRequirements(selectyears, lpjml, climatetype, multicropping)

Arguments

selectyears

Years to be returned

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Climate model or historical baseline "GSWP3-W5E5:historical"

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("IrrigWatRequirements", aggregate = FALSE)

## End(Not run)

calcIrrigYieldImprovementPotential

Description

This function calculates the yield improvement potential through irrigation for all grid cells given a certain crop mix

Usage

calcIrrigYieldImprovementPotential(
  lpjml,
  climatetype,
  unit,
  iniyear,
  selectyears,
  comagyear,
  cropmix,
  landScen,
  irrigationsystem,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Climate scenarios or historical baseline "GSWP3-W5E5:historical"

unit

Unit of yield improvement potential to be returned and level of price aggregation used, separated by ":". Unit: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); for relative return according to area and volume. Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices

iniyear

initialization year for food price and cropmix area

selectyears

Years to be returned by the function

comagyear

if !NULL: already irrigated area is subtracted; if NULL: total potential land area is used; year specified here is the year of the initialization used for cropland area initialization in calcIrrigatedArea

cropmix

Selected cropmix for which yield improvement potential is calculated (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops) NULL returns all crops individually

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("IrrigYieldImprovementPotential", aggregate = FALSE)

## End(Not run)

calcMissingWater

Description

Calculates difference between requested water and water that can be fulfilled in algorithm given available surface water resources for all scenarios. This information is used to derive non-renewable groundwater use.

Usage

calcMissingWater(
  output,
  lpjml,
  climatetype,
  transDistGW = 100,
  multicropping = "TRUE:actual:irrig_crop",
  selectyears,
  iniyear
)

Arguments

output

sector to be reported: non-agricultural sector water use ("nonAg"), (committed) agricultural water use ("comAg"), or both ("total")

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

transDistGW

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability to determine missing water that is tagged as non-renewable groundwater

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

selectyears

Years to be returned

iniyear

Initialization year

Value

cellular magpie object

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("MissingWater", aggregate = FALSE)

## End(Not run)

calcNonrenGroundwatUse

Description

Calculates current non-renewable (fossil) groundwater use as negative difference between water availability from renewable sources and human water use (consumption and withdrawal). The water use in the initialization year is fixed in the future as non-renewable groundwater.

Usage

calcNonrenGroundwatUse(
  output,
  lpjml,
  climatetype,
  transDistGW = 100,
  multicropping = "TRUE:actual:irrig_crop",
  selectyears,
  iniyear
)

Arguments

output

"total": total groundwater use (non-agricultural and agricultural), "nonAg": groundwater use in non-agricultural sector (industry, domestic, electricity), "comAg": groundwater use in agricultural sector (currently irrigated area)

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

transDistGW

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability to determine missing water that is tagged as non-renewable groundwater

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

selectyears

Years to be returned

iniyear

Initialization year

Value

cellular magpie object

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("NonrenGroundwatUse", aggregate = FALSE)

## End(Not run)

calcPotIrrigAreas

Description

Calculates Potentially Irrigated Areas (PIAs) per crop given available water and land

Usage

calcPotIrrigAreas(
  cropAggregation,
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  efrMethod,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  landScen,
  cropmix,
  comAg,
  fossilGW,
  multicropping,
  transDist
)

Arguments

cropAggregation

TRUE (aggregated Potentially Irrigated Areas (PIAs)), FALSE (crop-specific PIAs)

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years for which irrigatable area is calculated

iniyear

Initialization year for initial croparea

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

comAg

If TRUE: currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("PotIrrigAreas", aggregate = FALSE)

## End(Not run)

calcPotMulticroppingShare

Description

Calculates share of currently irrigated areas that is multiple cropped. On areas where irrigation expansion takes place, full multiple cropping is assumed.

Usage

calcPotMulticroppingShare(
  scenario,
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  efrMethod,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  landScen,
  cropmix,
  comAg,
  fossilGW,
  multicropping,
  transDist
)

Arguments

scenario

EFP and non-agricultural water use scenario separated with a "." (e.g. "on.ssp2")

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years for which irrigatable area is calculated

iniyear

Initialization year for initial croparea

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

comAg

If TRUE: currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("PotMulticroppingShare", aggregate = FALSE)

## End(Not run)

calcPotWater

Description

This function returns the potential water quantity (separted into withdrawal and consumption) available for different uses

Usage

calcPotWater(
  lpjml,
  selectyears,
  climatetype,
  efrMethod,
  accessibilityrule,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  iniyear,
  landScen,
  cropmix,
  comAg,
  fossilGW,
  multicropping,
  transDist
)

Arguments

lpjml

LPJmL version used

selectyears

Years for which irrigatable area is calculated

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

iniyear

Initialization year of irrigation system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

comAg

If TRUE: currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected ("endogenous": suitability for multiple cropping determined by rules based on grass and crop productivity "exogenous": suitability for multiple cropping given by GAEZ data set), separated by ":" (e.g. TRUE:endogenous; TRUE:exogenous; FALSE)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("PotWater", aggregate = FALSE)

## End(Not run)

calcRiverDischargeAllocation

Description

This function distributes surplus basin discharge after the previous river routings following certain management assumptions

Usage

calcRiverDischargeAllocation(
  lpjml,
  climatetype,
  selectyears,
  efrMethod,
  accessibilityrule,
  transDist,
  rankmethod,
  yieldcalib,
  allocationrule,
  gainthreshold,
  irrigationsystem,
  iniyear,
  landScen,
  cropmix,
  comAg,
  multicropping
)

Arguments

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

allocationrule

Rule to be applied for river basin discharge allocation ("optimization" or "upstreamfirst")

gainthreshold

Threshold of yield improvement potential (in USD per hectare)

irrigationsystem

Irrigation system to be used for river basin discharge allocation algorithm ("surface", "sprinkler", "drip", "initialization")

iniyear

Initialization year of irrigation system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

comAg

if TRUE: the currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("RiverDischargeAllocation", aggregate = FALSE)

## End(Not run)

calcRiverHumanUseAccounting

Description

This function calculates human uses and reserved water along the river

Usage

calcRiverHumanUseAccounting(
  iteration,
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  efrMethod,
  multicropping,
  transDist,
  comAg,
  accessibilityrule,
  rankmethod,
  gainthreshold,
  cropmix,
  yieldcalib,
  irrigationsystem,
  landScen
)

Arguments

iteration

Water use to be allocated in this river routing iteration (non_agriculture, committed_agriculture, committed_agriculture_fullMulticropping, potential_irrigation,

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

iniyear

Initialization year of irrigation system

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

comAg

if TRUE: the currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential). Only relevant for iteration = potential

accessibilityrule

(For case of iteration = "potential_irrigation" only:) Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

gainthreshold

(For case of iteration = "potential_irrigation" only:) Threshold of yield improvement potential (same unit as in rankmethod)

cropmix

(For case of iteration = "potential_irrigation" only:) Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

yieldcalib

(For case of iteration = "potential_irrigation" only:) If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

irrigationsystem

(For case of iteration = "potential_irrigation" only:) Irrigation system to be used for river basin discharge allocation algorithm ("surface", "sprinkler", "drip", "initialization")

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("RiverHumanUseAccounting", aggregate = FALSE)

## End(Not run)

calcRiverNaturalFlows

Description

This function calculates natural discharge for the river routing derived from inputs from LPJmL

Usage

calcRiverNaturalFlows(selectyears, lpjml, climatetype)

Arguments

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("RiverNaturalFlows", aggregate = FALSE)

## End(Not run)

calcRiverRoutingInputs

Description

This function collects inputs necessary for the different river routings depending on the chosen settings

Usage

calcRiverRoutingInputs(
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  iteration,
  transDist,
  efrMethod,
  accessibilityrule,
  multicropping,
  comAg,
  rankmethod,
  gainthreshold,
  cropmix,
  yieldcalib,
  irrigationsystem,
  landScen
)

Arguments

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

iniyear

Initialization year of irrigation system

iteration

Water use to be allocated in this river routing iteration (non_agriculture, committed_agriculture, potential_irrigation, committed_agriculture_fullMulticropping).

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

accessibilityrule

Water accessibility rule. Available methods: Quantile method (Q) or Coefficient of Variation (CV); combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

comAg

if TRUE: the currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential). Only relevant for iteration = potential

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

gainthreshold

Threshold of yield improvement potential (in USD per hectare)

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

irrigationsystem

Irrigation system to be used for river basin discharge allocation algorithm ("surface", "sprinkler", "drip", "initialization")

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("RiverRoutingInputs", aggregate = FALSE)

## End(Not run)

calcShrHumanUsesFulfilled

Description

calculates of share of current non-agricultural and irrigation that can be fulfilled given renewable water availability of the algorithm

Usage

calcShrHumanUsesFulfilled(
  lpjml,
  climatetype,
  transDist,
  multicropping,
  selectyears,
  iniyear,
  efrMethod
)

Arguments

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

selectyears

Years to be returned

iniyear

Initialization year

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

Value

cellular magpie object

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("ShrHumanUsesFulfilled", aggregate = FALSE)

## End(Not run)

calcWaterUseActuallyCommittedAg

Description

This function calculates committed agricultural water uses that are used in the river routing algorithm for distributing available water across the basin

Usage

calcWaterUseActuallyCommittedAg(
  iteration = "committed_agriculture",
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  multicropping,
  efrMethod,
  fossilGW,
  transDist
)

Arguments

iteration

Default: "committed_agriculture", Special case: "committed_agriculture_fullPotential". Special case should only be used for calculation of full multicropping potential committed agricultural area for case of Current Irrigation.

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned

iniyear

Year of initialization for cropland area

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("WaterUseActuallyCommittedAg", aggregate = FALSE)

## End(Not run)

calcWaterUseCommittedAg

Description

This function calculates committed agricultural water uses that are used in the river routing algorithm for distributing available water across the basin

Usage

calcWaterUseCommittedAg(
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  multicropping
)

Arguments

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned

iniyear

Year of initialization for cropland area

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("WaterUseCommittedAg", aggregate = FALSE)

## End(Not run)

calcWaterUseNonAg

Description

This function extracts non-agricultural water demand

Usage

calcWaterUseNonAg(
  selectyears = seq(1995, 2100, by = 5),
  cells = "lpjcell",
  datasource = "WATCH_ISIMIP_WATERGAP",
  usetype = "all",
  seasonality = "grper",
  harmonType = "average",
  lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop =
    "ggcmi_phase3_nchecks_9ca735cb"),
  climatetype = "GSWP3-W5E5:historical"
)

Arguments

selectyears

Years to be returned

cells

Number of cells to be returned (select "magpiecell" for 59199 cells or "lpjcell" for 67420 cells)

datasource

Data source to be used (e.g. WATERGAP2020)

usetype

water use types (domestic, industry, electricity) and option to return withdrawals or consumption separated by ":" (e.g. "all:withdrawal") options for first argument: "total" (returns the sum over different water use types) or "all" ( returns all water use types (domestic, industry, electricity)) options for second argument: "all", "withdrawal", "consumption"

seasonality

grper (default): non-agricultural water demand in growing period per year; total: non-agricultural water demand throughout the year

harmonType

Type of time smoothing: average (average over 8-year time span around baseline year) or spline (time smoothing using spline method with 4 degrees of freedom) or NULL (no smoothing)

lpjml

Defines LPJmL version for crop/grass and natveg specific inputs

climatetype

Switch between different climate scenarios for calcGrowingPeriod

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("WaterUseNonAg", aggregate = FALSE)

## End(Not run)

calcYearlyRunoff

Description

This function calculates yearly runoff from runoff on land and water provided by LPJmL

Usage

calcYearlyRunoff(selectyears, lpjml, climatetype)

Arguments

selectyears

Years to be returned (Note: does not affect years of harmonization or smoothing)

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("YearlyRunoff", aggregate = FALSE)

## End(Not run)

calcYieldgainArea

Description

reports potentially irrigated area depending on gainthreshold and land constraint only

Usage

calcYieldgainArea(
  rangeGT,
  lpjml,
  selectyears,
  iniyear,
  climatetype,
  yieldcalib,
  unit,
  irrigationsystem,
  landScen,
  cropmix,
  multicropping
)

Arguments

rangeGT

Range of gainthreshold for calculation of potentially irrigated areas (in USD per hectare)

lpjml

LPJmL version required for respective inputs: natveg or crop

selectyears

Years for which irrigatable area is calculated

iniyear

Initialization year for cropland area

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

unit

Unit of yield improvement potential used as threshold, consisting of unit and price aggregation level separated by ":". Unit: tDM (tons per dry matter), USD_ha (USD per hectare) for area return, or USD_m3 (USD per cubic meter) for volumetric return. Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

multicropping

Multicropping activated (TRUE) or not (FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcYieldgainArea(rangeGT = seq(0, 10000, by = 100), scenario = "ssp2")

## End(Not run)

calcYieldgainPotential

Description

reports yield gain potential for irrigatable area under different scenarios

Usage

calcYieldgainPotential(
  scenario,
  selectyears,
  iniyear,
  lpjml,
  climatetype,
  efrMethod,
  yieldcalib,
  irrigationsystem,
  accessibilityrule,
  rankmethod,
  gainthreshold,
  allocationrule,
  transDist,
  fossilGW,
  landScen,
  cropmix,
  multicropping,
  unlimited
)

Arguments

scenario

Non-agricultural water use and EFP scenario, separated by "." (e.g. "on.ssp2")

selectyears

Years for which yield gain potential is calculated

iniyear

Initialization year

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

efrMethod

EFR method used including selected strictness of EFRs (e.g. Smakhtin:good, VMF:fair)

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

irrigationsystem

Irrigation system used ("surface", "sprinkler", "drip", "initialization")

accessibilityrule

Strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx). (e.g. Q75: 0.25, Q50: 0.5)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

gainthreshold

Threshold of yield improvement potential required (in USD per hectare)

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst", "equality")

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

unlimited

TRUE: no water limitation to potentially irrigated area FALSE: irrigatable area limited by water availability

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("YieldgainPotential", aggregate = FALSE)

## End(Not run)

calcYieldgainWatUse

Description

This function calculates water use on selected land areas without considering water constraints

Usage

calcYieldgainWatUse(
  lpjml,
  climatetype,
  selectyears,
  iniyear,
  landScen,
  cropmix,
  yieldcalib,
  multicropping,
  unit,
  irrigationsystem,
  rangeGT
)

Arguments

lpjml

LPJmL version required for respective inputs: natveg or crop

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

selectyears

Years to be returned

iniyear

Year of initialization for cropland area

landScen

Land availability scenario consisting of two parts separated by ":": 1. available land scenario (currCropland, currIrrig, potCropland) 2. protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection). For case of no land protection select "NA" in second part of argument or do not specify second part of the argument

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

unit

Unit of yield improvement potential to be returned and level of price aggregation used, separated by ":". Unit: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices

irrigationsystem

Irrigation system used: system share as in initialization year, or drip, surface, sprinkler for full irrigation by selected system

rangeGT

Range of gainthreshold for calculation of potentially irrigated areas (in USD per hectare)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("YieldgainWatUse", aggregate = FALSE)

## End(Not run)

calcYieldImprovementPotential

Description

This function calculates the yield improvement potential through irrigation or multiple cropping per grid cell for a given cropmix

Usage

calcYieldImprovementPotential(
  lpjml,
  climatetype,
  yieldgaintype,
  priceAgg,
  iniyear,
  selectyears,
  cropmix,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Climate scenarios or historical baseline "GSWP3-W5E5:historical"

yieldgaintype

Crop yield gain through multiple cropping under rainfed conditions "multicropping_rf", multiple cropping under irrigated conditions "multicropping_ir", irrigation under single cropping conditions "irrigation_singlecropping" irrigation and multiple cropping "irrigation_multicropping"

priceAgg

Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices, or "CONST" for same price for all crops

iniyear

initialization year for food price and cropmix area

selectyears

Years to be returned by the function

cropmix

Selected cropmix for which yield improvement potential is calculated (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops) NULL returns all crops individually

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("YieldImprovementPotential", aggregate = FALSE)

## End(Not run)

calcYieldsAdjusted

Description

This function returns irrigated and rainfed yields for MAgPIE crops.

Usage

calcYieldsAdjusted(
  lpjml,
  climatetype,
  iniyear,
  selectyears,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical" for yields

iniyear

Year to be used for cropland of yield calibration

selectyears

Years to be returned by the function

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("YieldsAdjusted", aggregate = FALSE)

## End(Not run)

calcYieldsValued

Description

This function calculates yields per crop valued at FAO prices (in USD per hectare)

Usage

calcYieldsValued(
  lpjml,
  climatetype,
  priceAgg,
  iniyear,
  selectyears,
  yieldcalib,
  multicropping
)

Arguments

lpjml

LPJmL version used for yields

climatetype

Climate scenarios or historical baseline "GSWP3-W5E5:historical"

priceAgg

Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices, or "CONST" for same price for all crops

iniyear

initialization year for food price and cropmix area

selectyears

Years to be returned by the function

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier

Examples

## Not run: 
calcOutput("YieldsValued", aggregate = FALSE)

## End(Not run)

correctDams

Description

Read dam file (no source information available)

Usage

correctDams(x)

Arguments

x

magpie object provided by the read function

Value

List of magpie objects with results on cellular level, weight, unit and description.

Author(s)

Kristine Karstens

See Also

readDams

Examples

## Not run: 
readSource("Dams", convert = "onlycorrect")

## End(Not run)

correctISIMIPinputs

Description

Correct ISIMIP data

Usage

correctISIMIPinputs(x)

Arguments

x

MAgPIE object provided by the read function

Value

List of magpie objects with results on cellular level, weight, unit and description.

Author(s)

Felicitas Beier

See Also

readISIMIPinputs

Examples

## Not run: 
  readSource("ISIMIPinputs", convert="onlycorrect")

## End(Not run)

correctWATERGAP

Description

Correct WATERGAP data

Usage

correctWATERGAP(x)

Arguments

x

MAgPIE object provided by the read function

Value

List of magpie objects with results on cellular level, weight, unit and description.

Author(s)

Felicitas Beier

See Also

readWATERGAP

Examples

## Not run: 
  readSource("WATERGAP", convert="onlycorrect")

## End(Not run)

fullCURRENTIRRIGATION

Description

Function that produces output for irrigation potentials under multiple cropping on cellular resolution.

Usage

fullCURRENTIRRIGATION(yieldcalib = "TRUE:TRUE:actual:irrig_crop")

Arguments

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

Author(s)

Felicitas Beier


fullGROUNDWATER

Description

Function that produces output for analysis of non-renewable groundwater resources

Usage

fullGROUNDWATER(multicropping = FALSE, rankmethod = "USD_ha:GLO:TRUE")

Arguments

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected ("endogenous": suitability for multiple cropping determined by rules based on grass and crop productivity "exogenous": suitability for multiple cropping given by GAEZ data set), separated by ":" (e.g. TRUE:endogenous; TRUE:exogenous; FALSE)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

Author(s)

Felicitas Beier


fullIRRIGATIONPOTENTIAL

Description

Function that produces the objects for Technical and Economic Irrigation Potentials within land and water boundaries

Usage

fullIRRIGATIONPOTENTIAL(
  efrMethod = "VMF:fair",
  accessibilityrule = "CV:2",
  transDist = 0,
  fossilGW = FALSE,
  allocationrule = "optimization",
  rankmethod = "USD_ha:GLO:TRUE",
  gainthreshold = 500,
  protectLand = "HalfEarth",
  yieldcalib = "TRUE:FALSE",
  multicropping = FALSE,
  cropmix = "hist_total",
  climatetype = "MRI-ESM2-0:ssp370",
  lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop =
    "ggcmi_phase3_nchecks_9ca735cb")
)

Arguments

efrMethod

EFR method used including selected strictness of EFRs (Smakhtin:good, VMF:fair)

accessibilityrule

Method used: Quantile method (Q) or Coefficient of Variation (CV) combined with scalar value defining the strictness of accessibility restriction: discharge that is exceeded x percent of the time on average throughout a year (Qx, e.g. Q75: 0.25, Q50: 0.5) or base value for exponential curve separated by : (CV:2)

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst")

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

gainthreshold

Threshold of yield improvement potential required for water allocation in upstreamfirst algorithm (in same unit as in rankmethod)

protectLand

Land protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection).

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

lpjml

LPJmL version required for respective inputs: natveg or crop

Author(s)

Felicitas Beier


fullMULTICROPPING

Description

Function that produces output for multiple cropping and irrigation potentials on current cropland at cellular resolution.

Usage

fullMULTICROPPING(
  allocationrule = "optimization",
  comAg = TRUE,
  fossilGW = TRUE,
  transDist = 100
)

Arguments

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst")

comAg

if TRUE: the currently already irrigated areas in initialization year are reserved for irrigation, if FALSE: no irrigation areas reserved (irrigation potential)

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

Author(s)

Felicitas Beier


fullPREPROCESSING

Description

Function that produces the objects for Technical and Economic Irrigation Potentials within land and water boundaries

Usage

fullPREPROCESSING(
  protectLand = "HalfEarth",
  yieldcalib = "TRUE:TRUE:actual:irrig_crop",
  multicropping = "TRUE:potential:endogenous",
  cropmix = "hist_total",
  climatetype = "MRI-ESM2-0:ssp370",
  lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop =
    "ggcmi_phase3_nchecks_9ca735cb")
)

Arguments

protectLand

Land protection scenario (WDPA, or one of the scenarios available in calcConservationPriorities, e.g., 30by20, BH, BH_IFL, PBL_HalfEarth, or NA for no protection

yieldcalib

If TRUE: LPJmL yields calibrated to FAO country yield in iniyear Also needs specification of refYields, separated by ":". Options: FALSE (for single cropping analyses) or "TRUE:actual:irrig_crop" (for multiple cropping analyses) If FALSE: uncalibrated LPJmL yields are used

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected (mask can be: "none": no mask applied (only for development purposes) "actual:total": currently multicropped areas calculated from total harvested areas and total physical areas per cell from LandInG "actual:crop" (crop-specific), "actual:irrigation" (irrigation-specific), "actual:irrig_crop" (crop- and irrigation-specific) "total" "potential:endogenous": potentially multicropped areas given temperature and productivity limits "potential:exogenous": potentially multicropped areas given GAEZ suitability classification) (e.g. TRUE:actual:total; TRUE:none; FALSE)

cropmix

Selected cropmix (options: "hist_irrig" for historical cropmix on currently irrigated area, "hist_total" for historical cropmix on total cropland, or selection of proxycrops)

climatetype

Switch between different climate scenarios or historical baseline "GSWP3-W5E5:historical"

lpjml

LPJmL version required for respective inputs: natveg or crop

Author(s)

Felicitas Beier


fullSIMPLE

Description

Function that produces gridded outputs for usage in the SIMPLE model (Baldos & Hertel 2012) and the SIMPLE-G model (Baldos et al. 2020)

Usage

fullSIMPLE(
  transDist = 100,
  fossilGW = TRUE,
  allocationrule = "optimization",
  rankmethod = "USD_m3:GLO:TRUE"
)

Arguments

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

fossilGW

If TRUE: non-renewable groundwater can be used. If FALSE: non-renewable groundwater cannot be used.

allocationrule

Rule to be applied for river basin discharge allocation across cells of river basin ("optimization", "upstreamfirst")

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

Author(s)

Felicitas Beier


fullTRANSPORT

Description

Function that produces output for analysis of water transport for provision to cells in surrounding

Usage

fullTRANSPORT(multicropping, rankmethod = "USD_ha:GLO:TRUE")

Arguments

multicropping

Multicropping activated (TRUE) or not (FALSE) and Multiple Cropping Suitability mask selected ("endogenous": suitability for multiple cropping determined by rules based on grass and crop productivity "exogenous": suitability for multiple cropping given by GAEZ data set), separated by ":" (e.g. TRUE:endogenous; TRUE:exogenous; FALSE)

rankmethod

Rank and optimization method consisting of Unit according to which rank is calculated: USD_ha (USD per hectare) for relative area return, or USD_m3 (USD per cubic meter) for relative volumetric return; USD for absolute return (total profit); Price aggregation: "GLO" for global average prices, or "ISO" for country-level prices and boolean indicating fullpotential (TRUE, i.e. cell receives full irrigation requirements in total area) or reduced potential (FALSE, reduced potential of cell receives at later stage in allocation algorithm); separated by ":"

Author(s)

Felicitas Beier


readDams

Description

Read dam file (no source information available)

Usage

readDams()

Value

List of magpie objects with results on cellular level, weight, unit and description.

Author(s)

Kristine Karstens

Examples

## Not run: 
readSource("Dams", convert = "onlycorrect")

## End(Not run)

readIrrigationSystem

Description

Read in irrigation system type for initialization

Usage

readIrrigationSystem(subtype = "Jaegermeyr")

Arguments

subtype

Data source to be used: Jaegermeyr (irrigation system share based on FAO 2014, ICID 2012 and Rohwer et al. 2007) or LPJmL (dominant irrigation system per country)

Value

MAgPIE object of at country-level

Author(s)

Felicitas Beier

Examples

## Not run: 
readSource("IrrigationSystem", convert = FALSE)

## End(Not run)

readISIMIPinputs

Description

Read in non-agricultural water demand data from ISIMIP inputs

Usage

readISIMIPinputs(subtype = "ISIMIP3b:water:histsoc.waterabstraction")

Arguments

subtype

Data source to be read from including path separated by ":", subtype separated by "."

Value

MAgPIE object of non-agricultural water demand at 0.5 cellular level in mio. m^3

Author(s)

Felicitas Beier

Examples

## Not run: 
readSource("ISIMIPinputs",
subtype = "ISIMIP3b:water:histsoc.waterabstraction",
convert = "onlycorrect")

## End(Not run)

readJaegermeyr2015

Description

Read in irrigation system suitability per crop type and country-level irrigation system shares from Jaegermeyr (2015)

Usage

readJaegermeyr2015(subtype)

Arguments

subtype

Data to be read in: "systemShare": irrigation system share as provided in SI of Jägermeyr et al. (2015), based on FAO 2014, ICID 2012 and Rohwer et al. 2007); "systemSuitability": biophysical and technical irrigation system suitability by crop type (CFT) as provided in Table 2 of Jägermeyr et al. (2015) based on Sauer et al. (2010) and Fischer et al. (2012).

Value

MAgPIE object

Author(s)

Felicitas Beier

Examples

## Not run: 
readSource("Jaegerymeyr2015", convert = FALSE)

## End(Not run)

readNeighborCells

Description

read file with neighbor cell and distance information derived from LPJmL grid

Usage

readNeighborCells()

Value

empty magpie object with list data stored in attributes

Author(s)

Felicitas Beier

Examples

## Not run: 
readSource("NeighborCells", convert = FALSE)

## End(Not run)

readWATERGAP

Description

Read in non-agricultural water demand data from WATERGAP model

Usage

readWATERGAP(subtype = "WATCH_ISIMIP_WATERGAP")

Arguments

subtype

Data source to be read from

Value

MAgPIE object of non-agricultural water demand at 0.5 cellular level in mio. m^3

Author(s)

Felicitas Beier, Abhijeet Mishra

Examples

## Not run: 
readSource("WATERGAP", convert = "onlycorrect")

## End(Not run)

toolLPJarrayToMAgPIEmap

Description

transforms object (array) with 67420 cells to be able to be used in plotmap function

This tool function selects the required cells from object with 67420 cells to be able to plot using plotmap or plotmap2 that are applied to magpie object of size 59199 cells

Usage

toolLPJarrayToMAgPIEmap(x)

Arguments

x

magpie object to be transformed

Value

magpie object with correct dimension for use in plotmap

Author(s)

Felicitas Beier


toolLPJcell2MAgPIEcell

Description

transforms magpie object with 67420 cells to object with 59199 cells

This tool function selects the required cells from object with 67420 cells to be able to plot using plotmap or plotmap2 that are applied to magpie object of size 59199 cells

Usage

toolLPJcell2MAgPIEcell(x)

Arguments

x

magpie object to be transformed

Value

magpie object with correct dimension for use in plotmap

Author(s)

Felicitas Beier


toolLPJcellCoordinates

Description

maps LPJ cells and coordinates

Usage

toolLPJcellCoordinates(x, type)

Arguments

x

magpie object for which coordinatese should be remapped

type

direction of transformation (coord2lpj or lpj2coord)

Value

magpie object with coordinates in LPJ cell ordering

Author(s)

Felicitas Beier


toolNeighborUpDownProvision

Description

This function calculates water provision by surrounding grid cells for upstream-downstream allocation set-up

Usage

toolNeighborUpDownProvision(rs, transDist, years, scenarios, listNeighborIN)

Arguments

rs

River structure including information on neighboring cells

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

years

Vector of years for which neighbor allocation shall be applied

scenarios

Vector of scenarios for which neighbor allocation shall be applied

listNeighborIN

List of arrays required for the algorithm: yearlyRunoff, lakeEvap reserved flows from previous water allocation round (prevReservedWC, prevReservedWW) missing water at this stage of water allocation (missingWW, missingWC) discharge

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("RiverHumanUseAccounting", aggregate = FALSE)

## End(Not run)

toolRegionSums

Description

sum over regional aggregation chosen in region argument

Usage

toolRegionSums(x, region)

Arguments

x

magpie object to be summed up over first dimension

region

regional resolution (can be country iso-code, "GLO" for global, or region name and respective mapping "EUR:H12")

Value

magpie object with regional sum

Author(s)

Felicitas Beier


toolRiverDischargeAllocation

Description

This tool function allocates discharge for grid cells respecting upstream-downstream relationships and various water constraints

Usage

toolRiverDischargeAllocation(
  rs,
  c,
  downCells,
  iteration,
  transDist,
  inLIST,
  inoutLIST
)

Arguments

rs

River structure with information on upstreamcells, downstreamcells and neighboring cells and distances

c

Current cell for which water shall be allocated

downCells

Downstream cells of c

iteration

Currently active iteration of river discharge allocation. Arguments: "main" for case of main river cells "neighbor" for case of neighboring cells of main river cells

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand by surrounding cell water availability

inLIST

List of objects that are inputs to the function irrigGain, gainthreshold,

inoutLIST

List of objects that are inputs to the function and are updated by the function

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke, Jan Philipp Dietrich


toolRiverDischargeUpdate

Description

This function calculates cellular discharge after reserving water uses for consumption

Usage

toolRiverDischargeUpdate(rs, runoffWOEvap, watCons)

Arguments

rs

River structure

runoffWOEvap

Array that contains (runoff - lake evap)

watCons

Array that contains water reserved for consumptive use

Value

array in cellular resolution and all year and scenario dimensions

Author(s)

Felicitas Beier, Jens Heinke

Examples

## Not run: 
calcOutput("RiverHumanUseAccounting", aggregate = FALSE)

## End(Not run)

toolRiverUpDownBalance

Description

This function calculates the cell water balance under consideration of different reserved human uses (non-agricultural, neighbor water requirements, committed-agricultural uses)

Usage

toolRiverUpDownBalance(inLIST, inoutLIST)

Arguments

inLIST

List of objects that are inputs to the function: previously reserved withdrawals and consumption in current cell; currently requested withdrawal in current cell

inoutLIST

List of objects that are inputs to the function and are updated by the function: discharge (including up- and downstream cells) currently requested consumption (including upstream cells)

Value

list of arrays objects in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke


toolSelectNeighborCell

Description

Selects cells in certain radius of current cell

Usage

toolSelectNeighborCell(transDist, rs = rs, neighborCells = neighborCells)

Arguments

transDist

Water transport distance allowed to fulfill locally unfulfilled water demand

rs

River structure list

neighborCells

List of neighboring cells for all river cells

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier, Jens Heinke


toolSelectRiverBasin

Description

returns coordinates of cells that belong to chosen basin

Usage

toolSelectRiverBasin(basinname)

Arguments

basinname

river basin name as listed in mapping file RiverBasinMapping.csv

Value

list of cell names

Author(s)

Felicitas Beier