1 function p=fire2struct(filename,timesteps)
2 % p=wrfatm2struct(filename)
3 % read WRF NetCDF file atmosphere mesh variables of interest as fields in p
5 % filename string, e.g. 'wrfout_d01_0001-01-01_00:00:00'
6 % timesteps vector of integers; use [] for all
8 % p structure with several arrays from WRF and few more
9 if ~exist('timesteps','var'),
12 p=nc2struct(filename,{'UAH','VAH','UF','VF','ROS','LFN','R_0',...
13 'XLONG','XLAT','GRNHFX','FGRNHFX','FXLONG','FXLAT','Times'},...
15 for i=1:size(p.times,2), % make Times readable
16 times{i}=char(p.times(:,i)');