separated constant part in module_w_assembly.f90
[wrf-fire-matlab.git] / smoke / ts_readslice.R
blobd5eaa1a475faf90dc149925f08bca1ffb485d9da
1 # Load required packages
2 library(ncdf4)  # For reading netCDF files
4 print_variable_info <- function(x) {
5     cat("Variable:", deparse(substitute(x)),"class", class(x),"type",typeof(x),
6     "dimension",dim(x))
7     if(is.numeric(x)) {
8       cat(" min",min(x),"max",max(x),"\n")
9     } else {
10       # The array contains non-numeric values
11       cat("\n")
12     }
15 # Open input netCDF file
16 nc_file <- nc_open("ts_smoke.nc")
18 # read the variables
19 lon <- ncvar_get(nc_file, "XLONG")
20 lat <- ncvar_get(nc_file, "XLAT")
21 pm25 <- ncvar_get(nc_file, "pm25")
22 times <- ncvar_get(nc_file, "Times")
24 print_variable_info(lon)
25 print_variable_info(lat)
26 print_variable_info(pm25)
27 print_variable_info(times)
28 cat("The first time frame is",times[1],"Zulu\n")
29 cat("The last  time frame is",times[dim(times)],"Zulu\n")
31 nc_close(nc_file)