Package 'reporttransport'

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

Help Index


Aggregate variables

Description

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

Usage

aggregateVariables(vars, mapAggregation, weight = NULL)

Arguments

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

Value

Data.table with aggregated variables

Author(s)

Johanna Hoppe


Check a data.table for NAs and duplicates and throw an error if needed

Description

Check a data.table for NAs and duplicates and throw an error if needed

Usage

checkForNAsAndDups(dt, varname, codePosition)

Arguments

dt

data.table to be checked

varname

name of the variable

codePosition

position in the code to find the bug

Author(s)

Johanna Hoppe


Convert variables into model intercomparison format MIF

Description

Convert variables into model intercomparison format MIF

Usage

convertToMIF(
  vars,
  GDPMER,
  helpers,
  scenario,
  model,
  gdx,
  isTransportExtendedReported = FALSE
)

Arguments

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

Value

Variables provided in different aggregation levels in MIF format

Author(s)

Johanna Hoppe


Prepare data to report to REMIND

Description

Prepare data to report to REMIND

Usage

prepareForREMIND(dt, demScen, SSPscen, transportPolScen)

Arguments

dt

data.table with data to report to REMIND

demScen

demand scenario

SSPscen

SSP scenario

transportPolScen

transport policy scenario

Value

data table ready to report to REMIND

Author(s)

Johanna Hoppe


Renames vertain variables to prevent duplicates for variables that are reported also in remind2

Description

Renames vertain variables to prevent duplicates for variables that are reported also in remind2

Usage

renameDuplicateVariables(vars)

Arguments

vars

MIF variables

Value

MIF variables that are renamed to "Transport edge" where necessary

Author(s)

Johanna Hoppe


Report cost variables in aggregated levels: Capital costs sales, operating costs (total non-fuel), fuel costs

Description

Report cost variables in aggregated levels: Capital costs sales, operating costs (total non-fuel), fuel costs

Usage

reportAggregatedCosts(combinedCAPEXandOPEX)

Arguments

combinedCAPEXandOPEX

detailed data on cost variables

Value

aggregated cost variables

Author(s)

Johanna Hoppe


Report analytics variable set

Description

Report analytics variable set

Usage

reportAnalyticsVarSet(data, timeResReporting)

Arguments

data

List that contains the model results to report the analytics variable set

timeResReporting

Timesteps to be reported

Value

Analytics variable set

Author(s)

Johanna Hoppe


Report basic variable set needed to report REMIND input data and detailed transport data

Description

Report basic variable set needed to report REMIND input data and detailed transport data

Usage

reportBaseVarSet(data, timeResReporting)

Arguments

data

List that contains at least the model results to report the basic variable set

timeResReporting

Timesteps to be reported

Value

list of intensive and extensive output variables

Author(s)

Johanna Hoppe


Report EDGE-Transport Model results

Description

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.

Usage

reportEdgeTransport(
  folderPath = file.path(".", "EDGE-T"),
  data = NULL,
  isTransportReported = TRUE,
  isTransportExtendedReported = FALSE,
  isAnalyticsReported = FALSE,
  isREMINDinputReported = FALSE,
  isStored = TRUE,
  ...
)

Arguments

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

Value

The function either returns the REMINDinputData if isREMINDinputReported is enabled or the transport data in MIF format

Author(s)

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.

Description

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.

Usage

reportEmissions(dtFE, gdxPath, prefix, helpers)

Arguments

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

Value

Emissions data for provided values in dtFE

Author(s)

Johanna Hoppe


Report extended detailed transport variable set

Description

Report extended detailed transport variable set

Usage

reportExtendedTransportVarSet(data, baseVarSet, timeResReporting)

Arguments

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

Value

Extended detailed transport output variable set

Author(s)

Johanna Hoppe


Report variables in relation to the vehicle fleet.

Description

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.

Usage

reportFinalEnergy(
  fleetEnergyIntensity,
  fleetESdemand,
  loadFactor,
  hybridElecShare,
  helpers
)

Arguments

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

Value

Final energy consumed by all modes and technologies

Author(s)

Johanna Hoppe


Report variables in relation to the vehicle fleet.

Description

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.

Usage

reportFleetVariables(salesData, vehiclesConstrYears, helpers)

Arguments

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

Value

Variable in relation to the vehicle fleet

Author(s)

Johanna Hoppe


Report the split of liquids and gases into fossil|bio|hydrogen

Description

Report the split of liquids and gases into fossil|bio|hydrogen

