function gb_plot97vel(id,tstart,tstop)
% gb_plot97vel(id,tstart,tstop) plots wind stress 
% magnitude and direction, drifter speed and
% directions given in id for the time between
% tstart and tstop during 1997.
% 4/1/01

% find number of drifters to be plotted
N=length(id);

%load data
load gb10mallA
load windstress97
clf
orient tall

% plot stress mag
m=find(t97>=tstart & t97<=tstop);
subplot(3,1,1)
plot(t97(m),tau97(m));
hold on

% convert to 1995 yd for drifters
tstart=yd2dd(tstart,1997);
tstop=yd2dd(tstop,1997);

% start loop
speed=ones(1,4);
tpmin=[];
tpmax=[];

for n=1:N
   nn=find(z(:,8)==id(n));
   zz=z(nn,:);
   % find subarray
   t=zz(:,1);
   err=0.005;
   I=find(tstart-err<=t & t<=tstop+err);
   t=zz(I,1);
   u=zz(I,4);
   v=zz(I,5);
   spd=100.*sqrt(u.^2+v.^2);
   dr=atan2(v,u)*180./pi;
   subplot(3,1,2)
   tp=dd2yd(t); 
   plot(tp,spd);grid;
   tpmin=[tpmin;min(tp)];
   tpmax=[tpmax;max(tp)];
   axis([min(tpmin) max(tpmax) 0 100])
   hold on
   spdm=max(spd);
   nspm=find(spd==spdm);
   spdmean=mean(spd);
   speed=[speed;[id(n) spdmean spdm dd2yd(tp(nspm))]];
    
   subplot(3,1,3)
   plot(tp,dr,t97(m),taudr97(m),'r')
   xlabel(['drifter id = ',int2str(id(n))])
   grid
   hold on
end
disp(speed)
save speed speed
   