% TEMBA Climate User's Guide % Camilo Ramirez (expanded from the work from Ioannis Pappis) % June 22, 2023
This folder contains all the scripts and data necessary to reproduce the work for the TEMBA Climate model.
To run this analysis you need to install GLPK and the CPLEX solver
You should also have a python >=3.6 environment setup with the dependencies listed in the
envs/environment.yaml file
To install the environment you need to install first a distribution of anaconda or miniconda, open a anaconda promp and run:
conda env create -n temba -f envs/environment.yaml
Finally, activate the environment with conda activate temba.
The TEMBA Climate model uses two automated workflows to run the analysis and produce all result files.
We use the snakemake python package for that. Learn more about snakemake in: https://snakemake.readthedocs.io/en/stable/index.html
In the rooth of the 04. TEMBA model folder, you will find two snakemake files:
snakefile: This file contains all the code and rules needed to run the TEMBA Climate model from begining to end. It usesGLPKto produce the model based on the input excel scenario files andCPLEXto solve the model. It also runs some postprocessing analysis to clean-up the results and create the results of interest such asScenario CSVs/scenario/LCOEs.csvandScenario CSVs/scenario/GridEmissionFactors.csv.snake_merge_results: Contains the code and rules to create theMain results, dividedPer scenarioandAggregatedresults for each country.
To run any of the workflows, you should first perform a dry run running snakemake with the -n flag. In a
conda promp or the command line run snakemake -s snakefile -n this will perform the dry run listing all the rules,
and result files it would create. Inspect this first to be sure it is what you want to run and then run the workflow with
snakemake -s snakefile --cores n. replace snakefile for the workflow name you want to run (either snakefile or
snake_merge_results) and n for the number of cores you wan to use to run the model in parallel.
- Input data are stored in
.xlsxExcel files in theinput_datafolder. The available scenarios are- BU: Bottom-up demand
- Low: Top-down low demand
- High: Top-down high demand
- BU_CT_high: Bottom-up demand with high cost of carbon
- Low_CT_high: Top-down low demand with high cost of carbon
- High_CT_high: Top-down high demand with high cost of carbon
- A modified OSeMOSYS model file is stored in
modelfolder - Temporary output data is stored in the
output_datafolder - Final results are stored in the
resultsfolder (see below for a description of this folder) - All the scripts are stored in the
scriptsfolder - The conda environment is stored in the
envsfolder
The results folder contains the results of all TEMBA Climate model runs and is structured in the following way:
Main results: This folder contains the consolidated results of the TEMBA Climate model. Results are presented for each country, either aggregated for all scenarios or split per scenario.Aggreagated: Contains the results for each country and all scenarios aggregated.- Country: iso code of the country.
ElectricityDemand.csv: lists the electricity demand (GWh) in each year divided per demand type (Current electrified, New electrified and exports). It also divides the results between scenario (Bottom-up, Top-down high and Top-down low) and carbon tax/cost (No, High).ElectricityDemand.html: same as above but representing the data in graphical format.ElectricityGeneration.csv: lists the electricity generation (GWh) in each year divided per source type
(fuel types and imports). It also divides the results between scenario (Bottom-up, Top-down high and Top-down low) and carbon tax/cost (No, High).ElectricityGeneration.html: same as above but representing the data in graphical format.InstalledCapacity.csv: lists the power generation installed capacity (GW) in each year divided per source type
(fuel types). It also divides the results between scenario (Bottom-up, Top-down high and Top-down low) and carbon tax/cost (No, High).InstalledCapacity.html: same as above but representing the data in graphical format.
- Country: iso code of the country.
Per scenario: Contains separate results for each scenario and each country.- Scenario: name of the scenario.
Capacity: Contains results related to the yearly power generation installed capacity (GW) of each country. Results are presented in several text and graphical formats (CSV,HTML,PNG).Demand: Contains results related to the yearly electricity demand (GWh) of each country. Results are presented in several text and graphical formats (CSV,HTML,PNG).Generation: Contains results related to the yearly power generation (GWh) of each country. Results are presented in several text and graphical formats (CSV,HTML,PNG).
- Scenario: name of the scenario.
Model files: This are scenario specific result files from theCPLEXsolver such as thescenario.solfiles.Scenario CSVs: Contains the rawCSVresults for each scenario. This results are quite desaggregated showing results per technology, fuel and year in some cases.- Scenario: scenario name.
AnnualEmissions.csvAnnualFixedOperatingCost.csvAnnualTechnologyEmission.csvAnnualVariableOperatingCost.csvAvgCapacityCost.csvCapitalInvestment.csvElectricityDemand.csvElectricityGeneration.csvGridEmissionFactors.csvInstalledCapacity.csvLCOEs.csvNewCapacity.csvProductionByTechnologyAnnual.csvRateOfActivity.csvTotalCapacityAnnual.csvUseByTechnologyAnnual.csv
- Scenario: scenario name.
capacity_costs.csv: Aggregated new installed capacity cost in USD/kW for each scenario.emission_factors.csv: Aggregated grid emission factors in gCO2eq/kWh for each scenario.LCOEs.csv: Aggregated Levelized Cost of Electricity in USD/kWh for each scenario.