clear;
close;

fig=figure('Units','centimeters','Position',[0.0 0.0 21.0 21.0]...
,'PaperUnits','centimeters','PaperPosition',[0.0 0.0 21.0 21.0]);

len=180
wid=180
rt=100

load tr;
time_dat=tr;
L=time_dat(1,1)/1000;
W=time_dat(1,2)/1000;
NL=time_dat(2,1)
NW=time_dat(2,2)

ii=2;
for iy=1:NW
  for ix=1:NL
       ii=ii+1;
	  x(ix)=time_dat(ii,1)/1000;
	  y(iy)=time_dat(ii,2)/1000;
            t1(iy,ix)=time_dat(ii,3);
            t2(iy,ix)=time_dat(ii,4);
            t3(iy,ix)=time_dat(ii,5);
	  time1(ii)=time_dat(ii,3);
	  time2(ii)=time_dat(ii,4);
	  time3(ii)=time_dat(ii,5);
  end
end

tmax=max(time1)
mesh(x,y,t1);
xlabel('Length (km)')
ylabel('Width (km)')
zlabel('Rupture Time (s)')
title('Rupture Time (sec)')
axis([0 len 0 wid 0 rt])
grid
view(145,40)
%print
print time1.ps
a='Enter Return for Printing'
pause

tmax=max(time2)
mesh(x,y,t2);
xlabel('Length (km)')
ylabel('Width (km)')
zlabel('Coherent (Average) Rupture Time (s)')
title('Mesh for Rupture Time (sec)')
axis([0 len 0 wid 0 rt])
grid
view(145,40)
%print
print time2.ps
a='Enter Return for Printing'
pause

tmax=max(time3)
mesh(x,y,t3);
xlabel('Length (km)')
ylabel('Width (km)')
zlabel('Incoherent Rupture Time (s)')
title('Mesh for Rupture Time (sec)')
axis([0 len 0 wid 0 rt])
%axis([0 len 0 wid -50 50])
grid
view(145,40)
%view(0,0)
%print
print time3.ps
