2 % uses code from dddas cvs server : wf1-2006a/fire1_vvk/Matlab
3 % to produce a plot of the tracer output from wrffire
5 % requires the modified version of ncdump that accepts the -w
6 % flag. the source for this can be found in other/netcdf_write_matrix
7 % or on wf, you can just copy /home/jbeezley/bin/ncdump somewhere
10 % this likely will only work on linux!!! if you use any other
11 % OS you are on your own.
13 % you may need to modify these variables:
15 % absolute path to ncdump binary, 'ncdump' will work if it is in PATH
16 ncdump_binary='ncdump';
18 % base netcdf file name, will create plots for all files that
19 % match $(netcdf_basename)*
20 % can include path/to/file if necessary
21 netcdf_basename='wrfrst';
23 % set this variable to 1 to stop between plots to examine
27 % the directory that the figures will be saved to
30 %%%%%%%%% begin code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 addpath('../util1_jan');
35 [os_test,output]=unix('true');
37 fprintf('this script only works in a *NIX OS\n')
41 unix(sprintf('mkdir -p %s',figs_dir));
42 netcdf_files=dir(sprintf('%s*',netcdf_basename));
44 for i=1:length(netcdf_files)
45 outdir=sprintf('vars_%s',netcdf_files(i).name);
46 file=sprintf('%s',netcdf_files(i).name);
48 % output the write_matrix files
49 [s,output]=unix(sprintf('./ncdump_wrapper.sh ''%s'' ''%s'' ''%s''',...
50 ncdump_binary,file,outdir));
52 fprintf('ncdump_wrapper failed with:\n%s',output);
56 xfg=read_m(sprintf('%s/XFG',outdir));
57 yfg=read_m(sprintf('%s/YFG',outdir));
58 xcd=read_m(sprintf('%s/XCD',outdir));
59 ycd=read_m(sprintf('%s/YCD',outdir));
61 fire_plot_cd(xfg,yfg,xcd,ycd);
63 saveas(gcf,sprintf('%s/%s.fig',figs_dir,file));
64 saveas(gcf,sprintf('%s/%s.png',figs_dir,file));
66 if(pause_after_plot ~=0)