2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
configfile: "config.yaml"
|
|
|
|
|
2019-04-17 09:44:16 +00:00
|
|
|
wildcard_constraints:
|
|
|
|
lv="[a-z0-9\.]+",
|
2020-10-12 11:26:21 +00:00
|
|
|
network="[a-zA-Z0-9]*",
|
2019-04-17 09:44:16 +00:00
|
|
|
simpl="[a-zA-Z0-9]*",
|
|
|
|
clusters="[0-9]+m?",
|
|
|
|
sectors="[+a-zA-Z0-9]+",
|
2019-04-17 15:04:33 +00:00
|
|
|
opts="[-+a-zA-Z0-9]*",
|
2021-01-14 09:21:11 +00:00
|
|
|
sector_opts="[-+a-zA-Z0-9\.\s]*"
|
2019-04-17 09:44:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
subworkflow pypsaeur:
|
|
|
|
workdir: "../pypsa-eur"
|
|
|
|
snakefile: "../pypsa-eur/Snakefile"
|
|
|
|
configfile: "../pypsa-eur/config.yaml"
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2019-04-18 10:12:38 +00:00
|
|
|
rule all:
|
2020-07-30 06:27:33 +00:00
|
|
|
input:
|
2020-07-07 16:30:37 +00:00
|
|
|
config['summary_dir'] + '/' + config['run'] + '/graphs/costs.pdf'
|
2019-04-18 10:12:38 +00:00
|
|
|
|
2020-07-08 07:04:20 +00:00
|
|
|
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-08-19 10:41:17 +00:00
|
|
|
rule solve_all_networks:
|
2019-04-18 10:12:38 +00:00
|
|
|
input:
|
2020-11-30 12:21:38 +00:00
|
|
|
expand(config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2019-04-18 10:12:38 +00:00
|
|
|
**config['scenario'])
|
2019-04-16 14:03:51 +00:00
|
|
|
|
2019-04-17 09:44:16 +00:00
|
|
|
rule prepare_sector_networks:
|
|
|
|
input:
|
2020-11-30 12:21:38 +00:00
|
|
|
expand(config['results_dir'] + config['run'] + "/prenetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2019-04-17 09:44:16 +00:00
|
|
|
**config['scenario'])
|
2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_population_layouts:
|
|
|
|
input:
|
2019-04-17 09:44:16 +00:00
|
|
|
nuts3_shapes=pypsaeur('resources/nuts3_shapes.geojson'),
|
2019-04-16 14:03:51 +00:00
|
|
|
urban_percent="data/urban_percent.csv"
|
|
|
|
output:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=20000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_population_layouts.py"
|
|
|
|
|
|
|
|
|
|
|
|
rule build_clustered_population_layouts:
|
|
|
|
input:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc",
|
2021-04-29 14:52:35 +00:00
|
|
|
regions_onshore=pypsaeur('resources/regions_onshore_elec_s{simpl}_{clusters}.geojson')
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=10000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_clustered_population_layouts.py"
|
|
|
|
|
|
|
|
|
2020-09-25 13:25:41 +00:00
|
|
|
rule build_simplified_population_layouts:
|
|
|
|
input:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc",
|
2021-04-29 14:52:35 +00:00
|
|
|
regions_onshore=pypsaeur('resources/regions_onshore_elec_s{simpl}.geojson')
|
2020-09-25 13:25:41 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}.csv"
|
2020-09-25 13:25:41 +00:00
|
|
|
resources: mem_mb=10000
|
|
|
|
script: "scripts/build_clustered_population_layouts.py"
|
|
|
|
|
|
|
|
|
2019-04-17 09:44:16 +00:00
|
|
|
rule build_heat_demands:
|
2019-04-16 14:03:51 +00:00
|
|
|
input:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc",
|
2021-04-29 14:52:35 +00:00
|
|
|
regions_onshore=pypsaeur("resources/regions_onshore_elec_s{simpl}_{clusters}.geojson")
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
heat_demand_urban="resources/heat_demand_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
heat_demand_rural="resources/heat_demand_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
heat_demand_total="resources/heat_demand_total_elec_s{simpl}_{clusters}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=20000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_heat_demand.py"
|
|
|
|
|
|
|
|
rule build_temperature_profiles:
|
|
|
|
input:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc",
|
2021-04-29 14:52:35 +00:00
|
|
|
regions_onshore=pypsaeur("resources/regions_onshore_elec_s{simpl}_{clusters}.geojson")
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
temp_soil_total="resources/temp_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_rural="resources/temp_soil_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_urban="resources/temp_soil_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_total="resources/temp_air_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_rural="resources/temp_air_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_urban="resources/temp_air_urban_elec_s{simpl}_{clusters}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=20000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_temperature_profiles.py"
|
|
|
|
|
|
|
|
|
|
|
|
rule build_cop_profiles:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
temp_soil_total="resources/temp_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_rural="resources/temp_soil_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_urban="resources/temp_soil_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_total="resources/temp_air_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_rural="resources/temp_air_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_urban="resources/temp_air_urban_elec_s{simpl}_{clusters}.nc"
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
cop_soil_total="resources/cop_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_soil_rural="resources/cop_soil_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_soil_urban="resources/cop_soil_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_total="resources/cop_air_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_rural="resources/cop_air_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_urban="resources/cop_air_urban_elec_s{simpl}_{clusters}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=20000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_cop_profiles.py"
|
|
|
|
|
|
|
|
|
|
|
|
rule build_solar_thermal_profiles:
|
|
|
|
input:
|
|
|
|
pop_layout_total="resources/pop_layout_total.nc",
|
|
|
|
pop_layout_urban="resources/pop_layout_urban.nc",
|
|
|
|
pop_layout_rural="resources/pop_layout_rural.nc",
|
2021-04-29 14:52:35 +00:00
|
|
|
regions_onshore=pypsaeur("resources/regions_onshore_elec_s{simpl}_{clusters}.geojson")
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
solar_thermal_total="resources/solar_thermal_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
solar_thermal_urban="resources/solar_thermal_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
solar_thermal_rural="resources/solar_thermal_rural_elec_s{simpl}_{clusters}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
resources: mem_mb=20000
|
2019-04-16 14:03:51 +00:00
|
|
|
script: "scripts/build_solar_thermal_profiles.py"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule build_energy_totals:
|
|
|
|
input:
|
2019-04-17 09:44:16 +00:00
|
|
|
nuts3_shapes=pypsaeur('resources/nuts3_shapes.geojson')
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2020-09-21 11:06:58 +00:00
|
|
|
energy_name='resources/energy_totals.csv',
|
|
|
|
co2_name='resources/co2_totals.csv',
|
|
|
|
transport_name='resources/transport_data.csv'
|
2019-04-16 14:03:51 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=10000
|
|
|
|
script: 'scripts/build_energy_totals.py'
|
|
|
|
|
|
|
|
rule build_biomass_potentials:
|
|
|
|
input:
|
|
|
|
jrc_potentials="data/biomass/JRC Biomass Potentials.xlsx"
|
|
|
|
output:
|
2020-09-21 16:35:45 +00:00
|
|
|
biomass_potentials_all='resources/biomass_potentials_all.csv',
|
2020-09-21 11:06:58 +00:00
|
|
|
biomass_potentials='resources/biomass_potentials.csv'
|
2019-04-16 14:03:51 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_biomass_potentials.py'
|
|
|
|
|
2020-08-28 17:13:18 +00:00
|
|
|
rule build_ammonia_production:
|
|
|
|
input:
|
|
|
|
usgs="data/myb1-2017-nitro.xls"
|
|
|
|
output:
|
|
|
|
ammonia_production="resources/ammonia_production.csv"
|
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_ammonia_production.py'
|
|
|
|
|
2019-07-18 09:40:38 +00:00
|
|
|
|
|
|
|
rule build_industry_sector_ratios:
|
2020-08-28 17:13:18 +00:00
|
|
|
input:
|
|
|
|
ammonia_production="resources/ammonia_production.csv"
|
2019-07-18 09:40:38 +00:00
|
|
|
output:
|
|
|
|
industry_sector_ratios="resources/industry_sector_ratios.csv"
|
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industry_sector_ratios.py'
|
|
|
|
|
|
|
|
|
2020-08-26 11:12:16 +00:00
|
|
|
rule build_industrial_production_per_country:
|
2020-08-28 17:13:18 +00:00
|
|
|
input:
|
|
|
|
ammonia_production="resources/ammonia_production.csv"
|
2020-08-26 11:12:16 +00:00
|
|
|
output:
|
2021-05-19 11:57:44 +00:00
|
|
|
industrial_production_per_country="resources/industrial_production_per_country.csv"
|
2020-08-26 11:12:16 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_production_per_country.py'
|
|
|
|
|
|
|
|
|
2020-08-26 14:13:01 +00:00
|
|
|
rule build_industrial_production_per_country_tomorrow:
|
|
|
|
input:
|
|
|
|
industrial_production_per_country="resources/industrial_production_per_country.csv"
|
|
|
|
output:
|
|
|
|
industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow.csv"
|
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_production_per_country_tomorrow.py'
|
|
|
|
|
2020-10-05 18:04:04 +00:00
|
|
|
|
2020-10-12 10:07:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_industrial_distribution_key:
|
2020-10-05 18:04:04 +00:00
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
|
2020-10-05 18:04:04 +00:00
|
|
|
europe_shape=pypsaeur('resources/europe_shape.geojson'),
|
|
|
|
hotmaps_industrial_database="data/Industrial_Database.csv",
|
2021-04-29 14:52:35 +00:00
|
|
|
network=pypsaeur('networks/elec_s{simpl}_{clusters}.nc')
|
2020-10-12 10:07:49 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_distribution_key="resources/industrial_distribution_key_elec_s{simpl}_{clusters}.csv"
|
2020-10-12 10:07:49 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_distribution_key.py'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule build_industrial_production_per_node:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_distribution_key="resources/industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
|
2020-10-05 18:04:04 +00:00
|
|
|
industrial_production_per_country_tomorrow="resources/industrial_production_per_country_tomorrow.csv"
|
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}.csv"
|
2020-10-05 18:04:04 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_production_per_node.py'
|
|
|
|
|
|
|
|
|
2020-10-12 10:20:04 +00:00
|
|
|
rule build_industrial_energy_demand_per_node:
|
|
|
|
input:
|
|
|
|
industry_sector_ratios="resources/industry_sector_ratios.csv",
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_production_per_node="resources/industrial_production_elec_s{simpl}_{clusters}.csv",
|
|
|
|
industrial_energy_demand_per_node_today="resources/industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv"
|
2020-10-12 10:20:04 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_energy_demand_per_node="resources/industrial_energy_demand_elec_s{simpl}_{clusters}.csv"
|
2020-10-12 10:20:04 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_energy_demand_per_node.py'
|
|
|
|
|
|
|
|
|
2020-09-07 14:48:06 +00:00
|
|
|
rule build_industrial_energy_demand_per_country_today:
|
2020-09-07 16:41:07 +00:00
|
|
|
input:
|
2020-09-07 17:12:47 +00:00
|
|
|
ammonia_production="resources/ammonia_production.csv",
|
|
|
|
industrial_production_per_country="resources/industrial_production_per_country.csv"
|
2020-09-07 14:48:06 +00:00
|
|
|
output:
|
|
|
|
industrial_energy_demand_per_country_today="resources/industrial_energy_demand_per_country_today.csv"
|
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_energy_demand_per_country_today.py'
|
|
|
|
|
2020-08-26 14:13:01 +00:00
|
|
|
|
2020-10-12 11:26:21 +00:00
|
|
|
rule build_industrial_energy_demand_per_node_today:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_distribution_key="resources/industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
|
2020-10-12 11:26:21 +00:00
|
|
|
industrial_energy_demand_per_country_today="resources/industrial_energy_demand_per_country_today.csv"
|
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_energy_demand_per_node_today="resources/industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv"
|
2020-10-12 11:26:21 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_energy_demand_per_node_today.py'
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-26 11:12:16 +00:00
|
|
|
rule build_industrial_energy_demand_per_country:
|
2019-07-18 09:40:38 +00:00
|
|
|
input:
|
2020-08-26 11:12:16 +00:00
|
|
|
industry_sector_ratios="resources/industry_sector_ratios.csv",
|
2020-08-26 14:13:01 +00:00
|
|
|
industrial_production_per_country="resources/industrial_production_per_country_tomorrow.csv"
|
2019-07-18 09:40:38 +00:00
|
|
|
output:
|
2020-08-26 10:06:01 +00:00
|
|
|
industrial_energy_demand_per_country="resources/industrial_energy_demand_per_country.csv"
|
2019-07-18 09:40:38 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
2020-08-26 11:12:16 +00:00
|
|
|
script: 'scripts/build_industrial_energy_demand_per_country.py'
|
2019-07-18 09:40:38 +00:00
|
|
|
|
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
rule build_industrial_demand:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
|
2020-08-26 10:06:01 +00:00
|
|
|
industrial_demand_per_country="resources/industrial_energy_demand_per_country.csv"
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
industrial_demand="resources/industrial_demand_elec_s{simpl}_{clusters}.csv"
|
2019-04-16 14:03:51 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script: 'scripts/build_industrial_demand.py'
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-12-01 13:41:11 +00:00
|
|
|
rule build_retro_cost:
|
|
|
|
input:
|
|
|
|
building_stock="data/retro/data_building_stock.csv",
|
2021-02-24 15:51:58 +00:00
|
|
|
data_tabula="data/retro/tabula-calculator-calcsetbuilding.csv",
|
2021-05-19 11:57:44 +00:00
|
|
|
air_temperature = "resources/temp_air_total_elec_s{simpl}_{clusters}.nc",
|
2020-12-01 13:41:11 +00:00
|
|
|
u_values_PL="data/retro/u_values_poland.csv",
|
|
|
|
tax_w="data/retro/electricity_taxes_eu.csv",
|
|
|
|
construction_index="data/retro/comparative_level_investment.csv",
|
|
|
|
floor_area_missing="data/retro/floor_area_missing.csv",
|
2021-04-29 14:52:35 +00:00
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
|
2020-12-01 13:41:11 +00:00
|
|
|
cost_germany="data/retro/retro_cost_germany.csv",
|
2021-02-24 15:51:58 +00:00
|
|
|
window_assumptions="data/retro/window_assumptions.csv",
|
2020-12-01 13:41:11 +00:00
|
|
|
output:
|
2021-04-29 14:52:35 +00:00
|
|
|
retro_cost="resources/retro_cost_elec_s{simpl}_{clusters}.csv",
|
|
|
|
floor_area="resources/floor_area_elec_s{simpl}_{clusters}.csv"
|
2020-12-30 14:55:08 +00:00
|
|
|
resources: mem_mb=1000
|
2020-12-01 13:41:11 +00:00
|
|
|
script: "scripts/build_retro_cost.py"
|
2020-10-21 13:21:26 +00:00
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule prepare_sector_network:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
network=pypsaeur('networks/elec_s{simpl}_{clusters}_ec_lv{lv}_{opts}.nc'),
|
2020-09-21 11:06:58 +00:00
|
|
|
energy_totals_name='resources/energy_totals.csv',
|
|
|
|
co2_totals_name='resources/co2_totals.csv',
|
|
|
|
transport_name='resources/transport_data.csv',
|
2020-10-21 11:45:49 +00:00
|
|
|
traffic_data = "data/emobility/",
|
2020-09-21 11:06:58 +00:00
|
|
|
biomass_potentials='resources/biomass_potentials.csv',
|
2020-07-08 14:34:15 +00:00
|
|
|
timezone_mappings='data/timezone_mappings.csv',
|
|
|
|
heat_profile="data/heat_load_profile_BDEW.csv",
|
2020-08-20 12:26:39 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{planning_horizons}.csv",
|
2020-09-22 07:52:53 +00:00
|
|
|
h2_cavern = "data/hydrogen_salt_cavern_potentials.csv",
|
2020-08-12 09:08:09 +00:00
|
|
|
profile_offwind_ac=pypsaeur("resources/profile_offwind-ac.nc"),
|
|
|
|
profile_offwind_dc=pypsaeur("resources/profile_offwind-dc.nc"),
|
2021-04-29 14:52:35 +00:00
|
|
|
busmap_s=pypsaeur("resources/busmap_elec_s{simpl}.csv"),
|
|
|
|
busmap=pypsaeur("resources/busmap_elec_s{simpl}_{clusters}.csv"),
|
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
|
|
|
|
simplified_pop_layout="resources/pop_layout_elec_s{simpl}.csv",
|
|
|
|
industrial_demand="resources/industrial_energy_demand_elec_s{simpl}_{clusters}.csv",
|
|
|
|
heat_demand_urban="resources/heat_demand_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
heat_demand_rural="resources/heat_demand_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
heat_demand_total="resources/heat_demand_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_total="resources/temp_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_rural="resources/temp_soil_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_soil_urban="resources/temp_soil_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_total="resources/temp_air_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_rural="resources/temp_air_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air_urban="resources/temp_air_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_soil_total="resources/cop_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_soil_rural="resources/cop_soil_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_soil_urban="resources/cop_soil_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_total="resources/cop_air_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_rural="resources/cop_air_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_urban="resources/cop_air_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
solar_thermal_total="resources/solar_thermal_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
solar_thermal_urban="resources/solar_thermal_urban_elec_s{simpl}_{clusters}.nc",
|
|
|
|
solar_thermal_rural="resources/solar_thermal_rural_elec_s{simpl}_{clusters}.nc",
|
|
|
|
retro_cost_energy = "resources/retro_cost_elec_s{simpl}_{clusters}.csv",
|
|
|
|
floor_area = "resources/floor_area_elec_s{simpl}_{clusters}.csv"
|
|
|
|
output: config['results_dir'] + config['run'] + '/prenetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc'
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=2000
|
2021-04-29 14:52:35 +00:00
|
|
|
benchmark: config['results_dir'] + config['run'] + "/benchmarks/prepare_network/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}"
|
2020-07-08 14:34:15 +00:00
|
|
|
script: "scripts/prepare_sector_network.py"
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule plot_network:
|
|
|
|
input:
|
2020-11-30 12:21:38 +00:00
|
|
|
network=config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc"
|
2020-07-08 14:34:15 +00:00
|
|
|
output:
|
2020-11-30 12:21:38 +00:00
|
|
|
map=config['results_dir'] + config['run'] + "/maps/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
|
|
|
today=config['results_dir'] + config['run'] + "/maps/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}-today.pdf"
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 2
|
|
|
|
resources: mem_mb=10000
|
|
|
|
script: "scripts/plot_network.py"
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule copy_config:
|
|
|
|
output:
|
|
|
|
config=config['summary_dir'] + '/' + config['run'] + '/configs/config.yaml'
|
|
|
|
threads: 1
|
|
|
|
resources: mem_mb=1000
|
|
|
|
script:
|
|
|
|
'scripts/copy_config.py'
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule make_summary:
|
|
|
|
input:
|
2020-11-30 12:21:38 +00:00
|
|
|
networks=expand(config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-08 14:34:15 +00:00
|
|
|
**config['scenario']),
|
2020-08-20 12:26:39 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{}.csv".format(config['scenario']['planning_horizons'][0]),
|
2020-11-30 12:21:38 +00:00
|
|
|
plots=expand(config['results_dir'] + config['run'] + "/maps/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
2020-08-21 10:15:01 +00:00
|
|
|
**config['scenario'])
|
2020-07-08 14:34:15 +00:00
|
|
|
#heat_demand_name='data/heating/daily_heat_demand.h5'
|
|
|
|
output:
|
|
|
|
nodal_costs=config['summary_dir'] + '/' + config['run'] + '/csvs/nodal_costs.csv',
|
|
|
|
nodal_capacities=config['summary_dir'] + '/' + config['run'] + '/csvs/nodal_capacities.csv',
|
|
|
|
nodal_cfs=config['summary_dir'] + '/' + config['run'] + '/csvs/nodal_cfs.csv',
|
|
|
|
cfs=config['summary_dir'] + '/' + config['run'] + '/csvs/cfs.csv',
|
|
|
|
costs=config['summary_dir'] + '/' + config['run'] + '/csvs/costs.csv',
|
|
|
|
capacities=config['summary_dir'] + '/' + config['run'] + '/csvs/capacities.csv',
|
|
|
|
curtailment=config['summary_dir'] + '/' + config['run'] + '/csvs/curtailment.csv',
|
|
|
|
energy=config['summary_dir'] + '/' + config['run'] + '/csvs/energy.csv',
|
|
|
|
supply=config['summary_dir'] + '/' + config['run'] + '/csvs/supply.csv',
|
|
|
|
supply_energy=config['summary_dir'] + '/' + config['run'] + '/csvs/supply_energy.csv',
|
|
|
|
prices=config['summary_dir'] + '/' + config['run'] + '/csvs/prices.csv',
|
|
|
|
weighted_prices=config['summary_dir'] + '/' + config['run'] + '/csvs/weighted_prices.csv',
|
|
|
|
market_values=config['summary_dir'] + '/' + config['run'] + '/csvs/market_values.csv',
|
|
|
|
price_statistics=config['summary_dir'] + '/' + config['run'] + '/csvs/price_statistics.csv',
|
|
|
|
metrics=config['summary_dir'] + '/' + config['run'] + '/csvs/metrics.csv'
|
|
|
|
threads: 2
|
|
|
|
resources: mem_mb=10000
|
|
|
|
script:
|
|
|
|
'scripts/make_summary.py'
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
|
|
|
|
rule plot_summary:
|
|
|
|
input:
|
|
|
|
costs=config['summary_dir'] + '/' + config['run'] + '/csvs/costs.csv',
|
|
|
|
energy=config['summary_dir'] + '/' + config['run'] + '/csvs/energy.csv',
|
|
|
|
balances=config['summary_dir'] + '/' + config['run'] + '/csvs/supply_energy.csv'
|
|
|
|
output:
|
|
|
|
costs=config['summary_dir'] + '/' + config['run'] + '/graphs/costs.pdf',
|
|
|
|
energy=config['summary_dir'] + '/' + config['run'] + '/graphs/energy.pdf',
|
2020-08-21 10:15:01 +00:00
|
|
|
balances=config['summary_dir'] + '/' + config['run'] + '/graphs/balances-energy.pdf'
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 2
|
|
|
|
resources: mem_mb=10000
|
|
|
|
script:
|
|
|
|
'scripts/plot_summary.py'
|
|
|
|
|
|
|
|
if config["foresight"] == "overnight":
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule solve_network:
|
2020-07-07 16:30:37 +00:00
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
network=config['results_dir'] + config['run'] + "/prenetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-30 06:27:33 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{planning_horizons}.csv",
|
2020-08-11 09:41:53 +00:00
|
|
|
config=config['summary_dir'] + '/' + config['run'] + '/configs/config.yaml'
|
2021-04-29 14:52:35 +00:00
|
|
|
output: config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc"
|
2020-07-08 14:34:15 +00:00
|
|
|
shadow: "shallow"
|
|
|
|
log:
|
2021-04-29 14:52:35 +00:00
|
|
|
solver=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
|
|
|
python=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
|
|
|
memory=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_memory.log"
|
|
|
|
benchmark: config['results_dir'] + config['run'] + "/benchmarks/solve_network/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}"
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 4
|
|
|
|
resources: mem_mb=config['solving']['mem']
|
2020-07-30 06:27:33 +00:00
|
|
|
# group: "solve" # with group, threads is ignored https://bitbucket.org/snakemake/snakemake/issues/971/group-job-description-does-not-contain
|
2020-07-08 14:34:15 +00:00
|
|
|
script: "scripts/solve_network.py"
|
2020-07-30 06:27:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
if config["foresight"] == "myopic":
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
rule add_existing_baseyear:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
network=config['results_dir'] + config['run'] + '/prenetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc',
|
2020-08-10 18:30:29 +00:00
|
|
|
powerplants=pypsaeur('resources/powerplants.csv'),
|
2021-04-29 14:52:35 +00:00
|
|
|
busmap_s=pypsaeur("resources/busmap_elec_s{simpl}.csv"),
|
|
|
|
busmap=pypsaeur("resources/busmap_elec_s{simpl}_{clusters}.csv"),
|
|
|
|
clustered_pop_layout="resources/pop_layout_elec_s{simpl}_{clusters}.csv",
|
2020-07-30 06:27:33 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{}.csv".format(config['scenario']['planning_horizons'][0]),
|
2021-04-29 14:52:35 +00:00
|
|
|
cop_soil_total="resources/cop_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_total="resources/cop_air_total_elec_s{simpl}_{clusters}.nc"
|
|
|
|
output: config['results_dir'] + config['run'] + '/prenetworks-brownfield/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc'
|
2020-07-07 16:30:37 +00:00
|
|
|
wildcard_constraints:
|
|
|
|
planning_horizons=config['scenario']['planning_horizons'][0] #only applies to baseyear
|
|
|
|
threads: 1
|
2020-07-30 06:27:33 +00:00
|
|
|
resources: mem_mb=2000
|
2020-07-07 16:30:37 +00:00
|
|
|
script: "scripts/add_existing_baseyear.py"
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
def process_input(wildcards):
|
2020-08-11 09:41:53 +00:00
|
|
|
i = config["scenario"]["planning_horizons"].index(int(wildcards.planning_horizons))
|
2021-04-29 14:52:35 +00:00
|
|
|
return config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_" + str(config["scenario"]["planning_horizons"][i-1]) + ".nc"
|
2020-07-30 06:27:33 +00:00
|
|
|
|
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
rule add_brownfield:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
network=config['results_dir'] + config['run'] + '/prenetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc',
|
2020-07-07 16:30:37 +00:00
|
|
|
network_p=process_input, #solved network at previous time step
|
2020-07-30 06:27:33 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{planning_horizons}.csv",
|
2021-04-29 14:52:35 +00:00
|
|
|
cop_soil_total="resources/cop_soil_total_elec_s{simpl}_{clusters}.nc",
|
|
|
|
cop_air_total="resources/cop_air_total_elec_s{simpl}_{clusters}.nc"
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2021-04-29 14:52:35 +00:00
|
|
|
output: config['results_dir'] + config['run'] + "/prenetworks-brownfield/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
threads: 4
|
2020-11-30 12:21:38 +00:00
|
|
|
resources: mem_mb=10000
|
2020-07-07 16:30:37 +00:00
|
|
|
script: "scripts/add_brownfield.py"
|
|
|
|
|
2020-07-30 06:27:33 +00:00
|
|
|
ruleorder: add_existing_baseyear > add_brownfield
|
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
rule solve_network_myopic:
|
|
|
|
input:
|
2021-04-29 14:52:35 +00:00
|
|
|
network=config['results_dir'] + config['run'] + "/prenetworks-brownfield/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-30 06:27:33 +00:00
|
|
|
costs=config['costs_dir'] + "costs_{planning_horizons}.csv",
|
2020-08-11 09:41:53 +00:00
|
|
|
config=config['summary_dir'] + '/' + config['run'] + '/configs/config.yaml'
|
2021-04-29 14:52:35 +00:00
|
|
|
output: config['results_dir'] + config['run'] + "/postnetworks/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}.nc"
|
2020-07-07 16:30:37 +00:00
|
|
|
shadow: "shallow"
|
|
|
|
log:
|
2021-04-29 14:52:35 +00:00
|
|
|
solver=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
|
|
|
python=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
|
|
|
memory=config['results_dir'] + config['run'] + "/logs/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}_memory.log"
|
|
|
|
benchmark: config['results_dir'] + config['run'] + "/benchmarks/solve_network/elec_s{simpl}_{clusters}_lv{lv}_{opts}_{sector_opts}_{planning_horizons}"
|
2020-07-07 16:30:37 +00:00
|
|
|
threads: 4
|
|
|
|
resources: mem_mb=config['solving']['mem']
|
|
|
|
script: "scripts/solve_network.py"
|