2023-02-16 10:50:55 +00:00
|
|
|
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
|
2020-05-29 07:50:55 +00:00
|
|
|
#
|
2021-09-14 14:37:41 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2020-05-29 07:50:55 +00:00
|
|
|
|
2019-11-28 15:33:33 +00:00
|
|
|
from os.path import normpath, exists
|
2022-02-22 18:34:47 +00:00
|
|
|
from shutil import copyfile, move
|
2019-11-28 15:33:33 +00:00
|
|
|
|
2021-04-27 12:54:54 +00:00
|
|
|
from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2021-04-27 12:54:54 +00:00
|
|
|
HTTP = HTTPRemoteProvider()
|
|
|
|
|
2023-02-16 10:51:39 +00:00
|
|
|
if not exists("config.yaml"):
|
|
|
|
copyfile("config.default.yaml", "config.yaml")
|
2019-11-22 14:13:46 +00:00
|
|
|
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
configfile: "config.yaml"
|
|
|
|
|
2023-03-07 17:24:47 +00:00
|
|
|
|
2023-03-07 17:11:59 +00:00
|
|
|
COSTS = f"data/costs_{config['costs']['year']}.csv"
|
|
|
|
ATLITE_NPROCESSES = config["atlite"].get("nprocesses", 4)
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2022-09-08 07:52:00 +00:00
|
|
|
run = config.get("run", {})
|
2022-09-13 07:47:11 +00:00
|
|
|
RDIR = run["name"] + "/" if run.get("name") else ""
|
2022-09-13 12:51:36 +00:00
|
|
|
CDIR = RDIR if not run.get("shared_cutouts") else ""
|
2022-09-08 07:52:00 +00:00
|
|
|
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS = "logs/" + RDIR
|
|
|
|
BENCHMARKS = "benchmarks/" + RDIR
|
2023-03-07 19:37:47 +00:00
|
|
|
RESOURCES = "resources/" + RDIR if not run.get("shared_resources") else "resources/"
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS = "results/" + RDIR
|
2018-10-25 14:43:24 +00:00
|
|
|
|
2022-09-08 07:52:00 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
wildcard_constraints:
|
2023-03-06 16:41:09 +00:00
|
|
|
simpl="[a-zA-Z0-9]*",
|
2023-03-06 16:41:48 +00:00
|
|
|
clusters="[0-9]+m?|all",
|
2023-03-06 16:41:09 +00:00
|
|
|
ll="(v|c)([0-9\.]+|opt)",
|
2019-06-18 09:50:54 +00:00
|
|
|
opts="[-+a-zA-Z0-9\.]*",
|
2023-03-06 18:44:57 +00:00
|
|
|
sector_opts="[-+a-zA-Z0-9\.\s]*",
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2019-02-03 13:00:45 +00:00
|
|
|
|
2020-12-05 16:54:50 +00:00
|
|
|
rule cluster_all_networks:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
2023-03-07 17:24:47 +00:00
|
|
|
expand(RESOURCES + "networks/elec_s{simpl}_{clusters}.nc", **config["scenario"]),
|
2020-01-09 13:09:28 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-05 16:54:50 +00:00
|
|
|
rule extra_components_all_networks:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
|
|
|
expand(
|
2023-03-07 17:24:47 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc", **config["scenario"]
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2020-01-09 13:09:28 +00:00
|
|
|
|
2020-12-05 16:54:50 +00:00
|
|
|
rule prepare_all_networks:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
|
|
|
expand(
|
2023-03-07 17:24:47 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
**config["scenario"]
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2019-04-17 09:44:16 +00:00
|
|
|
rule prepare_sector_networks:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
2019-04-16 14:03:51 +00:00
|
|
|
|
2023-01-07 12:23:12 +00:00
|
|
|
|
2023-03-06 10:54:08 +00:00
|
|
|
rule all:
|
2023-03-06 18:44:57 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "graphs/costs.pdf",
|
2023-03-06 10:54:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule solve_all_elec_networks:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
|
|
|
expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
**config["scenario"]
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2023-03-06 10:54:08 +00:00
|
|
|
rule solve_all_networks:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
**config["scenario"]
|
2023-03-06 10:54:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
|
2023-01-07 12:23:12 +00:00
|
|
|
rule plot_all_networks:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
2023-01-07 12:23:12 +00:00
|
|
|
|
|
|
|
|
2019-11-19 14:56:44 +00:00
|
|
|
if config["enable"].get("prepare_links_p_nom", False):
|
2018-01-30 22:48:29 +00:00
|
|
|
|
2018-08-13 12:09:20 +00:00
|
|
|
rule prepare_links_p_nom:
|
|
|
|
output:
|
|
|
|
"data/links_p_nom.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "prepare_links_p_nom.log",
|
2018-08-13 12:09:20 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
2022-12-27 11:16:02 +00:00
|
|
|
mem_mb=1500,
|
2018-08-13 12:09:20 +00:00
|
|
|
script:
|
|
|
|
"scripts/prepare_links_p_nom.py"
|
2022-09-16 13:04:04 +00:00
|
|
|
|
|
|
|
|
2019-11-05 11:53:21 +00:00
|
|
|
datafiles = [
|
|
|
|
"ch_cantons.csv",
|
|
|
|
"je-e-21.03.02.xls",
|
2022-03-28 10:02:08 +00:00
|
|
|
"eez/World_EEZ_v8_2014.shp",
|
2019-11-05 11:53:21 +00:00
|
|
|
"hydro_capacities.csv",
|
|
|
|
"naturalearth/ne_10m_admin_0_countries.shp",
|
|
|
|
"NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp",
|
|
|
|
"nama_10r_3popgdp.tsv.gz",
|
2022-08-02 13:56:47 +00:00
|
|
|
"nama_10r_3gdp.tsv.gz",
|
|
|
|
"corine/g250_clc06_V18_5.tif",
|
|
|
|
]
|
2022-09-16 13:04:04 +00:00
|
|
|
|
|
|
|
|
2019-11-19 14:56:44 +00:00
|
|
|
if not config.get("tutorial", False):
|
2019-11-06 16:50:57 +00:00
|
|
|
datafiles.extend(["natura/Natura2000_end2015.shp", "GEBCO_2014_2D.nc"])
|
2019-11-05 11:53:21 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2019-11-19 14:56:44 +00:00
|
|
|
if config["enable"].get("retrieve_databundle", True):
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2019-11-19 14:56:44 +00:00
|
|
|
rule retrieve_databundle:
|
2020-12-03 18:50:53 +00:00
|
|
|
output:
|
|
|
|
expand("data/bundle/{file}", file=datafiles),
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "retrieve_databundle.log",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
2019-11-19 14:56:44 +00:00
|
|
|
script:
|
|
|
|
"scripts/retrieve_databundle.py"
|
2019-11-05 11:53:21 +00:00
|
|
|
|
2020-08-25 19:41:21 +00:00
|
|
|
|
2021-11-10 09:37:09 +00:00
|
|
|
rule retrieve_load_data:
|
|
|
|
input:
|
|
|
|
HTTP.remote(
|
|
|
|
"data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv",
|
|
|
|
keep_local=True,
|
|
|
|
static=True,
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2021-11-10 09:37:09 +00:00
|
|
|
output:
|
|
|
|
"data/load_raw.csv",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-16 11:33:38 +00:00
|
|
|
run:
|
|
|
|
move(input[0], output[0])
|
2021-11-10 09:37:09 +00:00
|
|
|
|
|
|
|
|
2020-12-03 11:49:04 +00:00
|
|
|
rule build_load_data:
|
2021-11-10 09:37:09 +00:00
|
|
|
input:
|
|
|
|
"data/load_raw.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "load.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_load_data.log",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2020-12-03 11:49:04 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_load_data.py"
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2020-08-25 19:41:21 +00:00
|
|
|
|
2019-10-31 15:45:13 +00:00
|
|
|
rule build_powerplants:
|
2019-11-06 14:59:34 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
base_network=RESOURCES + "networks/base.nc",
|
2019-11-06 14:59:34 +00:00
|
|
|
custom_powerplants="data/custom_powerplants.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "powerplants.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_powerplants.log",
|
2019-10-31 15:45:13 +00:00
|
|
|
threads: 1
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2019-10-31 15:45:13 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_powerplants.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
rule base_network:
|
|
|
|
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",
|
2018-08-03 09:49:23 +00:00
|
|
|
links_p_nom="data/links_p_nom.csv",
|
2018-09-24 18:19:47 +00:00
|
|
|
links_tyndp="data/links_tyndp.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
country_shapes=RESOURCES + "country_shapes.geojson",
|
|
|
|
offshore_shapes=RESOURCES + "offshore_shapes.geojson",
|
|
|
|
europe_shape=RESOURCES + "europe_shape.geojson",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/base.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "base_network.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "base_network"
|
2017-12-18 19:34:15 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
2022-12-27 11:16:02 +00:00
|
|
|
mem_mb=1500,
|
2017-12-18 19:34:15 +00:00
|
|
|
script:
|
|
|
|
"scripts/base_network.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-08-03 09:49:23 +00:00
|
|
|
rule build_shapes:
|
|
|
|
input:
|
|
|
|
naturalearth="data/bundle/naturalearth/ne_10m_admin_0_countries.shp",
|
|
|
|
eez="data/bundle/eez/World_EEZ_v8_2014.shp",
|
|
|
|
nuts3="data/bundle/NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp",
|
|
|
|
nuts3pop="data/bundle/nama_10r_3popgdp.tsv.gz",
|
|
|
|
nuts3gdp="data/bundle/nama_10r_3gdp.tsv.gz",
|
|
|
|
ch_cantons="data/bundle/ch_cantons.csv",
|
|
|
|
ch_popgdp="data/bundle/je-e-21.03.02.xls",
|
|
|
|
output:
|
2023-03-07 17:11:59 +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",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_shapes.log",
|
2018-08-03 09:49:23 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
2022-12-27 11:16:02 +00:00
|
|
|
mem_mb=1500,
|
2018-08-03 09:49:23 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_shapes.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-01-29 21:28:33 +00:00
|
|
|
rule build_bus_regions:
|
2017-12-18 19:34:15 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
country_shapes=RESOURCES + "country_shapes.geojson",
|
|
|
|
offshore_shapes=RESOURCES + "offshore_shapes.geojson",
|
|
|
|
base_network=RESOURCES + "networks/base.nc",
|
2018-01-29 21:28:33 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore.geojson",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_bus_regions.log",
|
2020-12-03 18:50:53 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
2018-01-29 21:28:33 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_bus_regions.py"
|
2022-09-16 13:04:04 +00:00
|
|
|
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
if config["enable"].get("build_cutout", False):
|
2018-01-29 21:28:33 +00:00
|
|
|
|
2019-11-05 11:53:21 +00:00
|
|
|
rule build_cutout:
|
Atlite availability (#224)
* adjust buil_cutout.py and Snakefile
* try adjusting build_renewable_profiles, currently crashing due to weird pyproj error
* build_renewable_profiles: -remove printing gid
* build_renewable_profiles: use dask for paralellization, use dense functions
* build_renewable_profiles:
- revise imports
- add logging for long calculation
- revise explaining comment
- revise distance calculation
* build profiles: adjust to cutout.grid
* * fix area to square km
* rename potmatrix -> capacity_potential
* rename available to availibility
* config.default update cutout params
build_renewable_potentials: major refactoring and simplification
hydro_profiles: update code
* build profiles: fix weight output dimensions
* build profiles: fix typo, fix selection of buses
* build profiles: reinsert paths variable
* follow up
* build profiles: move to dask calculation only
* CI: set build cutout to true (add CDSAPI)
* build profiles: use pyproj, test with gleas and geokit upstream
* environment.yaml fix atlite version
* build profiles: use dask 'processes' for more than 25 regions
* build profiles: specify dask scheduler according to number of regions
* backpedal a bit, only allow scheduler='processes'
* follow up, code style and fixup
* build profiles: add logger info for underwater fraction calc
* config adjust cutout parameters
Snakefile fixup
* config.default.yaml: adjust resolution
* config: use one cutout in total
build_cutout: automatic detetection of geographical boundaries
* env: add python>=3.8 requirement
build_cutout: fixup for region bound
* config: allow base cutout
* folllow up, fix up
* follow up II
* clean up
* clean up II
* build profiles: move back to multiprocessing due to performance issues
* small code style corrections
* move in pool context
* swqitch to ratsterio
* switch to rasterio for availibility calculation
* tiny fixup
* * build continental raster for offshore distance calculation
* adjust Snakefile to new script build_raster
* rename continental raster to onshore raster
add projected_mask function (not yet tested)
add docstrings, modularize
* Snakefile: remove build_onhore_raster rule, build mask directly from geometry instead
build_natura_raster: adjust code, add function for exporting
build_profiles:
* add buffer to shore distance to init_globals function
* update docstrings
* improve handling of nodata grid codes
* add geometry mask if natura raster not activated
(the 255 value is an 'eligible' value for the corine data base,
do this for excluding data outside the shape)
* build_profiles: adjust docstrings
* update environment
* build profiles: fixup reproject woth padding
* follow up, small fixups
* fix resampling method
checkpoint: reproduces solar profile in tut data
* reintegrate plot map
code style
* config: rename cutout into "base"
* build profiles: adjust to new atlite code
* natura raster: small fixup
* build natura raster: compress tiff file
* config: adjust cutout names
* build profiles: cover case if no or partial overlap between natura raster and cutout
* config-tutorial: adjust cutout params
* buid-profifiles: fixup in gebco filter
* follow up
* update config files
* build profiles: select layoutmatrix != 0
* build profiles: speed up average_distance and underwaterfraction
* build profiles: fix typo
* update release notes
build_cutout: only build needed features
* update envs
* config: add temperature to sarah features
* temporary fix for atlite v0.2.1 and new xarray version release
* env: remove xarray specification
* * remove rule build_country_flh
* build profiles: remove sneaked in line
* doc: update configuration.rst (section atlite) and corresponding csv table
* release notes: fix quotes
* build profiles: use 3035 for area calculation
* Update envs/environment.docs.yaml
* Update scripts/build_cutout.py
* Update doc/release_notes.rst
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* Update doc/configuration.rst
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* Update scripts/build_cutout.py
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* update release notes
* release notes: add deprecation of 'keep_all_available_areas'
build profiles: remove warning for 'keep_all_available_areas'
* build cutout: rearrage code, set buffer correctly
* Rename tutorial cutout to remove name clash with real cutout.
* Update release_notes.rst: Rename tutorial cutout.
* retrieve: update cutouts and downloads (alternative) (#237)
* retrieve: update cutouts and downloads
* retrieve: remove unnecessary import
* use snakemake remote file functionality
* Snakefile: update zenodo link
* update natura remote link (closes #234)
* env: update atlite version to 0.2.2
* env: fix dask version due to memory issues
* test: retrieve cutout instead of build
* test: use tutorial cutout for CI
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-04-27 15:58:31 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore.geojson",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
|
|
|
"cutouts/" + CDIR + "{cutout}.nc",
|
|
|
|
log:
|
|
|
|
"logs/" + CDIR + "build_cutout/{cutout}.log",
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/" + CDIR + "build_cutout_{cutout}"
|
2020-12-03 18:50:53 +00:00
|
|
|
threads: ATLITE_NPROCESSES
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=ATLITE_NPROCESSES * 1000,
|
2019-11-05 11:53:21 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_cutout.py"
|
2020-03-16 14:51:47 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2020-03-16 14:51:47 +00:00
|
|
|
if config["enable"].get("retrieve_cutout", True):
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2019-11-05 11:53:21 +00:00
|
|
|
rule retrieve_cutout:
|
2022-03-24 14:51:36 +00:00
|
|
|
input:
|
|
|
|
HTTP.remote(
|
|
|
|
"zenodo.org/record/6382570/files/{cutout}.nc",
|
|
|
|
keep_local=True,
|
|
|
|
static=True,
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
|
|
|
"cutouts/" + CDIR + "{cutout}.nc",
|
|
|
|
log:
|
|
|
|
"logs/" + CDIR + "retrieve_cutout_{cutout}.log",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-16 11:33:38 +00:00
|
|
|
run:
|
|
|
|
move(input[0], output[0])
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2020-08-26 08:06:10 +00:00
|
|
|
if config["enable"].get("retrieve_cost_data", True):
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2020-08-26 08:06:10 +00:00
|
|
|
rule retrieve_cost_data:
|
2022-06-27 08:35:39 +00:00
|
|
|
input:
|
|
|
|
HTTP.remote(
|
2023-03-06 18:44:57 +00:00
|
|
|
"raw.githubusercontent.com/PyPSA/technology-data/{}/outputs/".format(
|
|
|
|
config["costs"]["version"]
|
|
|
|
)
|
|
|
|
+ "costs_{year}.csv",
|
2022-06-27 08:35:39 +00:00
|
|
|
keep_local=True,
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2020-08-26 08:06:10 +00:00
|
|
|
output:
|
2023-03-06 16:46:29 +00:00
|
|
|
"data/costs_{year}.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-06 16:46:29 +00:00
|
|
|
"logs/retrieve_cost_data_{year}.log",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
2023-03-06 14:18:30 +00:00
|
|
|
mem_mb=1000,
|
2022-09-16 11:33:38 +00:00
|
|
|
run:
|
|
|
|
move(input[0], output[0])
|
2020-08-25 19:41:21 +00:00
|
|
|
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2022-06-27 17:00:41 +00:00
|
|
|
if config["enable"].get("build_natura_raster", False):
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2022-06-27 17:00:41 +00:00
|
|
|
rule build_natura_raster:
|
|
|
|
input:
|
|
|
|
natura="data/bundle/natura/Natura2000_end2015.shp",
|
2022-09-08 07:52:00 +00:00
|
|
|
cutouts=expand("cutouts/" + CDIR + "{cutouts}.nc", **config["atlite"]),
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "natura.tiff",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_natura_raster.log",
|
2022-06-27 17:00:41 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_natura_raster.py"
|
2022-09-16 13:04:04 +00:00
|
|
|
|
2022-06-27 17:00:41 +00:00
|
|
|
|
|
|
|
if config["enable"].get("retrieve_natura_raster", True):
|
|
|
|
|
|
|
|
rule retrieve_natura_raster:
|
|
|
|
input:
|
|
|
|
HTTP.remote(
|
|
|
|
"zenodo.org/record/4706686/files/natura.tiff",
|
|
|
|
keep_local=True,
|
|
|
|
static=True,
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "natura.tiff",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-16 11:33:38 +00:00
|
|
|
run:
|
|
|
|
move(input[0], output[0])
|
2022-06-27 17:00:41 +00:00
|
|
|
|
|
|
|
|
2022-08-02 13:56:47 +00:00
|
|
|
rule retrieve_ship_raster:
|
|
|
|
input:
|
|
|
|
HTTP.remote(
|
|
|
|
"https://zenodo.org/record/6953563/files/shipdensity_global.zip",
|
|
|
|
keep_local=True,
|
|
|
|
static=True,
|
2022-09-16 13:04:04 +00:00
|
|
|
),
|
2022-08-02 13:56:47 +00:00
|
|
|
output:
|
|
|
|
"data/shipdensity_global.zip",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-16 11:33:38 +00:00
|
|
|
run:
|
|
|
|
move(input[0], output[0])
|
2022-07-28 08:38:24 +00:00
|
|
|
|
|
|
|
|
2022-08-02 13:56:47 +00:00
|
|
|
rule build_ship_raster:
|
|
|
|
input:
|
|
|
|
ship_density="data/shipdensity_global.zip",
|
2023-03-06 14:43:45 +00:00
|
|
|
cutouts=expand(
|
|
|
|
"cutouts/" + CDIR + "{cutout}.nc",
|
|
|
|
cutout=[
|
|
|
|
config["renewable"][k]["cutout"]
|
|
|
|
for k in config["electricity"]["renewable_carriers"]
|
|
|
|
],
|
|
|
|
),
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "shipdensity_raster.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_ship_raster.log",
|
2022-08-11 08:10:35 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "build_ship_raster"
|
2022-08-02 13:56:47 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_ship_raster.py"
|
|
|
|
|
2022-07-28 08:38:24 +00:00
|
|
|
|
2018-01-29 21:28:33 +00:00
|
|
|
rule build_renewable_profiles:
|
2017-12-18 19:34:15 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
base_network=RESOURCES + "networks/base.nc",
|
2018-12-10 17:40:54 +00:00
|
|
|
corine="data/bundle/corine/g250_clc06_V18_5.tif",
|
2022-09-08 07:52:00 +00:00
|
|
|
natura=lambda w: (
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "natura.tiff"
|
2022-03-20 20:01:07 +00:00
|
|
|
if config["renewable"][w.technology]["natura"]
|
|
|
|
else []
|
|
|
|
),
|
2020-12-03 18:50:53 +00:00
|
|
|
gebco=lambda w: (
|
|
|
|
"data/bundle/GEBCO_2014_2D.nc"
|
2023-02-22 18:28:07 +00:00
|
|
|
if config["renewable"][w.technology].get("max_depth")
|
2020-12-03 18:50:53 +00:00
|
|
|
else []
|
|
|
|
),
|
2022-09-08 07:52:00 +00:00
|
|
|
ship_density=lambda w: (
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "shipdensity_raster.nc"
|
2022-07-28 08:38:24 +00:00
|
|
|
if "ship_threshold" in config["renewable"][w.technology].keys()
|
|
|
|
else []
|
|
|
|
),
|
2023-03-07 17:11:59 +00:00
|
|
|
country_shapes=RESOURCES + "country_shapes.geojson",
|
|
|
|
offshore_shapes=RESOURCES + "offshore_shapes.geojson",
|
2022-09-08 07:52:00 +00:00
|
|
|
regions=lambda w: (
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "regions_onshore.geojson"
|
Atlite availability (#224)
* adjust buil_cutout.py and Snakefile
* try adjusting build_renewable_profiles, currently crashing due to weird pyproj error
* build_renewable_profiles: -remove printing gid
* build_renewable_profiles: use dask for paralellization, use dense functions
* build_renewable_profiles:
- revise imports
- add logging for long calculation
- revise explaining comment
- revise distance calculation
* build profiles: adjust to cutout.grid
* * fix area to square km
* rename potmatrix -> capacity_potential
* rename available to availibility
* config.default update cutout params
build_renewable_potentials: major refactoring and simplification
hydro_profiles: update code
* build profiles: fix weight output dimensions
* build profiles: fix typo, fix selection of buses
* build profiles: reinsert paths variable
* follow up
* build profiles: move to dask calculation only
* CI: set build cutout to true (add CDSAPI)
* build profiles: use pyproj, test with gleas and geokit upstream
* environment.yaml fix atlite version
* build profiles: use dask 'processes' for more than 25 regions
* build profiles: specify dask scheduler according to number of regions
* backpedal a bit, only allow scheduler='processes'
* follow up, code style and fixup
* build profiles: add logger info for underwater fraction calc
* config adjust cutout parameters
Snakefile fixup
* config.default.yaml: adjust resolution
* config: use one cutout in total
build_cutout: automatic detetection of geographical boundaries
* env: add python>=3.8 requirement
build_cutout: fixup for region bound
* config: allow base cutout
* folllow up, fix up
* follow up II
* clean up
* clean up II
* build profiles: move back to multiprocessing due to performance issues
* small code style corrections
* move in pool context
* swqitch to ratsterio
* switch to rasterio for availibility calculation
* tiny fixup
* * build continental raster for offshore distance calculation
* adjust Snakefile to new script build_raster
* rename continental raster to onshore raster
add projected_mask function (not yet tested)
add docstrings, modularize
* Snakefile: remove build_onhore_raster rule, build mask directly from geometry instead
build_natura_raster: adjust code, add function for exporting
build_profiles:
* add buffer to shore distance to init_globals function
* update docstrings
* improve handling of nodata grid codes
* add geometry mask if natura raster not activated
(the 255 value is an 'eligible' value for the corine data base,
do this for excluding data outside the shape)
* build_profiles: adjust docstrings
* update environment
* build profiles: fixup reproject woth padding
* follow up, small fixups
* fix resampling method
checkpoint: reproduces solar profile in tut data
* reintegrate plot map
code style
* config: rename cutout into "base"
* build profiles: adjust to new atlite code
* natura raster: small fixup
* build natura raster: compress tiff file
* config: adjust cutout names
* build profiles: cover case if no or partial overlap between natura raster and cutout
* config-tutorial: adjust cutout params
* buid-profifiles: fixup in gebco filter
* follow up
* update config files
* build profiles: select layoutmatrix != 0
* build profiles: speed up average_distance and underwaterfraction
* build profiles: fix typo
* update release notes
build_cutout: only build needed features
* update envs
* config: add temperature to sarah features
* temporary fix for atlite v0.2.1 and new xarray version release
* env: remove xarray specification
* * remove rule build_country_flh
* build profiles: remove sneaked in line
* doc: update configuration.rst (section atlite) and corresponding csv table
* release notes: fix quotes
* build profiles: use 3035 for area calculation
* Update envs/environment.docs.yaml
* Update scripts/build_cutout.py
* Update doc/release_notes.rst
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* Update doc/configuration.rst
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* Update scripts/build_cutout.py
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
* update release notes
* release notes: add deprecation of 'keep_all_available_areas'
build profiles: remove warning for 'keep_all_available_areas'
* build cutout: rearrage code, set buffer correctly
* Rename tutorial cutout to remove name clash with real cutout.
* Update release_notes.rst: Rename tutorial cutout.
* retrieve: update cutouts and downloads (alternative) (#237)
* retrieve: update cutouts and downloads
* retrieve: remove unnecessary import
* use snakemake remote file functionality
* Snakefile: update zenodo link
* update natura remote link (closes #234)
* env: update atlite version to 0.2.2
* env: fix dask version due to memory issues
* test: retrieve cutout instead of build
* test: use tutorial cutout for CI
Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-04-27 15:58:31 +00:00
|
|
|
if w.technology in ("onwind", "solar")
|
2023-03-07 17:11:59 +00:00
|
|
|
else RESOURCES + "regions_offshore.geojson"
|
2022-09-08 07:52:00 +00:00
|
|
|
),
|
|
|
|
cutout=lambda w: "cutouts/"
|
|
|
|
+ CDIR
|
|
|
|
+ config["renewable"][w.technology]["cutout"]
|
|
|
|
+ ".nc",
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
profile=RESOURCES + "profile_{technology}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_renewable_profile_{technology}.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "build_renewable_profiles_{technology}"
|
2020-12-03 18:50:53 +00:00
|
|
|
threads: ATLITE_NPROCESSES
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=ATLITE_NPROCESSES * 5000,
|
2022-03-21 09:01:34 +00:00
|
|
|
wildcard_constraints:
|
|
|
|
technology="(?!hydro).*", # Any technology other than hydro
|
2018-01-29 21:28:33 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_renewable_profiles.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2022-03-18 10:13:58 +00:00
|
|
|
rule build_hydro_profile:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
country_shapes=RESOURCES + "country_shapes.geojson",
|
2022-03-28 10:02:08 +00:00
|
|
|
eia_hydro_generation="data/eia_hydro_annual_generation.csv",
|
2023-03-06 14:41:02 +00:00
|
|
|
cutout=f"cutouts/" + CDIR + config["renewable"]["hydro"]["cutout"] + ".nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "profile_hydro.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "build_hydro_profile.log",
|
2022-03-18 10:13:58 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
|
|
|
script:
|
|
|
|
"scripts/build_hydro_profile.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
rule add_electricity:
|
|
|
|
input:
|
2022-09-16 13:04:04 +00:00
|
|
|
**{
|
2023-03-07 17:11:59 +00:00
|
|
|
f"profile_{tech}": RESOURCES + f"profile_{tech}.nc"
|
2023-03-06 14:41:02 +00:00
|
|
|
for tech in config["electricity"]["renewable_carriers"]
|
2022-09-16 13:04:04 +00:00
|
|
|
},
|
|
|
|
**{
|
2022-09-08 07:52:00 +00:00
|
|
|
f"conventional_{carrier}_{attr}": fn
|
|
|
|
for carrier, d in config.get("conventional", {None: {}}).items()
|
|
|
|
for attr, fn in d.items()
|
|
|
|
if str(fn).startswith("data/")
|
2022-09-16 13:04:04 +00:00
|
|
|
},
|
2023-03-07 17:11:59 +00:00
|
|
|
base_network=RESOURCES + "networks/base.nc",
|
2018-10-25 14:43:24 +00:00
|
|
|
tech_costs=COSTS,
|
2023-03-07 17:11:59 +00:00
|
|
|
regions=RESOURCES + "regions_onshore.geojson",
|
|
|
|
powerplants=RESOURCES + "powerplants.csv",
|
2018-08-03 09:53:14 +00:00
|
|
|
hydro_capacities="data/bundle/hydro_capacities.csv",
|
2018-11-12 20:43:33 +00:00
|
|
|
geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
load=RESOURCES + "load.csv",
|
|
|
|
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/elec.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "add_electricity.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "add_electricity"
|
2017-12-18 19:34:15 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=5000,
|
2017-12-18 19:34:15 +00:00
|
|
|
script:
|
|
|
|
"scripts/add_electricity.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-01-30 22:11:16 +00:00
|
|
|
rule simplify_network:
|
2018-01-29 21:28:33 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESOURCES + "networks/elec.nc",
|
2018-10-27 01:41:38 +00:00
|
|
|
tech_costs=COSTS,
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore.geojson",
|
2018-01-29 21:28:33 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESOURCES + "networks/elec_s{simpl}.nc",
|
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}.geojson",
|
|
|
|
busmap=RESOURCES + "busmap_elec_s{simpl}.csv",
|
|
|
|
connection_costs=RESOURCES + "connection_costs_s{simpl}.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "simplify_network/elec_s{simpl}.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "simplify_network/elec_s{simpl}"
|
2018-01-30 22:11:16 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
2018-01-30 22:11:16 +00:00
|
|
|
script:
|
|
|
|
"scripts/simplify_network.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-01-30 22:11:16 +00:00
|
|
|
rule cluster_network:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESOURCES + "networks/elec_s{simpl}.nc",
|
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}.geojson",
|
|
|
|
busmap=ancient(RESOURCES + "busmap_elec_s{simpl}.csv"),
|
2020-12-03 18:50:53 +00:00
|
|
|
custom_busmap=(
|
|
|
|
"data/custom_busmap_elec_s{simpl}_{clusters}.csv"
|
2020-12-03 14:17:16 +00:00
|
|
|
if config["enable"].get("custom_busmap", False)
|
|
|
|
else []
|
|
|
|
),
|
2019-09-23 14:44:48 +00:00
|
|
|
tech_costs=COSTS,
|
2018-01-30 22:11:16 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESOURCES + "networks/elec_s{simpl}_{clusters}.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
busmap=RESOURCES + "busmap_elec_s{simpl}_{clusters}.csv",
|
|
|
|
linemap=RESOURCES + "linemap_elec_s{simpl}_{clusters}.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "cluster_network/elec_s{simpl}_{clusters}.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "cluster_network/elec_s{simpl}_{clusters}"
|
2018-01-29 21:28:33 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=6000,
|
2018-01-29 21:28:33 +00:00
|
|
|
script:
|
|
|
|
"scripts/cluster_network.py"
|
|
|
|
|
2019-11-19 18:36:28 +00:00
|
|
|
|
|
|
|
rule add_extra_components:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESOURCES + "networks/elec_s{simpl}_{clusters}.nc",
|
2019-11-19 18:36:28 +00:00
|
|
|
tech_costs=COSTS,
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "add_extra_components/elec_s{simpl}_{clusters}.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "add_extra_components/elec_s{simpl}_{clusters}_ec"
|
2019-11-19 18:36:28 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=3000,
|
2019-11-19 18:36:28 +00:00
|
|
|
script:
|
|
|
|
"scripts/add_extra_components.py"
|
|
|
|
|
|
|
|
|
2018-01-29 21:28:33 +00:00
|
|
|
rule prepare_network:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
tech_costs=COSTS,
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
LOGS + "prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log",
|
2022-09-08 07:52:00 +00:00
|
|
|
benchmark:
|
2023-03-07 17:24:47 +00:00
|
|
|
(BENCHMARKS + "prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}")
|
2018-01-29 21:28:33 +00:00
|
|
|
threads: 1
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
2018-01-29 21:28:33 +00:00
|
|
|
script:
|
|
|
|
"scripts/prepare_network.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-02-19 09:03:25 +00:00
|
|
|
def memory(w):
|
2018-10-22 21:28:56 +00:00
|
|
|
factor = 3.0
|
|
|
|
for o in w.opts.split("-"):
|
|
|
|
m = re.match(r"^(\d+)h$", o, re.IGNORECASE)
|
|
|
|
if m is not None:
|
|
|
|
factor /= int(m.group(1))
|
|
|
|
break
|
2020-12-03 15:02:21 +00:00
|
|
|
for o in w.opts.split("-"):
|
|
|
|
m = re.match(r"^(\d+)seg$", o, re.IGNORECASE)
|
|
|
|
if m is not None:
|
|
|
|
factor *= int(m.group(1)) / 8760
|
|
|
|
break
|
2018-02-19 09:03:25 +00:00
|
|
|
if w.clusters.endswith("m"):
|
2018-10-22 21:28:56 +00:00
|
|
|
return int(factor * (18000 + 180 * int(w.clusters[:-1])))
|
2022-03-02 13:22:16 +00:00
|
|
|
elif w.clusters == "all":
|
|
|
|
return int(factor * (18000 + 180 * 4000))
|
2018-02-19 09:03:25 +00:00
|
|
|
else:
|
2019-02-06 10:46:39 +00:00
|
|
|
return int(factor * (10000 + 195 * int(w.clusters)))
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-02-10 16:19:46 +00:00
|
|
|
|
2017-12-18 19:34:15 +00:00
|
|
|
rule solve_network:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2017-12-18 19:34:15 +00:00
|
|
|
log:
|
2023-03-07 17:24:47 +00:00
|
|
|
solver=normpath(
|
|
|
|
LOGS + "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_solver.log"
|
2022-09-08 07:52:00 +00:00
|
|
|
),
|
2023-03-07 17:11:59 +00:00
|
|
|
python=LOGS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
memory=LOGS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_memory.log",
|
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS + "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
2017-12-18 19:34:15 +00:00
|
|
|
threads: 4
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=memory,
|
|
|
|
shadow:
|
|
|
|
"minimal"
|
2017-12-18 19:34:15 +00:00
|
|
|
script:
|
|
|
|
"scripts/solve_network.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2018-02-19 09:17:49 +00:00
|
|
|
rule solve_operations_network:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
unprepared=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
optimized=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op.nc",
|
2018-02-19 09:17:49 +00:00
|
|
|
log:
|
2022-09-08 07:52:00 +00:00
|
|
|
solver=normpath(
|
2023-03-07 17:24:47 +00:00
|
|
|
LOGS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op_solver.log"
|
|
|
|
),
|
2023-03-07 17:11:59 +00:00
|
|
|
python=LOGS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op_python.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
memory=LOGS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op_memory.log",
|
|
|
|
benchmark:
|
2022-09-16 13:04:04 +00:00
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
BENCHMARKS
|
2022-09-08 07:52:00 +00:00
|
|
|
+ "solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
2022-09-16 13:04:04 +00:00
|
|
|
)
|
2018-02-19 09:17:49 +00:00
|
|
|
threads: 4
|
2022-01-27 20:04:50 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=(lambda w: 5000 + 372 * int(w.clusters)),
|
|
|
|
shadow:
|
|
|
|
"minimal"
|
2018-02-19 09:17:49 +00:00
|
|
|
script:
|
|
|
|
"scripts/solve_operations_network.py"
|
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2021-11-29 08:12:55 +00:00
|
|
|
datafiles = [
|
2022-04-11 15:08:25 +00:00
|
|
|
"data/eea/UNFCCC_v23.csv",
|
|
|
|
"data/switzerland-sfoe/switzerland-new_format.csv",
|
|
|
|
"data/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson",
|
|
|
|
"data/myb1-2017-nitro.xls",
|
|
|
|
"data/Industrial_Database.csv",
|
|
|
|
"data/emobility/KFZ__count",
|
|
|
|
"data/emobility/Pkw__count",
|
|
|
|
"data/h2_salt_caverns_GWh_per_sqkm.geojson",
|
|
|
|
directory("data/eurostat-energy_balances-june_2016_edition"),
|
|
|
|
directory("data/eurostat-energy_balances-may_2018_edition"),
|
|
|
|
directory("data/jrc-idees-2015"),
|
2021-11-29 08:12:55 +00:00
|
|
|
]
|
|
|
|
|
2023-03-06 18:44:57 +00:00
|
|
|
if config["enable"].get("retrieve_sector_databundle", True):
|
|
|
|
|
2021-11-29 08:12:55 +00:00
|
|
|
rule retrieve_sector_databundle:
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
|
|
|
*datafiles,
|
|
|
|
log:
|
|
|
|
"logs/retrieve_sector_databundle.log",
|
|
|
|
script:
|
|
|
|
"scripts/retrieve_sector_databundle.py"
|
2021-11-29 08:12:55 +00:00
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
rule build_population_layouts:
|
2017-12-18 19:34:15 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
|
2023-03-06 14:07:09 +00:00
|
|
|
urban_percent="data/urban_percent.csv",
|
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2017-12-18 19:34:15 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout_total=RESOURCES + "pop_layout_total.nc",
|
|
|
|
pop_layout_urban=RESOURCES + "pop_layout_urban.nc",
|
|
|
|
pop_layout_rural=RESOURCES + "pop_layout_rural.nc",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=20000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_population_layouts"
|
2021-07-01 18:09:04 +00:00
|
|
|
threads: 8
|
2023-03-06 18:44:57 +00:00
|
|
|
script:
|
|
|
|
"scripts/build_population_layouts.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
rule build_clustered_population_layouts:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout_total=RESOURCES + "pop_layout_total.nc",
|
|
|
|
pop_layout_urban=RESOURCES + "pop_layout_urban.nc",
|
|
|
|
pop_layout_rural=RESOURCES + "pop_layout_rural.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-06 14:07:09 +00:00
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_clustered_population_layouts/s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_clustered_population_layouts.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2020-09-25 13:25:41 +00:00
|
|
|
rule build_simplified_population_layouts:
|
2019-02-03 12:50:05 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout_total=RESOURCES + "pop_layout_total.nc",
|
|
|
|
pop_layout_urban=RESOURCES + "pop_layout_urban.nc",
|
|
|
|
pop_layout_rural=RESOURCES + "pop_layout_rural.nc",
|
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}.geojson",
|
2023-03-06 15:50:41 +00:00
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_clustered_population_layouts/s{simpl}"
|
|
|
|
script:
|
|
|
|
"scripts/build_clustered_population_layouts.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2021-11-29 11:42:10 +00:00
|
|
|
if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
|
2021-11-04 20:48:54 +00:00
|
|
|
datafiles = [
|
|
|
|
"IGGIELGN_LNGs.geojson",
|
|
|
|
"IGGIELGN_BorderPoints.geojson",
|
|
|
|
"IGGIELGN_Productions.geojson",
|
2021-11-13 15:48:08 +00:00
|
|
|
"IGGIELGN_PipeSegments.geojson",
|
2021-11-04 20:48:54 +00:00
|
|
|
]
|
|
|
|
|
2023-02-16 17:27:57 +00:00
|
|
|
rule retrieve_gas_infrastructure_data:
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
|
|
|
expand("data/gas_network/scigrid-gas/data/{files}", files=datafiles),
|
|
|
|
script:
|
|
|
|
"scripts/retrieve_gas_infrastructure_data.py"
|
2023-02-16 17:27:57 +00:00
|
|
|
|
2021-11-03 19:34:43 +00:00
|
|
|
rule build_gas_network:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
gas_network="data/gas_network/scigrid-gas/data/IGGIELGN_PipeSegments.geojson",
|
2021-11-03 19:34:43 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
cleaned_gas_network=RESOURCES + "gas_network.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
|
|
|
script:
|
|
|
|
"scripts/build_gas_network.py"
|
2021-11-13 15:48:08 +00:00
|
|
|
|
2021-11-04 20:48:54 +00:00
|
|
|
rule build_gas_input_locations:
|
2021-11-03 19:34:43 +00:00
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
lng=HTTP.remote(
|
|
|
|
"https://globalenergymonitor.org/wp-content/uploads/2022/09/Europe-Gas-Tracker-August-2022.xlsx",
|
|
|
|
keep_local=True,
|
|
|
|
),
|
2021-11-04 20:48:54 +00:00
|
|
|
entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson",
|
|
|
|
production="data/gas_network/scigrid-gas/data/IGGIELGN_Productions.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_onshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_offshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_offshore_elec_s{simpl}_{clusters}.geojson",
|
2021-11-03 19:34:43 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
gas_input_nodes=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "gas_input_locations_s{simpl}_{clusters}.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
gas_input_nodes_simplified=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "gas_input_locations_s{simpl}_{clusters}_simplified.csv",
|
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
script:
|
|
|
|
"scripts/build_gas_input_locations.py"
|
2021-11-13 15:48:08 +00:00
|
|
|
|
2021-11-03 19:34:43 +00:00
|
|
|
rule cluster_gas_network:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
cleaned_gas_network=RESOURCES + "gas_network.csv",
|
|
|
|
regions_onshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_offshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_offshore_elec_s{simpl}_{clusters}.geojson",
|
2021-11-03 19:34:43 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_gas_network=RESOURCES + "gas_network_elec_s{simpl}_{clusters}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
|
|
|
script:
|
|
|
|
"scripts/cluster_gas_network.py"
|
2021-11-03 19:34:43 +00:00
|
|
|
|
2023-03-06 18:44:57 +00:00
|
|
|
gas_infrastructure = {
|
|
|
|
**rules.cluster_gas_network.output,
|
|
|
|
**rules.build_gas_input_locations.output,
|
|
|
|
}
|
2021-11-13 15:48:08 +00:00
|
|
|
|
2023-03-07 17:24:47 +00:00
|
|
|
|
2023-03-07 17:22:07 +00:00
|
|
|
if not (config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]):
|
2023-03-07 17:24:47 +00:00
|
|
|
# this is effecively an `else` statement which is however not liked by snakefmt
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2021-11-03 19:34:43 +00:00
|
|
|
gas_infrastructure = {}
|
|
|
|
|
2020-09-25 13:25:41 +00:00
|
|
|
|
2019-04-17 09:44:16 +00:00
|
|
|
rule build_heat_demands:
|
2022-09-08 07:52:00 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-06 14:07:09 +00:00
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
heat_demand=RESOURCES + "heat_demand_{scope}_elec_s{simpl}_{clusters}.nc",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=20000,
|
2022-12-28 11:21:00 +00:00
|
|
|
threads: 8
|
2023-03-06 18:44:57 +00:00
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_heat_demands/{scope}_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_heat_demand.py"
|
2017-12-18 19:34:15 +00:00
|
|
|
|
2020-12-03 18:50:53 +00:00
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
rule build_temperature_profiles:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-06 14:07:09 +00:00
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
temp_soil=RESOURCES + "temp_soil_{scope}_elec_s{simpl}_{clusters}.nc",
|
|
|
|
temp_air=RESOURCES + "temp_air_{scope}_elec_s{simpl}_{clusters}.nc",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=20000,
|
2022-12-28 11:20:34 +00:00
|
|
|
threads: 8
|
2023-03-06 18:44:57 +00:00
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_temperature_profiles/{scope}_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_temperature_profiles.py"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_cop_profiles:
|
|
|
|
input:
|
2023-03-07 17:24:47 +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",
|
2023-03-06 10:54:08 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +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",
|
2023-03-07 17:11:59 +00:00
|
|
|
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",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=20000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_cop_profiles/s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_cop_profiles.py"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_solar_thermal_profiles:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-06 14:07:09 +00:00
|
|
|
cutout="cutouts/" + CDIR + config["atlite"]["default_cutout"] + ".nc",
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
solar_thermal=RESOURCES + "solar_thermal_{scope}_elec_s{simpl}_{clusters}.nc",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=20000,
|
2022-12-28 11:21:46 +00:00
|
|
|
threads: 16
|
2023-03-06 18:44:57 +00:00
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_solar_thermal_profiles/{scope}_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_solar_thermal_profiles.py"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
def input_eurostat(w):
|
|
|
|
# 2016 includes BA, 2017 does not
|
|
|
|
report_year = config["energy"]["eurostat_report_year"]
|
|
|
|
return f"data/eurostat-energy_balances-june_{report_year}_edition"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
rule build_energy_totals:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
|
2021-07-01 18:09:04 +00:00
|
|
|
co2="data/eea/UNFCCC_v23.csv",
|
|
|
|
swiss="data/switzerland-sfoe/switzerland-new_format.csv",
|
|
|
|
idees="data/jrc-idees-2015",
|
2023-03-06 18:44:57 +00:00
|
|
|
district_heat_share="data/district_heat_share.csv",
|
|
|
|
eurostat=input_eurostat,
|
2019-04-16 14:03:51 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
energy_name=RESOURCES + "energy_totals.csv",
|
|
|
|
co2_name=RESOURCES + "co2_totals.csv",
|
|
|
|
transport_name=RESOURCES + "transport_data.csv",
|
2021-07-01 18:09:04 +00:00
|
|
|
threads: 16
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_energy_totals"
|
|
|
|
script:
|
|
|
|
"scripts/build_energy_totals.py"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
|
2019-04-16 14:03:51 +00:00
|
|
|
rule build_biomass_potentials:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
enspreso_biomass=HTTP.remote(
|
|
|
|
"https://cidportal.jrc.ec.europa.eu/ftp/jrc-opendata/ENSPRESO/ENSPRESO_BIOMASS.xlsx",
|
|
|
|
keep_local=True,
|
|
|
|
),
|
|
|
|
nuts2="data/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson", # https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/#nuts21
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-06 10:54:08 +00:00
|
|
|
nuts3_population="data/bundle/nama_10r_3popgdp.tsv.gz",
|
|
|
|
swiss_cantons="data/bundle/ch_cantons.csv",
|
|
|
|
swiss_population="data/bundle/je-e-21.03.02.xls",
|
2023-03-07 17:11:59 +00:00
|
|
|
country_shapes=RESOURCES + "country_shapes.geojson",
|
2023-03-06 10:54:08 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
biomass_potentials_all=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "biomass_potentials_all_s{simpl}_{clusters}.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
biomass_potentials=RESOURCES + "biomass_potentials_s{simpl}_{clusters}.csv",
|
2019-04-16 14:03:51 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_biomass_potentials_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_biomass_potentials.py"
|
2019-04-16 14:03:51 +00:00
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
|
2021-08-04 13:05:37 +00:00
|
|
|
if config["sector"]["biomass_transport"]:
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2021-08-04 13:05:37 +00:00
|
|
|
rule build_biomass_transport_costs:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
transport_cost_data=HTTP.remote(
|
|
|
|
"publications.jrc.ec.europa.eu/repository/bitstream/JRC98626/biomass potentials in europe_web rev.pdf",
|
|
|
|
keep_local=True,
|
|
|
|
),
|
2021-08-04 13:05:37 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
biomass_transport_costs=RESOURCES + "biomass_transport_costs.csv",
|
2021-08-04 13:05:37 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_biomass_transport_costs"
|
|
|
|
script:
|
|
|
|
"scripts/build_biomass_transport_costs.py"
|
|
|
|
|
2021-08-04 13:05:37 +00:00
|
|
|
build_biomass_transport_costs_output = rules.build_biomass_transport_costs.output
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2023-03-07 17:24:47 +00:00
|
|
|
|
2023-03-07 17:22:07 +00:00
|
|
|
if not config["sector"]["biomass_transport"]:
|
2023-03-07 17:24:47 +00:00
|
|
|
# this is effecively an `else` statement which is however not liked by snakefmt
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2021-08-04 13:05:37 +00:00
|
|
|
build_biomass_transport_costs_output = {}
|
2021-07-02 09:07:35 +00:00
|
|
|
|
|
|
|
|
2023-02-16 16:21:58 +00:00
|
|
|
if config["sector"]["regional_co2_sequestration_potential"]["enable"]:
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2023-01-24 17:44:39 +00:00
|
|
|
rule build_sequestration_potentials:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
sequestration_potential=HTTP.remote(
|
|
|
|
"https://raw.githubusercontent.com/ericzhou571/Co2Storage/main/resources/complete_map_2020_unit_Mt.geojson",
|
|
|
|
keep_local=True,
|
|
|
|
),
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_onshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2023-03-07 17:11:59 +00:00
|
|
|
regions_offshore=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "regions_offshore_elec_s{simpl}_{clusters}.geojson",
|
2023-01-24 17:44:39 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
sequestration_potential=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "co2_sequestration_potential_elec_s{simpl}_{clusters}.csv",
|
2023-01-24 17:44:39 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=4000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_sequestration_potentials_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_sequestration_potentials.py"
|
|
|
|
|
2023-01-24 17:44:39 +00:00
|
|
|
build_sequestration_potentials_output = rules.build_sequestration_potentials.output
|
2023-03-06 18:44:57 +00:00
|
|
|
|
|
|
|
|
2023-03-07 17:22:07 +00:00
|
|
|
if not config["sector"]["regional_co2_sequestration_potential"]["enable"]:
|
2023-03-07 17:24:47 +00:00
|
|
|
# this is effecively an `else` statement which is however not liked by snakefmt
|
2023-01-24 17:44:39 +00:00
|
|
|
build_sequestration_potentials_output = {}
|
|
|
|
|
|
|
|
|
2021-11-29 08:12:07 +00:00
|
|
|
rule build_salt_cavern_potentials:
|
|
|
|
input:
|
|
|
|
salt_caverns="data/h2_salt_caverns_GWh_per_sqkm.geojson",
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
regions_offshore=RESOURCES + "regions_offshore_elec_s{simpl}_{clusters}.geojson",
|
2021-11-29 08:12:07 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
h2_cavern_potential=RESOURCES + "salt_cavern_potentials_s{simpl}_{clusters}.csv",
|
2021-11-29 08:12:07 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_salt_cavern_potentials_s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_salt_cavern_potentials.py"
|
2021-11-29 08:12:07 +00:00
|
|
|
|
|
|
|
|
2020-08-28 17:13:18 +00:00
|
|
|
rule build_ammonia_production:
|
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
usgs="data/myb1-2017-nitro.xls",
|
2020-08-28 17:13:18 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
ammonia_production=RESOURCES + "ammonia_production.csv",
|
2020-08-28 17:13:18 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_ammonia_production"
|
|
|
|
script:
|
|
|
|
"scripts/build_ammonia_production.py"
|
2020-08-28 17:13:18 +00:00
|
|
|
|
2019-07-18 09:40:38 +00:00
|
|
|
|
|
|
|
rule build_industry_sector_ratios:
|
2020-08-28 17:13:18 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
ammonia_production=RESOURCES + "ammonia_production.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
idees="data/jrc-idees-2015",
|
2019-07-18 09:40:38 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industry_sector_ratios=RESOURCES + "industry_sector_ratios.csv",
|
2019-07-18 09:40:38 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industry_sector_ratios"
|
|
|
|
script:
|
|
|
|
"scripts/build_industry_sector_ratios.py"
|
2019-07-18 09:40:38 +00:00
|
|
|
|
|
|
|
|
2020-08-26 11:12:16 +00:00
|
|
|
rule build_industrial_production_per_country:
|
2020-08-28 17:13:18 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
ammonia_production=RESOURCES + "ammonia_production.csv",
|
2021-07-01 18:09:04 +00:00
|
|
|
jrc="data/jrc-idees-2015",
|
|
|
|
eurostat="data/eurostat-energy_balances-may_2018_edition",
|
2020-08-26 11:12:16 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_production_per_country=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_per_country.csv",
|
2021-07-01 18:09:04 +00:00
|
|
|
threads: 8
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_production_per_country"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_production_per_country.py"
|
2020-08-26 11:12:16 +00:00
|
|
|
|
|
|
|
|
2020-08-26 14:13:01 +00:00
|
|
|
rule build_industrial_production_per_country_tomorrow:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_production_per_country=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_per_country.csv",
|
2020-08-26 14:13:01 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_production_per_country_tomorrow=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_per_country_tomorrow_{planning_horizons}.csv",
|
2020-08-26 14:13:01 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_production_per_country_tomorrow_{planning_horizons}"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_production_per_country_tomorrow.py"
|
2020-08-26 14:13:01 +00:00
|
|
|
|
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:
|
2023-03-07 17:24:47 +00:00
|
|
|
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2020-10-05 18:04:04 +00:00
|
|
|
hotmaps_industrial_database="data/Industrial_Database.csv",
|
2020-10-12 10:07:49 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_distribution_key=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
|
2020-10-12 10:07:49 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_distribution_key/s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_distribution_key.py"
|
2020-10-12 10:07:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
rule build_industrial_production_per_node:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_distribution_key=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_production_per_country_tomorrow=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_per_country_tomorrow_{planning_horizons}.csv",
|
2020-10-05 18:04:04 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_production_per_node=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
|
2020-10-05 18:04:04 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_production_per_node/s{simpl}_{clusters}_{planning_horizons}"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_production_per_node.py"
|
2020-10-05 18:04:04 +00:00
|
|
|
|
|
|
|
|
2020-10-12 10:20:04 +00:00
|
|
|
rule build_industrial_energy_demand_per_node:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
industry_sector_ratios=RESOURCES + "industry_sector_ratios.csv",
|
|
|
|
industrial_production_per_node=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_energy_demand_per_node_today=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv",
|
2020-10-12 10:20:04 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_energy_demand_per_node=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
|
2020-10-12 10:20:04 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_energy_demand_per_node/s{simpl}_{clusters}_{planning_horizons}"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_energy_demand_per_node.py"
|
2020-10-12 10:20:04 +00:00
|
|
|
|
|
|
|
|
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:
|
2021-07-01 18:09:04 +00:00
|
|
|
jrc="data/jrc-idees-2015",
|
2023-03-07 17:11:59 +00:00
|
|
|
ammonia_production=RESOURCES + "ammonia_production.csv",
|
|
|
|
industrial_production_per_country=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_production_per_country.csv",
|
2020-09-07 14:48:06 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_energy_demand_per_country_today=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_per_country_today.csv",
|
2021-07-01 18:09:04 +00:00
|
|
|
threads: 8
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_energy_demand_per_country_today"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_energy_demand_per_country_today.py"
|
2020-09-07 14:48:06 +00:00
|
|
|
|
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:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_distribution_key=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_distribution_key_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_energy_demand_per_country_today=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_per_country_today.csv",
|
2020-10-12 11:26:21 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
industrial_energy_demand_per_node_today=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_today_elec_s{simpl}_{clusters}.csv",
|
2020-10-12 11:26:21 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_industrial_energy_demand_per_node_today/s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_industrial_energy_demand_per_node_today.py"
|
2020-10-12 11:26:21 +00:00
|
|
|
|
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
if config["sector"]["retrofitting"]["retro_endogen"]:
|
2023-03-06 18:44:57 +00:00
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
rule build_retro_cost:
|
|
|
|
input:
|
|
|
|
building_stock="data/retro/data_building_stock.csv",
|
|
|
|
data_tabula="data/retro/tabula-calculator-calcsetbuilding.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
air_temperature=RESOURCES + "temp_air_total_elec_s{simpl}_{clusters}.nc",
|
2021-07-01 18:09:04 +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",
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2021-07-01 18:09:04 +00:00
|
|
|
cost_germany="data/retro/retro_cost_germany.csv",
|
|
|
|
window_assumptions="data/retro/window_assumptions.csv",
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
retro_cost=RESOURCES + "retro_cost_elec_s{simpl}_{clusters}.csv",
|
|
|
|
floor_area=RESOURCES + "floor_area_elec_s{simpl}_{clusters}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
|
|
|
"benchmarks/build_retro_cost/s{simpl}_{clusters}"
|
|
|
|
script:
|
|
|
|
"scripts/build_retro_cost.py"
|
|
|
|
|
2021-07-01 18:09:04 +00:00
|
|
|
build_retro_cost_output = rules.build_retro_cost.output
|
2023-03-06 18:44:57 +00:00
|
|
|
|
|
|
|
|
2023-03-07 17:22:07 +00:00
|
|
|
if not config["sector"]["retrofitting"]["retro_endogen"]:
|
2023-03-07 17:24:47 +00:00
|
|
|
# this is effecively an `else` statement which is however not liked by snakefmt
|
2021-07-01 18:09:04 +00:00
|
|
|
build_retro_cost_output = {}
|
2020-10-21 13:21:26 +00:00
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
|
2022-04-03 16:49:35 +00:00
|
|
|
rule build_population_weighted_energy_totals:
|
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
energy_totals=RESOURCES + "energy_totals.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "pop_weighted_energy_totals_s{simpl}_{clusters}.csv",
|
2022-04-03 16:49:35 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
script:
|
|
|
|
"scripts/build_population_weighted_energy_totals.py"
|
2022-04-03 16:49:35 +00:00
|
|
|
|
|
|
|
|
2022-11-13 12:43:05 +00:00
|
|
|
rule build_shipping_demand:
|
|
|
|
input:
|
|
|
|
ports="data/attributed_ports.json",
|
2023-03-07 17:11:59 +00:00
|
|
|
scope=RESOURCES + "europe_shape.geojson",
|
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
|
|
|
demand=RESOURCES + "energy_totals.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESOURCES + "shipping_demand_s{simpl}_{clusters}.csv",
|
2022-11-13 12:43:05 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
script:
|
|
|
|
"scripts/build_shipping_demand.py"
|
2022-11-13 12:43:05 +00:00
|
|
|
|
|
|
|
|
2022-04-03 16:49:35 +00:00
|
|
|
rule build_transport_demand:
|
2022-08-01 13:21:11 +00:00
|
|
|
input:
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_weighted_energy_totals=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "pop_weighted_energy_totals_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
transport_data=RESOURCES + "transport_data.csv",
|
2022-04-03 16:49:35 +00:00
|
|
|
traffic_data_KFZ="data/emobility/KFZ__count",
|
|
|
|
traffic_data_Pkw="data/emobility/Pkw__count",
|
2023-03-07 17:24:47 +00:00
|
|
|
temp_air_total=RESOURCES + "temp_air_total_elec_s{simpl}_{clusters}.nc",
|
2022-08-01 13:21:11 +00:00
|
|
|
output:
|
2023-03-07 17:24:47 +00:00
|
|
|
transport_demand=RESOURCES + "transport_demand_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
transport_data=RESOURCES + "transport_data_s{simpl}_{clusters}.csv",
|
|
|
|
avail_profile=RESOURCES + "avail_profile_s{simpl}_{clusters}.csv",
|
|
|
|
dsm_profile=RESOURCES + "dsm_profile_s{simpl}_{clusters}.csv",
|
2022-04-03 16:49:35 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
script:
|
|
|
|
"scripts/build_transport_demand.py"
|
2022-04-03 16:49:35 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule prepare_sector_network:
|
2023-03-06 18:44:57 +00:00
|
|
|
params:
|
|
|
|
RDIR=RDIR,
|
2020-07-08 14:34:15 +00:00
|
|
|
input:
|
2023-03-06 18:44:57 +00:00
|
|
|
**build_retro_cost_output,
|
|
|
|
**build_biomass_transport_costs_output,
|
|
|
|
**gas_infrastructure,
|
|
|
|
**build_sequestration_potentials_output,
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:24:47 +00:00
|
|
|
network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
2023-03-07 17:11:59 +00:00
|
|
|
energy_totals_name=RESOURCES + "energy_totals.csv",
|
2022-08-01 13:21:11 +00:00
|
|
|
eurostat=input_eurostat,
|
2023-03-07 17:11:59 +00:00
|
|
|
pop_weighted_energy_totals=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "pop_weighted_energy_totals_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
shipping_demand=RESOURCES + "shipping_demand_s{simpl}_{clusters}.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
transport_demand=RESOURCES + "transport_demand_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
transport_data=RESOURCES + "transport_data_s{simpl}_{clusters}.csv",
|
|
|
|
avail_profile=RESOURCES + "avail_profile_s{simpl}_{clusters}.csv",
|
|
|
|
dsm_profile=RESOURCES + "dsm_profile_s{simpl}_{clusters}.csv",
|
|
|
|
co2_totals_name=RESOURCES + "co2_totals.csv",
|
2022-08-01 13:21:11 +00:00
|
|
|
co2="data/eea/UNFCCC_v23.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
biomass_potentials=RESOURCES + "biomass_potentials_s{simpl}_{clusters}.csv",
|
2020-07-08 14:34:15 +00:00
|
|
|
heat_profile="data/heat_load_profile_BDEW.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
costs="data/costs_{}.csv".format(config["costs"]["year"])
|
|
|
|
if config["foresight"] == "overnight"
|
|
|
|
else "data/costs_{planning_horizons}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
profile_offwind_ac=RESOURCES + "profile_offwind-ac.nc",
|
|
|
|
profile_offwind_dc=RESOURCES + "profile_offwind-dc.nc",
|
|
|
|
h2_cavern=RESOURCES + "salt_cavern_potentials_s{simpl}_{clusters}.csv",
|
|
|
|
busmap_s=RESOURCES + "busmap_elec_s{simpl}.csv",
|
|
|
|
busmap=RESOURCES + "busmap_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
simplified_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}.csv",
|
|
|
|
industrial_demand=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv",
|
2023-03-07 17:24:47 +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",
|
|
|
|
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",
|
2023-03-07 17:11:59 +00:00
|
|
|
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
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "solar_thermal_total_elec_s{simpl}_{clusters}.nc"
|
|
|
|
if config["sector"]["solar_thermal"]
|
|
|
|
else [],
|
2023-03-07 17:11:59 +00:00
|
|
|
solar_thermal_urban=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "solar_thermal_urban_elec_s{simpl}_{clusters}.nc"
|
|
|
|
if config["sector"]["solar_thermal"]
|
|
|
|
else [],
|
2023-03-07 17:11:59 +00:00
|
|
|
solar_thermal_rural=RESOURCES
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "solar_thermal_rural_elec_s{simpl}_{clusters}.nc"
|
|
|
|
if config["sector"]["solar_thermal"]
|
|
|
|
else [],
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/prepare_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
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:
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-03-07 17:11:59 +00:00
|
|
|
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
2020-07-08 14:34:15 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
map=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
2023-03-07 17:11:59 +00:00
|
|
|
today=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}-today.pdf",
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 2
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/plot_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
script:
|
|
|
|
"scripts/plot_network.py"
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule copy_config:
|
2023-03-06 18:44:57 +00:00
|
|
|
params:
|
|
|
|
RDIR=RDIR,
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "configs/config.yaml",
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=1000,
|
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "benchmarks/copy_config"
|
2023-03-06 18:44:57 +00:00
|
|
|
script:
|
|
|
|
"scripts/copy_config.py"
|
2020-07-07 16:30:37 +00:00
|
|
|
|
|
|
|
|
2021-11-24 15:01:58 +00:00
|
|
|
rule copy_conda_env:
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "configs/environment.yaml",
|
2021-11-24 15:01:58 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=500,
|
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "benchmarks/copy_conda_env"
|
2023-03-06 18:44:57 +00:00
|
|
|
shell:
|
|
|
|
"conda env export -f {output} --no-builds"
|
2021-11-24 15:01:58 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule make_summary:
|
2023-03-06 18:44:57 +00:00
|
|
|
params:
|
|
|
|
RDIR=RDIR,
|
2020-07-08 14:34:15 +00:00
|
|
|
input:
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
|
|
|
networks=expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
**config["scenario"]
|
2021-07-01 18:09:04 +00:00
|
|
|
),
|
2023-03-06 18:44:57 +00:00
|
|
|
costs="data/costs_{}.csv".format(config["costs"]["year"])
|
|
|
|
if config["foresight"] == "overnight"
|
|
|
|
else "data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]),
|
2021-07-01 18:09:04 +00:00
|
|
|
plots=expand(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
|
|
|
**config["scenario"]
|
|
|
|
),
|
2020-07-08 14:34:15 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
nodal_costs=RESULTS + "csvs/nodal_costs.csv",
|
|
|
|
nodal_capacities=RESULTS + "csvs/nodal_capacities.csv",
|
|
|
|
nodal_cfs=RESULTS + "csvs/nodal_cfs.csv",
|
|
|
|
cfs=RESULTS + "csvs/cfs.csv",
|
|
|
|
costs=RESULTS + "csvs/costs.csv",
|
|
|
|
capacities=RESULTS + "csvs/capacities.csv",
|
|
|
|
curtailment=RESULTS + "csvs/curtailment.csv",
|
|
|
|
energy=RESULTS + "csvs/energy.csv",
|
|
|
|
supply=RESULTS + "csvs/supply.csv",
|
|
|
|
supply_energy=RESULTS + "csvs/supply_energy.csv",
|
|
|
|
prices=RESULTS + "csvs/prices.csv",
|
|
|
|
weighted_prices=RESULTS + "csvs/weighted_prices.csv",
|
|
|
|
market_values=RESULTS + "csvs/market_values.csv",
|
|
|
|
price_statistics=RESULTS + "csvs/price_statistics.csv",
|
|
|
|
metrics=RESULTS + "csvs/metrics.csv",
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 2
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "benchmarks/make_summary"
|
2023-03-06 18:44:57 +00:00
|
|
|
script:
|
|
|
|
"scripts/make_summary.py"
|
2020-12-03 18:50:53 +00:00
|
|
|
|
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
rule plot_summary:
|
2023-03-06 18:44:57 +00:00
|
|
|
params:
|
|
|
|
RDIR=RDIR,
|
2019-02-03 13:22:12 +00:00
|
|
|
input:
|
2023-03-07 17:11:59 +00:00
|
|
|
costs=RESULTS + "csvs/costs.csv",
|
|
|
|
energy=RESULTS + "csvs/energy.csv",
|
|
|
|
balances=RESULTS + "csvs/supply_energy.csv",
|
2022-08-01 14:04:14 +00:00
|
|
|
eurostat=input_eurostat,
|
2023-03-06 18:44:57 +00:00
|
|
|
country_codes="data/Country_codes.csv",
|
2022-09-08 07:52:00 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
costs=RESULTS + "graphs/costs.pdf",
|
|
|
|
energy=RESULTS + "graphs/energy.pdf",
|
|
|
|
balances=RESULTS + "graphs/balances-energy.pdf",
|
2020-07-08 14:34:15 +00:00
|
|
|
threads: 2
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS + "benchmarks/plot_summary"
|
2023-03-06 18:44:57 +00:00
|
|
|
script:
|
|
|
|
"scripts/plot_summary.py"
|
2021-07-01 18:09:04 +00:00
|
|
|
|
2020-07-08 14:34:15 +00:00
|
|
|
|
|
|
|
if config["foresight"] == "overnight":
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2023-03-06 11:10:23 +00:00
|
|
|
rule solve_sector_network:
|
2020-07-07 16:30:37 +00:00
|
|
|
input:
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
costs="data/costs_{}.csv".format(config["costs"]["year"]),
|
2023-03-07 17:11:59 +00:00
|
|
|
config=RESULTS + "configs/config.yaml",
|
2023-03-06 10:54:08 +00:00
|
|
|
#env=RDIR + 'configs/environment.yaml',
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
shadow:
|
|
|
|
"shallow"
|
2020-07-08 14:34:15 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
solver=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
python=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
memory=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_memory.log",
|
|
|
|
threads: config["solving"]["solver"].get("threads", 4)
|
|
|
|
resources:
|
|
|
|
mem_mb=config["solving"]["mem"],
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/solve_sector_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
script:
|
|
|
|
"scripts/solve_sector_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-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-03-07 17:11:59 +00:00
|
|
|
powerplants=RESOURCES + "powerplants.csv",
|
|
|
|
busmap_s=RESOURCES + "busmap_elec_s{simpl}.csv",
|
|
|
|
busmap=RESOURCES + "busmap_elec_s{simpl}_{clusters}.csv",
|
2023-03-07 17:24:47 +00:00
|
|
|
clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv",
|
2023-03-06 18:44:57 +00:00
|
|
|
costs="data/costs_{}.csv".format(config["scenario"]["planning_horizons"][0]),
|
2023-03-07 17:24:47 +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",
|
2023-03-06 18:44:57 +00:00
|
|
|
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
|
|
|
|
country_codes="data/Country_codes.csv",
|
|
|
|
existing_solar="data/existing_infrastructure/solar_capacity_IRENA.csv",
|
|
|
|
existing_onwind="data/existing_infrastructure/onwind_capacity_IRENA.csv",
|
|
|
|
existing_offwind="data/existing_infrastructure/offwind_capacity_IRENA.csv",
|
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-07 16:30:37 +00:00
|
|
|
wildcard_constraints:
|
2023-03-06 18:44:57 +00:00
|
|
|
planning_horizons=config["scenario"]["planning_horizons"][0], #only applies to baseyear
|
2020-07-07 16:30:37 +00:00
|
|
|
threads: 1
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/add_existing_baseyear/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
script:
|
|
|
|
"scripts/add_existing_baseyear.py"
|
2021-07-01 18:09:04 +00:00
|
|
|
|
|
|
|
def solved_previous_horizon(wildcards):
|
|
|
|
planning_horizons = config["scenario"]["planning_horizons"]
|
|
|
|
i = planning_horizons.index(int(wildcards.planning_horizons))
|
2023-03-06 18:44:57 +00:00
|
|
|
planning_horizon_p = str(planning_horizons[i - 1])
|
|
|
|
return (
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_"
|
|
|
|
+ planning_horizon_p
|
|
|
|
+ ".nc"
|
|
|
|
)
|
2020-07-30 06:27:33 +00:00
|
|
|
|
2020-07-07 16:30:37 +00:00
|
|
|
rule add_brownfield:
|
|
|
|
input:
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
network_p=solved_previous_horizon, #solved network at previous time step
|
2023-01-28 07:15:43 +00:00
|
|
|
costs="data/costs_{planning_horizons}.csv",
|
2023-03-07 17:24:47 +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",
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2020-07-07 16:30:37 +00:00
|
|
|
threads: 4
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/add_brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
script:
|
|
|
|
"scripts/add_brownfield.py"
|
2021-07-01 18:09:04 +00:00
|
|
|
|
2020-07-30 06:27:33 +00:00
|
|
|
ruleorder: add_existing_baseyear > add_brownfield
|
|
|
|
|
2023-03-06 11:10:23 +00:00
|
|
|
rule solve_sector_network_myopic:
|
2020-07-07 16:30:37 +00:00
|
|
|
input:
|
2021-07-01 18:09:04 +00:00
|
|
|
overrides="data/override_component_attrs",
|
2023-03-07 17:11:59 +00:00
|
|
|
network=RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-01-28 07:15:43 +00:00
|
|
|
costs="data/costs_{planning_horizons}.csv",
|
2023-03-07 17:11:59 +00:00
|
|
|
config=RESULTS + "configs/config.yaml",
|
2023-03-06 18:44:57 +00:00
|
|
|
output:
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
shadow:
|
|
|
|
"shallow"
|
2020-07-07 16:30:37 +00:00
|
|
|
log:
|
2023-03-07 17:11:59 +00:00
|
|
|
solver=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
python=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
2023-03-07 17:11:59 +00:00
|
|
|
memory=LOGS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_memory.log",
|
2020-07-07 16:30:37 +00:00
|
|
|
threads: 4
|
2023-03-06 18:44:57 +00:00
|
|
|
resources:
|
|
|
|
mem_mb=config["solving"]["mem"],
|
|
|
|
benchmark:
|
|
|
|
(
|
2023-03-07 17:11:59 +00:00
|
|
|
RESULTS
|
2023-03-06 18:44:57 +00:00
|
|
|
+ "benchmarks/solve_sector_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
|
|
|
)
|
|
|
|
script:
|
|
|
|
"scripts/solve_sector_network.py"
|