@@ -363,6 +363,8 @@ function create_data_sets(inputdata, sspscenario_input, sspyear_input, era_year_
363363 Hydro_summed = combine (groupby (List_full, :x1 ), names (List_full, Not (:x1 )) .=> sum, renamecols= false )
364364 reservoir = Hydro_summed[! ,:x4 ]. / (Hydro_summed[! ,:x2 ] .+ Hydro_summed[! ,:x3 ] .+ Hydro_summed[! ,:x4 ])
365365 reservoir_table = hcat (Regions, reservoir)
366+ # # Percentage between PHS and reservoir for later calculation of Wmin and Wmax
367+ reservoir_PHS = Hydro_summed[! ,:x4 ]. / (Hydro_summed[! ,:x2 ] .+ Hydro_summed[! ,:x4 ])
366368 end
367369
368370 reservoirp = permutedims (reservoir_table[:,2 ])
@@ -439,8 +441,9 @@ function create_data_sets(inputdata, sspscenario_input, sspyear_input, era_year_
439441 NodeNr = [1 : n;]
440442 H_min = permutedims (hydroCap) # existing reservoir capacity per node (percentage)
441443 HR_max = permutedims (hydroRoRCap) # RoR counterpart of existing capacity
442- W_max = Wmax_summed[:,2 ]
443- W_min = Wmin_summed[:,2 ]
444+ # # ENTSO-E data includes both PHS and reservoir, so we need the reservoir percentage to calculate acutal Wmin and Wmax for reservoir only
445+ W_max = Wmax_summed[:,2 ]. * reservoir_PHS
446+ W_min = Wmin_summed[:,2 ]. * reservoir_PHS
444447 hydro_tech = repeat (1 : 1 , inner= n)
445448 Hydro_cap = DataFrame (hcat (NodeNr, hydro_tech, H_min, H_max, W_min, W_max), :auto )
446449 rename! (Hydro_cap, [" node" , " hydro_tech" , " hcap_min" , " hcap_max" , " wcap_min" ," wcap_max" ])
0 commit comments