Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - fgassert/process-gddp: Processing scripts for NASA NEX GDDP data · GitHub
Skip to content

Repository files navigation

prep-climate-indicators

Processing scripts for NEX-GDDP and LOCA CMIP5 climate datasets.

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets NEX-GDDP (global) and LOCA (continental US).

These data can be viewed at https://prepdata.org/explore.

Downloads are available at:

Learn more at https://www.wri.org/research/making-climate-data-accessible

Citation: Gassert, Francis, Enrique Cornejo, and Emily Nilson. 2021. "Making Climate Data Accessible: Methods for Producing NEX-GDDP and LOCA Downscaled Climate Indicators." Technical Note. World Resources Institute. Washington DC. Available at https://www.wri.org/research/making-climate-data-accessible

Background

This repository contains a script for generating ensemble indicators from the downscaled CMIP5 datasets: NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP) (Thrasher and Nemani 2015) for the globe and Localized Constructed Analogs (LOCA) CMIP5 projections for the continental United States (Pierce, Cayan, and Thrasher 2014; Maurer et al. 2007). NEX-GDDP and LOCA contain daily minimum and maximum temperature and precipitation values from several dozen models for two climate scenarios over the period of 1950-2100. These scripts reduce the large size of source datasets (~12TB and ~9TB, respectively) by several orders of magnitude.

This typically takes place in four steps:

  1. For each model, scenario, and year: compute annual indicators
  2. For each indicator, model, and scenario: compute moving averages (typically 30yrs)
  3. For each indicator, model, and scenario: compute difference and/or change layers
  4. For each indicator and scenario: compute statistics across the ensemble of models (e.g. median)

Requirements

These scripts require Docker and an AWS account to run.

This package is designed to compute against the large input data sources using AWS S3 as intermediate storage. This allows it to be run on commodity hardware, with the minimum requirement that some annual indicators may require up to 1.5GB of memory per CPU.

AWS cost managment note

It is possible to compute the listed indicators under the AWS Free Tier.

Computation can generate a large amount of intermediate data. It is recommended that you set a Lifecycle Rule on your S3 Bucket to automatically expire (delete) data older than 30 days to avoid accumulating storage cost, and move or download the resulting data that you want to keep.

Under test conditions, computing the listed indicators generated costs as follows:

  • ~$40 - AWS EC2 Spot Instance
  • ~$50/month - S3 Storage

Installation

  1. Download the repository
git clone https://github.com/fgassert/process-gddp/
cd process-gddp
  1. Create a .env file in the root folder with the following four configuration variables.
# AWS credentials for accessing S3
AWS_ACCESS_KEY_ID={aws-access-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret-access-key}
# Bucket name for saving data
GDDP_BUCKET={bucket-name}
# Prefix (folder) in which you want to save data i.e. s3://{bucket-name}/{prefix-name}/
GDDP_PREFIX={folder-name}

Usage

There is a shell script in the root directory to build and run the main script in a docker container. It takes any number of keynames (output file names) as parameters. For each keyname, it will determine what input data and intermediate steps are needed to generate that output, and produce them in order.

  • ./start.sh - Run without parameters to generate a few test outputs.
  • ./start.sh [keyname] [keyname]... - Compute specific outputs.
  • ./start.sh $(cat scripts/outputs.txt) - Compute all outputs listed in scripts/outputs.txt.

Outputs and intermediate results are saved in s3://{GDDP_BUCKET}/{GDDP_PREFIX}/.

Keynames

Keynames are the output filenames that will be generated, but also define what to compute.

Keynames are composed of the following parts, joined by underscores, with an implied .tif extension:

 {formula}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]
# or expanding {formula} into subcomponents:
{ensemble}-{timefunc}-{indicator}_{variable}_{scenario}_{model}_{years}_{dataset}[.tif]

e.g. q50-abs-annual_pr_rcp85_ens_2035-2065_nexgddp.tif - Median absolute average annual (q50-abs-annual) precipitation (pr) for the high emissions scenario (rcp85) across the ensemble (ens) for the 31yr period centered on 2050 (2035-2065) derived from NEX-GDDP (nexgddp).

Formula

The formula defines what computations to run, the remainder of the keyname defines what data to run the computationts against. The {formula} can be decomposed further as follows:

# {formula} can be decompose into:
{indicator}_...
{timefunc}-{indicator}_...
# or
{ensemble}-{timefunc}-{indicator}_...

Each of these components is a reducing function that depends on the previous. For example, computing ensemble median average annual (q50-abs-annual) precipitation from individual models' average annual (abs-annual) precipitation:

keyis derived from
q50-abs-annual_..._ens_...abs-annual_..._ACCESS1-0_...abs-annual_..._BNU-ESM_...abs-annual_..._CCSM4_...abs-annual_..._CESM1-BGC_...abs-annual_..._CNRM-CM5_... ...

Or computing the 31yr average (abs-annual) precipitation from annual (annual) precipitation:

