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:

  • PNW-1.33km

  • PNW-4km

Some useful variables provided by WRF:

  • XLONG - Longitude (degrees East)

  • XLAT - Latitude (degrees North)

  • XLONG_U - Longitude (degrees East)

  • XLAT_U - Latitude (degrees North)

  • XLONG_V - Longitude (degrees East)

  • XLAT_V - Latitude (degrees North)

  • U - Wind X component (m/s)

  • V - Wind Y component (m/s)

  • W - Wind Z component (m/s)

  • U10 - Wind X component at 10 meters (m/s)

  • V10 - Wind Y component at 10 meters (m/s)

  • ZNU - eta values on half (mass) levels

  • ZNW - eta values on full (w) levels

  • LU_INDEX - Land use category

  • Q2 - QV at 2 M (kg)

  • T - Perturbation potential temperature theta-t0 (K)

  • T2 - Temperature at 2 meters (K)

  • TH2 - Potential temperature at 2 meters (K)

  • HGT - Terrain height (m)

  • RAINNC - Accumulated total grid scale precipitation (mm)

  • CFRACT - Total cloud fraction

  • PBLH - Planetary boundary layer height (m)

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

# \donttest{ 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) )
#> Warning: multiple methods tables found for ‘wkt’
print(raster)
#> class : RasterBrick #> dimensions : 51, 91, 4641, 4 (nrow, ncol, ncell, nlayers) #> resolution : 0.1001554, 0.1000347 (x, y) #> extent : -125.0784, -115.9642, 44.99589, 50.09766 (xmin, xmax, ymin, ymax) #> crs : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 #> source : memory #> names : HGT, TSK, U10, V10 #> min values : 0.000000, 276.636688, -3.233186, -10.490043 #> max values : 2436.073059, 315.662526, 8.301670, 5.910079 #>
# }