# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: CC0-1.0

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#top-level-configuration
version: 0.11.0
tutorial: false

logging:
  level: INFO
  format: '%(levelname)s:%(name)s:%(message)s'

private:
  keys:
    entsoe_api:

remote:
  ssh: ""
  path: ""

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
run:
  prefix: ""
  name: ""
  scenarios:
    enable: false
    file: config/scenarios.yaml
  disable_progressbar: false
  shared_resources:
    policy: false
    exclude: []
  shared_cutouts: true

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#foresight
foresight: overnight

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#scenario
# Wildcard docs in https://pypsa-eur.readthedocs.io/en/latest/wildcards.html
scenario:
  simpl:
  - ''
  ll:
  - vopt
  clusters:
  - 37
  - 128
  - 256
  opts:
  - ''
  sector_opts:
  - ''
  planning_horizons:
  # - 2020
  # - 2030
  # - 2040
  - 2050

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#countries
countries: ['AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'ME', 'MK', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'SE', 'SI', 'SK']

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#snapshots
snapshots:
  start: "2013-01-01"
  end: "2014-01-01"
  inclusive: 'left'

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#enable
enable:
  retrieve: auto
  retrieve_databundle: true
  retrieve_cost_data: true
  build_cutout: false
  retrieve_cutout: true
  custom_busmap: false
  drop_leap_day: true


# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#co2-budget
co2_budget:
  2020: 0.701
  2025: 0.524
  2030: 0.297
  2035: 0.150
  2040: 0.071
  2045: 0.032
  2050: 0.000

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#electricity
electricity:
  voltages: [220., 300., 380., 500., 750.]
  gaslimit_enable: false
  gaslimit: false
  co2limit_enable: false
  co2limit: 7.75e+7
  co2base: 1.487e+9

  operational_reserve:
    activate: false
    epsilon_load: 0.02
    epsilon_vres: 0.02
    contingency: 4000

  max_hours:
    battery: 6
    H2: 168

  extendable_carriers:
    Generator: [solar, solar-hsat, onwind, offwind-ac, offwind-dc, offwind-float, OCGT, CCGT]
    StorageUnit: [] # battery, H2
    Store: [battery, H2]
    Link: [] # H2 pipeline

  powerplants_filter: (DateOut >= 2023 or DateOut != DateOut) and not (Country == 'Germany' and Fueltype == 'Nuclear')
  custom_powerplants: false
  everywhere_powerplants: []

  conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
  renewable_carriers: [solar, solar-hsat, onwind, offwind-ac, offwind-dc, offwind-float, hydro]

  estimate_renewable_capacities:
    enable: true
    from_opsd: true
    year: 2020
    expansion_limit: false
    technology_mapping:
      Offshore: [offwind-ac, offwind-dc, offwind-float]
      Onshore: [onwind]
      PV: [solar]

  autarky:
    enable: false
    by_country: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#atlite
atlite:
  default_cutout: europe-2013-sarah3-era5
  nprocesses: 4
  show_progress: false
  cutouts:
    # use 'base' to determine geographical bounds and time span from config
    # base:
      # module: era5
    europe-2013-sarah3-era5:
      module: [sarah, era5] # in priority order
      x: [-12., 42.]
      y: [33., 72.]
      dx: 0.3
      dy: 0.3
      time: ['2013', '2013']

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#renewable
renewable:
  onwind:
    cutout: europe-2013-sarah3-era5
    resource:
      method: wind
      turbine: Vestas_V112_3MW
      add_cutout_windspeed: true
    capacity_per_sqkm: 3
    # correction_factor: 0.93
    corine:
      grid_codes: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32]
      distance: 1000
      distance_grid_codes: [1, 2, 3, 4, 5, 6]
    luisa: false
      # grid_codes: [1111, 1121, 1122, 1123, 1130, 1210, 1221, 1222, 1230, 1241, 1242]
      # distance: 1000
      # distance_grid_codes: [1111, 1121, 1122, 1123, 1130, 1210, 1221, 1222, 1230, 1241, 1242]
    natura: true
    excluder_resolution: 100
    clip_p_max_pu: 1.e-2
  offwind-ac:
    cutout: europe-2013-sarah3-era5
    resource:
      method: wind
      turbine: NREL_ReferenceTurbine_2020ATB_5.5MW
      add_cutout_windspeed: true
    capacity_per_sqkm: 2
    correction_factor: 0.8855
    corine: [44, 255]
    luisa: false # [0, 5230]
    natura: true
    ship_threshold: 400
    max_depth: 60
    max_shore_distance: 30000
    excluder_resolution: 200
    clip_p_max_pu: 1.e-2
  offwind-dc:
    cutout: europe-2013-sarah3-era5
    resource:
      method: wind
      turbine: NREL_ReferenceTurbine_2020ATB_5.5MW
      add_cutout_windspeed: true
    capacity_per_sqkm: 2
    correction_factor: 0.8855
    corine: [44, 255]
    luisa: false # [0, 5230]
    natura: true
    ship_threshold: 400
    max_depth: 60
    min_shore_distance: 30000
    excluder_resolution: 200
    clip_p_max_pu: 1.e-2
  offwind-float:
    cutout: europe-2013-sarah3-era5
    resource:
      method: wind
      turbine: NREL_ReferenceTurbine_5MW_offshore
    # ScholzPhd Tab 4.3.1: 10MW/km^2
    capacity_per_sqkm: 2
    correction_factor: 0.8855
    # proxy for wake losses
    # from 10.1016/j.energy.2018.08.153
    # until done more rigorously in #153
    corine: [44, 255]
    natura: true
    ship_threshold: 400
    excluder_resolution: 200
    min_depth: 60
    max_depth: 1000
    clip_p_max_pu: 1.e-2
  solar:
    cutout: europe-2013-sarah3-era5
    resource:
      method: pv
      panel: CSi
      orientation:
        slope: 35.
        azimuth: 180.
    capacity_per_sqkm: 5.1
    # correction_factor: 0.854337
    corine: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 26, 31, 32]
    luisa: false # [1111, 1121, 1122, 1123, 1130, 1210, 1221, 1222, 1230, 1241, 1242, 1310, 1320, 1330, 1410, 1421, 1422, 2110, 2120, 2130, 2210, 2220, 2230, 2310, 2410, 2420, 3210, 3320, 3330]
    natura: true
    excluder_resolution: 100
    clip_p_max_pu: 1.e-2
  solar-hsat:
    cutout: europe-2013-sarah3-era5
    resource:
      method: pv
      panel: CSi
      orientation:
        slope: 35.
        azimuth: 180.
      tracking: horizontal
    capacity_per_sqkm: 4.43 # 15% higher land usage acc. to NREL
    corine: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 26, 31, 32]
    luisa: false # [1111, 1121, 1122, 1123, 1130, 1210, 1221, 1222, 1230, 1241, 1242, 1310, 1320, 1330, 1410, 1421, 1422, 2110, 2120, 2130, 2210, 2220, 2230, 2310, 2410, 2420, 3210, 3320, 3330]
    natura: true
    excluder_resolution: 100
    clip_p_max_pu: 1.e-2
  hydro:
    cutout: europe-2013-sarah3-era5
    carriers: [ror, PHS, hydro]
    PHS_max_hours: 6
    hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country, estimate_by_large_installations or a float
    flatten_dispatch: false
    flatten_dispatch_buffer: 0.2
    clip_min_inflow: 1.0
    eia_norm_year: false
    eia_correct_by_capacity: false
    eia_approximate_missing: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#conventional
