From ccb43a5612010d13db0b000dfabab673cd900aeb Mon Sep 17 00:00:00 2001 From: Koen van Greevenbroek Date: Mon, 19 Feb 2024 22:45:17 +0100 Subject: [PATCH] Allow absence of offshore wind from sector-coupled networks --- rules/build_sector.smk | 7 +++++-- scripts/prepare_sector_network.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rules/build_sector.smk b/rules/build_sector.smk index acdc3203..ff25af0e 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -808,6 +808,11 @@ rule prepare_sector_network: **rules.cluster_gas_network.output, **rules.build_gas_input_locations.output, **build_sequestration_potentials_output, + **{ + f"profile_offwind_{tech}": RESOURCES + f"profile_offwind-{tech}.nc" + for tech in ["ac", "dc"] + if (f"offwind-{tech}" in config["electricity"]["renewable_carriers"]) + }, network=RESOURCES + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc", energy_totals_name=RESOURCES + "energy_totals.csv", eurostat=input_eurostat, @@ -833,8 +838,6 @@ rule prepare_sector_network: if config["foresight"] == "overnight" else "data/costs_{planning_horizons}.csv" ), - 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", diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index b1351089..21728f7c 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -423,6 +423,8 @@ def update_wind_solar_costs(n, costs): # code adapted from pypsa-eur/scripts/add_electricity.py for connection in ["dc", "ac"]: tech = "offwind-" + connection + if tech not in n.generators.carrier.values: + continue profile = snakemake.input["profile_offwind_" + connection] with xr.open_dataset(profile) as ds: