I recall the EU rated Spain #1 in removing "river obstructions." This meant dams and maybe other stuff. Then came very heavy rains and massive flooding. Grok says this removal did not cause the flooding. Failure to build a planned dam may have made things worse.
Also, years ago, Spain paid high rates to people who generated electricity from solar. Some was generated at night. From diesel generators.