Usage

reportLiquidsAndGasesComposition(dtFE, gdxPath, helpers)

Arguments

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

Value

Final energy for liquids and gases split into fossil|bio|hydrogen

Author(s)

Johanna Hoppe


Report REMIND/iterative EDGE-T input data

Description

Report REMIND/iterative EDGE-T input data

Usage

reportREMINDinputVarSet(
  fleetESdemand,
  fleetFEdemand,
  fleetEnergyIntensity,
  scenSpecLoadFactor,
  fleetCapCosts,
  combinedCAPEXandOPEX,
  scenSpecPrefTrends,
  scenSpecEnIntensity,
  initialIncoCosts,
  annualMileage,
  timeValueCosts,
  hybridElecShare,
  demScen,
  SSPscen,
  transportPolScen,
  timeResReporting,
  helpers
)

Arguments

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

Value

REMIND/iterative EDGE-T input data

Author(s)

Johanna Hoppe


Report to REMIND p35_esCapCost

Description

Report to REMIND p35_esCapCost

Usage

reportToREMINDcapitalCosts(
  fleetCapCosts,
  fleetESdemand,
  hybridElecShare,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Value

Capital Costs per CES node in [US$2017/pkm or US$2017/tkm]

Author(s)

Johanna Hoppe


Report to REMIND f35_fe2es

Description

Report to REMIND f35_fe2es

Usage

reportToREMINDenergyEfficiency(
  fleetFEdemand,
  fleetESdemand,
  hybridElecShare,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Value

Energy efficiency of transport fuel technologies in [trn pkm/Twa or trn tkm/Twa]

Author(s)

Johanna Hoppe


Report energy service demand to REMIND

Description

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.

Usage

reportToREMINDesDemand(
  fleetESdemand,
  hybridElecShare,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Details

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.

Value

Energy service demand per technology in [trillion pkm/trillion tkm]

Author(s)

Johanna Hoppe


Report to REMIND f35_demByTech

Description

Report to REMIND f35_demByTech

Usage

reportToREMINDfinalEnergyDemand(
  fleetFEdemand,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Value

Final energy demand on CES level per transport fuel technology [TWa]

Author(s)

Johanna Hoppe


Report to REMIND final energy shares f35_shFeCes

Description

Report to REMIND final energy shares f35_shFeCes

Usage

reportToREMINDfinalEnergyShares(
  fleetFEdemand,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Value

Final energy shares of transport fuel technologies in [-]


Report detailed transport variable set

Description

Report detailed transport variable set

Usage

reportTransportVarSet(data, baseVarSet)

Arguments

data

List that contains the model results to report the detailed transport variable set

baseVarSet

Basic output variable set

Value

Detailed transport output variable set

Author(s)

Johanna Hoppe


Report variables in relation to the vehicle fleet.

Description

Report variables in relation to the vehicle fleet.

Usage

reportUE(FEdemand, helpers)

Arguments

FEdemand

Finale energy demand

helpers

List with helpers

Value

Useful energy demand

Author(s)

Johanna Hoppe


Store EDGE-Transport model results

Description

This function creates the EDGE-Transport outputfolder and stores all outputfiles in the respective subfolders

Usage

storeData(outputFolder, varsList = NULL, ...)

Arguments

outputFolder

Path to folder for storing output data

varsList

Raw model results

...

Optional passing of additional variables

Author(s)

Johanna Hoppe


Report FE shares of LDV in transport liquids

Description

Report FE shares of LDV in transport liquids

Usage

toolReportsharesLDVtransport(
  fleetFEdemand,
  timeResReporting,
  demScen,
  SSPscen,
  transportPolScen,
  helpers
)

Arguments

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

Value

Final energy shares of LDV in transport liquids [-]

Author(s)

Johanna Hoppe


Render CompareScenarios for EDGE Transport

Description

A wrapper for piamPlotComparison::compareScenarios

Usage

transportCompareScenarios(
  mifScen,
  mifHist,
  outputDir = getwd(),
  outputFile = "CompareScenarios",
  outputFormat = "PDF"
)

Arguments

mifScen

character(n), optionally named. Paths to scenario mifs. If the vector has names, those are used to refer to the scenarios in the output file.

mifHist

character(1). Path to historical mif.

outputDir

character(1). The directory where the output document and intermediary files are created.

outputFile

character(1). File name (without extension) of the output document to be created.

outputFormat

character(1), not case-sensitive. "html", "pdf", or "rmd".

Value

The value returned by render().