Skip to content

Commit

Permalink
updated make pages automation
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbuster committed Mar 4, 2024
1 parent df23b8c commit 920425c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 26 deletions.
46 changes: 24 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,30 @@
Welcome to the NREL Global Climate Model Evaluation Repository
##############################################################

The interplay between energy, climate, and weather is becoming more complex as
our energy system becomes more sensitive to the impacts of weather events and
climate change due to increasing contributions of renewable energy generation
and electrified end uses. Energy system analyses commonly rely on
meteorological inputs to estimate renewable energy generation and energy
demand; however, these inputs rarely represent the estimated impacts of future
climate change. Climate models and publicly available climate change datasets
can be used for this purpose, but the selection of inputs from the myriad of
available models and datasets is a nuanced and subjective process. In this
work, we assess datasets from various global climate models (GCMs) from the
Coupled Model Intercomparison Project (CMIP6), evaluating their skills with
respect to the historical climate and comparing their future projections of
climate change. Previous work has presented similar GCM evaluations, but none
have presented variables and metrics specifically intended for comprehensive
energy systems analysis including impacts on energy demand, thermal cooling,
hydropower, water availability, solar energy generation, and wind energy
generation. We focus on GCM output meteorological variables that directly
affect these energy system components including the representation of extreme
values that can drive grid resilience events. The objective of this work is
not to recommend the best climate model and dataset for a given analysis, but
instead to provide a reference to facilitate the selection of climate models
and datasets in subsequent work.
The interplay between energy, climate, and weather is becoming more complex due
to increasing contributions of renewable energy generation, energy storage,
electrified end uses, and the increasing frequency of extreme weather events.
Energy system analyses commonly rely on meteorological inputs to estimate
renewable energy generation and energy demand; however, these inputs rarely
represent the estimated impacts of future climate change. Climate models and
publicly available climate change datasets can be used for this purpose, but
the selection of inputs from the myriad of available models and datasets is a
nuanced and subjective process. In this work, we assess datasets from various
global climate models (GCMs) from the Coupled Model Intercomparison Project
(CMIP6). We present evaluations of their skills with respect to the historical
climate and comparisons of their future projections of climate change. We
present the results for different climatic and energy system regions and
include interactive figures in the accompanying software repository. Previous
work has presented similar GCM evaluations, but none have presented variables
and metrics specifically intended for comprehensive energy systems analysis
including impacts on energy demand, thermal cooling, hydropower, water
availability, solar energy generation, and wind energy generation. We focus on
GCM output meteorological variables that directly affect these energy system
components including the representation of extreme values that can drive grid
resilience events. The objective of this work is not to recommend the best
climate model and dataset for a given analysis, but instead to provide a
reference to facilitate the selection of climate models and datasets in
subsequent work.

The NREL software record for this repository is SWR-24-37

Expand Down
41 changes: 37 additions & 4 deletions docs/make_interactive_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
"""
import glob

REGIONS = ['CONUS']
REGIONS = ['CONUS',
'Northeast', 'Northern Rockies and Plains',
'Northwest', 'Ohio Valley', 'South', 'Southeast',
'Southwest', 'Upper Midwest', 'West',
'MRO', 'NPCC', 'RF', 'SERC', 'Texas RE', 'WECC',
'Atlantic', 'Pacific', 'Gulf']

NOAA = ['Northeast', 'Northern Rockies and Plains',
'Northwest', 'Ohio Valley', 'South', 'Southeast',
'Southwest', 'Upper Midwest', 'West']
NERC = ['MRO', 'NPCC', 'RF', 'SERC', 'Texas RE', 'WECC']
OFFSHORE = ['Atlantic', 'Pacific', 'Gulf']
UTILITIES = ['TVA', 'Southern Company']

VARS = {'t2m': 'Change in Temperature (Celsius)',
't2m_degf': 'Change in Temperature (Fahrenheit)',
Expand All @@ -22,21 +34,41 @@
if __name__ == '__main__':
index = ['.. toctree::\n',
' :hidden:\n\n',
' Home page <self>\n',
'\n.. include:: ../../README.rst\n']
' Home page <self>\n']

for region in REGIONS:
tag = region.lower().replace(' ', '_')
fps = sorted(glob.glob(f'./source/_static/trend_plots/{tag}*.html'))
region_rst = f'./source/regions/{tag}.rst'

if region in NOAA:
region = f'NOAA Region {region}'
elif region in NERC:
region = f'NERC Region {region}'
elif region in OFFSHORE:
region = f'Offshore Wind Region {region}'
elif region in UTILITIES:
region = f'Utility Partner {region}'

region_pointer = region_rst.replace('./source/', '')
index.insert(3, f' {region} <{region_pointer}>\n')
index.append(f' {region} <{region_pointer}>\n')

with open(region_rst, 'w') as f:
f.write(f'{"#"*len(region)}\n')
f.write(f'{region}\n')
f.write(f'{"#"*len(region)}\n\n')

title = f'Map of {region}'
f.write(f'\n{title}\n')
f.write(f'{"="*len(title)}\n\n')
f.write(f'.. image:: ../_static/region_maps/map_{tag}.png\n')

title = 'GCM Historical Skill Summary'
f.write(f'\n{title}\n')
f.write(f'{"="*len(title)}\n\n')
f.write('.. raw:: html\n')
f.write(f' :file: ../_static/skill_tables/skill_{tag}.html\n')

for var, title in VARS.items():
f.write(f'\n{title}\n')
f.write(f'{"="*len(title)}\n\n')
Expand All @@ -45,3 +77,4 @@

with open('./source/index.rst', 'w') as f:
f.writelines(index)
f.write('\n.. include:: ../../README.rst\n')

0 comments on commit 920425c

Please sign in to comment.