Skip to content

FINITO Link - #128

Open
mmowers wants to merge 105 commits into
mainfrom
bs/finito_link
Open

mmowers wants to merge 105 commits into
mainfrom
bs/finito_link

Conversation

@mmowers

@mmowers mmowers commented Jun 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR provides a linkage to the FINITO model, which is currently a private repository at https://github.com/NatLabRockies/FINITO). The linkage allows the full electricity sector detail of the ReEDS model to be used in combination with the industrial (and other) sector representation of the FINITO model.

The linkage is turned off by default, so this PR itself should not have impact on ReEDS results (although very small differences were observed in out years, presumably because the ReEDS model itself was touched, even if the matrix is identical).

For a high-level overview of FINITO and the linkage points see this slide deck.

See companion FINITO PR: https://github.com/NatLabRockies/FINITO/pull/438

Technical details

Turning on the linkage adds the constraints of the FINITO model to those of the ReEDS model, and adds the two objective functions together.

To turn on the linkage, clone the FINITO model and checkout the bs/reeds_link2 branch, unless this branch has already been merged into main, at which point main.

Configure these switches:

  • GSw_FINITO_Link: This switch turns on the linkage
  • finito_dir: This switch needs to point to the FINITO directory as a complete, absolute path
  • finito_cases_file: This switch should be the suffix of the cases file in the FINITO directory, which contains the corresponding FINITO scenario configuration
  • finito_case: This switch is the specific case in finito_cases_file to be run
  • first_year_finito: This switch is the first year that the linkage will be implemented

The reeds conda environment should be used for the linked model.

Linked runs result in the the same set of ReEDS outputs, but new outputs are also added from FINITO in the finito subdirectory of the run directory.

Relevant sources or documentation

FINITO documentation is at https://github.com/NatLabRockies/FINITO

Validation, testing, and comparison report(s)

A comparison of default (Ref) was made berfore and after this change, showing no changes, as expected:
reeds_report_ref_2026-08-05.zip

Running the USA_fast case with the linkage turned on results in moderate generation differences to the ReEDS standalone "USA_fast", but similar amonts of fossil and renewables by 2050:
image

Electricity load differences show that FINITO endogenous industrial electricity demand is lower than the reference demand that was removed from the EER load profiles, even in the near term:
image

Gas price differences align with gas generation differences by 2050, although alignment isn't perfect for the years before:
image

See more results of the comparison here:
reeds_report_finito_vs_usa-fast_plus4_2026-08-08.zip

Also, a more thorough comparison of the reference industrial electricity load that was removed from ReEDS load profiles, as compared to the endogenous finito load that was added back in, is here:
finito_load_check_2026-08-06.zip

Checklist for author

Details to double-check

  • Charge code provided to reviewers
  • Included comparison reports for appropriate test cases
  • Documentation updated if necessary
  • If input data added/modified:
    • Dollar year recorded and converted to 2004$ for GAMS
    • Timeseries are in Central Time
    • Units are specified
    • Preprocessing steps have been documented and committed to ReEDS_Input_Processing
    • New large data files handled with .h5 instead of .csv
    • If spatially resolved inputs are modified, the following visualizations for each file are included in the PR description (time-averaged if the inputs are time-resolved):
      • Map of absolute values before
      • Map of absolute values after
      • Map of differences: (after - before) or (after / before)
    • If entries are added/removed/changed in the EIA-NEMS unit database:
      • Changes have been committed to ReEDS_Input_Processing
      • hourlize/resource.py was rerun to regenerate the existing/prescribed VRE capacity data
  • Code formatting standardized
  • Reusable functions used where possible instead of copy/pasted code

General information to guide review

  • Zero impact on results of default case
  • No large data file(s) added/modified
  • No substantive impact on runtime for full-US reference case
  • No substantive impact on folder size for full-US reference case
  • No change to process flow (runreeds.py, reeds/core/solve/solve.py)
  • No change to code organization
  • No change to package requirements (environment.yml or Project.toml)

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Tag points of contact here if you would like additional review of the relevant parts of the model

@mmowers
mmowers marked this pull request as ready for review July 2, 2026 15:50
@bsergi bsergi changed the title Finito Link FINITO Link Jul 6, 2026
@github-actions github-actions Bot added the docs label Sep 12, 2026

@bsergi bsergi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the helpful feedback here--I took a pass at addressing most of these but let me know if there's any I missed.

I plan to rerun the comparison cases once the HPC comes back. The other outstanding piece is that I'm still sorting through the best way to report fuel prices for coal, biomass, and nuclear from FINITO just to ensure our system cost isn't missing any fuel costs.

Comment thread cases_test.csv Outdated
pras_unitsize_source,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r2x
pras_vre_combine,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
pras_samples,,,,,,10,10,10,,,,,,,,,,,,,,,,10,10,,,,,,
,Default Value,Pacific,USA_defaults,Mid_Case,USA_decarb,github_Pacific,github_Everything,github_MA_county_CC,Pacific_CC,Pacific_weks,Pacific_full_year,Interday_storage,Pacific_2020,Pacific_rep15,WY_county,WECC_county,PJM_county_CC,NYVT_mixed,OR_water,MonteCarlo_Random,MonteCarlo_LHS,Everything,Simple,USA_fast,USA_faster,MultiMetricRA,Pacific_DR,Pacific_MGA,Pacific_LoadSite95,MARICTNYNJPAOH_Offshore,R2P,FINITO,FINITO_Pacific

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original motivation for two was to have a quick test and a test with the recommended defaults for a national-scale linked run. I'll move the latter to the cases_examples.csv.

