ensembleGenerator: ClimateNA Ensemble Generator

View source: R/ensembleGenerator.R

ensembleGeneratorR Documentation

ClimateNA Ensemble Generator

Description

This function uses the desired SSPs and variables to generate averaged ensembles. Its outputs will consist of a series of ensemble CSV files, each consisting of the average value for each variable under every SSP scenario and time frames. This function is only used with monthly data outputs.

Usage

ensembleGenerator(
  files,
  tFrame = c("M", "S", "Y"),
  var = c("Tmax", "Tmin", "PPT", "DD5", "NFFD", "PAS", "CMI"),
  ssp = c("S1", "S2", "S3"),
  years = c("Y2", "Y3", "Y4", "Y5"),
  concatenate = TRUE
)

Arguments

files

The list of files provided by the projClimateNA20Y output, after using the AnnualSeasonalMeans function to process annual and seasonal averages/sums.

tFrame

The variable time frames included in the climate data. If the AnnualSeasonalMeans tool has been used, then the default value is desired. Otherwise, 'M' represents monthly, 'S' represents seasonal, and 'Y' represents annual time frames.

var

The desired variables to produce averages of. Variables include : 'Tmax','Tmin','Tavg','PPT','Rad','DD_0','DD5','DD18','DD_18','NFFD','CMI','PAS','Eref','CMD','RH'. Default value includes 'Tmin','Tmax','PPT','DD5_','NFFD','CMI','PAS'.

ssp

The SSP scenarios. 'S1' = 'ssp126' ; 'S2' = 'ssp245' ; 'S3' = 'ssp370' ; 'S5' = 'ssp585'. Default value is c('S1','S2','S3').

years

The 20-years time frames selection. Options include : 'Y1' (2001-2020); 'Y2' (2021-2040); 'Y3' (2041-2060); 'Y4' (2061-2080); 'Y5' (2081-2100).

concatenate

logical. If TRUE, all of the GCM ensemble data is concatenated into one mega file and producing a second file containing the GCM emsemble area's mean for each variable.

Value

Directory with ensemble files as CSVs

Author(s)

Michael Burnett - UBC Faculty of Forestry

Examples

#files <- list.files(pattern='*.csv$') # Access all CSV files
#ensembleGenerator(files) # Generate ensemble using the default parameters

Silva21-irss/silvR21 documentation built on Sept. 14, 2022, 7:55 a.m.