Extract data for different variables from ALFRESCO model outputs.

run_alf_extraction(domain = "akcan1km", type, loop_by = "rep",
  main_dir, out_dir, project, reps, years, cells, veg_labels,
  cru = FALSE, cru_id = "CRU 3.2", itervar = seq_along(years),
  mc.cores = 32, rmpi = TRUE)

Arguments

domain

character, the ALFRESCO run spatial domain, either "akcan1km" or "ak1km".

type

"fsv" or "av". See details.

loop_by

"rep" or "year" (default).

main_dir

input directory.

out_dir

output directory. If missing, a default is provided by alfdef()$alf_extract_dir.

project

character, valid projects based on the domain. See details.

reps

integer vector, simulation replicates included in data extraction, e.g., 1:200.

years

ALFRESCO model run years included in data extraction.

cells

data frame of raster grid cell indices appropriate to domain. See get_domain_cells.

veg_labels

vegetation labels appropriate to domain/vegetation input map for ALFRESCO runs. See get_veg_labels.

cru

logical, whether data extraction is for historical years (ALFRESCO runs based on CRU data) or projected years (GCM data).

cru_id

character, label for CRU data. Defaults to "CRU 3.2".

itervar

integer vector, iterator, defaults to 1:length(years).

mc.cores

number of processors. See details.

rmpi

logical, use Rmpi. Defaults to TRUE.

Value

invisible, writes files.

Details

The extracted data depends on type, which is "fsv" for fire size by vegetation class data or "av" for vegetation age and vegetation cover area data. A project refers to a collection of output directories pertaining to the set of climate models and emissions scenarios/RCPs that were used in project simulations. This function returns the full file path to each pertinent directory, given a valid domain and project. Valid projects for Alaska/western Canada include "IEM" and "FMO_Calibrated". For Alaska "statewide", it is "JFSP" and "CMIP5_SW". JFSP project names allow subproject/treatment run directories, e.g. "JFSP/tx1". mc.cores is used explicitly when rmpi = FALSE for parallel::mclapply instead of multi-node processing.

Extracted data are subsequently curated into estimated probability distribution tables by run_alf_extraction.

See also

alf_dist

Examples

# Not run; decontextualized example.
# NOT RUN { run_alf_extraction(type = "fsv", main_dir = "Maps", project = "MyProject", reps = 1:200, years = 2014:2099, cells = cells, veg_labels = veg_labels) # }