clear;

load data/midterm_isabel_dat;
load data/xland_isabel;
s_pres=squeeze(pres(1,:,:));
s_pres(XLAND<2)=NaN;

hydro_z=squeeze(Hydrometer(24,:,:));


[a1, ny]=min(min(s_pres,[],2));
[a1, nx]=min(min(s_pres,[],1));



[d3 d2 d1]=size(Hydrometer);

u0=squeeze(u(1,:,:));
v0=squeeze(v(1,:,:));
kd=10;
quiver(XLONG(1:kd:d2,1:kd:d1),XLAT(1:kd:d2,1:kd:d1),...
    u0(1:kd:d2,1:kd:d1),v0(1:kd:d2,1:kd:d1));

quiver(XLONG(1:kd:d2,1:kd:d1),XLAT(1:kd:d2,1:kd:d1),...
u0(1:kd:d2,1:kd:d1),v0(1:kd:d2,1:kd:d1),0);

quiver(XLONG(1:kd:d2,1:kd:d1),XLAT(1:kd:d2,1:kd:d1),...
    u0(1:kd:d2,1:kd:d1)/10,v0(1:kd:d2,1:kd:d1)/10,0);

quiver(XLONG(1:kd:d2,1:kd:d1),XLAT(1:kd:d2,1:kd:d1),...
    u0(1:kd:d2,1:kd:d1)/50,v0(1:kd:d2,1:kd:d1)/50,0);
hold on;
X2=[-78 -78];
Y2=[32 32];
U2=[1 1];
V2=[0 0];
quiver(X2,Y2,U2,V2,0,'r');
text(-76,32,'50 m/s');
hold off;


quiver(XLONG(50:kd:d2,130:kd:d1-30),XLAT(50:kd:d2,130:kd:d1-30),...
    u0(50:kd:d2,130:kd:d1-30),v0(50:kd:d2,130:kd:d1-30));

x0=XLONG(ny,130:d1-30);
z0=0.5*(z(1:50,ny,nx)+z(2:51,ny,nx))/1000;

[X0,Z0]=meshgrid(x0,z0);
UZ=squeeze(u(1:50,ny,130:d1-30))/10;
WZ=squeeze(w(1:50,ny,130:d1-30));

contourf(X0,Z0,WZ,'edgecolor','none');
contourf(X0,Z0,UZ,'edgecolor','none');

quiver(X0(:,1:4:end),Z0(:,1:4:end),UZ(:,1:4:end),WZ(:,1:4:end));






