disp('plt_bob')
kon=0.4;
load hld_bob
for lx=1:27;
	z(lx)=143+105*(lx-1);
end;
sav=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
for i=1:ny;
	for j=1:28;
		s(i,j)=sqrt(w(i,j)*w(i,j)+ux(i,j)*ux(i,j))/cos(75/180*3.14159);
		if j<10;
			sav(i)=sav(i)+s(i,j);
		end;
	end;
end;
sav=sav/(10);

for i=1:ny;
	x=[s(i,1) 0 25.0 24.5 20.2 19.5 141 419 0 600 980 143 10 10];
	zo=0.1;
	x1=[x zo];
	y1=cold_lkb(x1);
	ust=y1(8);
	L=y1(7);
	zet=10/L;
	u10(i)=ust/kon*(log(10/zo)-psiu(zet));
	zet=50/L;
%	u50(i)=ust/kon*(log(50/zo)-psiu(zet));
	u50(i)=ust/kon*(log(50/zo)-psiu(zet));
end;

%
sf=[18.5 19.5 22.6 24.6 23.6 15.4];
jf=[17.00 17.333 18.583 18.917 19.333 19.917]; 

figure(1);
jax=(jday-231)*24;
plot(jax,sav(1:ny),'g',jax,s(1:ny,1),'c',jax,s(1:ny,8),'r',jax,u10,'mo',jf,sf,'wx');
axis([17 19.5 0 55]);
title('Hurricane Bob PBL Wind Time Series');
xlabel('Time (Hour on August 19 1991)');
ylabel('Wind Speed (m/s)');
hold on;
snx=[0 0 0 0 0 0 0 0 0 0 0 0];
for i=24:ny;
	for j=1:12;
		if j==1;
			snx(j)=snx(j)+u10(i);
		else;
			if j==2;
				snx(j)=snx(j)+u50(i);
			else;
				snx(j)=snx(j)+s(i,j);
			end;
		end;
	end;
end;
snx=snx/30;
alt(1)=10;
alt(2)=50;
alt(3:12)=z(1:10);
jam(1)=max(u10(24:53));
jam(2)=max(u50(24:53));
jam(3:12)=max(s(24:53,1:10));
figure(2)
plot(snx,alt,'r',jam,alt,'b');
axis([0 60 0 1200]);
title('Hurricane Bob PBL Mean Wind Profile');
xlabel('Wind Speed (m/s)');
ylabel('Height (m)');

