Title: | madrat based MAgPIE Input Data Library |
---|---|
Description: | Provides functions for MAgPIE country and cellular input data generation. |
Authors: | Kristine Karstens [aut, cre], Jan Philipp Dietrich [aut], David Chen [aut], Michael Windisch [aut], Marcos Alves [aut], Felicitas Beier [aut], Alexandre Köberle [aut], Patrick v. Jeetze [aut], Abhijeet Mishra [aut], Florian Humpenoeder [aut], Pascal Sauer [aut] |
Maintainer: | Kristine Karstens <[email protected]> |
License: | LGPL-3 | file LICENSE |
Version: | 1.53.0 |
Built: | 2024-11-21 14:22:43 UTC |
Source: | https://github.com/pik-piam/mrmagpie |
Provides functions for MAgPIE country and cellular input data generation.
Maintainer: Kristine Karstens [email protected]
Authors:
Jan Philipp Dietrich [email protected]
David Chen
Michael Windisch
Marcos Alves
Felicitas Beier [email protected]
Alexandre Köberle [email protected]
Patrick v. Jeetze [email protected]
Abhijeet Mishra [email protected]
Florian Humpenoeder [email protected]
Pascal Sauer [email protected]
Useful links:
Report bugs at https://github.com/pik-piam/mrmagpie/issues
Afforestation mask for where afforestation possible
calcAfforestationMask(subtype, cells = "lpjcell")
calcAfforestationMask(subtype, cells = "lpjcell")
subtype |
afforestation mask sub type |
cells |
"magpiecell" or "lpjcell" |
magpie object in cellular resolution
David Chen, Florian Humpenoeder
## Not run: calcOutput("AfforestationMask", subtype = "noboreal", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("AfforestationMask", subtype = "noboreal", aggregate = FALSE) ## End(Not run)
This function calculates forest area in 15 age classes based on the Global Forest Age Dataset (GFAD) from Poulter et al. 2019
calcAgeClassDistribution(cells = "lpjcell")
calcAgeClassDistribution(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cluster resolution
Abhijeet Mishra, Felicitas Beier, Florian Humpenoeder
## Not run: calcOutput("AgeClassDistribution", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("AgeClassDistribution", aggregate = FALSE) ## End(Not run)
retrieves irrigated crop area from croparea intialization
calcAreaActuallyIrrigated(aggregationlevel = "iso", selectyears = "y1995")
calcAreaActuallyIrrigated(aggregationlevel = "iso", selectyears = "y1995")
aggregationlevel |
default is iso |
selectyears |
select years |
magpie object with results on cellular or iso country level
Felicitas Beier
## Not run: calcOutput("AreaActuallyIrrigated") ## End(Not run)
## Not run: calcOutput("AreaActuallyIrrigated") ## End(Not run)
Calculates the area equipped for irrigation based on LU2v2 or Mehta data sets. For LUH2v2, it assumes, that all cropland irrigated in the last 20 years at least once is equipped for irrigation. Mehta et al. (2022) directly report Global Area Equipped for Irrigation for the years 1900-2015
calcAreaEquippedForIrrigation( cellular = FALSE, cells = "lpjcell", selectyears = "past" )
calcAreaEquippedForIrrigation( cellular = FALSE, cells = "lpjcell", selectyears = "past" )
cellular |
if TRUE: 0.5 degree resolution returned |
cells |
number of cells to be returned: magpiecell (59199), lpjcell (67420) |
selectyears |
default on "past" |
List of magpie objects with results on country/cellular level, weight on country level, unit and description.
Benjamin Leon Bodirsky, Kristine Karstens, Felicitas Beier
[calcLanduseInitialisation()]
## Not run: calcOutput("AreaEquippedForIrrigation", source = "LUH2v2", cellular = TRUE, aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("AreaEquippedForIrrigation", source = "LUH2v2", cellular = TRUE, aggregate = FALSE) ## End(Not run)
Extracts si0 and nsi0 areas based on Ramankutty dataset
calcAvlLandSi(cells = "lpjcell")
calcAvlLandSi(cells = "lpjcell")
cells |
magpiecell (59199 cells) or lpjcell (67420 cells) |
magpie object in cellular resolution
Felicitas Beier
## Not run: calcOutput("AvlLandSi", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("AvlLandSi", aggregate = FALSE) ## End(Not run)
calculates soil carbon for rangelands
calcBinnedLsuDensity( breaks = c(seq(0, 2, 0.1), 2.25, 2.5), labels = c(0, 0.2, 0.2, 0.4, 0.4, 0.6, 0.6, 0.8, 0.8, 1, 1, 1.2, 1.2, 1.4, 1.4, 1.6, 1.6, 1.8, 1.8, 2, 2, 2.5), years = 1995 )
calcBinnedLsuDensity( breaks = c(seq(0, 2, 0.1), 2.25, 2.5), labels = c(0, 0.2, 0.2, 0.4, 0.4, 0.6, 0.6, 0.8, 0.8, 1, 1, 1.2, 1.2, 1.4, 1.4, 1.6, 1.6, 1.8, 1.8, 2, 2, 2.5), years = 1995 )
breaks |
Binning breaks |
labels |
Binning labels |
years |
years where data should binned |
Magpie object with lsu per cell.
Marcos Alves
## Not run: calcOutput("BinnedLsuDensity ", breaks, labels, years) ## End(Not run)
## Not run: calcOutput("BinnedLsuDensity ", breaks, labels, years) ## End(Not run)
Biogeophysical temperature change of afforestation (degree C). File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018
calcBphEffect(cells = "lpjcell")
calcBphEffect(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Michael Windisch, Felicitas Beier
## Not run: calcOutput("BphEffect", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("BphEffect", aggregate = FALSE) ## End(Not run)
Mask of Datapoints of biogeophysical temperature change of afforestation (degree C) to be used as weight. File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018
calcBphMask(cells = "lpjcell")
calcBphMask(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Michael Windisch, Felicitas Beier
## Not run: calcOutput("BphMask", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("BphMask", aggregate = FALSE) ## End(Not run)
Transient Climate Response to accumulated doubling of CO2. File based on CMIP5 +1perc CO2 per year experiment. To be used in the translation to carbon equivalents of BphEffect
calcBphTCRE(cells = "lpjcell")
calcBphTCRE(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Michael Windisch, Felicitas Beier
## Not run: calcOutput("BphTCRE", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("BphTCRE", aggregate = FALSE) ## End(Not run)
This function extracts carbon densities from LPJ to MAgPIE
calcCarbon( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", cells = "lpjcell" )
calcCarbon( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", cells = "lpjcell" )
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different GCM climate scenarios |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
magpie object in cellular resolution
Kristine Karstens, Patrick v. Jeetze
## Not run: calcOutput("Carbon", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Carbon", aggregate = FALSE) ## End(Not run)
This function extracts carbon densities from LPJ to MAgPIE
calcCarbonTests( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "raw" )
calcCarbonTests( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "raw" )
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different GCM climate scenarios |
stage |
Switch for raw data or harmonization |
magpie object in cellular resolution
Kristine Karstens, Florian Humpenoeder
## Not run: calcOutput("CarbonTests", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("CarbonTests", aggregate = FALSE) ## End(Not run)
cell fraction belonging to a country based on LanduseInitialisation
calcCellCountryFraction(cells = "lpjcell")
calcCellCountryFraction(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
Clustered MAgPIE object on requested resolution
Florian Humpenoeder
## Not run: calcOutput("calcCellCountryFraction", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("calcCellCountryFraction", aggregate = FALSE) ## End(Not run)
This function calculates the aggregation mapping for a given cluster methodology
calcCluster( ctype, regionscode = madrat::regionscode(), seed = 42, weight = NULL, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
calcCluster( ctype, regionscode = madrat::regionscode(), seed = 42, weight = NULL, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
ctype |
aggregation clustering type, which is a combination of a single letter, indicating the cluster methodology, and a number, indicating the number of resulting clusters. Available methodologies are hierarchical clustering (h), normalized k-means clustering (n), combined hierarchical/normalized k-means clustering (c) and manual setting for clusters per region (m). In the combined clustering hierarchical clustering is used to determine the cluster distribution among regions whereasit is manually set for the m type. Both use normalized k-means for the clustering within a region. |
regionscode |
regionscode of the regional mapping to be used.
Must agree with the regionscode of the mapping
mentioned in the madrat config!
Can be retrieved via |
seed |
Seed for Random Number Generation. If set to NULL it is chosen automatically, if set to an integer it will always return the same pseudo-random numbers (useful to get identical clusters under identical inputs for n and c clustering) |
weight |
Should specific regions be resolved with more or less detail? Values > 1 mean higher share, < 1 lower share e.g. cfg$cluster_weight <- c(LAM=2) means that a higher level of detail for region LAM if set to NULL all weights will be assumed to be 1 (examples: c(LAM=1.5,SSA=1.5,OAS=1.5), c(LAM=2,SSA=2,OAS=2)) |
lpjml |
defines LPJmL version for crop/grass and natveg specific inputs |
clusterdata |
similarity data to be used to determine clusters: yield_airrig (current default) or yield_increment |
map from cells to clusters as data.frame
Jan Philipp Dietrich
## Not run: calcOutput("Cluster", ctype = "c200", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Cluster", ctype = "c200", aggregate = FALSE) ## End(Not run)
Reads a series of MAgPIE files and combines them to a matrix which is then used for calculating a clustering.
calcClusterBase( clusterdata = "yield_airrig", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb") )
calcClusterBase( clusterdata = "yield_airrig", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb") )
clusterdata |
similarity data to be used to determine clusters: yield_airrig (current default) or yield_increment |
lpjml |
defines LPJmL version for crop/grass and natveg specific inputs |
A matrix containing the data
Jan Philipp Dietrich, Felicitas Beier
Performs MAgPIE hierarchical clustering and calculates corresponding spam relation matrix
As the creation of a clustering tree is very time consuming the function checks first in the input folder if the corresponding data already exists and if not it stores the tree information in the input folder for later use in the next execution of this function.
calcClusterHierarchical( regionscode, ncluster, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig", mode = "h", weight = NULL )
calcClusterHierarchical( regionscode, ncluster, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig", mode = "h", weight = NULL )
regionscode |
regionscode of the regional mapping to be used.
Must agree with the regionscode of the mapping mentioned
in the madrat config!
Can be retrieved via |
ncluster |
The desired total number of clusters. |
lpjml |
defines LPJmL version for crop/grass and natveg specific inputs |
clusterdata |
similarity data to be used to determine clusters: yield_airrig (current default) or yield_increment |
mode |
Clustering type. At the moment you can choose between complete linkage clustering (h), single linkage clustering (s) and Ward clustering (w). |
weight |
named vector with weighting factors for each region for the cluster distribution, e.g. weight=c(AFR=3,EUR=0.5). weight > 1 will grant more cluster to a region and weight < 1 less cluster than by default. |
A mapping between regions and clusters
Jan Philipp Dietrich
calcCluster
, calcClusterKMeans
Performs MAgPIE kmeans clustering and calculates corresponding spam relation matrix
calcClusterKMeans( regionscode, ncluster, weight = NULL, cpr = NULL, seed = 42, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
calcClusterKMeans( regionscode, ncluster, weight = NULL, cpr = NULL, seed = 42, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
regionscode |
regionscode of the regional mapping to be used.
Must agree with the regionscode of the mapping
mentioned in the madrat config!
Can be retrieved via |
ncluster |
The desired total number of clusters. |
weight |
named vector with weighting factors for each region for the cluster distribution, e.g. weight=c(AFR=3,EUR=0.5). weight > 1 will grant more cluster to a region and weight < 1 less cluster than by default. |
cpr |
cells-per-region information as returned by toolClusterPerRegionManual. Weight and ncluster are ignored in case that cpr is provided! |
seed |
a single value, interpreted as an integer, or NULL, to define seed for random calculations |
lpjml |
defines LPJmL version for crop/grass and natveg specific inputs |
clusterdata |
similarity data to be used to determine clusters: yield_airrig (current default) or yield_increment |
A mapping between regions and clusters
Jan Philipp Dietrich
toolClusterPerRegionManual
, calcClusterHierarchical
calculates hierarchical clustering tree
calcClusterTreeHierarchical( regionscode, mode = "h", weight = NULL, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
calcClusterTreeHierarchical( regionscode, mode = "h", weight = NULL, lpjml = c(natveg = "LPJmL4", crop = "LPJmL5"), clusterdata = "yield_airrig" )
regionscode |
regionscode of the regional mapping to be used.
Must agree with the regionscode of the mapping
mentioned in the madrat config! Can be retrieved via |
mode |
Clustering type. At the moment you can choose between complete linkage clustering (h), single linkage clustering (s) and Ward clustering (w). |
weight |
named vector with weighting factors for each region for the cluster distribution, e.g. weight = c(AFR = 3, EUR = 0.5). weight > 1 will grant more cluster to a region and weight < 1 less cluster than by default. |
lpjml |
defines LPJmL version for crop/grass and natveg specific inputs |
clusterdata |
similarity data to be used to determine clusters: yield_airrig (current default) or yield_increment |
A spam relation matrix
Jan Philipp Dietrich
Disaggregate CO2 global atmospheric concentration to cellular level
calcCO2Atmosphere_new( subtype = "ISIMIP3b:ssp126", co2Evolution = "rising", cells = "lpjcell" )
calcCO2Atmosphere_new( subtype = "ISIMIP3b:ssp126", co2Evolution = "rising", cells = "lpjcell" )
subtype |
specify the version and scenario eg. "ISIMIP3b:ssp126" |
co2Evolution |
Define 'rising' for rising CO2 according to the climate scenario selected or 'static' for stable CO2 at the last past time step level. |
cells |
"magpiecell" or "lpjcell" |
magpie object in cellular resolution
Marcos Alves, Kristine Karstens
## Not run: calcOutput("CO2Atmosphere_new", aggregate = FALSE, subtype, co2Evolution) ## End(Not run)
## Not run: calcOutput("CO2Atmosphere_new", aggregate = FALSE, subtype, co2Evolution) ## End(Not run)
Calculate climate, CO2 and soil environmental conditions on cellular level
calcCollectEnvironmentData_new( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", sar = 20, sel_feat = c("tas", "pr", "lwnet", "rsds", "CO2", "Ks", "Sf", "w_pwp", "w_fc", "w_sat", "hsg", "wet") )
calcCollectEnvironmentData_new( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", sar = 20, sel_feat = c("tas", "pr", "lwnet", "rsds", "CO2", "Ks", "Sf", "w_pwp", "w_fc", "w_sat", "hsg", "wet") )
subtype |
Switch between different climate scenarios (default: "CRU_4") eg. "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100" |
sar |
Average range for smoothing annual variations |
sel_feat |
features names to be included in the output file |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("CollectEnvironmentData_new", subtype, sar = 20, sel_feat = "temp") ## End(Not run)
## Not run: calcOutput("CollectEnvironmentData_new", subtype, sar = 20, sel_feat = "temp") ## End(Not run)
Calculate soil carbon stocks for different LSU and climate conditions
calcCollectSoilCarbonLSU( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatemodel = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20 )
calcCollectSoilCarbonLSU( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatemodel = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20 )
lsu_levels |
Livestock unit levels in the source folder |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatemodel |
Switch between different climate scenarios |
scenario |
scenario specifications (eg. ssp126_co2_limN) |
sar |
Average range for smoothing annual variations |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("CollectSoilCarbonLSU", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
## Not run: calcOutput("CollectSoilCarbonLSU", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
calculates soil carbon content for pasture areas
calcCollectSoilCarbonPastr( past_mngmt = "me2", lpjml = "lpjml5p2_pasture", climatemodel = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 1 )
calcCollectSoilCarbonPastr( past_mngmt = "me2", lpjml = "lpjml5p2_pasture", climatemodel = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 1 )
past_mngmt |
pasture areas management option |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatemodel |
Switch between different climate scenarios (default: "CRU_4") |
scenario |
scenario specifications (eg. ssp126_co2_limN) |
sar |
Average range for smoothing annual variations |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("CollectSoilCarbonPastr", past_mngmt = "me2") ## End(Not run)
## Not run: calcOutput("CollectSoilCarbonPastr", past_mngmt = "me2") ## End(Not run)
Function creates dummy file for including yield reduction coefficients to represent land degradation
calcDegradationYieldReduction(cells = "lpjcell")
calcDegradationYieldReduction(cells = "lpjcell")
cells |
number of halfdegree grid cells to be returned. Options: "magpiecell" (59199), "lpjcell" (67420) |
magpie object in cellular resolution
Patrick v. Jeetze
## Not run: calcOutput("DegradationYieldReduction", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("DegradationYieldReduction", aggregate = FALSE) ## End(Not run)
This function calculates environmental flow requirements (EFR) for MAgPIE retrieved from LPJmL monthly discharge and water availability following the definition of the planetary boundary in Rockström et al. 2023
calcEFRRockstroem( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", seasonality = "grper" )
calcEFRRockstroem( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", seasonality = "grper" )
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 |
seasonality |
grper (default): EFR in growing period per year; total: EFR throughout the year; monthly: monthly EFRs |
magpie object in cellular resolution
Felicitas Beier, Jens Heinke
## Not run: calcOutput("EFRRockstroem", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("EFRRockstroem", aggregate = FALSE) ## End(Not run)
This function calculates environmental flow requirements (EFR) for MAgPIE retrieved from LPJmL monthly discharge and water availability using the method of Smakthin et al. (2004)
calcEFRSmakthin( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", LFR_val = 0.1, HFR_LFR_less10 = 0.2, HFR_LFR_10_20 = 0.15, HFR_LFR_20_30 = 0.07, HFR_LFR_more30 = 0, seasonality = "grper", cells = "lpjcell" )
calcEFRSmakthin( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", LFR_val = 0.1, HFR_LFR_less10 = 0.2, HFR_LFR_10_20 = 0.15, HFR_LFR_20_30 = 0.07, HFR_LFR_more30 = 0, seasonality = "grper", cells = "lpjcell" )
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 |
LFR_val |
Strictness of environmental flow requirements |
HFR_LFR_less10 |
High flow requirements (share of total water for cells) with LFR<10percent of total water |
HFR_LFR_10_20 |
High flow requirements (share of total water for cells) with 10percent < LFR < 20percent of total water |
HFR_LFR_20_30 |
High flow requirements (share of total water for cells) with 20percent < LFR < 30percent of total water |
HFR_LFR_more30 |
High flow requirements (share of total water for cells) with LFR>30percent of total water |
seasonality |
grper (default): EFR in growing period per year; total: EFR throughout the year; monthly: monthly EFRs |
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Felicitas Beier, Abhijeet Mishra
## Not run: calcOutput("EFRSmakthin", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("EFRSmakthin", aggregate = FALSE) ## End(Not run)
This function calculates environmental flow requirements (EFR) for MAgPIE retrieved from LPJmL monthly discharge and water availability
calcEnvmtlFlow( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", seasonality = "grper" )
calcEnvmtlFlow( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", stage = "harmonized2020", seasonality = "grper" )
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 |
seasonality |
grper (default): EFR in growing period per year; total: EFR throughout the year; monthly: monthly EFRs |
magpie object in cellular resolution
Felicitas Beier
## Not run: calcOutput("EnvmtlFlow", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("EnvmtlFlow", aggregate = FALSE) ## End(Not run)
Calculates grid-level food demand, note also includes food and feed
calcFoodDemandGridded( attribute = "dm", prod = "k", feed = TRUE, cells = "lpjcell" )
calcFoodDemandGridded( attribute = "dm", prod = "k", feed = TRUE, cells = "lpjcell" )
attribute |
dm or calories ("ge") or other massbalance attribute |
prod |
for memory reasons |
feed |
whether to include feed demand in the gridded demand |
cells |
magpiecell or lpjcell (default) |
Gridded magpie object of food demand disaggregated by rural urban pop
David M Chen
## Not run: calcOutput("FoodDemandGridded") ## End(Not run)
## Not run: calcOutput("FoodDemandGridded") ## End(Not run)
Disaggregate CO2 global atmospheric concentration to cellular level NOTE: This function will be depreciate soon, please use mrland::calcLPJmLClimate
calcGCMClimate( subtype = "ISIMIP3bv2:IPSL-CM6A-LR:ssp126:1850-2100:tas:annual_mean", smooth = 0, cells = "lpjcell" )
calcGCMClimate( subtype = "ISIMIP3bv2:IPSL-CM6A-LR:ssp126:1850-2100:tas:annual_mean", smooth = 0, cells = "lpjcell" )
subtype |
type of climate data to collect, consisting of data source, GDM, RCP, time period, variable and time resolution separated by ":" |
smooth |
set averaging value for smoothing trajectories |
cells |
number of halfdegree grid cells to be returned. Options: "magpiecell" (59199), "lpjcell" (67420) |
magpie object in cellular resolution
Marcos Alves, Kristine Karstens, Felicitas Beier
## Not run: calcOutput("GCMClimate", subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1850-2100:tas:annual_mean") ## End(Not run)
## Not run: calcOutput("GCMClimate", subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1850-2100:tas:annual_mean") ## End(Not run)
Calculates pasture biomass demand for the historical period split between rangelands andmanaged pastures.
calcGrasslandBiomass(cells = "lpjcell")
calcGrasslandBiomass(cells = "lpjcell")
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
Regional biomass demand
Marcos Alves
calcOutput
, calcFAOmassbalance
,
readSource
## Not run: calcOutput("GrasslandBiomass") ## End(Not run)
## Not run: calcOutput("GrasslandBiomass") ## End(Not run)
Calculates rangelands maximum output and managed pastures yields
calcGrasslandsYields( lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", cells = "lpjcell", subtype = "/co2/Nreturn0p5", lsu_levels = c(seq(0, 2, 0.2), 2.5), past_mngmt = "mdef" )
calcGrasslandsYields( lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", cells = "lpjcell", subtype = "/co2/Nreturn0p5", lsu_levels = c(seq(0, 2, 0.2), 2.5), past_mngmt = "mdef" )
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Global Circulation Model to be used |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
subtype |
Switch between different climate scenarios |
lsu_levels |
Livestock unit levels in the source folder |
past_mngmt |
pasture areas management option |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("GrasslandsYields", lsu_levels, past_mngmt = "me2", subtype) ## End(Not run)
## Not run: calcOutput("GrasslandsYields", lsu_levels, past_mngmt = "me2", subtype) ## End(Not run)
Read files related to the training and optimization of the LPJml emulators.
calcGrassSoilEmu( subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100", model = "5f5fa2", mfile = "weights" )
calcGrassSoilEmu( subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100", model = "5f5fa2", mfile = "weights" )
subtype |
Subtype of file to be opened. Subtypes available: 'weights', 'inputs', 'stddevs' and 'means'. |
model |
trained model ID |
mfile |
model file name |
Magpie objects with a diverse inforamtion
Marcos Alves
## Not run: readSource("GrassSoilEmu", subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100", model = "5f5fa2", mfile = "weights" ) ## End(Not run)
## Not run: readSource("GrassSoilEmu", subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100", model = "5f5fa2", mfile = "weights" ) ## End(Not run)
Past and future (SSP1-5) population based on HYDE3.2 and Jones & O'Neill (2016) Data is scaled to match WDI data from calcPopulation NOTE that some scaling factors for the future (for small countries Gambia and Djibouti) are off, data read in is 50
calcGridPop( source = "ISIMIP", subtype = "all", cellular = TRUE, cells = "lpjcell", FiveYear = TRUE, scale = TRUE, harmonize_until = 2015, urban = FALSE )
calcGridPop( source = "ISIMIP", subtype = "all", cellular = TRUE, cells = "lpjcell", FiveYear = TRUE, scale = TRUE, harmonize_until = 2015, urban = FALSE )
source |
default source (ISIMIP) or Gao data (readGridPopGao) which is split into urban and rural. |
subtype |
time horizon to be returned. Options: past (1965-2005), future (2005-2010) or all (divergence starts at year in harmonize_until) |
cellular |
if true: half degree grid cell data returned |
cells |
number of halfdegree grid cells to be returned. Options: "magpiecell" (59199), "lpjcell" (67420) |
FiveYear |
TRUE for 5 year time steps, otherwise yearly from source |
scale |
if true: scales sum of gridded values to match country level totals |
harmonize_until |
harmonization year until which SSPs diverge (default: 2015) |
urban |
TRUE to return only urban gridded population based on iso share |
Population in millions.
David Chen, Felicitas Beier
## Not run: calcOutput("GridPop", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("GridPop", aggregate = FALSE) ## End(Not run)
Loads the LSU that provides the maximum grass harvest as a initial values for MAgPIE
calcInitialLsu(model = "f41f19be67")
calcInitialLsu(model = "f41f19be67")
model |
Grass harvest machine learning model ID |
MAgPIE objects with optimal lsu on a cellular level.
Marcos Alves
## Not run: calOutput("InitialLsu", model = "f41f19be67") ## End(Not run)
## Not run: calOutput("InitialLsu", model = "f41f19be67") ## End(Not run)
This function extracts irrigation water (airrig: water applied additionally to rainfall) from LPJmL for MAgPIE
calcIrrigation( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", cells = "lpjcell", rainfedweight = 0.01 )
calcIrrigation( lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical", cells = "lpjcell", rainfedweight = 0.01 )
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different climate scenarios |
cells |
Number of cells to be returned: "magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
rainfedweight |
For clustering airrig is weighted with cropland_irrigated + rainfedweight * cropland_rainfed (default: 0.01) |
magpie object in cellular resolution
Felicitas Beier, Abhijeet Mishra
## Not run: calcOutput("Irrigation", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Irrigation", aggregate = FALSE) ## End(Not run)
Labour productivity impacts
calcLabourProdImpact( timestep = "5year", subtype = "Orlov", cellular = TRUE, cells = "lpjcell" )
calcLabourProdImpact( timestep = "5year", subtype = "Orlov", cellular = TRUE, cells = "lpjcell" )
timestep |
5year or yearly |
subtype |
data source comes from |
cellular |
cellular is true |
cells |
"magpiecell" or "lpjcell" |
List of magpie objects with results on 0.5deg grid level, weights based on production value, unit (ratio) and description.
David Chen
Spatial and temporal aggr. of labour productivity impacts from climate change emulated by LAMACLIMA
based on method of Orlov et al. 2019. Economics of Disasters and Climate Change, 3(3), 191-211.
calcLabourProdImpactEmu( timestep = "5year", cellular = TRUE, subtype = "impact", cells = "lpjcell" )
calcLabourProdImpactEmu( timestep = "5year", cellular = TRUE, subtype = "impact", cells = "lpjcell" )
timestep |
5-year or yearly |
cellular |
cellular is true |
subtype |
impact for rcp based laborprod decrease, relief for LCLM based relief of impact |
cells |
"magpiecell" or "lpjcell" |
List of magpie object of gridded (0.5) labour productivity as percentage of full labour prod 1
Michael Windisch, Florian Humpenöder
Disaggregate Livestock estimates based on the GLW3 dataset.
calcLivestockDistribution(cells = "lpjcell")
calcLivestockDistribution(cells = "lpjcell")
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
MAgPIE objects with livestock numbers on a cellular level.
Marcos Alves
## Not run: calcOutput("LivestockDistribution") ## End(Not run)
## Not run: calcOutput("LivestockDistribution") ## End(Not run)
Calculate livestock historical livestock densities
calcLsuDensityHist(disagg_type = "grassland", cells = "lpjcell")
calcLsuDensityHist(disagg_type = "grassland", cells = "lpjcell")
disagg_type |
select the disaggregaton weights for biomass production (can be either grassland or livestock) |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
List of magpie object with results on cluster level
Marcos Alves
## Not run: calcOutput("LsuDensityHist") ## End(Not run)
## Not run: calcOutput("LsuDensityHist") ## End(Not run)
Function extracts biodiversity data for LUH2 land cover types
calcLuh2SideLayers(cells = "lpjcell")
calcLuh2SideLayers(cells = "lpjcell")
cells |
number of cells to be returned: magpiecell (59199), lpjcell (67420) |
magpie object in cellular resolution
Patrick v. Jeetze
## Not run: calcOutput("Luh2SideLayers", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Luh2SideLayers", aggregate = FALSE) ## End(Not run)
MAPSPAM data
calcMAPSPAM(subtype = "physical")
calcMAPSPAM(subtype = "physical")
subtype |
it can be either "physical" or "harvested" area |
magpie object in cellular resolution
Edna J. Molina Bacca
## Not run: calcOutput("MAPSPAM", subtype = "physical", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("MAPSPAM", subtype = "physical", aggregate = FALSE) ## End(Not run)
Calculate maximum glassland suitable for pasture management based on population and aridity criteria.
calcMaxPastureSuit( climatetype = "MRI-ESM2-0:ssp126", lpjml = "LPJmL4_for_MAgPIE_44ac93de", cells = "lpjcell" )
calcMaxPastureSuit( climatetype = "MRI-ESM2-0:ssp126", lpjml = "LPJmL4_for_MAgPIE_44ac93de", cells = "lpjcell" )
climatetype |
Switch between different climate scenarios |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
cells |
number of halfdegree grid cells to be returned. Options: "magpiecell" (59199), "lpjcell" (67420) |
List of magpie object with results on cluster level
Marcos Alves, Kristine Karstens, Alexandre Köberle
## Not run: calcOutput("MaxPastureSuit") ## End(Not run)
## Not run: calcOutput("MaxPastureSuit") ## End(Not run)
Calculates grid-level amount of food that would need to be transported, assuming that food produced in the grid cell is first consumed by local population i.e. amount of food greater than local rural demand, split into that which feeds the local urban population, and that which exceeds total local demand and is available to export
calcNonLocalProduction(cells = "lpjcell")
calcNonLocalProduction(cells = "lpjcell")
cells |
magpiecell or lpjcell (default) |
David M Chen
## Not run: calcOutput("NonLocalTransport") ## End(Not run)
## Not run: calcOutput("NonLocalTransport") ## End(Not run)
Function creates dummy NPI/NDC policies
calcNpiNdcAdAolcPol(cells = "lpjcell")
calcNpiNdcAdAolcPol(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Patrick v. Jeetze, Michael Windisch
## Not run: calcOutput("NpiNdcAdAolcPol", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("NpiNdcAdAolcPol", aggregate = FALSE) ## End(Not run)
Function creates dummy NPI/NDC policies
calcNpiNdcAffPol(cells = "lpjcell")
calcNpiNdcAffPol(cells = "lpjcell")
cells |
lpjcell for 67420 cells or magpiecell for 59199 cells |
magpie object in cellular resolution
Patrick v. Jeetze, Michael Windisch
## Not run: calcOutput("NpiNdcAffPol", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("NpiNdcAffPol", aggregate = FALSE) ## End(Not run)
calculates per-ton marketing and packaging costs for food that leaves a cell Currnetly assume expert guess 50 USD / ton of packaging/marketing costs (100 USD/t in model, of which half is already in GTAP)
calcPackagingMarketingCosts()
calcPackagingMarketingCosts()
List of magpie objects with results on country level, weight on country level, unit and description.
David M Chen
Calculates managed pasture yields
calcPastr_new( past_mngmt = "me2", lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", scenario = "/co2/Nreturn0p5/limN", cells = "lpjcell" )
calcPastr_new( past_mngmt = "me2", lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", scenario = "/co2/Nreturn0p5/limN", cells = "lpjcell" )
past_mngmt |
pasture areas management option |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different climate scenarios (default: "CRU_4") |
scenario |
specify ssp scenario |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("Pastr_new", past_mngmt = "me2", lpjml = "LPJml_pastr", climatetype) ## End(Not run)
## Not run: calcOutput("Pastr_new", past_mngmt = "me2", lpjml = "LPJml_pastr", climatetype) ## End(Not run)
Calculates managed pasture potential yields for different combinations of SSP+RCP and grassland management options
calcPastrMngtLevels( climatetype = "MRI-ESM2-0:ssp370", options = c("brazil_1", "brazil_2", "brazil_4"), cost_level = c(1, 2, 3), cells = "lpjcell" )
calcPastrMngtLevels( climatetype = "MRI-ESM2-0:ssp370", options = c("brazil_1", "brazil_2", "brazil_4"), cost_level = c(1, 2, 3), cells = "lpjcell" )
climatetype |
SSP+RCP combination |
options |
Management options simulated by LPJml |
cost_level |
level cost for different past management options |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
magpie object in 0.5 degree resolution
Marcos Alves
## Not run: calcOutput("PastrMngtLevels", ssps, options) ## End(Not run)
## Not run: calcOutput("PastrMngtLevels", ssps, options) ## End(Not run)
Calculates managed pastures Tau based on FAO yield trends for 1995.
calcPastrTauHist(past_mngmt = "mdef", cells = "lpjcell")
calcPastrTauHist(past_mngmt = "mdef", cells = "lpjcell")
past_mngmt |
Pasture management reference yield |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
List of magpie objects with results on country level, weight on country level, unit and description.
Marcos Alves
## Not run: calcOutput("PastrTauHist", past_mngmt) ## End(Not run)
## Not run: calcOutput("PastrTauHist", past_mngmt) ## End(Not run)
This function calculates degraded and intact peatland area at cell level. The function takes degraded and intact peatland area from the Global Peatland Database (GPD) at the national level and downscales the peatland area to grid cell level using gridded potential peatland area. The GPD has been provided by Alexandra Barthelmes. The potential peatland area has been provided by Leifeld_2018 (DOI 10.1038/s41467-018-03406-6).
calcPeatland(subtype = "degraded", cells = "lpjcell")
calcPeatland(subtype = "degraded", cells = "lpjcell")
subtype |
degraded (default) or intact |
cells |
"magpiecell" or "lpjcell" |
magpie object in cellular resolution
Florian Humpenoeder
## Not run: calcOutput("Peatland", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Peatland", aggregate = FALSE) ## End(Not run)
This function calculates degraded and intact peatland area at cell level. The function takes degraded and intact peatland area from the Global Peatland Database 2022 (GPD2022) at the national level and downscales the peatland area to grid cell level using gridded peatland area from the Global Peatland Map 2.0 (GPM2) The data has been provided by Alexandra Barthelmes.
calcPeatland2(cells = "magpiecell", countryLevel = FALSE)
calcPeatland2(cells = "magpiecell", countryLevel = FALSE)
cells |
number of cells to be returned: magpiecell (59199), lpjcell (67420) |
countryLevel |
Whether output shall be at country level. Requires aggregate=FALSE in calcOutput. |
magpie object in cellular resolution
Florian Humpenoeder
## Not run: calcOutput("Peatland2", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("Peatland2", aggregate = FALSE) ## End(Not run)
Calculates the area than can be potentially covered by forests, based on environmental conditions.
calcPotentialForestArea( refData = "lpj", countryLevel = FALSE, cells = "lpjcell", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de"), climatetype = "MRI-ESM2-0:ssp370" )
calcPotentialForestArea( refData = "lpj", countryLevel = FALSE, cells = "lpjcell", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de"), climatetype = "MRI-ESM2-0:ssp370" )
refData |
Determines the reference data that the estimated potential forest area is derived from (currently only "lpj") |
countryLevel |
Whether output shall be at country level. Requires aggregate=FALSE in calcOutput. |
cells |
magpiecell (59199 cells) or lpjcell (67420 cells) |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs. Only relevant, if refData = "lpj". |
climatetype |
Switch between different GCM climate scenarios. Only relevant, if refData = "lpj". |
magpie object in cellular resolution
Patrick v. Jeetze
## Not run: calcOutput("PotentialForestArea", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("PotentialForestArea", aggregate = FALSE) ## End(Not run)
Calculates rangelands maximum output
calcRangelandsMaxNew( lsuLevels = c(seq(0, 2.2, 0.2), 2.5), lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", scenario = "/co2/Nreturn0p5/limN", report = "harvest", cells = "lpjcell" )
calcRangelandsMaxNew( lsuLevels = c(seq(0, 2.2, 0.2), 2.5), lpjml = "lpjml5p2_pasture", climatetype = "MRI-ESM2-0:ssp370", scenario = "/co2/Nreturn0p5/limN", report = "harvest", cells = "lpjcell" )
lsuLevels |
Livestock unit levels in the source folder |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different climate scenarios (default: "CRU_4") |
scenario |
specify ssp scenario |
report |
Either 'harvest' or 'lsu/ha' controlling what values are output by the function. |
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("ContGrazMax_new", lsuLevels = 0, lpjml, climatetype, report) ## End(Not run)
## Not run: calcOutput("ContGrazMax_new", lsuLevels = 0, lpjml, climatetype, report) ## End(Not run)
calculates soil carbon for rangelands
calcRangeSoilCarbonHist( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", lpjml, model = "9eaf9b" )
calcRangeSoilCarbonHist( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", lpjml, model = "9eaf9b" )
subtype |
subtypes |
lpjml |
lpjml version |
model |
trained model ID |
List of magpie objects with results on country level, weight on country level, unit and description.
Marcos Alves
## Not run: calcOutput("GrassSoilCarbonHist ", subtype, model) ## End(Not run)
## Not run: calcOutput("GrassSoilCarbonHist ", subtype, model) ## End(Not run)
Function extracts range-rarity as used for biodiversity loss
calcRRLayer(cells = "lpjcell")
calcRRLayer(cells = "lpjcell")
cells |
number of cells to be returned: magpiecell (59199), lpjcell (67420) |
magpie object in cellular resolution
Patrick v. Jeetze
## Not run: calcOutput("RRLayer", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("RRLayer", aggregate = FALSE) ## End(Not run)
calculates the mean and sd of the scaled pasture soil carbon dataset
calcScaledPastSoilCarbon( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatetype = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20, aggr = FALSE )
calcScaledPastSoilCarbon( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatetype = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20, aggr = FALSE )
lsu_levels |
Livestock unit levels in the source folder |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different climate scenarios (default: "CRU_4") |
scenario |
scenario specifications (eg. ssp126_co2_limN) |
sar |
Average range for smoothing annual variations |
aggr |
aggregation level |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("ScaledPastSoilCarbon", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
## Not run: calcOutput("ScaledPastSoilCarbon", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
Scale climate, CO2 and soil environmental conditions on cellular level
calcScaleEnvironmentData_new( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", aggr = FALSE, sar = 20, sel_feat = c("tas", "pr", "lwnet", "rsds", "CO2", "Ks", "Sf", "w_pwp", "w_fc", "w_sat", "hsg") )
calcScaleEnvironmentData_new( subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:1965-2100", aggr = FALSE, sar = 20, sel_feat = c("tas", "pr", "lwnet", "rsds", "CO2", "Ks", "Sf", "w_pwp", "w_fc", "w_sat", "hsg") )
subtype |
Switch between different climate scenarios |
aggr |
aggregation level |
sar |
Average range for smoothing annual variations |
sel_feat |
features names to be included in the output file |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("ScaleEnvironmentData_new", climatetype = "HadGEM2_ES:rcp8p5:co2", sar = 20, sel_feat) ## End(Not run)
## Not run: calcOutput("ScaleEnvironmentData_new", climatetype = "HadGEM2_ES:rcp8p5:co2", sar = 20, sel_feat) ## End(Not run)
calculates the mean and sd of the scaled pasture soil carbon dataset
calcSCScalingFactors( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatetype = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20 )
calcSCScalingFactors( lsu_levels = c(seq(0, 2, 0.2), 2.5), lpjml = "LPJML5.2_pasture", climatetype = "IPSL_CM6A_LR", scenario = "ssp126_co2_limN", sar = 20 )
lsu_levels |
Livestock unit levels in the source folder |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different climate scenarios (default: "CRU_4") |
scenario |
scenario specifications (eg. ssp126_co2_limN) |
sar |
Average range for smoothing annual variations |
magpie object in cellular resolution
Marcos Alves
## Not run: calcOutput("SCScalingFactors", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
## Not run: calcOutput("SCScalingFactors", lsu_levels = c(seq(0, 2, 0.2), 2.5), scenario) ## End(Not run)
Calculate Soil Characteristics based on a HWDS soil classification map
calcSoilCharacteristics()
calcSoilCharacteristics()
Magpie objects with results on cellular level.
Marcos Alves
## Not run: readSource("SoilClassification", subtype = "HWSD.soil", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("SoilClassification", subtype = "HWSD.soil", convert = "onlycorrect") ## End(Not run)
calculates Soil Organic Matter Pool, accounting for the management history as initialisation to magpie
calcSOMinitialsiationPools(cells = "lpjcell")
calcSOMinitialsiationPools(cells = "lpjcell")
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
List of magpie object with results on country or cellular level, weight on cellular level, unit and description.
Benjamin Leon Bodirsky, Kristine Karstens
## Not run: calcOutput("SOMinitialsiationPools") ## End(Not run)
## Not run: calcOutput("SOMinitialsiationPools") ## End(Not run)
This function extracts topsoil carbon densities from LPJ to MAgPIE
calcTopsoilCarbon( cells = "lpjcell", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical" )
calcTopsoilCarbon( cells = "lpjcell", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb"), climatetype = "GSWP3-W5E5:historical" )
cells |
"magpiecell" for 59199 cells or "lpjcell" for 67420 cells |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
climatetype |
Switch between different GCM climate scenarios |
magpie object in cellular resolution
Kristine Karstens
## Not run: calcOutput("TopsoilCarbon", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("TopsoilCarbon", aggregate = FALSE) ## End(Not run)
calculates country-level transport costs from GTAP total transport costs, cellular production, and cellular travel time
calcTransportCosts(transport = "all", gtapVersion = "9")
calcTransportCosts(transport = "all", gtapVersion = "9")
transport |
"all" or "nonlocal". "all" means all production incurs transport costs, while "nonlocal" sees only production greater than local rural consumption with transport costs |
gtapVersion |
"9" or "81" |
List of magpie objects with results on country level, weight on country level, unit and description.
David M Chen
[calcTransportTime()], [calcGTAPTotalTransportCosts()]
## Not run: calcOutput("TransportCosts_new") ## End(Not run)
## Not run: calcOutput("TransportCosts_new") ## End(Not run)
Function extracts travel time to major cities in minutes This function now deprecated - use calcTransportTime instead
calcTransportDistance()
calcTransportDistance()
magpie object in cellular resolution
David Chen
## Not run: calcOutput("TransportDistance", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("TransportDistance", aggregate = FALSE) ## End(Not run)
Function extracts travel time to major cities in minutes
calcTransportTime(subtype = "cities50", cells = "lpjcell")
calcTransportTime(subtype = "cities50", cells = "lpjcell")
subtype |
currently only cities of 5, 20, or 50 thousand people ("cities5", "cities20", "cities50") or ports of various sizes ("portsLarge|Medium|Small|VerySmall|Any") |
cells |
number of cells to be returned: magpiecell (59199), lpjcell (67420) |
magpie object in cellular resolution
David Chen
## Not run: calcOutput("TransportTime", aggregate = FALSE) ## End(Not run)
## Not run: calcOutput("TransportTime", aggregate = FALSE) ## End(Not run)
convert GPD
convertGPD(x)
convertGPD(x)
x |
magpie object provided by the read function |
List of magpie objects with results on iso level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("GPD", convert = TRUE) ## End(Not run)
## Not run: readSource("GPD", convert = TRUE) ## End(Not run)
convert GPD2022
convertGPD2022(x)
convertGPD2022(x)
x |
magpie object provided by the read function |
List of magpie objects with results on iso level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("GPD2022", convert = TRUE) ## End(Not run)
## Not run: readSource("GPD2022", convert = TRUE) ## End(Not run)
Read Available Land Si
correctAvlLandSi(x)
correctAvlLandSi(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
David Chen
## Not run: readSource("AvlLandSi", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("AvlLandSi", convert = "onlycorrect") ## End(Not run)
Read bending the curve data
correctBendingTheCurve(x)
correctBendingTheCurve(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Patrick v. Jeetze, Michael Windisch
## Not run: readSource("BendingTheCurve", subtype = "rr_layer", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("BendingTheCurve", subtype = "rr_layer", convert = "onlycorrect") ## End(Not run)
Correct GCMs climate variables NOTE: This function will be depreciate soon, please use mrland::correctLPJmLClimate
correctGCMClimate(x)
correctGCMClimate(x)
x |
magpie object provided by the read function |
Magpie objects with results on cellular level, weight, unit and description.
Marcos Alves, Felicitas Beier
## Not run: readSource("GCMClimate", subtype, convert="onlycorrect") ## End(Not run)
## Not run: readSource("GCMClimate", subtype, convert="onlycorrect") ## End(Not run)
Correct Global Forest Age Dataset
correctGFAD(x)
correctGFAD(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Abhijeet Mishra, Felicitas Beier
## Not run: readSource("GFAD", convert="onlycorrect") ## End(Not run)
## Not run: readSource("GFAD", convert="onlycorrect") ## End(Not run)
correct peatland area
correctGPM2(x)
correctGPM2(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("GPM2", convert="onlycorrect") ## End(Not run)
## Not run: readSource("GPM2", convert="onlycorrect") ## End(Not run)
Correct files related to the training and optimization of the LPJml emulators
correctGrassYldEmu(x)
correctGrassYldEmu(x)
x |
magpie object provided by the read function |
List of magpie objects.
Marcos Alves
## Not run: readSource("GrassYldEmu", subtype = "GrassYldEmu:20f33a2280.weights", convert="onlycorrect") ## End(Not run)
## Not run: readSource("GrassYldEmu", subtype = "GrassYldEmu:20f33a2280.weights", convert="onlycorrect") ## End(Not run)
correct labour productivity impacts from climate change emulated by the LAMACLIMA project
based on method of Orlov et al. 2019. Economics of Disasters and Climate Change, 3(3), 191-211.
correctLabourProdImpactEmu(x)
correctLabourProdImpactEmu(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Michael Windisch
## Not run: readSource("LabourProdImpactEmu", convert="onlycorrect") ## End(Not run)
## Not run: readSource("LabourProdImpactEmu", convert="onlycorrect") ## End(Not run)
correct potential peatland area from Leifeld2018
correctLeifeld2018(x)
correctLeifeld2018(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("Leifeld2018", convert="onlycorrect") ## End(Not run)
## Not run: readSource("Leifeld2018", convert="onlycorrect") ## End(Not run)
correct Global Area Equipped for Irrigation Dataset 1900-2015 from Mehta et al., 2024
correctMehta2024(x)
correctMehta2024(x)
x |
magpie object provided by the read function |
magpie object in cellular resolution
Felicitas Beier
## Not run: readSource("Mehta2024", convert="onlycorrect") ## End(Not run)
## Not run: readSource("Mehta2024", convert="onlycorrect") ## End(Not run)
Read Available Land Si
correctRamankutty(x)
correctRamankutty(x)
x |
magpie object provided by the read function |
magpie object
Felicitas Beier
## Not run: readSource("Ramankutty", convert="onlycorrect") ## End(Not run)
## Not run: readSource("Ramankutty", convert="onlycorrect") ## End(Not run)
Correct soil classification
correctSoilClassification(x)
correctSoilClassification(x)
x |
Magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Marcos Alves, Kristine Karstens
## Not run: readSource("SoilClassification", subtype = "HWSD.soil", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("SoilClassification", subtype = "HWSD.soil", convert = "onlycorrect") ## End(Not run)
Read transport distance file
correctTransportDistance(x)
correctTransportDistance(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
David Chen
## Not run: readSource("TransportDistance", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("TransportDistance", convert = "onlycorrect") ## End(Not run)
correct data to calculate BphEffect, BphTCRE or BphMask depending on the chosen subtype. BphEffect: Biogeophysical temperature change of afforestation (degree C). (File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018). BphMask: Mask of Datapoints of biogeophysical temperature change of afforestation (degree C) to be used as weight. (File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018). BphTCRE: Transient Climate Response to accumulated doubling of CO2. (File is based on CMIP5 +1perc CO2 per year experiment. To be used in the translation to carbon equivalents of BphEffect)
correctWindisch2021(x)
correctWindisch2021(x)
x |
magpie object provided by the read function |
List of magpie objects with results on cellular level, weight, unit and description.
Felicitas Beier, Michael Windisch
## Not run: readSource("Windisch2021", convert="onlycorrect") ## End(Not run)
## Not run: readSource("Windisch2021", convert="onlycorrect") ## End(Not run)
Download CO2 atm. inputs used for Lpjml runs
downloadCO2Atmosphere_new(subtype = "ISIMIP3b:ssp126")
downloadCO2Atmosphere_new(subtype = "ISIMIP3b:ssp126")
subtype |
Switch between different inputs (eg. "ISIMIP3b:IPSL-CM6A-LR:historical:1850-2014:tas") It consists of GCM version, climate model, scenario and variable. |
metadata entry
Marcos Alves
## Not run: readSource("CO2Atmosphere_new",convert="onlycorrect")
## Not run: readSource("CO2Atmosphere_new",convert="onlycorrect")
Download GCM climate input used for Lpjml runs NOTE: This function will be depreciate soon, please use mrland::downloadLPJmLClimate
downloadGCMClimate(subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:2015-2100:tas")
downloadGCMClimate(subtype = "ISIMIP3b:IPSL-CM6A-LR:ssp126:2015-2100:tas")
subtype |
Switch between different inputs (e.g. "ISIMIP3b:IPSL-CM6A-LR:historical:1850-2014:tas") Argument consists of GCM version, climate model, scenario and variable, separated by ":" |
metadata entry
Marcos Alves
## Not run: readSource("GCMClimate", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("GCMClimate", convert = "onlycorrect") ## End(Not run)
Downloads the MAP-SPAM (SPAM) data set for harvested and physical croparea
downloadMAPSPAM()
downloadMAPSPAM()
raw files for MAPSPAM
Edna J. Molina Bacca
[downloadSource()]
## Not run: a <- download("downloadMAPSPAM") ## End(Not run)
## Not run: a <- download("downloadMAPSPAM") ## End(Not run)
download Global Area Equipped for Irrigation Dataset 1900-2015 from Mehta et al. (2024). Gridded dataset is created based on (sub-)national statistics from FAOSTAT, AQUASTAT, EUROSTAT and country's census data downscaled using two alternative gridded irrigation maps (GMIA from Siebert et al. 2013 and Meier et al. 2018)
downloadMehta2024(subtype = "GMIA")
downloadMehta2024(subtype = "GMIA")
subtype |
data subtype to be downloaded. Subtypes available: 'GMIA': gridded base map for downscaling from Stefan et al. (2013). Global Map of Irrigation Areas version 5. 'Meier2018': gridded base map for downscaling from Meier, et al. (2018). Global Irrigated Areas. |
Felicitas Beier
[downloadSource()] [readMehta2024()]
## Not run: a <- downloadSource() ## End(Not run)
## Not run: a <- downloadSource() ## End(Not run)
download Ramankutty available land si (Source: Ramankutty N, Foley JA, Norman J and McSweeney K (2002) The global distribution of cultivable lands: current patterns and sensitivity to possible climate change. Global Ecology and Biogeography, 11, 377-392.)
downloadRamankutty()
downloadRamankutty()
Felicitas Beier
## Not run: a <- downloadSource()
## Not run: a <- downloadSource()
download Nelson 2019 paper
downloadTravelTimeNelson2019()
downloadTravelTimeNelson2019()
David M Chen
Function that produces the complete cellular data set required for running the MAgPIE model.
fullCELLULARMAGPIE( rev = numeric_version("0.1"), dev = "", ctype = "c200", climatetype = "MRI-ESM2-0:ssp370", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb", grass = "lpjml5p2_pasture"), isimip = NULL, clusterweight = NULL, emu_id = NULL )
fullCELLULARMAGPIE( rev = numeric_version("0.1"), dev = "", ctype = "c200", climatetype = "MRI-ESM2-0:ssp370", lpjml = c(natveg = "LPJmL4_for_MAgPIE_44ac93de", crop = "ggcmi_phase3_nchecks_9ca735cb", grass = "lpjml5p2_pasture"), isimip = NULL, clusterweight = NULL, emu_id = NULL )
rev |
data revision which should be used as input (numeric_version). |
dev |
development suffix to distinguish development versions for the same data revision. This can be useful to distinguish parallel lines of development. |
ctype |
aggregation clustering type, which is a combination of a single letter, indicating the cluster methodology, and a number, indicating the number of resulting clusters. Available methodologies are - hierarchical clustering (h), - normalized k-means clustering (n) and - combined hierarchical/normalized k-means clustering (c). In the latter hierarchical clustering is used to determine the cluster distribution among regions whereas normalized k-means is used for the clustering within a region. |
climatetype |
Global Circulation Model to be used |
lpjml |
Defines LPJmL version for crop/grass and natveg specific inputs |
isimip |
Defines isimip crop model input which replace maiz, tece, rice_pro and soybean |
clusterweight |
Should specific regions be resolved with more or less detail?
Values > 1 mean higher share, < 1 lower share
e.g. cfg$clusterweight <- c(LAM=2) means that
a higher level of detail for region LAM if set to NULL
all weights will be assumed to be 1. Examples:
c(LAM=1.5,SSA=1.5,OAS=1.5) or c(LAM=2,SSA=2,OAS=2)
|
emu_id |
Pasture Soil carbon emulator ID |
Kristine Karstens, Jan Philipp Dietrich
readSource
,getCalculations
,calcOutput
,setConfig
## Not run: retrieveData("CELLULARMAGPIE", rev = numeric_version("12"), mainfolder = "pathtowhereallfilesarestored") ## End(Not run)
## Not run: retrieveData("CELLULARMAGPIE", rev = numeric_version("12"), mainfolder = "pathtowhereallfilesarestored") ## End(Not run)
Read si0 and nsi0 areas based on Ramankutty dataset"
readAvlLandSi()
readAvlLandSi()
List of magpie objects with results on cellular level, weight, unit and description.
David Chen
## Not run: readSource("AvlLandSi", convert="onlycorrect") ## End(Not run)
## Not run: readSource("AvlLandSi", convert="onlycorrect") ## End(Not run)
Read bending the curve data
readBendingTheCurve(subtype)
readBendingTheCurve(subtype)
subtype |
Data used in the Bending the Curve initiative. Type "rr_layer" for the range-size rarity layer and "luh2_side_layers" for the LUH2 Side Layers. |
List of magpie objects with results on cellular level, weight, unit and description.
Patrick v. Jeetze
## Not run: readSource("BendingTheCurve", subtype="rr_layer", convert="onlycorrect") ## End(Not run)
## Not run: readSource("BendingTheCurve", subtype="rr_layer", convert="onlycorrect") ## End(Not run)
Read CO2 global atmospheric concentration
readCO2Atmosphere_new(subtype = "ISIMIP3b:ssp126")
readCO2Atmosphere_new(subtype = "ISIMIP3b:ssp126")
subtype |
Switch between different inputs |
Magpie objects with results on global level
Marcos Alves, Kristine Karstens
## Not run: readSource("CO2Atmosphere_new", subtype = "ISIMIP3b:ssp126", convert = FALSE) ## End(Not run)
## Not run: readSource("CO2Atmosphere_new", subtype = "ISIMIP3b:ssp126", convert = FALSE) ## End(Not run)
Read soil classification data used as input for lpjml
readFishCatches()
readFishCatches()
Magpie object with results on cellular level for soil types
Marcos Alves, Kristine Karstens
## Not run: readSource("SoilClassification") ## End(Not run)
## Not run: readSource("SoilClassification") ## End(Not run)
Read Climate data used as LPJmL inputs into MAgPIE objects NOTE: This function will be depreciate soon, please use mrland::readLPJmLClimate
readGCMClimate( subtype = "ISIMIP3bv2:IPSL-CM6A-LR:historical:1850-2014:tas", subset = "annual_mean" )
readGCMClimate( subtype = "ISIMIP3bv2:IPSL-CM6A-LR:historical:1850-2014:tas", subset = "annual_mean" )
subtype |
Switch between different inputs, e.g. "ISIMIP3b:IPSL-CM6A-LR:historical:1850-2014:tas" Available variables are: * tas - * wet - * per - |
subset |
Switch between different subsets of the same subtype Available options are: "annual_mean", "annual_sum", "monthly_mean", "monthly_sum", "wet" |
MAgPIE objects with results on cellular level.
Marcos Alves, Kristine Karstens, Felicitas Beier
## Not run: readSource("GCMClimate", subtype, convert = "onlycorrect") ## End(Not run)
## Not run: readSource("GCMClimate", subtype, convert = "onlycorrect") ## End(Not run)
Read GLobal Forest Age Dataset derived from MODIS and COPENICUS satellite data
readGFAD()
readGFAD()
magpie object in cellular resolution
Abhijeet Mishra, Felicitas Beier
## Not run: readSource("GFAD", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("GFAD", convert = "onlycorrect") ## End(Not run)
read GPD Data from the Global Peatland Database provided by Alexandra Barthelmes. The original xls file has been clean-up manually (country names). Turkey had two identical entries in the original xls file. Sources: "Inventory Reports and National Communications UNFCC 2014", "soil and peatland science", "European Mires Book" , "own estimates (incl. GIS data)",
readGPD()
readGPD()
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("GPD", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("GPD", convert = "onlycorrect") ## End(Not run)
read x Data from the Global Peatland Database provided by Alexandra Barthelmes. The original xls file has been clean-up manually (country names). Turkey had two identical entries in the original xls file. Sources: "Inventory Reports and National Communications UNFCC 2014", "soil and peatland science", "European Mires Book" , "own estimates (incl. GIS data)",
readGPD2022()
readGPD2022()
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("x", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("x", convert = "onlycorrect") ## End(Not run)
read peatland area from GPM2
readGPM2(subtype = "1km")
readGPM2(subtype = "1km")
subtype |
resolution ("1km" or "500m") |
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("GPM2", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("GPM2", convert = "onlycorrect") ## End(Not run)
Read files related to the training and optimization of the LPJml emulators.
readGrassSoilEmu( subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100:5f5fa2:stddevs_lab" )
readGrassSoilEmu( subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100:5f5fa2:stddevs_lab" )
subtype |
Subtype of file to be opened. Subtypes available: 'weights', 'inputs', 'stddevs' and 'means'. |
Magpie objects with a diverse inforamtion
Marcos Alves
## Not run: readSource("GrassSoilEmu", subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100:5f5fa2:weights", convert = F ) ## End(Not run)
## Not run: readSource("GrassSoilEmu", subtype = "ISIMIP3b:IPSL_CM6A_LR:ssp126:1965_2100:5f5fa2:weights", convert = F ) ## End(Not run)
Read files related to the training and optimization of the LPJml emulators.
readGrassYldEmu(subtype = "109325f71e.inputs")
readGrassYldEmu(subtype = "109325f71e.inputs")
subtype |
Subtype of file to be opened. Subtypes available: 'max_harvest', 'weights', 'inputs', 'stddevs' and 'means'. |
Magpie objects with a diverse inforamtion
Marcos Alves
## Not run: readSource("GrassYldEmu", subtype = "109325f71e.inputs", convert="onlycorrect") ## End(Not run)
## Not run: readSource("GrassYldEmu", subtype = "109325f71e.inputs", convert="onlycorrect") ## End(Not run)
Read gridded population, by urban and rural, from Gao O'Neill and JOnes dataset, see https://www.cgd.ucar.edu/iam/modeling/spatial-population-scenarios.html https://doi.org/10.7927/m30p-j498
readGridPopGao(subtype = "future")
readGridPopGao(subtype = "future")
subtype |
only "future" post-2000 available for this source |
David Chen, Felicitas Beier
Reads in past and future (SSP1-5) gridded population data, from ISIMIP database, Past data is based on HYDE3.2, while future SSPs are based on projections from Jones & O'Neill 2016
readGridPopIsimip(subtype)
readGridPopIsimip(subtype)
subtype |
past (1965-2005) or future (2010-2100) |
A MAgPIE object, cellular 0.5deg resolution, of population (millions)
David Chen, Marcos Alves, Felicitas Beier
read in labour productivity impacts from climate change emulated by the LAMACLIMA project
based on method of Orlov et al. 2019. Economics of Disasters and Climate Change, 3(3), 191-211.
readLabourProdImpactEmu()
readLabourProdImpactEmu()
magpie object of gridded productivity loss in percent (0-100)
Michael Windisch, Florian Humpenöder, Felicitas Beier
read in labour productivity impacts from climate change from Orlov (see Orlov et al. 2019. Economic Losses of Heat-Induced Reductions in Outdoor Worker Productivity: a Case Study of Europe. Economics of Disasters and Climate Change, 3(3), 191-211.)
readLabourProdImpactOrlov( subtype = "IPSL-CM5A-LR_rcp85_wbgtod_hothaps_400W.nc" )
readLabourProdImpactOrlov( subtype = "IPSL-CM5A-LR_rcp85_wbgtod_hothaps_400W.nc" )
subtype |
subtype of choice between indoor outdoor work, GCM, work intesnsity (300W medium, 400W high, rcp) |
magpie object of gridded productivity as share of 1 (full productivity)
David Chen
read potential peatland area from Leifeld2018
readLeifeld2018()
readLeifeld2018()
List of magpie objects with results on cellular level, weight, unit and description.
Florian Humpenoeder
## Not run: readSource("Leifeld2018", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("Leifeld2018", convert = "onlycorrect") ## End(Not run)
Reads the MAP-SPAM crop data per year (mapping each year different)
readMAPSPAM(subtype = "harvested")
readMAPSPAM(subtype = "harvested")
subtype |
It can be either "harvested" or "physical" area |
magpie object with croparea data in ha
Edna J. Molina Bacca, Felicitas Beier
[readSource()]
## Not run: a <- readSource("MAPSPAM") ## End(Not run)
## Not run: a <- readSource("MAPSPAM") ## End(Not run)
reads in Global Area Equipped for Irrigation for years 1900-2015 from Mehta et al. (2022)
readMehta2024(subtype = "GMIA")
readMehta2024(subtype = "GMIA")
subtype |
data subtype to be downloaded. Subtypes available: 'GMIA': gridded base map for downscaling from Stefan et al. (2013). Global Map of Irrigation Areas version 5. 'Meier2018': gridded base map for downscaling from Meier, et al. (2018). Global Irrigated Areas. |
Felicitas Beier
[correctMehta2024()]
## Not run: a <- readSource("Mehta2024") ## End(Not run)
## Not run: a <- readSource("Mehta2024") ## End(Not run)
Read in data of Ramankutty dataset (Source: Ramankutty N, Foley JA, Norman J and McSweeney K (2002) The global distribution of cultivable lands: current patterns and sensitivity to possible climate change. Global Ecology and Biogeography, 11, 377-392.). Link to data: https://www.nelson.wisc.edu/sage/data-and-models/global-land-use/grid.php
readRamankutty()
readRamankutty()
magpie object
Felicitas Beier
## Not run: readSource("Ramankutty", convert = "onlycorrect") ## End(Not run)
## Not run: readSource("Ramankutty", convert = "onlycorrect") ## End(Not run)
Read soil classification data used as input for lpjml
readSoilClassification(subtype = "HWSD.soil")
readSoilClassification(subtype = "HWSD.soil")
subtype |
Switch between different inputs |
Magpie object with results on cellular level for soil types
Marcos Alves, Kristine Karstens
## Not run: readSource("SoilClassification", subtype="HWSD.soil", convert="onlycorrect") ## End(Not run)
## Not run: readSource("SoilClassification", subtype="HWSD.soil", convert="onlycorrect") ## End(Not run)
Read transport distance
readTransportDistance()
readTransportDistance()
List of magpie objects with results on cellular level, weight, unit and description.
David Chen
## Not run: readSource("TransportDistance", convert="onlycorrect") ## End(Not run)
## Not run: readSource("TransportDistance", convert="onlycorrect") ## End(Not run)
Read minimum travel time to cities and ports and ports of various size, see metadata file in source folder
readTravelTimeNelson2019(subtype = "cities50")
readTravelTimeNelson2019(subtype = "cities50")
subtype |
currently only cities of 5, 20, or 50 thousand people ("cities5", "cities20", "cities50") or ports of various sizes ("portsLarge|Medium|Small|VerySmall|Any") |
gridded magpie object for 2015, minimum travel time to cities in minutes
David M Chen
Reads in data to calculate BphEffect, BphTCRE or BphMask depending on the chosen subtype. BphEffect: Biogeophysical temperature change of afforestation (degree C). (File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018). BphMask: Mask of Datapoints of biogeophysical temperature change of afforestation (degree C) to be used as weight. (File is based on observation datasets of Bright et al. 2017 and Duveiller et al. 2018). BphTCRE: Transient Climate Response to accumulated doubling of CO2. (File is based on CMIP5 +1perc CO2 per year experiment. To be used in the translation to carbon equivalents of BphEffect)
readWindisch2021(subtype)
readWindisch2021(subtype)
subtype |
refordefor_BPHonly_05_new, annmean_pertCha_05_EW1, annstd_diff_pertCha_05_EW1 |
List of magpie objects with results on cellular level, weight, unit and description.
Felicitas Beier, Michael Windisch, Patrick v. Jeetze
## Not run: readSource("Windisch2021", convert="onlycorrect") ## End(Not run)
## Not run: readSource("Windisch2021", convert="onlycorrect") ## End(Not run)
This tool function replaces country names with region names in the spatial dimension of the object. To avoid mixing up of cache files with different regional aggregation the regioncode needs to supplied and checked as well. Only if the supplied regions code agrees with the region mapping currently chosen the function will return the data.
toolApplyRegionNames(cdata, regionscode)
toolApplyRegionNames(cdata, regionscode)
cdata |
a cluster data file as produced by cluster_base |
regionscode |
regionscode of the regional mapping to be used.
Must agree with the regionscode of the mapping mentioned
in the madrat config!
Can be retrieved via |
the cluster data file with region names in spatial dimension rather than country names
Jan Philipp Dietrich, Felicitas Beier
calcClusterKMeans
, calcClusterBase
This function calculates an appropriate number of clusters per region as it is needed for ClusterKMeans
toolClusterPerRegion(cells, ncluster, weight = NULL)
toolClusterPerRegion(cells, ncluster, weight = NULL)
cells |
spatial names as returned by |
ncluster |
The desired total number of clusters. |
weight |
named vector with weighting factors for each region for the cluster distribution, e.g. weight=c(AFR=3,EUR=0.5). weight > 1 will grant more cluster to a region and weight < 1 less cluster than by default. |
A matrix with regions in rows and number of cells and clusters in columns
Jan Philipp Dietrich
calcClusterKMeans
, calcClusterBase
This function translates weights into number of clusters per region as it is needed for ClusterKMeans. Weights have to sum up to total number of clusters.
toolClusterPerRegionManual(cells, ncluster, ncluster2reg)
toolClusterPerRegionManual(cells, ncluster, ncluster2reg)
cells |
spatial names as returned by |
ncluster |
The desired total number of clusters. |
ncluster2reg |
named vector with numbers per region |
A matrix with regions in rows and number of cells and clusters in columns
Kristine Karstens
calcClusterKMeans
, calcClusterBase
Distances are calculated from the lat and lon coordinates. Therefore, all magpie objects must have location information (see addLocation). Values are only moved within a country. If no suitable cell is available in the same country, the undesirable values are discarded. This function takes only magpie objects with only one time and data dimensions to allow for more flexibility. Whenever more than one dimension is available in the magpie objects, I suggest using a loop (see for and apply).
toolMoveValues(x, y, z, w = NULL)
toolMoveValues(x, y, z, w = NULL)
x |
Unidimensional magpie object (one time and one data dimension) with location information caring for the values that must be checked and moved if necessary. |
y |
Unidimensional magpie object (one time and one data dimension) that has a binary or logical mapping (see as.logical) of the unsuitable areas for the values in x |
z |
Unidimensional magpie object (one time and one data dimension) that has a binary or logical (see as.logical) mapping of the areas that can receive the values from x. |
w |
Unidimensional magpie object (one time and one data dimension) that has a binary or logical (see as.logical) mapping of the areas that have to be zeroed. If left empty, the inverse of 'z' is assumed. |
Move values in an undesirable cell to the nearest desirable neighbor (Euclidian distance).
Unidimensional magpie object with summed values of the moved values to the nearest suitale neighbor. All the unmoved and discarded values are set to 0.
Marcos Alves
Reconstructs and evaluate a neural network from the weights and biases provided as arguments
toolNeuralNet(inputsMl, weights, activation)
toolNeuralNet(inputsMl, weights, activation)
inputsMl |
Neural Network input features properly scaled with the scale and center attributes of the scaled training set in a matrix format. |
weights |
The learned weights and biases in a list format as outputed by the
function |
activation |
Name of the activation function used for training. Currently implemented functions: 'relu', 'softplus', 'sigmoid'. Optionally, a custom activation function can be passed using a "." to indicate where the layer inputs should be piped. |
The evaluated result of the neural network for the input_ml
parameter.
Marcos Alves
Refold weights from NN training Refold weights into their original configuration.
toolRefoldWeights(x)
toolRefoldWeights(x)
x |
magpie object containing weights. |
Marcos Alves