wc_cmip5: Download and Extract CMIP5 Climate Data Layers

View source: R/wc_cmip5.R

wc_cmip5R Documentation

Download and Extract CMIP5 Climate Data Layers

Description

This function downloads climate data layers from the CMIP5 archive based on user specifications for variable, resolution, model, RCP, and year. It then unzips the files and returns the relevant climate data layers as a terra raster object.

Usage

wc_cmip5(
  var = "bio",
  res = "10",
  rcp = "85",
  model = "AC",
  year = "50",
  save_path = "."
)

Arguments

var

A character string specifying the climate variable to download. Choices are: "bio" (bioclimatic variables), "tmin" (temperature min), "tmax" (temperature max), or "prec" (precipitation). Default is "bio".

res

A character string specifying the resolution of the data. Choices are: "10" (10 minutes), "5" (5 minutes), "2.5" (2.5 minutes), or "0.5" (0.5 minutes). Default is "10".

rcp

A character string specifying the Representative Concentration Pathway (RCP) scenario. Choices are: "26", "45", "60", or "85". Default is "85".

model

A character string specifying the Global Climate Model (GCM) to use. Choices are: 'AC', 'BC', 'CC', 'CE', 'CN', 'GF', 'GD', 'GS', 'HD', 'HG', 'HE', 'IN', 'IP', 'MI', 'MR', 'MC', 'MP', 'MG', 'NO'. These codes correspond to specific models (e.g., 'AC' = 'ACCESS1-0', 'BC' = 'BCC-CSM1-1', etc.). Default is "AC".

year

A character string specifying the future year to use. Choices are "50" or "70" (for years 2050 and 2070). Default is "50".

save_path

A character string specifying the path where the downloaded and unzipped files should be saved. Default is the current working directory (".").

Value

A terra raster object containing the downloaded and extracted climate data layers for the specified parameters.

Examples

# Example usage:
## Not run: 
wc_layers <- wc_cmip5(var = "bio", res = "10", rcp = "85", model = "AC",
                      year = "50", save_path = "data/")

## End(Not run)

luismurao/ntbox documentation built on Feb. 20, 2025, 11:40 p.m.