couplers.remind
REMIND coupling backends: GDX and IAMC (.mif).
Two Coupler subclasses implementing the source-specific hooks
(build_regional_demand and extract_cost_parameters) for REMIND output:
RemindGdxCoupler— GDX backend (readsload_sector/cost symbols directly).RemindIamcCoupler— IAMC.mifbackend (derives demand via T&D efficiency + AC residual; reads per-parameter variable-sets, converts FOM to %/capex, derives nuclear fuel cost/efficiency from mass-basis REMIND variables).
All other builders (build_co2_prices, discount_rates, downscale_country_demand)
are inherited from Coupler unchanged — they work for both backends via
spec-shape dispatch.
RemindGdxCoupler
¶
Bases: Coupler
Coupler specialised for REMIND GDX output.
Implements:
- build_regional_demand: reads load_sector GDX symbol (TWa→MWh via spec).
- extract_cost_parameters: reads all cost symbols from GDX, applies REMIND-GDX
tech-facts (tnrs/peur nuclear mass-basis → USD/MWh_el, storage $/MWh label,
GAMS-dropped zeros filled).
Source code in src/iampypsa/couplers/remind.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
build_regional_demand()
¶
Read REMIND regional sectoral demand as tidy [year, region, sector, value] (MWh/yr).
Reads demand_fe_sectors (p32_load_sector), with TWa→MWh conversion applied by
load_frame, and restricts to the configured REMIND regions. All available years are
returned; the year filter to planning horizons happens in downscale_country_demand.
Source code in src/iampypsa/couplers/remind.py
extract_cost_parameters(year)
¶
Extract REMIND GDX cost parameters as long
[region, technology, parameter, value, unit].
Unit conversions are config-declared (applied by load_frame/load_set). The
REMIND-GDX-specific tech-facts encoded here are:
- tnrs (nuclear) efficiency is mass-basis (TWa_elec/Mt_Ur); combined with peur's
$/g_U fuel price into a true USD/MWh_el cost + 1.0 p.u. efficiency (see
_nuclear_fuel_cost).
- Storage techs (h2stor, btstor) share the $/MW capex factor but are
relabelled $/MWh.
- GDX/GAMS drops explicit zeros, so entries missing for a modeled technology are
true zeros (filled via _fill_missing_with_zero).
Source code in src/iampypsa/couplers/remind.py
RemindIamcCoupler
¶
Bases: Coupler
Coupler specialised for REMIND IAMC .mif output.
Implements:
- build_regional_demand: FE sector rebasing via derived η_td + AC residual.
- extract_cost_parameters: loads per-parameter variable-sets, computes FOM%,
derives nuclear fuel cost/efficiency from mass-basis REMIND variables.
Source code in src/iampypsa/couplers/remind.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
build_regional_demand()
¶
Derive regional sectoral electricity demand from IAMC mif variables (MWh/yr).
Variable names and sector token labels come from the symbol config. The algorithm applied on top is REMIND-specific:
- η_td = (SE − Losses) / SE (derived T&D efficiency, replaces GDX pm_eta_conv).
- Electricity FE sectors are rebased to the SE level: FE_sector_MWh / η_td.
demand_h2is treated as a hydrogen-demand quantity and is not rebased. - Electrolysis electricity demand (MWh_el) = (SE|Hydrogen|Electricity − SE|Input|Hydrogen|Electricity) / η_elec Both SE variables are in EJ H2; the difference is the net H2 from electricity destined for final-energy demand (not cycling back via fuel cells). Dividing by η_elec converts to the electricity consumed to produce it. This matches REMIND's p32_load_sector("elh2") on the GDX path exactly.
- AC = (SE − Losses) − Σ(rebased FE sectors) − electrolysis (residual). Negative values are clamped to 0 with a warning.
Returns [year, region, sector, value, unit] matching the GDX path.
Source code in src/iampypsa/couplers/remind.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
extract_cost_parameters(year)
¶
Extract REMIND mif cost parameters as [region, technology, parameter, value, unit].
Reads six per-parameter variable-sets declared in the IAMC symbol config
(cost_investment, tech_lifetime, cost_omf, cost_omv, efficiency, fuel_price,
emission_factor), queries to year, and:
- Computes FOM%/yr = absolute FOM (USD/MW/yr) / capex (USD/MW) × 100, because the mif reports absolute FOM whereas PyPSA-Eur uses percent-of-capex.
- Derives nuclear's fuel cost/efficiency from mass-basis price/conversion-factor
variables (see
_nuclear_fuel_cost) — not a fallback, real per-region REMIND data. - Reads real per-tech CO2 intensity (t_CO2/MWh_th); biomass techs without a mif variable fall back to 0.0 (carbon-neutral), declared in the symbol config.
Battery cost tokens are intentionally omitted (their mif values are full-system costs per kW_power and are not comparable to PyPSA-Eur's separate inverter+storage parametrisation; those techs fall back to the PyPSA-Eur baseline).
Source code in src/iampypsa/couplers/remind.py
read_region_map(source='country', target='model_region', file_path=None, flatten=False)
¶
Read the REMIND region↔country mapping as {source: [target, ...]}.
Reads the ;-separated mapping CSV (columns RegionCode/CountryCode), converts
ISO3 country codes to ISO2, and adds Kosovo (XK → NES). Pass source/target as
"model_region" or "country" to select the groupby direction.