1 function k=fire_plot_cd(xfg,yfg,xcd,ycd)
2 % k=fire_plot(xfg,yfg) - plot tracer arrays and return number of cells with
5 error('xfg must have 3 dimensions')
8 error('xfg must have 3 dimensions')
12 error('dim3 of tracer array must be 4')
14 if any(size(xfg)~=size(yfg)),
15 error('xfg and yfg must be same dimension')
24 tr_x=squeeze(xfg(i,j,:));
25 fire_x=squeeze(xcd(i,j,:));
26 tr_y=squeeze(yfg(i,j,:));
27 fire_y=squeeze(ycd(i,j,:));
29 %if(any(tr_x) | any(tr_y) | any(fire_x) | any(fire_y)),
30 if(any(tr_x) | any(tr_y)),
31 %if(any(fire_x) | any(fire_y)),
35 fire_xcoord=fire_x(q)+i;
36 fire_ycoord=fire_y(q)+j;
37 fire_xcoord1=fire_x(qq)+i;
38 fire_ycoord1=fire_y(qq)+j;
39 fill(xcoord,ycoord,[1,0,0]);
41 %if(any(fire_x) | any(fire_y)),
42 if((fire_x(q)~=0) | (fire_y(q)~=0)),
43 plot(fire_xcoord,fire_ycoord,'ok');
44 plot([fire_xcoord(1),fire_xcoord(2),fire_xcoord(3)],[fire_ycoord(1),fire_ycoord(2),fire_ycoord(3)],'-b')
46 if ((fire_x(qq)~=0) | (fire_y(qq)~=0)),
47 plot(fire_xcoord1,fire_ycoord1,'ok');
48 plot([fire_xcoord1(1),fire_xcoord1(2)],[fire_ycoord1(1),fire_ycoord1(2)],'-b')
50 plot(xcoord,ycoord,'*g')
51 plot(i+[-0.5,+0.5,+0.5,-0.5,-0.5],j+[-0.5,-0.5,+0.5,+0.5,-0.5],'-k')
59 fprintf('%g cells with nonzero tracers\n',k)