Read a variable

wrf_get(
  file = file.choose(),
  name = NA,
  as_raster = FALSE,
  raster_crs = "+proj=longlat",
  raster_lev = 1,
  verbose = FALSE
)

Arguments

file

name of file interactively (default) or specified

name

name of the variable (any variable) or time to return a POSIXlt object from model

as_raster

return a raster instead of an array

raster_crs

crs to use if as_raster is TRUE

raster_lev

level for rasters from a 4D variable

verbose

display additional information

Format

array or raster object

See also

Author

Daniel Schuch

Examples

{ # create the folder and emission file dir.create(file.path(tempdir(), "EMISS")) wrf_create(wrfinput_dir = system.file("extdata", package = "eixport"), wrfchemi_dir = file.path(tempdir(), "EMISS")) # get the name of created file files <- list.files(path = file.path(tempdir(), "EMISS"), pattern = "wrfchemi", full.names = TRUE) # open, put some numbers and write CO <- wrf_get(file = files[1], name = "E_CO") CO[] = rnorm(length(CO)) wrf_put(file = files[1], name = "E_CO", POL = CO) COr <- wrf_get(file = files[1], name = "E_CO", as_raster = TRUE) }
#> Warning: '/tmp/Rtmp0unmTl/EMISS' already exists
#> creating emission for domain 1 ... #> output file: /tmp/Rtmp0unmTl/EMISS/wrfchemi_d01_2011-08-01_00:00:00