Extract variable

wrf_put(
  file = file.choose(),
  name = NA,
  POL,
  k,
  check = FALSE,
  verbose = FALSE
)

Arguments

file

Character; name of file interactively (default) or specified

name

Character; name of the variable (any variable)

POL

Numeric; emissions input or string/POSIXlt time

k

Numeric; multiplier. If the length is more than 1, it multiplies POL for each value of k. It can be used if you want to add an hourly profile to your emissions.

check

logic (default is FALSE), TRUE to check for NA and negative values and replace with zeros

verbose

display additional information

See also

Author

Daniel Schuch and Sergio Ibarra

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)
}
#> Warning: '/tmp/RtmpEjoyhr/EMISS' already exists
#> creating emission for domain 1 ...
#> output file: /tmp/RtmpEjoyhr/EMISS/wrfchemi_d01_2011-08-01_00:00:00