Skip to content

Commit

Permalink
move household emissions calc to end
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Aug 16, 2024
1 parent 7ffeca3 commit 27ad877
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/CalculationFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ calculateResultsWithExternalFactors <- function(model, perspective = "FINAL", de
result <- list()
y_d <- prepareDemandVectorForStandardResults(model, demand, location = location, use_domestic_requirements = TRUE)
y_m <- prepareDemandVectorForImportResults(model, demand, location = location)

if(household_emissions) {
hh <- calculateHouseholdEmissions(model, f=(y_d + y_m), location, characterized=FALSE)
hh_lcia <- calculateHouseholdEmissions(model, f=(y_d + y_m), location, characterized=TRUE)
}


if(show_RoW) {
if(model$specs$IODataSource=="stateior") {
sector_count <- nrow(y_d)/2
Expand Down Expand Up @@ -211,6 +206,8 @@ calculateResultsWithExternalFactors <- function(model, perspective = "FINAL", de

# Add household emissions to results if applicable
if(household_emissions) {
hh <- calculateHouseholdEmissions(model, f=(y_d + y_m), location, characterized=FALSE)
hh_lcia <- calculateHouseholdEmissions(model, f=(y_d + y_m), location, characterized=TRUE)
LCI <- rbind(LCI, hh)
LCIA <- rbind(LCIA, hh_lcia)
}
Expand Down

0 comments on commit 27ad877

Please sign in to comment.