1 function wrfs = make_w_files(varargin)
2 %make matlab file from wrfouts
13 %all directories have '.' and '..' as dir(1),dir(2)??
16 dir_name = ([d(i).name,'/']);
17 dir_fold = ([d(i).folder,'/']);
18 dir_path = ([dir_fold,dir_name]);
20 fprintf('calling make_w_files on %s \n',dir_path)
21 make_w_files(dir_path)
23 %fprintf('moved to %s \n',pwd)
25 %%%strcmp can avoid this...
26 elseif length(d(i).name) > 6 & strcmp(d(i).name(1:6),'wrfout')
27 %elseif length(d(i).name) > 6
28 if d(i).name(end) ~= 't'
30 %dir_name = ([d(i).name,'/']);
31 wrf_fold = ([d(i).folder,'/']);
32 wrf_path = ([wrf_fold,d(i).name]);
33 save_str = ([wrf_path,'.mat']);
34 fprintf('Working in %s \n', cwd)
35 if ~exist(save_str,'file')
36 w = read_wrfout_tign(wrf_path);
37 fprintf('Saving %s \n',save_str)
40 fprintf('%s already exists \n',save_str)