My thinking for including the quick test here was that it would be nice as part of Kennedy's regular checks to run a linked case to see if it's working or not. There wouldn't necessarily be an obligation to fix before merging, but it could be helpful for tracing when something broke (it already seems like we have some test cases that are failing in the tagged versions).

Comment thread cases.csv Outdated
demandscen,Demand scenario (see inputs\load),N/A,AEO_2026_baseline,
dr_shedscen,DR shed scenario,demo_data_January_2025,demo_data_January_2025,
evmcscen,EVMC scenario for load and supply curve and flexibility,Baseline,Baseline,
GSw_FINITO_Link,Switch to enable linkage with FINITO,0; 1,0,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

Comment thread cases.csv Outdated
finito_dir,Directory with cloned FINITO repository,N/A,/path/to/FINITO/directory,
finito_cases_file,"extension of the FINITO cases file including all scenarios to be run, e.g., 'linked' for cases_linked.csv",N/A,linked,
finito_case,Case name for FINITO in {finito_dir}/cases_linked.csv; use 'same' if the scenario name in cases_linked.csv matches the scenario name in the cases file,N/A,BAUfast,
first_year_finito,First year when the FINITO module is enabled,N/A,2018,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to the idea, but how would this work given that FINITO starts in 2018 and StartMarkets is set to 2026? Are you proposing to try not running FINITO until 2026?

Comment thread reeds/core/solve/2_temporal_params.gms Outdated
* ----- ReEDS-FINITO temporal parameters -----
*=============================================
$ifthene.linked_finito_temporal_params %GSw_FINITO_Link% ==1
$include finito/model/linked_finito_temporal_params.gms

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I rooted all these out previously but looks like I missed a few.

Comment thread reeds/core/solve/3_solve_oneyear.gms Outdated
* (ReEDS-FINITO) also reset t_finito
$ifthene.linked_finito_time %GSw_FINITO_Link% == 1
t_finito(t) = no ;
t_finito(t)$[tmodel(t)$(t.val>=first_year_finito)$(t.val<=endyear)] = yes ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refer to the same thing--standardized this one to match.

Comment on lines +404 to +406
$ifthene.linked_load Sw_FINITO_Link==1
+ (USE_ELE_FINITO(r,h,t) / (1.0 - distloss))$[t_finito(t)] * (1 + prm(r,t)$h_stress(h))
$endif.linked_load

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the other comment, but that approach will cause an error since USE_ELE_FINITO is only defined if FINITO is linked.

Comment thread reeds/core/setup/c_model.gms Outdated
Comment on lines +3867 to +3868
* capture from industry when linked with FINITO [metric_tons-CO2/hr]:
* calculation: hours_per_year [yrs/hr] * capture [scaled_metric_tons-CO2/yr] / co2_scale [scaled_metric_tons-CO2/metric_tons-CO2]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment thread reeds/core/setup/c_model.gms Outdated
+ sum{rr$co2_routes(r,rr), CO2_FLOW(rr,r,h,t) - CO2_FLOW(r,rr,h,t) }

* (ReEDS-FINITO) extraction - use of CO2 [metric_tons-CO2/hr]
*calculation: hours_per_year [yrs/hr] * (1 / co2_scale [scaled_metric_tons-CO2/metric_tons-CO2]) * extraction/use [scaled_metric_tons-CO2/yr]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging. I think many of these errors were holdover to when FINITO didn't have the h representation.

Comment thread reeds/core/setup/c_model.gms Outdated
* (ReEDS-FINITO) extraction of CO2 [metric_tons-CO2/hr]
* calculation: hours_per_year [yrs/hr] * (1 / co2_scale [scaled_metric_tons-CO2/metric_tons-CO2]) * use [scaled_metric_tons-CO2/yr]
$ifthene.linked_co2_spurline_caplimit Sw_FINITO_Link==1
+ [ (1 / co2_scale) * EXTRACT_CO2_CS(cs,r,h,t) ]$[h_rep(h)$t_finito(t)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's right about being used to reduce model size. I chatted through this with Charalampos and we think the best approach would be to remove the h_rep(h) conditionals throughout the CO2 equations for the time being so as to be consistent, and to open an issue on the need to revisit ways to improve the CO2 detail treatment more generally.

Comment thread reeds/core/setup/c_model.gms Outdated

*gas used from each bin is the sum of all gas used
eq_gasused(cendiv,h,t)$[tmodel(t)$((Sw_GasCurve=0) or (Sw_GasCurve=3))]..
eq_gasused(cendiv,h,t)$[tmodel(t)$tfuel(t)$((Sw_GasCurve=0) or (Sw_GasCurve=3))]..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through to verify the new not tfinito(t) is applied to all the supply curve constraints.

@bsergi
bsergi requested a review from cavraam October 2, 2026 20:26
@patrickbrown4
patrickbrown4 self-requested a review October 2, 2026 20:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants