Title: | Reporting package for edgeTransport |
---|---|
Description: | This package contains edgeTransport-specific routines to report model results. The main functionality is to generate transport reporting variables in MIF format from a given edgeTransport model run folder or REMIND input data. |
Authors: | Johanna Hoppe [aut, cre] |
Maintainer: | Johanna Hoppe <[email protected]> |
License: | LGPL-3 |
Version: | 0.6.0 |
Built: | 2024-10-30 13:27:30 UTC |
Source: | https://github.com/pik-piam/reporttransport |
This function aggregates a large set of variables according to the edge transport decision tree and additional aggregation levels that are set manually. The aggregation is applied to all variables simultaneously. Additional transport specific columns are transferred into the variable column entry
aggregateVariables(vars, mapAggregation, weight = NULL)
aggregateVariables(vars, mapAggregation, weight = NULL)
vars |
Data.table with variables to aggregate in modified quitte style format |
mapAggregation |
Map containing levels for aggregation in addition to the levels of the decision tree |
weight |
Weight to aggregate variables |
Data.table with aggregated variables
Johanna Hoppe
Check a data.table for NAs and duplicates and throw an error if needed
checkForNAsAndDups(dt, varname, codePosition)
checkForNAsAndDups(dt, varname, codePosition)
dt |
data.table to be checked |
varname |
name of the variable |
codePosition |
position in the code to find the bug |
Johanna Hoppe
Convert variables into model intercomparison format MIF
convertToMIF( vars, GDPMER, helpers, scenario, model, gdx, isTransportExtendedReported = FALSE )
convertToMIF( vars, GDPMER, helpers, scenario, model, gdx, isTransportExtendedReported = FALSE )
vars |
Variables to be aggregated and converted into MIF format |
GDPMER |
GDP on market exchange rate basis to be used as weight for regional aggregation |
helpers |
List of helpers |
scenario |
Scenario name in MIF entry |
model |
Model name in MIF entry |
gdx |
GDX file containing further regional aggregation levels |
isTransportExtendedReported |
Switch to enable the extended transport variable set |
Variables provided in different aggregation levels in MIF format
Johanna Hoppe
Prepare data to report to REMIND
prepareForREMIND(dt, demScen, SSPscen, transportPolScen)
prepareForREMIND(dt, demScen, SSPscen, transportPolScen)
dt |
data.table with data to report to REMIND |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
data table ready to report to REMIND
Johanna Hoppe
Renames vertain variables to prevent duplicates for variables that are reported also in remind2
renameDuplicateVariables(vars)
renameDuplicateVariables(vars)
vars |
MIF variables |
MIF variables that are renamed to "Transport edge" where necessary
Johanna Hoppe
Report cost variables in aggregated levels: Capital costs sales, operating costs (total non-fuel), fuel costs
reportAggregatedCosts(combinedCAPEXandOPEX)
reportAggregatedCosts(combinedCAPEXandOPEX)
combinedCAPEXandOPEX |
detailed data on cost variables |
aggregated cost variables
Johanna Hoppe
Report analytics variable set
reportAnalyticsVarSet(data, timeResReporting)
reportAnalyticsVarSet(data, timeResReporting)
data |
List that contains the model results to report the analytics variable set |
timeResReporting |
Timesteps to be reported |
Analytics variable set
Johanna Hoppe
Report basic variable set needed to report REMIND input data and detailed transport data
reportBaseVarSet(data, timeResReporting)
reportBaseVarSet(data, timeResReporting)
data |
List that contains at least the model results to report the basic variable set |
timeResReporting |
Timesteps to be reported |
list of intensive and extensive output variables
Johanna Hoppe
This function reports the transport model results of an iterative or standalone run. If not handed over in the function call, it first loads the transport model results from the stored RDS files. Then it calculates the output variables and brings the data into the right format. A basic output variables set is always calculated that is needed for all reporting packages. With the help of switches, different reporting packages can be generated: - isTransportReported activates the reduced reporting of transport variables in MIF format to be attached to a REMIND.mif. It includes the variables needed to create REMIND compareScenarios2 and report results for projects - isTransportReported + isTransportExtendedReported activates further the extended reporting of transport variables and if isStored is activated as well, triggers the generation of a seperate transport.MIF. It includes the reduced reporting and additional transport variables for a detailed analysis of the transport sector using transportCompareScenarios - isTransportReported + isTransportExtendedReported + isAnalyticsReported activates further the generation of additional variables for the analysis of the model behavior such as the inconvenience costs over iterations. They can be analyzed in the analytics sheet in compareScenariosTransport. It can be used in combination or without isTransportExtendedReported. - isREMINDinputReported activates the reporting of REMIND input data from a standalone run. This mode is used in the REMIND input data generation with all other switches turned off. It can be also used in combination with the other switches.
reportEdgeTransport( folderPath = file.path(".", "EDGE-T"), data = NULL, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isAnalyticsReported = FALSE, isREMINDinputReported = FALSE, isStored = TRUE, ... )
reportEdgeTransport( folderPath = file.path(".", "EDGE-T"), data = NULL, isTransportReported = TRUE, isTransportExtendedReported = FALSE, isAnalyticsReported = FALSE, isREMINDinputReported = FALSE, isStored = TRUE, ... )
folderPath |
Path to the EDGE-Transport output folder of an iterative or standalone run |
data |
List of model results. If not handed over, the data is loaded from the RDS files in the output folder |
isTransportReported |
Switch for activating the reporting of transport data in MIF format |
isTransportExtendedReported |
Switch for activating the reporting of detailed transport data im MIF format needed to create transportCompareScenarios |
isAnalyticsReported |
Switch for activating reporting of model analytics data |
isREMINDinputReported |
Switch for activating reporting of REMIND input data |
isStored |
Switch for activating data storage and creating the transport.MIF file |
... |
Additional model results/parameter that are handed over individually |
The function either returns the REMINDinputData if isREMINDinputReported is enabled or the transport data in MIF format
Johanna Hoppe
Report emissions allocated to the transport sector. Only direkt emissions from liquid or gaseous energy carriers used in ICEs are considered. Indirect emissions from electricity and hydrogen are not allocated to the transport sector.
reportEmissions(dtFE, gdxPath, prefix, helpers)
reportEmissions(dtFE, gdxPath, prefix, helpers)
dtFE |
Final energy data for liquids and gases |
gdxPath |
Path to REMIND fulldata.gdx containing emission factors |
prefix |
Prefix that specifies the emissions we are referring to in the variable name (either tailpipe or demand) |
helpers |
List of helpers |
Emissions data for provided values in dtFE
Johanna Hoppe
Report extended detailed transport variable set
reportExtendedTransportVarSet(data, baseVarSet, timeResReporting)
reportExtendedTransportVarSet(data, baseVarSet, timeResReporting)
data |
List that contains the model results to report the extended detailed transport variable set |
baseVarSet |
List that contains the basic variables |
timeResReporting |
Time resolution for variable reporting |
Extended detailed transport output variable set
Johanna Hoppe
Variables like energy intensity and capital costs are linked to the construction year of a vehicle. As energy intensity and capital costs change over time for new sales, the composition of the fleet from vehicles of different construction years needs to be taken into account to report these variables.
reportFinalEnergy( fleetEnergyIntensity, fleetESdemand, loadFactor, hybridElecShare, helpers )
reportFinalEnergy( fleetEnergyIntensity, fleetESdemand, loadFactor, hybridElecShare, helpers )
fleetEnergyIntensity |
Energy intensity linked to the vehicle fleet |
fleetESdemand |
Energy service on technology level linked to the vehicle fleet |
loadFactor |
Persons or tons per vehicle |
hybridElecShare |
Share of electric driving in hybrid electric vehicles |
helpers |
list of helpers |
Final energy consumed by all modes and technologies
Johanna Hoppe
Variables like energy intensity and capital costs are linked to the construction year of a vehicle. As energy intensity and capital costs change over time for new sales, the composition of the fleet from vehicles of different construction years needs to be taken into account to report these variables.
reportFleetVariables(salesData, vehiclesConstrYears, helpers)
reportFleetVariables(salesData, vehiclesConstrYears, helpers)
salesData |
variables linked to new sales in the respective years |
vehiclesConstrYears |
vehicle numbers and their construction years for the respective years |
helpers |
list of helpers |
Variable in relation to the vehicle fleet
Johanna Hoppe
Report the split of liquids and gases into fossil|bio|hydrogen
reportLiquidsAndGasesComposition(dtFE, gdxPath, helpers)
reportLiquidsAndGasesComposition(dtFE, gdxPath, helpers)
dtFE |
Final energy data for liquids and gases |
gdxPath |
Path to REMIND gdx, which contains the share of the various production routes for liquid and gaseous energy carriers |
helpers |
List of helpers |
Final energy for liquids and gases split into fossil|bio|hydrogen
Johanna Hoppe
Report REMIND/iterative EDGE-T input data
reportREMINDinputVarSet( fleetESdemand, fleetFEdemand, fleetEnergyIntensity, scenSpecLoadFactor, fleetCapCosts, combinedCAPEXandOPEX, scenSpecPrefTrends, scenSpecEnIntensity, initialIncoCosts, annualMileage, timeValueCosts, hybridElecShare, demScen, SSPscen, transportPolScen, timeResReporting, helpers )
reportREMINDinputVarSet( fleetESdemand, fleetFEdemand, fleetEnergyIntensity, scenSpecLoadFactor, fleetCapCosts, combinedCAPEXandOPEX, scenSpecPrefTrends, scenSpecEnIntensity, initialIncoCosts, annualMileage, timeValueCosts, hybridElecShare, demScen, SSPscen, transportPolScen, timeResReporting, helpers )
fleetESdemand |
energy service demand on fleet level |
fleetFEdemand |
final energy demand on fleet level |
fleetEnergyIntensity |
energy intensity on fleet level |
scenSpecLoadFactor |
scenario specific load factor data |
fleetCapCosts |
annualized capital costs on fleet level |
combinedCAPEXandOPEX |
CAPEX and OPEX on sales level in high temporal resolution |
scenSpecPrefTrends |
scenario specific preference trends in high temporal resolution |
scenSpecEnIntensity |
scenario specific energy intensity in high temporal resolution |
initialIncoCosts |
initial inconvenience cost |
annualMileage |
annual mileage in high temporal resolution |
timeValueCosts |
time value cost equivalent in high temporal resolution |
hybridElecShare |
share of electric driving for hybrid electric vehicles |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
timeResReporting |
time resolution reporting |
helpers |
list with helpers |
REMIND/iterative EDGE-T input data
Johanna Hoppe
Report to REMIND p35_esCapCost
reportToREMINDcapitalCosts( fleetCapCosts, fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
reportToREMINDcapitalCosts( fleetCapCosts, fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
fleetCapCosts |
capital costs on fleet level |
fleetESdemand |
energy service demand on fleet level |
hybridElecShare |
share of electric driving for hybrid electric vehicles |
timeResReporting |
time resolution reporting |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
helpers |
list of helpers |
Capital Costs per CES node in [US$2017/pkm or US$2017/tkm]
Johanna Hoppe
Report to REMIND f35_fe2es
reportToREMINDenergyEfficiency( fleetFEdemand, fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
reportToREMINDenergyEfficiency( fleetFEdemand, fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
fleetFEdemand |
final energy demand on fleet level |
fleetESdemand |
energy service demand on fleet level |
hybridElecShare |
share of electric driving for hybrid electric vehicles |
timeResReporting |
time resolution reporting |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
helpers |
list of helpers |
Energy efficiency of transport fuel technologies in [trn pkm/Twa or trn tkm/Twa]
Johanna Hoppe
Note that this is a helpers function that accounts for structural differences in REMIND and EDGE-T. The REMIND CES tree cannot represent active modes, as they deliver valuable energy service demand without capital cost and final energy production. Just filtering out the active modes energy service demand allocated by EDGE-Transport would lead to inconsistencies between both models: E.g. REMIND would split the whole trn_pass energy service demand according to the FE shares and energy efficiencies reported by EDGE-T (without considering the active modes) and would calculate a different FE value compared to EDGE-T that reserves a part of the trn_pass energy service demand to the active modes.
reportToREMINDesDemand( fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
reportToREMINDesDemand( fleetESdemand, hybridElecShare, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
fleetESdemand |
energy service demand on fleet level |
hybridElecShare |
share of electric driving for hybrid electric vehicles |
timeResReporting |
time resolution reporting |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
helpers |
list of helpers |
Solution: split and distribute the energy service demand of active modes across all technologies to calculate energy efficiency and capital cost per pkm. Consequence: This leads to the fact that in REMIND energy service demand, energy efficiencies, an capital costs on technology level are rather abstract values that are not technically correct. Hence, they should not be reported on technology level by REMIND (only by EDGE-T). The FE values on technology level are represented correctly as well as the energy service demand on CES node level. The decision of the technology share is anyway made by EDGE-T and not by REMIND.
Energy service demand per technology in [trillion pkm/trillion tkm]
Johanna Hoppe
Report to REMIND f35_demByTech
reportToREMINDfinalEnergyDemand( fleetFEdemand, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
reportToREMINDfinalEnergyDemand( fleetFEdemand, timeResReporting, demScen, SSPscen, transportPolScen, helpers )
fleetFEdemand |
final energy demand on fleet level |
timeResReporting |
time resolution reporting |
demScen |
demand scenario |
SSPscen |
SSP scenario |
transportPolScen |
transport policy scenario |
helpers |
list of helpers |
Final energy demand on CES level per transport fuel technology [TWa]
Johanna Hoppe
Report detailed transport variable set
reportTransportVarSet(data, baseVarSet)
reportTransportVarSet(data, baseVarSet)
data |
List that contains the model results to report the detailed transport variable set |
baseVarSet |
Basic output variable set |
Detailed transport output variable set
Johanna Hoppe
Report variables in relation to the vehicle fleet.
reportUE(FEdemand, helpers)
reportUE(FEdemand, helpers)
FEdemand |
Finale energy demand |
helpers |
List with helpers |
Useful energy demand
Johanna Hoppe
This function creates the EDGE-Transport outputfolder and stores all outputfiles in the respective subfolders
storeData(outputFolder, varsList = NULL, ...)
storeData(outputFolder, varsList = NULL, ...)
outputFolder |
Path to folder for storing output data |
varsList |
Raw model results |
... |
Optional passing of additional variables |
Johanna Hoppe
A wrapper for piamPlotComparison::compareScenarios
transportCompareScenarios( mifScen, mifHist, outputDir = getwd(), outputFile = "CompareScenarios", outputFormat = "PDF" )
transportCompareScenarios( mifScen, mifHist, outputDir = getwd(), outputFile = "CompareScenarios", outputFormat = "PDF" )
mifScen |
|
mifHist |
|
outputDir |
|
outputFile |
|
outputFormat |
|
The value returned by render()
.