{"id":"2c79a0bb-912b-49b2-a3c8-440c1bb4710d","arxiv_id":"2412.06571","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":6.0,"correctness_risk":"medium","formal_verification":"none","parameter_count":5,"one_line_summary":"PyPSA-Spain is an open-source, high-resolution model of the Spanish power system whose corrected renewable profiles and regional demand data yield a different optimal 2030 mix than the standard European model.","lead":"This paper presents PyPSA-Spain, an open-source computer model of Spain's electricity system built from the European PyPSA-Eur model, adding improved wind and solar profiles, regional demand data, and hourly cross-border trade. It is a practical tool for testing Spanish decarbonization plans, and the paper uses it to compare a cost-optimal 2030 electricity mix with Spain's official energy and climate plan.","discovery_kind":"new_application","skeptic_critique":{"model":"deepseek-v4-flash","headline":"The Q2Q renewable-profile correction is validated entirely on the same 2022 data used to fit it, so the reported improvement is in-sample and the 2030 results depend on an untested stationarity and scale-transfer assumption.","rationale":"I read the paper as a model-delivery and software contribution, and the open code, documentation, and reproducible workflows are genuine strengths. The central claim of improved representation, however, stands or falls with the Q2Q correction because Section 4 shows Case 1 changes the optimal mix most strongly, while demand and interconnection effects are smaller. The Q2Q validation is entirely in-sample: the target distribution used in Eq. (3) is the same 2022 historical series compared in Figures 5-7, and the normalisation scheme is selected by that same comparison. This makes the reported improvements expected rather than evidence of generalisability. Because the 2030 results and the NECP comparison use these corrected profiles, the numerical headline claims depend on stationarity and scale-transfer assumptions that are plausible but unverified. This does not invalidate the open model as a tool, but it means the 2030 results should be presented as conditional on those assumptions. An out-of-sample 2023 check would settle the concern, and the paper already contains the infrastructure needed to run it. This is exactly the reader's weakest assumption, and I agree with the CONDITIONAL verdict.","tokens_in":20626,"tokens_out":4396,"duration_ms":51533,"concrete_test":"Use public REE/ESIOS data for an out-of-sample 2023 validation: apply the published 2022 Q2Q transforms to PyPSA-Eur/Atlite capacity factors for the 2023 meteorological year with actual 2023 NUTS2 installed capacities, aggregate to national level, and compute bias and 1h/24h/7d RMSE against the 2023 historical generation series, for both wind and solar PV. If the Q2Q-corrected series is not consistently closer to the 2023 historical data than the uncorrected PyPSA-Eur series, the transform is overfit to 2022 and the 2030 mix results should be re-run with uncorrected or re-calibrated profiles. As a secondary check, calibrate the Q2Q transform separately on available NUTS2 or control-area generation series and compare with the country-level transform applied to those cells; large differences would show that the scale transfer in Eq. (3) is not valid.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The load-bearing element is the Q2Q correction in Section 3.1, Eq. (3). It is calibrated to the 2022 national historical wind and solar generation and to the same 2022 PyPSA-Eur capacity factors, and the choice among normalisation schemes 1-3 in Section 3.1 and Appendix B is made on the same year. The reported bias/RMSE improvements in Figures 7 and 28 are therefore in-sample diagnostics: they show the transform can reproduce the distribution it was fit to, not that the model's renewable profiles are generally more accurate. Because Section 4 shows this correction is the functionality with the largest effect on the optimal mix, the 2030 case study and the NECP export comparison in Section 5 inherit these profiles. The central claim of a more reliable Spanish representation thus requires the unstated assumption that the 2022 country-level bias structure of ERA5/Atlite relative to actual generation persists to the 2030 weather year and transfers unchanged from national scale to every Voronoi cell. That assumption is not tested anywhere; the text itself warns that changing configuration parameters or meteorological year may reduce performance. In addition, a pointwise monotone transform cannot correct phase or spatial-correlation errors, so reductions in country-level RMSE may overstate the improvement in timing that matters for storage and interconnection sizing.","agreement_with_reader":"agree"},"referee_report":{"model":"deepseek-v4-flash","summary":"The paper introduces PyPSA-Spain, an open-source single-country extension of PyPSA-Eur for the Spanish power system. It adds three main functionalities: a quantile-to-quantile (Q2Q) correction of wind and solar capacity factors calibrated to Spanish 2022 historical generation, NUTS2/NUTS3 demand profiles from Datadis, and price-based interconnections with France and Portugal via virtual border nodes fed by a one-node-per-country PyPSA-Eur optimisation. The model is used to compute cost-optimal 2030 mixes, finding roughly 70 GW each of onshore wind and solar PV, and to compare with the Spanish NECP, concluding that the NECP may overestimate exports to France.","tokens_in":20986,"tokens_out":9654,"duration_ms":102478,"significance":"If the validation issues are resolved, this is a valuable open modelling contribution. The paper ships open code and data, documents a reproducible workflow, exploits national institutional data (REE, Datadis), and provides a transparent spatial-resolution analysis. The Q2Q correction is a simple and potentially transferable idea, and the nested interconnection approach is a pragmatic alternative to full co-optimisation. The paper also produces falsifiable quantitative predictions (capacity mixes, interconnector flows, CO2 prices) that can be checked against future outcomes.","major_comments":[{"comment":"The headline validation of the Q2Q correction is in-sample and partly tautological. Because Eq. (3) is \\bar g* = CDF_H^{-1}(CDF_PE(\\bar g)), the marginal distribution of the transformed series equals the target CDF by construction, so the PDF agreement in Figures 5 and 26 is a consistency check rather than independent evidence. The bias and RMSE statistics in Figures 7 and 28 are computed on the same 2022 data used to estimate CDF_H, CDF_PE, and to select among normalisation schemes 1-3, so they measure in-sample fit. This is load-bearing because Section 4 shows the profile correction is the functionality with the largest effect on the optimal mix, and the 2030 case study in Section 5 inherits these profiles. The text itself warns at the end of Section 3.1 that changing configuration parameters or meteorological year may reduce performance, but that warning is not operationalised. Please add a genuine out-of-sample evaluation, e.g., calibrate on 2022 and validate on 2023, or perform split-sample cross-validation over several years, and report whether the normalisation-scheme ranking and the RMSE reductions persist.","section":"Section 3.1, Eq. (3), Figures 5, 7, 26, 28"},{"comment":"The country-level Q2Q transform is applied to every Voronoi cell, but the cell-level validity of this transfer is not demonstrated. The normalisation analysis in Section 3.1 compares only country-level aggregates, and no NUTS2 or cell-level validation is reported. A monotone pointwise transform cannot correct phase errors or spatial-correlation errors in the modelled time series, so improved country-level bias and RMSE need not translate into improved timing of renewable availability at individual nodes, which is what matters for storage and interconnection sizing in the 2030 optimisations. Please validate the corrected profiles at regional scale using the NUTS2 installed-capacity data already exploited in Section 3.4.1, and report temporal-coherence metrics (e.g., lagged correlation or event-timing errors) in addition to marginal-distribution statistics.","section":"Section 3.1, scale transfer from country to Voronoi cells"},{"comment":"The nested-interconnection price series are produced by a one-node-per-country PyPSA-Eur model under a single -70% CO2 target, and the conclusion in Section 5 that the NECP may overestimate exports to France depends directly on those prices. No sensitivity of the price series or of the resulting net flows to the neighbouring-country CO2 target, to the clustering resolution of the European model, or to the weather year is reported. Because the virtual border-node formulation makes Spain a price-taker on each interconnection, the export/import balance is exactly as robust as the assumed price series. Please stress-test the boundary prices (e.g., alternative CO2 targets or small price offsets) and show whether the qualitative conclusion about NECP exports to France survives.","section":"Section 3.3, Figures 11, 17, 21"},{"comment":"The 2030 scenario results are presented as point estimates without uncertainty quantification. The optimal capacities, battery requirements, and interconnector flows are conditional on several assumptions that the paper itself shows are influential, notably the Q2Q correction, the solar PV investment cost of 440 EUR/kWe in Table 4, the 1 MW/km2 power density cap, and the CO2 limit. The paper provides a spatial-resolution sensitivity but no sensitivity over these techno-economic parameters. At minimum, a one-at-a-time sensitivity analysis over the solar PV cost and the power density cap, together with a statement of how the NECP comparison changes, would be needed to support the policy-relevant claims in Section 5.","section":"Sections 4-5, Table 4, Figures 18-21"}],"minor_comments":[{"comment":"The abstract contains a typo: 'a entire year' should read 'an entire year'.","section":"Abstract"},{"comment":"There are several typos: 'stablish' should be 'establish', and 'The reminder of this paper' should be 'The remainder of this paper'.","section":"Section 1"},{"comment":"In the description of the capacity limit, 'This cup is used during the optimisation phase' should read 'This cap is used during the optimisation phase'.","section":"Section 2.2"},{"comment":"Typos include 'Lets consider' (should be 'Let us consider'), 'subestimation' (should be 'underestimation'), and 'strit' (should be 'strict').","section":"Section 3.1 and Section 4"},{"comment":"The text refers to 'Figure 3.4.2' where it should refer to Figure 12, and uses 'NCEP' instead of 'NECP' in Section 4.","section":"Sections 3.4.2 and 4"},{"comment":"The captions of Figures 27 and 28 say 'wind power generation time series' but the analysis in Appendix B is for solar PV generation; the captions should be corrected accordingly.","section":"Appendix B, Figures 27 and 28"},{"comment":"The bar charts in the Case 1, Case 2, and Case 3 figures appear to retain the legend label 'Reference case'; this is confusing because the figures are meant to show the cases with individual functionalities. The legends should be updated to match each figure.","section":"Figures 14-16"},{"comment":"Minor wording: 'a node located in the border' should be 'a node located at the border', and 'a node located in the shore' should be 'a node located on the shore'.","section":"Section 3.3"}],"recommendation":"major_revision","confidential_remarks":"The concern raised in the stress-test is valid and is the main reason for my recommendation: the central benefit of PyPSA-Spain over PyPSA-Eur rests on an in-sample Q2Q validation. The issue is fixable with an out-of-sample year or split-sample cross-validation, so I do not recommend rejection. The paper is a good fit for physics.comp-ph as a software/model description, and the open-code, open-data practice is a clear strength."},"author_rebuttal":null,"desk_editor":{"model":"deepseek-v4-flash","letter":"Two things to know. First, PyPSA-Spain is a genuinely useful open model: the Datadis NUTS2/NUTS3 demand data, the TSO-based regional capacities, and the nested hourly-price interconnections are real extensions over PyPSA-GB, and the per-functionality sensitivity analysis is the right way to present a model of this kind. Second, the headline Q2Q renewable-profile correction is fit and validated on the same 2022 data, so the reported bias/RMSE improvements are in-sample, and the 2030 results inherit an untested stationarity and scale-transfer assumption.\n\nThe paper does several things well. The demand data is a clear step forward: sector-resolved hourly profiles at NUTS2/3 capture regional patterns (summer tourism in the Balearics, industrial baseload in Navarra) that the single national profile in PyPSA-Eur misses. The nested interconnection treatment, using exogenous hourly prices from a European PyPSA-Eur run, is a reasonable middle ground between co-optimisation and fixed flows, and the paper is honest that it is an approximation. The NECP comparison, around 70 GW each for solar and onshore wind, and the suggestion that the NECP overestimates exports to France, is policy-relevant and the reasoning is transparent. The code and data are public.\n\nThe soft spots are real but proportionate. The Q2Q transform is a quantile mapping: CDF_H^{-1}(CDF_PE(g)). Matching the marginal distribution of the 2022 target is therefore by construction, not independent evidence. The bias and RMSE improvements are not fully tautological, since the transform is applied per Voronoi cell and re-aggregated, so the time series diagnostics carry some information, but they are in-sample: the same year selects the normalisation scheme (scheme 3 for wind, scheme 1 for solar) and evaluates it. The paper itself warns that other meteorological years or turbine models may reduce performance; that warning is the whole problem in miniature, because the 2030 case study relies on the 2022-fitted transform applied outside its calibration year. A pointwise monotone transform also cannot fix phase or spatial-correlation errors, so the RMSE gains may flatter the timing accuracy that matters for storage sizing. Minor points: the neighbouring-country prices come from a one-node-per-country model with a -70% CO2 target while Spain is optimised to a stricter target, and the technique section does not cite the large climate-science literature on quantile mapping.\n\nWho should read it: anyone building a national PyPSA model, and anyone doing Spanish power-system planning. The authors should be asked for out-of-sample or at least split-year validation, a clearer statement of what the Q2Q does and does not guarantee, and ideally a short weather-year robustness check on the 2030 mix. It deserves a serious referee, not a desk reject.","headline":"Useful open Spanish power-system model with genuinely new national datasets, but the headline Q2Q profile correction is fitted and validated on the same year, so the 2030 transfer rests on untested assumptions.","tokens_in":21490,"tokens_out":6147,"would_cite":true,"duration_ms":57689,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":["89.30.-g"],"model":"deepseek-v4-flash","headline":"PyPSA-Spain, a single-country extension of PyPSA-Eur with corrected renewable profiles and price-based interconnections, yields a more balanced 2030 mix for Spain and suggests the official energy plan overestimates exports to France.","keywords":["energy system model","PyPSA-Eur","quantile-to-quantile correction","renewable capacity factors","Spanish electricity system","2030 decarbonisation","interconnection modelling","national energy and climate plan"],"falsifier":"Compare the Q2Q-transformed wind and solar profiles for a non-2022 historical year, such as 2018 or 2023, against actual Spanish generation; if bias and RMSE are not lower than in the uncorrected PyPSA-Eur profiles, the claimed improvement does not generalise.","tokens_in":20394,"feed_emoji":"⚡","tokens_out":10577,"duration_ms":92693,"temperature":0.7,"pith_summary":"PyPSA-Spain is an open-source model of the Spanish electricity system built on the European model PyPSA-Eur. The paper argues that a single-country model with national data improves the representation of Spain compared to treating it as one node inside a European optimisation. Three features carry the improvement: a quantile-to-quantile (Q2Q) correction of wind and solar hourly capacity factors calibrated on 2022 historical generation, regional demand profiles at NUTS 2 and NUTS 3 levels, and interconnections to France and Portugal whose imports and exports respond to hourly electricity prices. In a 2030 case study, the corrected model yields a cost-optimal mix with roughly 70 GW each of solar PV and onshore wind, and indicates that the official Spanish energy plan overestimates exports to France because it assumes no decarbonisation in neighbouring countries.","feed_headline":"Open Spanish grid model finds 70 GW each of solar and wind for 2030","feed_subtitle":"The model corrects wind and solar bias with historical data and says the official plan overestimates exports to France.","key_machinery":"The central mechanism is the quantile-to-quantile (Q2Q) transformation $\\bar g^* = Q(\\bar g) = \\mathrm{CDF}_{H}^{-1}(\\mathrm{CDF}_{PE}(\\bar g))$, which maps the cumulative distribution of the modelled normalised capacity factor to that of historical national generation; three normalisation schemes are tested, and the paper chooses scheme 3 for wind and scheme 1 for solar, then applies the fitted transform to the hourly capacity factor of every Voronoi cell, the area assigned to each network node. The second load-bearing piece is the nested interconnection model: hourly price series for France and Portugal, obtained from a lower-resolution European optimisation with a consistent carbon target, are attached to border nodes so that imports and exports are decided by price arbitrage. The Q2Q transform corrects the systematic under/overestimation in the renewable time series without requiring knowledge of its physical cause, while the nested pricing keeps the single-country model consistent with a decarbonising Europe.","core_discovery":"The central claim is that the single-country model PyPSA-Spain, by replacing PyPSA-Eur's default Spanish representation with national-specific inputs, produces a more accurate picture of the Spanish power system. The Q2Q transformation reshapes the distribution of modelled hourly capacity factors for wind and solar so that it matches the distribution of historical national generation; the paper selects normalisation scheme 3 for wind and scheme 1 for solar, and applies the resulting function cell-by-cell. Demand is represented with regional hourly profiles and regional annual shares, and interconnections are modelled with border nodes whose generators and loads carry precomputed hourly prices from a European PyPSA-Eur run. When optimising the 2030 mix under the decarbonisation target of the Spanish NECP, the model finds about 70 GW of solar PV and about 70 GW of onshore wind; it also finds that Spain would be a net exporter to France and Portugal, and that the NECP's assumed French exports are larger than what emerges when France is also assumed to decarbonise.","pith_inferences":["Editorial extension: The Q2Q transform is calibrated and evaluated on the same year, 2022; applying the fitted transform to a different historical weather year would test whether it reduces bias generally or merely memorises that year.","Editorial extension: The negligible aggregate effect of the demand refinement suggests its value may lie in grid-bottleneck analysis rather than capacity totals; examining line loadings with the regional demand profiles could reveal that value.","Editorial extension: The one-way nested price treatment could be iterated, using the Spanish model's dispatch to update border prices, yielding a stronger equilibrium without running a full European optimisation.","Editorial extension: Because the Q2Q correction is purely statistical, its applicability to future scenarios with different turbine technology or siting patterns is uncertain; a physical calibration would be needed for reliable extrapolation."],"forward_implications":["The Q2Q-corrected profiles change the 2030 optimal mix from a solar-dominated configuration to a balanced one, with roughly 70 GW of solar PV and 70 GW of onshore wind, and lower battery and floating-offshore needs.","The refined regional demand representation alone has a negligible effect on aggregate optimal capacities, but it makes it possible to construct future demand scenarios with different sectoral shares across regions.","With price-based interconnections, the model yields net exports of similar order to historical balances, and suggests that the Spanish NECP overestimates exports to France because it does not assume French decarbonisation.","A spatial resolution of at least 35–50 nodes is required to stabilise the optimal onshore wind capacity and avoid underestimating wind potential.","The model's endogenous carbon price for the 2030 target is 71.2–77.1 EUR/tCO2, close to the NECP's exogenous 79 EUR/tCO2."],"supporting_citations":[{"why":"Defines the base European model and workflow that this paper extends with Spanish-specific data.","marker":"[1]"},{"why":"Spanish National Energy and Climate Plan, which sets the 2030 demand, carbon target, capacities, and export assumptions that the case study compares against.","marker":"[22]"},{"why":"Describes a prior single-country model whose fixed-price interconnection limitation motivates the hourly-price nested approach used in this paper.","marker":"[15]"},{"why":"Provides the mathematical description of the objective function and constraints used in the capacity and dispatch optimisation.","marker":"[4]"},{"why":"The core package on which the base model is implemented.","marker":"[10]"},{"why":"Supplies the data-quality methodology used to assemble historical capacity input data.","marker":"[23]"}],"fun_headline_variants":["PyPSA-Spain finds 70 GW each for solar and wind in 2030","Model says Spain's plan overestimates French power exports","Correcting bias: Spain's 2030 grid needs 70 GW solar and wind","Spain's 2030 renewables: 70 GW solar, 70 GW wind from improved model","PyPSA-Spain: better data, 70 GW each for solar and wind"],"cache_read_input_tokens":3200,"weakest_assumption_plain":"The load-bearing premise is that the Q2Q correction, calibrated on 2022 national historical generation, remains valid for the 2030 scenario and transfers from the country scale to every individual grid cell, so that a change in the bias structure over time or space would turn the correction into a distortion.","fun_headline_variants_meta":{"raw":{"variants":["PyPSA-Spain finds 70 GW each for solar and wind in 2030","Model says Spain's plan overestimates French power exports","Correcting bias: Spain's 2030 grid needs 70 GW solar and wind","Spain's 2030 renewables: 70 GW solar, 70 GW wind from improved model","PyPSA-Spain: better data, 70 GW each for solar and wind"]},"model":"deepseek-v4-flash","effort":"low","cost_usd":0.000979,"raw_usage":{"total_tokens":4160,"prompt_tokens":953,"completion_tokens":3207,"prompt_tokens_details":{"cached_tokens":384},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":569,"completion_tokens_details":{"reasoning_tokens":3099}},"tokens_in":569,"tokens_out":3207,"duration_ms":20311,"temperature":1.0,"reasoning_tokens":3099,"cache_read_input_tokens":384,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-08-11T19:31:49.712726+00:00","model_set":{"reader":"deepseek-v4-flash"},"falsifier":"Compare the Q2Q-transformed wind and solar profiles for a non-2022 historical year, such as 2018 or 2023, against actual Spanish generation; if bias and RMSE are not lower than in the uncorrected PyPSA-Eur profiles, the claimed improvement does not generalise.","supporting_citations":[{"cited_title":"Pypsa-eur: An open optimisation model of the european transmission system","cited_arxiv_id":null,"evidence_quote":"Defines the base European model and workflow that this paper extends with Spanish-specific data."},{"cited_title":"Plan Nacional Integrado de Energ ´ ıa y Clima 2021-2030","cited_arxiv_id":null,"evidence_quote":"Spanish National Energy and Climate Plan, which sets the 2030 demand, carbon target, capacities, and export assumptions that the case study compares against."},{"cited_title":"PyPSA-GB: An open-source model of Great Britain’s power system for simulating future energy scenarios","cited_arxiv_id":null,"evidence_quote":"Describes a prior single-country model whose fixed-price interconnection limitation motivates the hourly-price nested approach used in this paper."},{"cited_title":"Speed of technological transformations required in Europe to achieve different climate goals","cited_arxiv_id":null,"evidence_quote":"Provides the mathematical description of the objective function and constraints used in the capacity and dispatch optimisation."},{"cited_title":"PyPSA: Python for Power System Analysis","cited_arxiv_id":null,"evidence_quote":"The core package on which the base model is implemented."},{"cited_title":"Performing energy modelling exercises in a transparent way - The issue of data quality in power plant databases","cited_arxiv_id":null,"evidence_quote":"Supplies the data-quality methodology used to assemble historical capacity input data."}],"review_version":1}