conventional:
  unit_commitment: false
  dynamic_fuel_price: false
  nuclear:
    p_max_pu: "data/nuclear_p_max_pu.csv" # float of file name

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#lines
lines:
  types:
    220.: "Al/St 240/40 2-bundle 220.0"
    300.: "Al/St 240/40 3-bundle 300.0"
    380.: "Al/St 240/40 4-bundle 380.0"
    500.: "Al/St 240/40 4-bundle 380.0"
    750.: "Al/St 560/50 4-bundle 750.0"
  s_max_pu: 0.7
  s_nom_max: .inf
  max_extension: 20000 #MW
  length_factor: 1.25
  reconnect_crimea: true
  under_construction: 'keep' # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity
  dynamic_line_rating:
    activate: false
    cutout: europe-2013-sarah3-era5
    correction_factor: 0.95
    max_voltage_difference: false
    max_line_rating: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#links
links:
  p_max_pu: 1.0
  p_nom_max: .inf
  max_extension: 30000 #MW
  include_tyndp: true
  under_construction: 'zero' # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#transformers
transformers:
  x: 0.1
  s_nom: 2000.
  type: ''

# docs-load in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#load
load:
  interpolate_limit: 3
  time_shift_for_large_gaps: 1w
  manual_adjustments: true # false
  scaling_factor: 1.0
  fixed_year: false # false or year (e.g. 2013)
  supplement_synthetic: true

# docs
# TODO: PyPSA-Eur merge issue in prepare_sector_network.py
# regulate what components with which carriers are kept from PyPSA-Eur;
# some technologies are removed because they are implemented differently
# (e.g. battery or H2 storage) or have different year-dependent costs
# in PyPSA-Eur-Sec
pypsa_eur:
  Bus:
  - AC
  Link:
  - DC
  Generator:
  - onwind
  - offwind-ac
  - offwind-dc
  - offwind-float
  - solar-hsat
  - solar
  - ror
  - nuclear
  StorageUnit:
  - PHS
  - hydro
  Store: []

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#energy
energy:
  energy_totals_year: 2019
  base_emissions_year: 1990
  emissions: CO2

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#biomass
biomass:
  year: 2030
  scenario: ENS_Med
  classes:
    solid biomass:
    - Agricultural waste
    - Fuelwood residues
    - Secondary Forestry residues - woodchips
    - Sawdust
    - Residues from landscape care
    not included:
    - Sugar from sugar beet
    - Rape seed
    - "Sunflower, soya seed "
    - Bioethanol barley, wheat, grain maize, oats, other cereals and rye
    - Miscanthus, switchgrass, RCG
    - Willow
    - Poplar
    - FuelwoodRW
    - C&P_RW
    biogas:
    - Manure solid, liquid
    - Sludge
    municipal solid waste:
    - Municipal waste
  share_unsustainable_use_retained:
    2020: 1
    2025: 0.66
    2030: 0.33
    2035: 0
    2040: 0
    2045: 0
    2050: 0
  share_sustainable_potential_available:
    2020: 0
    2025: 0.33
    2030: 0.66
    2035: 1
    2040: 1
    2045: 1
    2050: 1


# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#solar-thermal
solar_thermal:
  clearsky_model: simple  # should be "simple" or "enhanced"?
  orientation:
    slope: 45.
    azimuth: 180.
  cutout: default

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#existing-capacities
existing_capacities:
  grouping_years_power: [1920, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025]
  grouping_years_heat: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019] # heat grouping years >= baseyear will be ignored
  threshold_capacity: 10
  default_heating_lifetime: 20
  conventional_carriers:
  - lignite
  - coal
  - oil
  - uranium

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#sector
sector:
  transport: true
  heating: true
  biomass: true
  industry: true
  agriculture: true
  fossil_fuels: true
  district_heating:
    potential: 0.6
    progress:
      2020: 0.0
      2025: 0.15
      2030: 0.3
      2035: 0.45
      2040: 0.6
      2045: 0.8
      2050: 1.0
    district_heating_loss: 0.15
    forward_temperature: 90 #C
    return_temperature: 50 #C
    heat_source_cooling: 6 #K
    heat_pump_cop_approximation:
      refrigerant: ammonia
      heat_exchanger_pinch_point_temperature_difference: 5 #K
      isentropic_compressor_efficiency: 0.8
      heat_loss: 0.0
  heat_pump_sources:
    urban central:
    - air
    urban decentral:
    - air
    rural:
    - air
    - ground
  cluster_heat_buses: true
  heat_demand_cutout: default
  bev_dsm_restriction_value: 0.75
  bev_dsm_restriction_time: 7
  transport_heating_deadband_upper: 20.
  transport_heating_deadband_lower: 15.
  ICE_lower_degree_factor: 0.375
  ICE_upper_degree_factor: 1.6
  EV_lower_degree_factor: 0.98
  EV_upper_degree_factor: 0.63
  bev_dsm: true
  bev_availability: 0.5
  bev_energy: 0.05
  bev_charge_efficiency: 0.9
  bev_charge_rate: 0.011
  bev_avail_max: 0.95
  bev_avail_mean: 0.8
  v2g: true
  land_transport_fuel_cell_share:
    2020: 0
    2025: 0
    2030: 0
    2035: 0
    2040: 0
    2045: 0
    2050: 0
  land_transport_electric_share:
    2020: 0
    2025: 0.15
    2030: 0.3
    2035: 0.45
    2040: 0.7
    2045: 0.85
    2050: 1
  land_transport_ice_share:
    2020: 1
    2025: 0.85
    2030: 0.7
    2035: 0.55
    2040: 0.3
    2045: 0.15
    2050: 0
  transport_electric_efficiency: 53.19 # 1 MWh_el = 53.19*100 km
  transport_fuel_cell_efficiency: 30.003 # 1 MWh_H2 = 30.003*100 km
  transport_ice_efficiency: 16.0712 # 1 MWh_oil = 16.0712 * 100 km
  agriculture_machinery_electric_share: 0
  agriculture_machinery_oil_share: 1
  agriculture_machinery_fuel_efficiency: 0.7
  agriculture_machinery_electric_efficiency: 0.3
  MWh_MeOH_per_MWh_H2: 0.8787
  MWh_MeOH_per_tCO2: 4.0321
  MWh_MeOH_per_MWh_e: 3.6907
  shipping_hydrogen_liquefaction: false
  shipping_hydrogen_share:
    2020: 0
    2025: 0
    2030: 0
    2035: 0
    2040: 0
    2045: 0
    2050: 0
  shipping_methanol_share:
    2020: 0
    2025: 0.15
    2030: 0.3
    2035: 0.5
    2040: 0.7
    2045: 0.85
    2050: 1
  shipping_oil_share:
    2020: 1
    2025: 0.85
    2030: 0.7
    2035: 0.5
    2040: 0.3
    2045: 0.15
    2050: 0
  shipping_methanol_efficiency: 0.46
  shipping_oil_efficiency: 0.40
  aviation_demand_factor: 1.
  HVC_demand_factor: 1.
  time_dep_hp_cop: true
  heat_pump_sink_T_individual_heating: 55.
  reduce_space_heat_exogenously: true
  reduce_space_heat_exogenously_factor:
    2020: 0.10  # this results in a space heat demand reduction of 10%
    2025: 0.09  # first heat demand increases compared to 2020 because of larger floor area per capita
    2030: 0.09
    2035: 0.11
    2040: 0.16
    2045: 0.21
    2050: 0.29
  retrofitting:
    retro_endogen: false
    cost_factor: 1.0
    interest_rate: 0.04
    annualise_cost: true
    tax_weighting: false
    construction_index: true
  tes: true
  tes_tau:
    decentral: 3
    central: 180
  boilers: true
  resistive_heaters: true
  oil_boilers: false
  biomass_boiler: true
  overdimension_individual_heating: 1.1  #to cover demand peaks bigger than data
  chp: true
  micro_chp: false
  solar_thermal: true
  solar_cf_correction: 0.788457  # =  >>> 1/1.2683
  marginal_cost_storage: 0. #1e-4
  methanation: true
  coal_cc: false
  dac: true
  co2_vent: false
  central_heat_vent: false
  allam_cycle: false
  hydrogen_fuel_cell: true
  hydrogen_turbine: false
  SMR: true
  SMR_cc: true
  regional_methanol_demand: false
  regional_oil_demand: false
  regional_coal_demand: false
  regional_co2_sequestration_potential:
    enable: false
    attribute:
    - conservative estimate Mt
    - conservative estimate GAS Mt
    - conservative estimate OIL Mt
    - conservative estimate aquifer Mt
    include_onshore: false
    min_size: 3
    max_size: 25
    years_of_storage: 25
  co2_sequestration_potential: 200
  co2_sequestration_cost: 10
  co2_sequestration_lifetime: 50
  co2_spatial: false
  co2network: false
  co2_network_cost_factor: 1
  cc_fraction: 0.9
  hydrogen_underground_storage: true
  hydrogen_underground_storage_locations:
    # - onshore  # more than 50 km from sea
  - nearshore    # within 50 km of sea
    # - offshore
  ammonia: false
  min_part_load_fischer_tropsch: 0.5
  min_part_load_methanolisation: 0.3
  min_part_load_methanation: 0.3
  use_fischer_tropsch_waste_heat: 0.25
  use_haber_bosch_waste_heat: 0.25
  use_methanolisation_waste_heat: 0.25
  use_methanation_waste_heat: 0.25
  use_fuel_cell_waste_heat: 0.25
  use_electrolysis_waste_heat: 0.25
  electricity_transmission_grid: true
  electricity_distribution_grid: true
  electricity_distribution_grid_cost_factor: 1.0
  electricity_grid_connection: true
  transmission_efficiency:
    DC:
      efficiency_static: 0.98
      efficiency_per_1000km: 0.977
    H2 pipeline:
      efficiency_per_1000km: 1 # 0.982
      compression_per_1000km: 0.018
    gas pipeline:
      efficiency_per_1000km: 1 #0.977
      compression_per_1000km: 0.01
    electricity distribution grid:
      efficiency_static: 0.97
  H2_network: true
  gas_network: false
  H2_retrofit: false
  H2_retrofit_capacity_per_CH4: 0.6
  gas_network_connectivity_upgrade: 1
  gas_distribution_grid: true
  gas_distribution_grid_cost_factor: 1.0
  biomass_spatial: false
  biomass_transport: false
  biogas_upgrading_cc: false
  conventional_generation:
    OCGT: gas
  biomass_to_liquid: false
  electrobiofuels: false
  biosng: false
  municipal_solid_waste: false
  limit_max_growth:
    enable: false
    # allowing 30% larger than max historic growth
    factor: 1.3
    max_growth:  # unit GW
      onwind: 16 # onshore max grow so far 16 GW in Europe https://www.iea.org/reports/renewables-2020/wind
      solar: 28 # solar max grow so far 28 GW in Europe https://www.iea.org/reports/renewables-2020/solar-pv
      offwind-ac: 35 # offshore max grow so far 3.5 GW in Europe https://windeurope.org/about-wind/statistics/offshore/european-offshore-wind-industry-key-trends-statistics-2019/
      offwind-dc: 35
    max_relative_growth:
      onwind: 3
      solar: 3
      offwind-ac: 3
      offwind-dc: 3
  enhanced_geothermal:
    enable: false
    flexible: true
    max_hours: 240
    max_boost: 0.25
    var_cf: true
    sustainability_factor: 0.0025
  solid_biomass_import:
    enable: false
    price: 54 #EUR/MWh
    max_amount: 1390 # TWh
    upstream_emissions_factor: .1 #share of solid biomass CO2 emissions at full combustion


# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#industry
industry:
  St_primary_fraction:
    2020: 0.6
    2025: 0.55
    2030: 0.5
    2035: 0.45
    2040: 0.4
    2045: 0.35
    2050: 0.3
  DRI_fraction:
    2020: 0
    2025: 0
    2030: 0.05
    2035: 0.2
    2040: 0.4
    2045: 0.7
    2050: 1
  H2_DRI: 1.7
  elec_DRI: 0.322
  Al_primary_fraction:
    2020: 0.4
    2025: 0.375
    2030: 0.35
    2035: 0.325
    2040: 0.3
    2045: 0.25
    2050: 0.2
  MWh_NH3_per_tNH3: 5.166
  MWh_CH4_per_tNH3_SMR: 10.8
  MWh_elec_per_tNH3_SMR: 0.7
  MWh_H2_per_tNH3_electrolysis: 5.93
  MWh_elec_per_tNH3_electrolysis: 0.2473
  MWh_NH3_per_MWh_H2_cracker: 1.46 # https://github.com/euronion/trace/blob/44a5ff8401762edbef80eff9cfe5a47c8d3c8be4/data/efficiencies.csv
  NH3_process_emissions: 24.5
  petrochemical_process_emissions: 25.5
  #HVC primary/recycling based on values used in Neumann et al https://doi.org/10.1016/j.joule.2023.06.016, linearly interpolated between 2020 and 2050
  #2020 recycling rates based on Agora https://static.agora-energiewende.de/fileadmin/Projekte/2021/2021_02_EU_CEAP/A-EW_254_Mobilising-circular-economy_study_WEB.pdf
  #fractions refer to the total primary HVC production in 2020
  #assumes 6.7 Mtplastics produced from recycling in 2020
  HVC_primary_fraction:
    2020: 1.0
    2025: 0.9
    2030: 0.8
    2035: 0.7
    2040: 0.6
    2045: 0.5
    2050: 0.4
  HVC_mechanical_recycling_fraction:
    2020: 0.12
    2025: 0.15
    2030: 0.18
    2035: 0.21
    2040: 0.24
    2045: 0.27
    2050: 0.30
  HVC_chemical_recycling_fraction:
    2020: 0.0
    2025: 0.0
    2030: 0.04
    2035: 0.08
    2040: 0.12
    2045: 0.16
    2050: 0.20
  HVC_environment_sequestration_fraction: 0.
  waste_to_energy: false
  waste_to_energy_cc: false
  sector_ratios_fraction_future:
    2020: 0.0
    2025: 0.1
    2030: 0.3
    2035: 0.5
    2040: 0.7
    2045: 0.9
    2050: 1.0
  basic_chemicals_without_NH3_production_today: 69. #Mt/a, = 86 Mtethylene-equiv - 17 MtNH3
  HVC_production_today: 52.
  MWh_elec_per_tHVC_mechanical_recycling: 0.547
  MWh_elec_per_tHVC_chemical_recycling: 6.9
  chlorine_production_today: 9.58
  MWh_elec_per_tCl: 3.6
  MWh_H2_per_tCl: -0.9372
  methanol_production_today: 1.5
  MWh_elec_per_tMeOH: 0.167
  MWh_CH4_per_tMeOH: 10.25
  MWh_MeOH_per_tMeOH: 5.528
  hotmaps_locate_missing: false
  reference_year: 2019


# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#costs
costs:
  year: 2030
  version: v0.9.1
  social_discountrate: 0.02
  fill_values:
    FOM: 0
    VOM: 0
    efficiency: 1
    fuel: 0
    investment: 0
    lifetime: 25
    "CO2 intensity": 0
    "discount rate": 0.07
  # Marginal and capital costs can be overwritten
  # capital_cost:
  #   onwind: 500
  marginal_cost:
    solar: 0.01
    onwind: 0.015
    offwind: 0.015
    hydro: 0.
    H2: 0.
    electrolysis: 0.
    fuel cell: 0.
    battery: 0.
    battery inverter: 0.
  emission_prices:
    enable: false
    co2: 0.
    co2_monthly_prices: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#clustering
clustering:
  focus_weights: false
  simplify_network:
    to_substations: false
    algorithm: kmeans # choose from: [hac, kmeans]
    feature: solar+onwind-time
    exclude_carriers: []
    remove_stubs: true
    remove_stubs_across_borders: true
  cluster_network:
    algorithm: kmeans
    feature: solar+onwind-time
    exclude_carriers: []
    consider_efficiency_classes: false
  aggregation_strategies:
    generators:
      committable: any
      ramp_limit_up: max
      ramp_limit_down: max
  temporal:
    resolution_elec: false
    resolution_sector: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#adjustments
adjustments:
  electricity: false
  sector: false

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#solving
solving:
  #tmpdir: "path/to/tmp"
  options:
    clip_p_max_pu: 1.e-2
    load_shedding: false
    curtailment_mode: false
    noisy_costs: true
    skip_iterations: true
    rolling_horizon: false
    seed: 123
    custom_extra_functionality: "../data/custom_extra_functionality.py"
    # io_api: "direct"  # Increases performance but only supported for the highs and gurobi solvers
    # options that go into the optimize function
    track_iterations: false
    min_iterations: 2
    max_iterations: 3
    transmission_losses: 2
    linearized_unit_commitment: true
    horizon: 365
    post_discretization:
      enable: false
      line_unit_size: 1700
      line_threshold: 0.3
      link_unit_size:
        DC: 2000
        H2 pipeline: 1200
        gas pipeline: 1500
      link_threshold:
        DC: 0.3
        H2 pipeline: 0.3
        gas pipeline: 0.3

  agg_p_nom_limits:
    agg_offwind: false
    include_existing: false
    file: data/agg_p_nom_minmax.csv

  constraints:
    CCL: false
    EQ: false
    BAU: false
    SAFE: false

  solver:
    name: gurobi
    options: gurobi-default

  solver_options:
    highs-default:
      # refer to https://ergo-code.github.io/HiGHS/dev/options/definitions/
      threads: 1
      solver: "ipm"
      run_crossover: "off"
      small_matrix_value: 1e-6
      large_matrix_value: 1e9
      primal_feasibility_tolerance: 1e-5
      dual_feasibility_tolerance: 1e-5
      ipm_optimality_tolerance: 1e-4
      parallel: "on"
      random_seed: 123
    gurobi-default:
      threads: 8
      method: 2 # barrier
      crossover: 0
      BarConvTol: 1.e-6
      Seed: 123
      AggFill: 0
      PreDual: 0
      GURO_PAR_BARDENSETHRESH: 200
    gurobi-numeric-focus:
      NumericFocus: 3       # Favour numeric stability over speed
      method: 2             # barrier
      crossover: 0          # do not use crossover
      BarHomogeneous: 1     # Use homogeneous barrier if standard does not converge
      BarConvTol: 1.e-5
      FeasibilityTol: 1.e-4
      OptimalityTol: 1.e-4
      ObjScale: -0.5
      threads: 8
      Seed: 123
    gurobi-fallback:        # Use gurobi defaults
      crossover: 0
      method: 2             # barrier
      BarHomogeneous: 1     # Use homogeneous barrier if standard does not converge
      BarConvTol: 1.e-5
      FeasibilityTol: 1.e-5
      OptimalityTol: 1.e-5
      Seed: 123
      threads: 8
    cplex-default:
      threads: 4
      lpmethod: 4 # barrier
      solutiontype: 2 # non basic solution, ie no crossover
      barrier.convergetol: 1.e-5
      feasopt.tolerance: 1.e-6
    copt-default:
      Threads: 8
      LpMethod: 2
      Crossover: 0
      RelGap: 1.e-6
      Dualize: 0
    copt-gpu:
      LpMethod: 6
      GPUMode: 1
      PDLPTol: 1.e-5
      Crossover: 0
    cbc-default: {} # Used in CI
    glpk-default: {} # Used in CI

  mem_mb: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2
  runtime: 6h #runtime in humanfriendly style https://humanfriendly.readthedocs.io/en/latest/


# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#plotting
plotting:
  map:
    boundaries: [-11, 30, 34, 71]
    color_geomap:
      ocean: white
      land: white
  projection:
    name: "EqualEarth"
    # See https://scitools.org.uk/cartopy/docs/latest/reference/projections.html for alternatives, for example:
    # name: "LambertConformal"
    # central_longitude: 10.
    # central_latitude: 50.
    # standard_parallels: [35, 65]
  eu_node_location:
    x: -5.5
    y: 46.
  costs_max: 1000
  costs_threshold: 1
  energy_max: 20000
  energy_min: -20000
  energy_threshold: 50.

  nice_names:
    OCGT: "Open-Cycle Gas"
    CCGT: "Combined-Cycle Gas"
    offwind-ac: "Offshore Wind (AC)"
    offwind-dc: "Offshore Wind (DC)"
    offwind-float: "Offshore Wind (Floating)"
    onwind: "Onshore Wind"
    solar: "Solar"
    PHS: "Pumped Hydro Storage"
    hydro: "Reservoir & Dam"
    battery: "Battery Storage"
    H2: "Hydrogen Storage"
    lines: "Transmission Lines"
    ror: "Run of River"
    load: "Load Shedding"
    ac: "AC"
    dc: "DC"

  tech_colors:
    # wind
    onwind: "#235ebc"
    onshore wind: "#235ebc"
    offwind: "#6895dd"
    offshore wind: "#6895dd"
    offwind-ac: "#6895dd"
    offshore wind (AC): "#6895dd"
    offshore wind ac: "#6895dd"
    offwind-dc: "#74c6f2"
    offshore wind (DC): "#74c6f2"
    offshore wind dc: "#74c6f2"
    offwind-float: "#b5e2fa"
    offshore wind (Float): "#b5e2fa"
    offshore wind float: "#b5e2fa"
    # water
    hydro: '#298c81'
    hydro reservoir: '#298c81'
    ror: '#3dbfb0'
    run of river: '#3dbfb0'
    hydroelectricity: '#298c81'
    PHS: '#51dbcc'
    hydro+PHS: "#08ad97"
    # solar
    solar: "#f9d002"
    solar PV: "#f9d002"
    solar-hsat: "#fdb915"
    solar thermal: '#ffbf2b'
    residential rural solar thermal: '#f1c069'
    services rural solar thermal: '#eabf61'
    residential urban decentral solar thermal: '#e5bc5a'
    services urban decentral solar thermal: '#dfb953'
    urban central solar thermal: '#d7b24c'
    solar rooftop: '#ffea80'
    # gas
    OCGT: '#e0986c'
    OCGT marginal: '#e0986c'
    OCGT-heat: '#e0986c'
    gas boiler: '#db6a25'
    gas boilers: '#db6a25'
    gas boiler marginal: '#db6a25'
    residential rural gas boiler: '#d4722e'
    residential urban decentral gas boiler: '#cb7a36'
    services rural gas boiler: '#c4813f'
    services urban decentral gas boiler: '#ba8947'
    urban central gas boiler: '#b0904f'
    gas: '#e05b09'
    fossil gas: '#e05b09'
    natural gas: '#e05b09'
    biogas to gas: '#e36311'
    biogas to gas CC: '#e51245'
    CCGT: '#a85522'
    CCGT marginal: '#a85522'
    allam: '#B98F76'
    gas for industry co2 to atmosphere: '#692e0a'
    gas for industry co2 to stored: '#8a3400'
    gas for industry: '#853403'
    gas for industry CC: '#692e0a'
    gas pipeline: '#ebbca0'
    gas pipeline new: '#a87c62'
    # oil
    oil: '#c9c9c9'
    imported oil: '#a3a3a3'
    oil boiler: '#adadad'
    residential rural oil boiler: '#a9a9a9'
    services rural oil boiler: '#a5a5a5'
    residential urban decentral oil boiler: '#a1a1a1'
    urban central oil boiler: '#9d9d9d'
    services urban decentral oil boiler: '#999999'
    agriculture machinery oil: '#949494'
    shipping oil: "#808080"
    land transport oil: '#afafaf'
    # nuclear
    Nuclear: '#ff8c00'
    Nuclear marginal: '#ff8c00'
    nuclear: '#ff8c00'
    uranium: '#ff8c00'
    # coal
    Coal: '#545454'
    coal: '#545454'
    Coal marginal: '#545454'
    coal for industry: '#343434'
    solid: '#545454'
    Lignite: '#826837'
    lignite: '#826837'
    Lignite marginal: '#826837'
    # biomass
    biogas: '#e3d37d'
    biomass: '#baa741'
    solid biomass: '#baa741'
    municipal solid waste: '#91ba41'
    solid biomass import: '#d5ca8d'
    solid biomass transport: '#baa741'
    solid biomass for industry: '#7a6d26'
    solid biomass for industry CC: '#47411c'
    solid biomass for industry co2 from atmosphere: '#736412'
    solid biomass for industry co2 to stored: '#47411c'
    urban central solid biomass CHP: '#9d9042'
    urban central solid biomass CHP CC: '#6c5d28'
    biomass boiler: '#8A9A5B'
    residential rural biomass boiler: '#a1a066'
    residential urban decentral biomass boiler: '#b0b87b'
    services rural biomass boiler: '#c6cf98'
    services urban decentral biomass boiler: '#dde5b5'
    biomass to liquid: '#32CD32'
    unsustainable bioliquids: '#32CD32'
    electrobiofuels: 'red'
    BioSNG: '#123456'
    # power transmission
    lines: '#6c9459'
    transmission lines: '#6c9459'
    electricity distribution grid: '#97ad8c'
    low voltage: '#97ad8c'
    # electricity demand
    Electric load: '#110d63'
    electric demand: '#110d63'
    electricity: '#110d63'
    industry electricity: '#2d2a66'
    industry new electricity: '#2d2a66'
    agriculture electricity: '#494778'
    # battery + EVs
    battery: '#ace37f'
    battery storage: '#ace37f'
    battery charger: '#88a75b'
    battery discharger: '#5d4e29'
    home battery: '#80c944'
    home battery storage: '#80c944'
    home battery charger: '#5e8032'
    home battery discharger: '#3c5221'
    BEV charger: '#baf238'
    V2G: '#e5ffa8'
    land transport EV: '#baf238'
    land transport demand: '#38baf2'
    EV battery: '#baf238'
    # hot water storage
    water tanks: '#e69487'
    residential rural water tanks: '#f7b7a3'
    services rural water tanks: '#f3afa3'
    residential urban decentral water tanks: '#f2b2a3'
    services urban decentral water tanks: '#f1b4a4'
    urban central water tanks: '#e9977d'
    hot water storage: '#e69487'
    hot water charging: '#e8998b'
    urban central water tanks charger: '#b57a67'
    residential rural water tanks charger: '#b4887c'
    residential urban decentral water tanks charger: '#b39995'
    services rural water tanks charger: '#b3abb0'
    services urban decentral water tanks charger: '#b3becc'
    hot water discharging: '#e99c8e'
    urban central water tanks discharger: '#b9816e'
    residential rural water tanks discharger: '#ba9685'
    residential urban decentral water tanks discharger: '#baac9e'
    services rural water tanks discharger: '#bbc2b8'
    services urban decentral water tanks discharger: '#bdd8d3'
    # heat demand
    Heat load: '#cc1f1f'
    heat: '#cc1f1f'
    heat vent: '#aa3344'
    heat demand: '#cc1f1f'
    rural heat: '#ff5c5c'
    residential rural heat: '#ff7c7c'
    services rural heat: '#ff9c9c'
    central heat: '#cc1f1f'
    urban central heat: '#d15959'
    urban central heat vent: '#a74747'
    decentral heat: '#750606'
    residential urban decentral heat: '#a33c3c'
    services urban decentral heat: '#cc1f1f'
    low-temperature heat for industry: '#8f2727'
    process heat: '#ff0000'
    agriculture heat: '#d9a5a5'
    # heat supply
    heat pumps: '#2fb537'
    heat pump: '#2fb537'
    air heat pump: '#36eb41'
    residential urban decentral air heat pump: '#48f74f'
    services urban decentral air heat pump: '#5af95d'
    services rural air heat pump: '#5af95d'
    urban central air heat pump: '#6cfb6b'
    ground heat pump: '#2fb537'
    residential rural ground heat pump: '#48f74f'
    residential rural air heat pump: '#48f74f'
    services rural ground heat pump: '#5af95d'
    Ambient: '#98eb9d'
    CHP: '#8a5751'
    urban central gas CHP: '#8d5e56'
    CHP CC: '#634643'
    urban central gas CHP CC: '#6e4e4c'
    CHP heat: '#8a5751'
    CHP electric: '#8a5751'
    district heating: '#e8beac'
    resistive heater: '#d8f9b8'
    residential rural resistive heater: '#bef5b5'
    residential urban decentral resistive heater: '#b2f1a9'
    services rural resistive heater: '#a5ed9d'
    services urban decentral resistive heater: '#98e991'
    urban central resistive heater: '#8cdf85'
    retrofitting: '#8487e8'
    building retrofitting: '#8487e8'
    # hydrogen
    H2 for industry: "#f073da"
    H2 for shipping: "#ebaee0"
    H2: '#bf13a0'
    hydrogen: '#bf13a0'
    retrofitted H2 boiler: '#e5a0d9'
    SMR: '#870c71'
    SMR CC: '#4f1745'
    H2 liquefaction: '#d647bd'
    hydrogen storage: '#bf13a0'
    H2 Store: '#bf13a0'
    H2 storage: '#bf13a0'
    land transport fuel cell: '#6b3161'
    H2 pipeline: '#f081dc'
    H2 pipeline retrofitted: '#ba99b5'
    H2 Fuel Cell: '#c251ae'
    H2 fuel cell: '#c251ae'
    H2 turbine: '#991f83'
    H2 Electrolysis: '#ff29d9'
    H2 electrolysis: '#ff29d9'
    # ammonia
    NH3: '#46caf0'
    ammonia: '#46caf0'
    ammonia store: '#00ace0'
    ammonia cracker: '#87d0e6'
    Haber-Bosch: '#076987'
    # syngas
    Sabatier: '#9850ad'
    methanation: '#c44ce6'
    methane: '#c44ce6'
    # synfuels
    Fischer-Tropsch: '#25c49a'
    liquid: '#25c49a'
    kerosene for aviation: '#a1ffe6'
    naphtha for industry: '#57ebc4'
    methanolisation: '#83d6d5'
    methanol: '#468c8b'
    shipping methanol: '#468c8b'
    industry methanol: '#468c8b'
    # co2
    CC: '#f29dae'
    CCS: '#f29dae'
    CO2 sequestration: '#f29dae'
    DAC: '#ff5270'
    co2 stored: '#f2385a'
    co2 sequestered: '#f2682f'
    co2: '#f29dae'
    co2 vent: '#ffd4dc'
    CO2 pipeline: '#f5627f'
    # emissions
    process emissions CC: '#000000'
    process emissions: '#222222'
    process emissions to stored: '#444444'
    process emissions to atmosphere: '#888888'
    oil emissions: '#aaaaaa'
    shipping oil emissions: "#555555"
    shipping methanol emissions: '#666666'
    land transport oil emissions: '#777777'
    agriculture machinery oil emissions: '#333333'
    # other
    shipping: '#03a2ff'
    power-to-heat: '#2fb537'
    power-to-gas: '#c44ce6'
    power-to-H2: '#ff29d9'
    power-to-liquid: '#25c49a'
    gas-to-power/heat: '#ee8340'
    waste: '#e3d37d'
    other: '#000000'
    geothermal: '#ba91b1'
    geothermal heat: '#ba91b1'
    geothermal district heat: '#d19D00'
    geothermal organic rankine cycle: '#ffbf00'
    AC: "#70af1d"
    AC-AC: "#70af1d"
    AC line: "#70af1d"
    links: "#8a1caf"
    HVDC links: "#8a1caf"
    DC: "#8a1caf"
    DC-DC: "#8a1caf"
    DC link: "#8a1caf"
    load: "#dd2e23"
    waste CHP: '#e3d37d'
    waste CHP CC: '#e3d3ff'
    HVC to air: 'k'
