2024-02-19 15:21:48 +00:00
|
|
|
# SPDX-FileCopyrightText: : 2023-2024 The PyPSA-Eur Authors
|
2023-03-08 16:29:01 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
if config["enable"].get("prepare_links_p_nom", False):
|
|
|
|
|
|
|
|
rule prepare_links_p_nom:
|
|
|
|
output:
|
|
|
|
"data/links_p_nom.csv",
|
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("prepare_links_p_nom.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=1500,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/prepare_links_p_nom.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-04-30 08:54:48 +00:00
|
|
|
|
2024-03-04 18:37:52 +00:00
|
|
|
rule build_electricity_demand:
|
|
|
|
params:
|
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 14:15:56 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2024-03-04 18:37:52 +00:00
|
|
|
countries=config_provider("countries"),
|
|
|
|
load=config_provider("load"),
|
|
|
|
input:
|
|
|
|
reported=ancient("data/electricity_demand_raw.csv"),
|
2024-03-15 13:28:01 +00:00
|
|
|
synthetic=lambda w: (
|
|
|
|
ancient("data/load_synthetic_raw.csv")
|
|
|
|
if config_provider("load", "supplement_synthetic")(w)
|
2024-03-04 18:38:29 +00:00
|
|
|
else []
|
|
|
|
),
|
2024-03-04 18:37:52 +00:00
|
|
|
output:
|
|
|
|
resources("electricity_demand.csv"),
|
|
|
|
log:
|
|
|
|
logs("build_electricity_demand.log"),
|
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/build_electricity_demand.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_powerplants:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
powerplants_filter=config_provider("electricity", "powerplants_filter"),
|
|
|
|
custom_powerplants=config_provider("electricity", "custom_powerplants"),
|
2024-02-10 16:22:01 +00:00
|
|
|
everywhere_powerplants=config_provider("electricity", "everywhere_powerplants"),
|
2023-08-15 13:02:41 +00:00
|
|
|
countries=config_provider("countries"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2023-08-23 15:14:57 +00:00
|
|
|
base_network=resources("networks/base.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
custom_powerplants="data/custom_powerplants.csv",
|
|
|
|
output:
|
2023-08-23 15:14:57 +00:00
|
|
|
resources("powerplants.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("build_powerplants.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
2024-07-01 12:33:29 +00:00
|
|
|
mem_mb=7000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_powerplants.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule base_network:
|
2023-06-30 09:29:46 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
countries=config_provider("countries"),
|
2024-02-17 16:16:28 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 14:15:56 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-08-15 13:02:41 +00:00
|
|
|
lines=config_provider("lines"),
|
|
|
|
links=config_provider("links"),
|
|
|
|
transformers=config_provider("transformers"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
|
|
|
eg_buses="data/entsoegridkit/buses.csv",
|
|
|
|
eg_lines="data/entsoegridkit/lines.csv",
|
|
|
|
eg_links="data/entsoegridkit/links.csv",
|
|
|
|
eg_converters="data/entsoegridkit/converters.csv",
|
|
|
|
eg_transformers="data/entsoegridkit/transformers.csv",
|
|
|
|
parameter_corrections="data/parameter_corrections.yaml",
|
|
|
|
links_p_nom="data/links_p_nom.csv",
|
|
|
|
links_tyndp="data/links_tyndp.csv",
|
2023-08-23 15:14:57 +00:00
|
|
|
country_shapes=resources("country_shapes.geojson"),
|
|
|
|
offshore_shapes=resources("offshore_shapes.geojson"),
|
|
|
|
europe_shape=resources("europe_shape.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-05-03 12:50:14 +00:00
|
|
|
base_network=resources("networks/base.nc"),
|
|
|
|
regions_onshore=resources("regions_onshore.geojson"),
|
|
|
|
regions_offshore=resources("regions_offshore.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("base_network.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2023-08-23 15:14:57 +00:00
|
|
|
benchmarks("base_network")
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=1500,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/base_network.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_shapes:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
countries=config_provider("countries"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2023-03-08 17:03:49 +00:00
|
|
|
naturalearth=ancient("data/bundle/naturalearth/ne_10m_admin_0_countries.shp"),
|
|
|
|
eez=ancient("data/bundle/eez/World_EEZ_v8_2014.shp"),
|
|
|
|
nuts3=ancient("data/bundle/NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp"),
|
|
|
|
nuts3pop=ancient("data/bundle/nama_10r_3popgdp.tsv.gz"),
|
|
|
|
nuts3gdp=ancient("data/bundle/nama_10r_3gdp.tsv.gz"),
|
2024-04-15 12:48:34 +00:00
|
|
|
ch_cantons=ancient("data/ch_cantons.csv"),
|
2023-03-08 17:03:49 +00:00
|
|
|
ch_popgdp=ancient("data/bundle/je-e-21.03.02.xls"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2023-08-23 15:14:57 +00:00
|
|
|
country_shapes=resources("country_shapes.geojson"),
|
|
|
|
offshore_shapes=resources("offshore_shapes.geojson"),
|
|
|
|
europe_shape=resources("europe_shape.geojson"),
|
|
|
|
nuts3_shapes=resources("nuts3_shapes.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("build_shapes.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=1500,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_shapes.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
if config["enable"].get("build_cutout", False):
|
|
|
|
|
|
|
|
rule build_cutout:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2024-02-17 16:16:28 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2023-08-15 13:02:41 +00:00
|
|
|
cutouts=config_provider("atlite", "cutouts"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2023-08-23 15:14:57 +00:00
|
|
|
regions_onshore=resources("regions_onshore.geojson"),
|
|
|
|
regions_offshore=resources("regions_offshore.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2023-03-08 16:56:50 +00:00
|
|
|
protected("cutouts/" + CDIR + "{cutout}.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-02-16 10:17:00 +00:00
|
|
|
logs(CDIR + "build_cutout/{cutout}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
|
|
|
"benchmarks/" + CDIR + "build_cutout_{cutout}"
|
2024-02-16 10:17:00 +00:00
|
|
|
threads: config["atlite"].get("nprocesses", 4)
|
2023-03-08 16:29:01 +00:00
|
|
|
resources:
|
2024-02-16 10:17:00 +00:00
|
|
|
mem_mb=config["atlite"].get("nprocesses", 4) * 1000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_cutout.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_ship_raster:
|
|
|
|
input:
|
|
|
|
ship_density="data/shipdensity_global.zip",
|
2024-03-01 10:45:39 +00:00
|
|
|
cutout=lambda w: "cutouts/"
|
|
|
|
+ CDIR
|
|
|
|
+ config_provider("atlite", "default_cutout")(w)
|
|
|
|
+ ".nc",
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2023-08-23 15:14:57 +00:00
|
|
|
resources("shipdensity_raster.tif"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("build_ship_raster.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
|
|
|
benchmark:
|
2023-08-23 15:14:57 +00:00
|
|
|
benchmarks("build_ship_raster")
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_ship_raster.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
2023-08-01 06:42:47 +00:00
|
|
|
rule determine_availability_matrix_MD_UA:
|
|
|
|
input:
|
2023-12-29 10:29:01 +00:00
|
|
|
copernicus="data/Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif",
|
|
|
|
wdpa="data/WDPA.gpkg",
|
|
|
|
wdpa_marine="data/WDPA_WDOECM_marine.gpkg",
|
2023-08-01 06:43:45 +00:00
|
|
|
gebco=lambda w: (
|
2024-04-15 12:48:34 +00:00
|
|
|
"data/bundle/gebco/GEBCO_2014_2D.nc"
|
2024-02-10 17:09:23 +00:00
|
|
|
if config_provider("renewable", w.technology)(w).get("max_depth")
|
2023-08-01 06:43:45 +00:00
|
|
|
else []
|
|
|
|
),
|
2023-10-09 14:19:31 +00:00
|
|
|
ship_density=lambda w: (
|
2024-02-10 17:09:23 +00:00
|
|
|
resources("shipdensity_raster.tif")
|
|
|
|
if "ship_threshold" in config_provider("renewable", w.technology)(w).keys()
|
2023-10-09 14:19:31 +00:00
|
|
|
else []
|
|
|
|
),
|
2024-02-10 17:09:23 +00:00
|
|
|
country_shapes=resources("country_shapes.geojson"),
|
|
|
|
offshore_shapes=resources("offshore_shapes.geojson"),
|
2023-08-01 06:43:45 +00:00
|
|
|
regions=lambda w: (
|
2024-02-10 17:09:23 +00:00
|
|
|
resources("regions_onshore.geojson")
|
2024-04-25 09:28:33 +00:00
|
|
|
if w.technology in ("onwind", "solar", "solar-hsat")
|
2024-02-10 17:09:23 +00:00
|
|
|
else resources("regions_offshore.geojson")
|
2023-08-01 06:43:45 +00:00
|
|
|
),
|
|
|
|
cutout=lambda w: "cutouts/"
|
|
|
|
+ CDIR
|
2024-02-10 17:09:23 +00:00
|
|
|
+ config_provider("renewable", w.technology, "cutout")(w)
|
2023-08-01 06:43:45 +00:00
|
|
|
+ ".nc",
|
2023-08-01 06:42:47 +00:00
|
|
|
output:
|
2024-02-10 17:09:23 +00:00
|
|
|
availability_matrix=resources("availability_matrix_MD-UA_{technology}.nc"),
|
|
|
|
availability_map=resources("availability_matrix_MD-UA_{technology}.png"),
|
2023-08-01 06:42:47 +00:00
|
|
|
log:
|
2024-02-10 17:09:23 +00:00
|
|
|
logs("determine_availability_matrix_MD_UA_{technology}.log"),
|
2024-02-16 10:17:00 +00:00
|
|
|
threads: config["atlite"].get("nprocesses", 4)
|
2023-08-01 06:42:47 +00:00
|
|
|
resources:
|
2024-02-16 10:17:00 +00:00
|
|
|
mem_mb=config["atlite"].get("nprocesses", 4) * 5000,
|
2023-08-01 06:42:47 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
2023-08-01 07:45:14 +00:00
|
|
|
"../scripts/determine_availability_matrix_MD_UA.py"
|
2023-08-01 06:42:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Optional input when having Ukraine (UA) or Moldova (MD) in the countries list
|
2024-02-17 16:38:46 +00:00
|
|
|
def input_ua_md_availability_matrix(w):
|
|
|
|
countries = set(config_provider("countries")(w))
|
|
|
|
if {"UA", "MD"}.intersection(countries):
|
|
|
|
return {
|
|
|
|
"availability_matrix_MD_UA": resources(
|
|
|
|
"availability_matrix_MD-UA_{technology}.nc"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
return {}
|
2023-08-01 06:42:47 +00:00
|
|
|
|
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule build_renewable_profiles:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2024-02-17 16:16:28 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 13:30:50 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-08-15 13:02:41 +00:00
|
|
|
renewable=config_provider("renewable"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-02-17 16:38:46 +00:00
|
|
|
unpack(input_ua_md_availability_matrix),
|
2023-08-23 15:14:57 +00:00
|
|
|
base_network=resources("networks/base.nc"),
|
2023-03-08 17:03:49 +00:00
|
|
|
corine=ancient("data/bundle/corine/g250_clc06_V18_5.tif"),
|
2023-03-08 16:29:01 +00:00
|
|
|
natura=lambda w: (
|
2024-04-15 12:48:34 +00:00
|
|
|
"data/bundle/natura/natura.tiff"
|
2023-08-17 10:31:07 +00:00
|
|
|
if config_provider("renewable", w.technology, "natura")(w)
|
2023-03-08 16:29:01 +00:00
|
|
|
else []
|
|
|
|
),
|
2024-01-03 14:01:43 +00:00
|
|
|
luisa=lambda w: (
|
|
|
|
"data/LUISA_basemap_020321_50m.tif"
|
2024-02-17 19:43:11 +00:00
|
|
|
if config_provider("renewable", w.technology, "luisa")(w)
|
2023-03-08 16:29:01 +00:00
|
|
|
else []
|
|
|
|
),
|
2023-03-08 18:26:41 +00:00
|
|
|
gebco=ancient(
|
|
|
|
lambda w: (
|
2024-04-15 12:48:34 +00:00
|
|
|
"data/bundle/gebco/GEBCO_2014_2D.nc"
|
2023-11-06 15:38:03 +00:00
|
|
|
if (
|
2024-05-10 11:29:58 +00:00
|
|
|
config_provider("renewable", w.technology)(w).get("max_depth")
|
|
|
|
or config_provider("renewable", w.technology)(w).get("min_depth")
|
2023-11-06 15:38:03 +00:00
|
|
|
)
|
2023-03-08 18:26:41 +00:00
|
|
|
else []
|
|
|
|
)
|
|
|
|
),
|
2023-03-08 16:29:01 +00:00
|
|
|
ship_density=lambda w: (
|
2023-08-23 15:14:57 +00:00
|
|
|
resources("shipdensity_raster.tif")
|
2023-08-17 10:31:07 +00:00
|
|
|
if "ship_threshold" in config_provider("renewable", w.technology)(w).keys()
|
2023-03-08 16:29:01 +00:00
|
|
|
else []
|
|
|
|
),
|
2023-08-23 15:14:57 +00:00
|
|
|
country_shapes=resources("country_shapes.geojson"),
|
|
|
|
offshore_shapes=resources("offshore_shapes.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
regions=lambda w: (
|
2023-08-23 15:14:57 +00:00
|
|
|
resources("regions_onshore.geojson")
|
2024-04-25 09:30:42 +00:00
|
|
|
if w.technology in ("onwind", "solar", "solar-hsat")
|
2023-08-23 15:14:57 +00:00
|
|
|
else resources("regions_offshore.geojson")
|
2023-03-08 16:29:01 +00:00
|
|
|
),
|
|
|
|
cutout=lambda w: "cutouts/"
|
|
|
|
+ CDIR
|
2023-08-17 10:31:07 +00:00
|
|
|
+ config_provider("renewable", w.technology, "cutout")(w)
|
2023-03-08 16:29:01 +00:00
|
|
|
+ ".nc",
|
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
profile=resources("profile_{technology}.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("build_renewable_profile_{technology}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 16:48:56 +00:00
|
|
|
benchmarks("build_renewable_profiles_{technology}")
|
2024-02-16 10:17:00 +00:00
|
|
|
threads: config["atlite"].get("nprocesses", 4)
|
2023-03-08 16:29:01 +00:00
|
|
|
resources:
|
2024-02-16 10:17:00 +00:00
|
|
|
mem_mb=config["atlite"].get("nprocesses", 4) * 5000,
|
2023-03-08 16:29:01 +00:00
|
|
|
wildcard_constraints:
|
|
|
|
technology="(?!hydro).*", # Any technology other than hydro
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_renewable_profiles.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
2023-05-16 11:49:03 +00:00
|
|
|
rule build_monthly_prices:
|
|
|
|
input:
|
|
|
|
co2_price_raw="data/validation/emission-spot-primary-market-auction-report-2019-data.xls",
|
2023-06-29 06:11:11 +00:00
|
|
|
fuel_price_raw="data/validation/energy-price-trends-xlsx-5619002.xlsx",
|
2023-05-16 11:49:03 +00:00
|
|
|
output:
|
2023-08-23 15:14:57 +00:00
|
|
|
co2_price=resources("co2_price.csv"),
|
|
|
|
fuel_price=resources("monthly_fuel_price.csv"),
|
2023-05-16 11:49:03 +00:00
|
|
|
log:
|
2023-08-23 15:14:57 +00:00
|
|
|
logs("build_monthly_prices.log"),
|
2023-05-16 11:49:03 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/build_monthly_prices.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-06-29 06:11:11 +00:00
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule build_hydro_profile:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
hydro=config_provider("renewable", "hydro"),
|
|
|
|
countries=config_provider("countries"),
|
2024-03-14 13:08:58 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 13:30:50 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2023-08-23 15:14:57 +00:00
|
|
|
country_shapes=resources("country_shapes.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
eia_hydro_generation="data/eia_hydro_annual_generation.csv",
|
2023-04-29 10:40:55 +00:00
|
|
|
eia_hydro_capacity="data/eia_hydro_annual_capacity.csv",
|
|
|
|
era5_runoff="data/era5-annual-runoff-per-country.csv",
|
2024-02-12 15:56:00 +00:00
|
|
|
cutout=lambda w: f"cutouts/"
|
2024-02-10 17:09:46 +00:00
|
|
|
+ CDIR
|
2024-02-12 15:56:00 +00:00
|
|
|
+ config_provider("renewable", "hydro", "cutout")(w)
|
2024-02-10 17:09:46 +00:00
|
|
|
+ ".nc",
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
profile=resources("profile_hydro.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("build_hydro_profile.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/build_hydro_profile.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
2024-02-17 16:38:46 +00:00
|
|
|
rule build_line_rating:
|
|
|
|
params:
|
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 13:30:50 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2024-02-17 16:38:46 +00:00
|
|
|
input:
|
|
|
|
base_network=resources("networks/base.nc"),
|
2024-02-17 17:35:26 +00:00
|
|
|
cutout=lambda w: "cutouts/"
|
2024-02-17 16:38:46 +00:00
|
|
|
+ CDIR
|
2024-02-17 17:35:26 +00:00
|
|
|
+ config_provider("lines", "dynamic_line_rating", "cutout")(w)
|
2024-02-17 16:38:46 +00:00
|
|
|
+ ".nc",
|
|
|
|
output:
|
|
|
|
output=resources("networks/line_rating.nc"),
|
|
|
|
log:
|
|
|
|
logs("build_line_rating.log"),
|
|
|
|
benchmark:
|
|
|
|
benchmarks("build_line_rating")
|
|
|
|
threads: config["atlite"].get("nprocesses", 4)
|
|
|
|
resources:
|
|
|
|
mem_mb=config["atlite"].get("nprocesses", 4) * 1000,
|
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
|
|
|
script:
|
|
|
|
"../scripts/build_line_rating.py"
|
2023-06-02 14:59:06 +00:00
|
|
|
|
|
|
|
|
2024-02-12 15:56:00 +00:00
|
|
|
def input_profile_tech(w):
|
|
|
|
return {
|
2024-03-04 18:36:41 +00:00
|
|
|
f"profile_{tech}": resources(f"profile_{tech}.nc")
|
2024-02-12 15:56:00 +00:00
|
|
|
for tech in config_provider("electricity", "renewable_carriers")(w)
|
|
|
|
}
|
2023-06-29 09:42:01 +00:00
|
|
|
|
2024-02-12 15:56:00 +00:00
|
|
|
|
|
|
|
def input_conventional(w):
|
|
|
|
return {
|
|
|
|
f"conventional_{carrier}_{attr}": fn
|
|
|
|
for carrier, d in config_provider("conventional", default={None: {}})(w).items()
|
|
|
|
if carrier in config_provider("electricity", "conventional_carriers")(w)
|
|
|
|
for attr, fn in d.items()
|
|
|
|
if str(fn).startswith("data/")
|
|
|
|
}
|
2023-06-02 14:59:06 +00:00
|
|
|
|
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule add_electricity:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
length_factor=config_provider("lines", "length_factor"),
|
|
|
|
scaling_factor=config_provider("load", "scaling_factor"),
|
|
|
|
countries=config_provider("countries"),
|
2024-03-14 13:30:50 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2023-08-15 13:02:41 +00:00
|
|
|
renewable=config_provider("renewable"),
|
|
|
|
electricity=config_provider("electricity"),
|
|
|
|
conventional=config_provider("conventional"),
|
|
|
|
costs=config_provider("costs"),
|
2024-05-24 07:47:23 +00:00
|
|
|
foresight=config_provider("foresight"),
|
2024-03-01 09:10:26 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-02-12 15:56:00 +00:00
|
|
|
unpack(input_profile_tech),
|
|
|
|
unpack(input_conventional),
|
2023-08-23 15:14:57 +00:00
|
|
|
base_network=resources("networks/base.nc"),
|
2024-02-12 15:56:00 +00:00
|
|
|
line_rating=lambda w: (
|
2024-02-10 16:22:36 +00:00
|
|
|
resources("networks/line_rating.nc")
|
2024-02-12 15:56:00 +00:00
|
|
|
if config_provider("lines", "dynamic_line_rating", "activate")(w)
|
2024-02-10 16:22:36 +00:00
|
|
|
else resources("networks/base.nc")
|
|
|
|
),
|
2024-02-17 17:35:52 +00:00
|
|
|
tech_costs=lambda w: resources(
|
2024-05-13 19:38:59 +00:00
|
|
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
2024-02-17 17:35:52 +00:00
|
|
|
),
|
2023-08-23 15:14:57 +00:00
|
|
|
regions=resources("regions_onshore.geojson"),
|
|
|
|
powerplants=resources("powerplants.csv"),
|
2024-04-15 12:48:34 +00:00
|
|
|
hydro_capacities=ancient("data/hydro_capacities.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
|
2023-06-29 12:50:41 +00:00
|
|
|
unit_commitment="data/unit_commitment.csv",
|
2024-02-12 15:56:00 +00:00
|
|
|
fuel_price=lambda w: (
|
2024-02-10 16:22:36 +00:00
|
|
|
resources("monthly_fuel_price.csv")
|
2024-02-12 15:56:00 +00:00
|
|
|
if config_provider("conventional", "dynamic_fuel_price")(w)
|
2024-02-10 16:22:36 +00:00
|
|
|
else []
|
|
|
|
),
|
2024-03-04 16:48:56 +00:00
|
|
|
load=resources("electricity_demand.csv"),
|
2023-08-23 15:14:57 +00:00
|
|
|
nuts3_shapes=resources("nuts3_shapes.geojson"),
|
2023-08-01 06:43:45 +00:00
|
|
|
ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
resources("networks/elec.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("add_electricity.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 16:48:56 +00:00
|
|
|
benchmarks("add_electricity")
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
2023-07-05 09:07:36 +00:00
|
|
|
mem_mb=10000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/add_electricity.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule simplify_network:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
simplify_network=config_provider("clustering", "simplify_network"),
|
|
|
|
aggregation_strategies=config_provider(
|
|
|
|
"clustering", "aggregation_strategies", default={}
|
2023-12-06 09:10:05 +00:00
|
|
|
),
|
2024-02-10 16:22:01 +00:00
|
|
|
focus_weights=config_provider("clustering", "focus_weights", default=None),
|
2023-08-15 13:02:41 +00:00
|
|
|
renewable_carriers=config_provider("electricity", "renewable_carriers"),
|
|
|
|
max_hours=config_provider("electricity", "max_hours"),
|
|
|
|
length_factor=config_provider("lines", "length_factor"),
|
|
|
|
p_max_pu=config_provider("links", "p_max_pu", default=1.0),
|
|
|
|
costs=config_provider("costs"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-03-04 16:48:56 +00:00
|
|
|
network=resources("networks/elec.nc"),
|
2024-02-17 17:35:52 +00:00
|
|
|
tech_costs=lambda w: resources(
|
2024-05-13 19:38:59 +00:00
|
|
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
2024-02-17 17:35:52 +00:00
|
|
|
),
|
2023-08-23 15:14:57 +00:00
|
|
|
regions_onshore=resources("regions_onshore.geojson"),
|
|
|
|
regions_offshore=resources("regions_offshore.geojson"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
network=resources("networks/elec_s{simpl}.nc"),
|
|
|
|
regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"),
|
2024-03-04 18:36:41 +00:00
|
|
|
regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"),
|
2024-03-04 16:48:56 +00:00
|
|
|
busmap=resources("busmap_elec_s{simpl}.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("simplify_network/elec_s{simpl}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 16:48:56 +00:00
|
|
|
benchmarks("simplify_network/elec_s{simpl}")
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
2023-08-03 16:21:36 +00:00
|
|
|
mem_mb=12000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/simplify_network.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule cluster_network:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
cluster_network=config_provider("clustering", "cluster_network"),
|
|
|
|
aggregation_strategies=config_provider(
|
|
|
|
"clustering", "aggregation_strategies", default={}
|
|
|
|
),
|
|
|
|
custom_busmap=config_provider("enable", "custom_busmap", default=False),
|
2024-02-10 16:22:01 +00:00
|
|
|
focus_weights=config_provider("clustering", "focus_weights", default=None),
|
2023-08-15 13:02:41 +00:00
|
|
|
renewable_carriers=config_provider("electricity", "renewable_carriers"),
|
|
|
|
conventional_carriers=config_provider(
|
|
|
|
"electricity", "conventional_carriers", default=[]
|
2023-12-06 09:10:05 +00:00
|
|
|
),
|
2023-08-15 13:02:41 +00:00
|
|
|
max_hours=config_provider("electricity", "max_hours"),
|
|
|
|
length_factor=config_provider("lines", "length_factor"),
|
|
|
|
costs=config_provider("costs"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-03-04 16:48:56 +00:00
|
|
|
network=resources("networks/elec_s{simpl}.nc"),
|
|
|
|
regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"),
|
2024-03-04 18:36:41 +00:00
|
|
|
regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"),
|
2024-03-04 16:48:56 +00:00
|
|
|
busmap=ancient(resources("busmap_elec_s{simpl}.csv")),
|
2024-02-12 15:56:00 +00:00
|
|
|
custom_busmap=lambda w: (
|
2023-03-08 16:29:01 +00:00
|
|
|
"data/custom_busmap_elec_s{simpl}_{clusters}.csv"
|
2024-02-12 15:56:00 +00:00
|
|
|
if config_provider("enable", "custom_busmap", default=False)(w)
|
2023-03-08 16:29:01 +00:00
|
|
|
else []
|
|
|
|
),
|
2024-02-17 17:35:52 +00:00
|
|
|
tech_costs=lambda w: resources(
|
2024-05-13 19:38:59 +00:00
|
|
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
2024-02-17 17:35:52 +00:00
|
|
|
),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
2024-03-04 18:36:41 +00:00
|
|
|
regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
|
|
|
|
regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
|
2024-03-04 16:48:56 +00:00
|
|
|
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
|
|
|
|
linemap=resources("linemap_elec_s{simpl}_{clusters}.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("cluster_network/elec_s{simpl}_{clusters}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 16:48:56 +00:00
|
|
|
benchmarks("cluster_network/elec_s{simpl}_{clusters}")
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
2023-07-05 09:07:36 +00:00
|
|
|
mem_mb=10000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/cluster_network.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule add_extra_components:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-08-15 13:02:41 +00:00
|
|
|
extendable_carriers=config_provider("electricity", "extendable_carriers"),
|
|
|
|
max_hours=config_provider("electricity", "max_hours"),
|
|
|
|
costs=config_provider("costs"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-03-04 16:48:56 +00:00
|
|
|
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
2024-02-17 17:35:52 +00:00
|
|
|
tech_costs=lambda w: resources(
|
2024-05-13 19:38:59 +00:00
|
|
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
2024-02-17 17:35:52 +00:00
|
|
|
),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 16:48:56 +00:00
|
|
|
logs("add_extra_components/elec_s{simpl}_{clusters}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 16:48:56 +00:00
|
|
|
benchmarks("add_extra_components/elec_s{simpl}_{clusters}_ec")
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
2023-07-05 09:07:36 +00:00
|
|
|
mem_mb=4000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:44:25 +00:00
|
|
|
"../scripts/add_extra_components.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule prepare_network:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2024-02-17 16:16:28 +00:00
|
|
|
time_resolution=config_provider("clustering", "temporal", "resolution_elec"),
|
2023-08-15 13:02:41 +00:00
|
|
|
links=config_provider("links"),
|
|
|
|
lines=config_provider("lines"),
|
|
|
|
co2base=config_provider("electricity", "co2base"),
|
2024-02-10 16:22:01 +00:00
|
|
|
co2limit_enable=config_provider("electricity", "co2limit_enable", default=False),
|
2023-08-15 13:02:41 +00:00
|
|
|
co2limit=config_provider("electricity", "co2limit"),
|
2024-02-10 16:22:01 +00:00
|
|
|
gaslimit_enable=config_provider("electricity", "gaslimit_enable", default=False),
|
2023-08-15 13:02:41 +00:00
|
|
|
gaslimit=config_provider("electricity", "gaslimit"),
|
|
|
|
max_hours=config_provider("electricity", "max_hours"),
|
|
|
|
costs=config_provider("costs"),
|
2024-02-17 17:35:26 +00:00
|
|
|
adjustments=config_provider("adjustments", "electricity"),
|
2024-02-10 16:22:01 +00:00
|
|
|
autarky=config_provider("electricity", "autarky", default={}),
|
2024-03-14 14:38:36 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-03-04 16:48:56 +00:00
|
|
|
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
2024-02-17 17:35:52 +00:00
|
|
|
tech_costs=lambda w: resources(
|
2024-05-13 19:38:59 +00:00
|
|
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
2024-02-17 17:35:52 +00:00
|
|
|
),
|
2024-02-10 16:22:01 +00:00
|
|
|
co2_price=lambda w: resources("co2_price.csv") if "Ept" in w.opts else [],
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-04 16:48:56 +00:00
|
|
|
resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
log:
|
2024-03-04 18:36:41 +00:00
|
|
|
logs("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-03-04 18:36:41 +00:00
|
|
|
(benchmarks("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"))
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
2023-03-08 18:26:41 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 18:26:41 +00:00
|
|
|
"../scripts/prepare_network.py"
|