Return a list containing information of a regular grid / domain

gridInfo(file = file.choose(), z = FALSE, verbose = TRUE)

Arguments

file

file name/path to a wrfinput, wrfchemi or geog_em file

z

TRUE for read wrfinput vertical coordinades

verbose

display additional information

Value

a list with grid information from air quality model

Note

just WRF-Chem is suported by now

Examples

grid_d1 <- gridInfo(paste(system.file("extdata", package = "EmissV"),
                                      "/wrfinput_d01",sep=""))
#> Grid information from: C:/Users/schuch/AppData/Local/Temp/Rtmp2H8oV2/temp_libpath3ae4412c5669/EmissV/extdata/wrfinput_d01 
grid_d2 <- gridInfo(paste(system.file("extdata", package = "EmissV"),
                                      "/wrfinput_d02",sep=""))
#> Grid information from: C:/Users/schuch/AppData/Local/Temp/Rtmp2H8oV2/temp_libpath3ae4412c5669/EmissV/extdata/wrfinput_d02 
grid_d3 <- gridInfo(paste(system.file("extdata", package = "EmissV"),
                                      "/wrfinput_d03",sep=""))
#> Grid information from: C:/Users/schuch/AppData/Local/Temp/Rtmp2H8oV2/temp_libpath3ae4412c5669/EmissV/extdata/wrfinput_d03 
names(grid_d1)
#>  [1] "File"        "Times"       "Lat"         "Lon"         "z"          
#>  [6] "Horizontal"  "DX"          "xlim"        "ylim"        "Box"        
#> [11] "boundary"    "poligon"     "map_proj"    "coords"      "geogrd.proj"
# for plot the shapes
library(sp)
shape   <- raster::shapefile(paste0(system.file("extdata", package = "EmissV"),
                                                "/BR.shp"))
plot(shape,xlim = c(-55,-40),ylim = c(-30,-15), main="3 nested domains")
axis(1); axis(2); box(); grid()
lines(grid_d1$Box, col = "red")
text(grid_d1$xlim[2],grid_d1$Ylim[1],"d1",pos=4, offset = 0.5)
lines(grid_d2$Box, col = "red")
text(grid_d2$xlim[2],grid_d2$Ylim[1],"d2",pos=4, offset = 0.5)
lines(grid_d3$Box, col = "red")
text(grid_d3$xlim[1],grid_d3$Ylim[2],"d3",pos=2, offset = 0.0)