wrf_load: Load WRF model run data

Description Usage Arguments Value Examples

View source: R/wrf_load.R

Description

Loads WRF model run data as a raster package RasterBrick. If the specified data does not exist on the user's machine, then it will try to be downloaded from the AirFire database.

On 2020-09-03, available model identifiers include the following:

Some useful variables provided by WRF:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
wrf_load(
  modelName = NULL,
  modelRun = NULL,
  modelRunHour = NULL,
  baseUrl = "http://m2.airfire.org",
  localPath = NULL,
  varNames = NULL,
  res = NULL,
  xlim = NULL,
  ylim = NULL,
  verbose = TRUE
)

Arguments

modelName

Model identifier.

modelRun

Model initialization timestamp as "YYYYMMDDHH".

modelRunHour

Hour forecasted from initial time, i.e. 7.

baseUrl

Base URL for WRF output.

localPath

Absolute path to a NetCDF file not found in 'WRFDataDir'.

varNames

WRF variable(s) to load. If NULL, the following subset specified by AirFire will be loaded: XLONG, XLAT, XLONG_U, XLAT_U, XLONG_V, XLAT_V, U, V, U10, V10, ZNU, ZNW, LU_INDEX, Q2, T, T2, TH2, HGT, RAINNC, CFRACT, and PBLH.

res

Resolution of raster in degrees.

xlim

A vector of coordinate longitude bounds.

ylim

A vector of coordinate latitude bounds.

verbose

Logical to display messages.

Value

A raster package RasterBrick object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(AirFireWRF)
setWRFDataDir("~/Data/WRF")

raster <- wrf_load(
  modelName = "PNW-4km",
  modelRun = "2020082612",
  modelRunHour = 9,
  varNames = c("HGT", "TSK", "U10", "V10"),
  res = 0.1,
  xlim = c(-125, -116),
  ylim = c(45, 50)
)

print(raster)

MazamaScience/AirFireWRF documentation built on Nov. 11, 2020, 3:32 a.m.