split of FEMWIND_MODULES in Makefile
[wrf-fire-matlab.git] / detection / read_wrfouts.m
blob61f196f54e8826bd6d237cc592bfd85af1ec1b6d
1 function h=read_wrfout_sel(files,vars)
2 % h=readsel_wfout(files,vars)
3 % read selected time levels from wrfouts
4 % in 
5 %     files     cell array of file names
6 %     vars     cell array of variable names
7 % out
8 %     h         structure with the selected variables
10 h=[];
11 for k=1:length(files)
12     [f,dims]=nc2struct(files{k},vars,{});
13     if isempty(h),
14         h=f;
15     else
16         for j=1:length(vars)
17             field=lower(vars{j});
18             n=length(dims.(field));
19             h.(field)=cat(n,h.(field),f.(field));
20         end
21     end
22 end