keyis derived from
abs-annual_..._2035-2065_...annual_..._2035_...annual_..._2036_...annual_..._2037_... ... annual_..._2065_...

Valid values for keynames

  • ensemble
valuedescription
q2525th percentile
q50median
q7575th percentile
iqrinterquartile range
meanmean
  • timefunc
valuedescription
absabsolute i.e. the average value over the range of years
difflinear change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... minus abs_..._1960-1990_...)
chmultiplicative change from baseline (1960-1990) (i.e. abs_..._{startyear}-{endyear}_... divided by abs_..._1960-1990_...)
  • indicator
valuedescription
annualannual average
q9898th percentile for the year
q9999th percentile for the year
gt-q98number of days/yr exceeding the 98th percentile for the baseline period (1960-1990)
gt-q99number of days/yr exceeding the 99th percentile for the baseline period (1960-1990)
gt50mmnumber of days/yr exceeding 0.0005787037037 (kg/m2/s) (50mm/day)
gt95fnumber of days/yr exceeding 308.15 (Kelvin)
gt90fnumber of days/yr exceeding 305.37 (Kelvin)
gt85fnumber of days/yr exceeding 302.59 (Kelvin)
gt32fnumber of days/yr exceeding 273.15 (Kelvin)
frostfreelength of longest run of days in a year exceeding 273.15 (Kelvin)
drydayslength of longest run of days in a year less than 0.000011574 (kg/m2/s) (1mm/day)
dryspellsnumber of runs of at least 5 days in a year with less than 0.000011574 (kg/m2/s) (1mm/day). Each day over 5 days counts as 0.2 of a run.
tavg-tasminUse with tasmax. Daily average temperature. (Specifically, daily value plus tasmin divided by 2.)
hdd65f-tasminUse with tasmax. Heating degree days. The sum of 291.48 - value (Kelvin) (65ºF), where positive, for each day in a year.
cdd65f-tasminUse with tasmax. Cooling degree days. The sum of value - 291.48 (Kelvin) (65ºF), where positive, for each day in a year.
  • variables
valuedescription
prprecipitation (kg/ms/s)
tasmindaily minimum temperature
tasmaxdaily maximum temperature
  • scenario
valuedescription
rcp45Low emissions scenario
rcp85High emissions scenario
historicalRetrospective data (1990-2005 only)
  • model
valuedescription
ACCESS1-0BNU-ESMCCSM4CESM1-BGCCNRM-CM5CSIRO-Mk3-6-0CanESM2GFDL-CM3GFDL-ESM2GGFDL-ESM2MIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESM-CHEMMIROC-ESMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1inmcm4Models included in NEX-GDDP
ACCESS1-0ACCESS1-3CCSM4CESM1-BGCCESM1-CAM5CMCC-CMCMCC-CMSCNRM-CM5CSIRO-Mk3-6-0CanESM2EC-EARTHFGOALS-g2GFDL-CM3GFDL-ESM2GGFDL-ESM2MGISS-E2-HGISS-E2-RHadGEM2-AOHadGEM2-CCHadGEM2-ESIPSL-CM5A-LRIPSL-CM5A-MRMIROC-ESMMIROC-ESM-CHEMMIROC5MPI-ESM-LRMPI-ESM-MRMRI-CGCM3NorESM1-Mbcc-csm1-1bcc-csm1-1-minmcm4Models included in LOCA
ensFor ensemble functions
  • years
valuedescription
A single {year} between 1950 and 2100Year of data (functions without a {timefunc})
A range of years {startyear}-{endyear}For multi-year averages (functions with a {timefunc})
  • dataset
valuedescription
nexgddpDerive from NEX GDDP
locaDerive from LOCA

Adding additional indicators or functions

Formula and indicators are defined in src/processgddp/formulae.py. The baseline period for indicators that use a baseline is defined here.

References

Thrasher, Bridget, and Rama Nemani. 2015. “NASA Earth Exchange Global Daily Downscaled Projections (NEX-GDDP).” https://nex.nasa.gov/nex/projects/1356/.

Pierce, David W., Daniel R. Cayan, and Bridget L. Thrasher. 2014. “Statistical Downscaling Using Localized Constructed Analogs (LOCA).” Journal of Hydrometeorology 15 (6): 2558–2585. doi:10.1175/JHM-D-14-0082.1.

Maurer, Edwin P., Levi Brekke, Tom Pruitt, and Philip B. Duffy. 2007. “Fine-Resolution Climate Projections Enhance Regional Climate Change Impact Studies.” Eos, Transactions American Geophysical Union 88 (47). John Wiley & Sons, Ltd: 504–504. doi:10.1029/2007EO470006.

We acknowledge the World Climate Research Programme's Working Group on Coupled Modelling, which is responsible for CMIP, and we thank the climate modeling groups for producing and making available their model output. For CMIP the U.S. Department of Energy's Program for Climate Model Diagnosis and Intercomparison provides coordinating support and led development of software infrastructure in partnership with the Global Organization for Earth System Science Portals.

About

Processing scripts for NASA NEX GDDP data

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages