nex_download: Download daily GCM data from NCCS THREDDS NEX-GDDP-CMIP6...

View source: R/nex_download.R

nex_downloadR Documentation

Download daily GCM data from NCCS THREDDS NEX-GDDP-CMIP6 (https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6)

Description

Download daily GCM data from NCCS THREDDS NEX-GDDP-CMIP6 (https://www.nccs.nasa.gov/services/data-collections/land-based-products/nex-gddp-cmip6)

Usage

nex_download(
  location,
  model = NULL,
  scenario,
  variable,
  years,
  roi,
  version = NULL,
  method = "curl"
)

Arguments

location

Select the location for data downloading.

model

Model name. If NULL, all available models will be selected.

scenario

CMIP6 scenario ('historical','ssp126','ssp245', 'ssp370', or 'ssp585).

variable

Variable ('hurs','huss','pr','rlds','rsds','sfcWind','tas','tasmax', or 'tasmin').

years

Data years (1950 - 2014 for 'historical' and 2015 - 2100 for 'ssp126', 'ssp245', 'ssp370' and 'ssp585').

roi

Extension for sub-setting gridded data (west, east, south, north). If NULL, original extension is considered.

version

Select file version. Use NULL for first version, or 'v1.1' and 'v1.2'. Please read technical notes in NEX website.

method

Method to be used for downloading files. Current download methods are 'internal', 'wininet' (Windows only), 'libcurl', 'wget' and 'curl'. The 'curl' method is recommended for Windows users.

Value

CMIP6 daily data in netCDF format.

Examples

# Load package
require(RClimChange)

# Download daily precipitation flux from BCC-CSM2-MR model
# historical period
nex_download(location=getwd(),
             model='BCC-CSM2-MR',
             scenario='historical',
             variable='pr',
             years=1990:1992,
             version='v1.1',
             roi=c(-86,-66,-20,2),
             method='curl')

# ssp585 scenario
nex_download(location=getwd(),
             model='BCC-CSM2-MR',
             scenario='ssp585',
             variable='pr',
             years=2050:2052,
             version='v1.1',
             roi=c(-86,-66,-20,2),
             method='curl')


hllauca/RClimChange documentation built on Aug. 26, 2024, 9:39 a.m.