function gb_plotA
% gb_plotA plots drifter trajectories
% and wind stress for event A.
% 4/2/01

clear
clf reset

id=[1:5];
N=5;

%load data
load gb10mallA
load windstress95

% set start, stop times
tstart=[20 25 30 35];
tstop=[25 30 35 40];

% start outer loop
clf
V=[-69 -65.5 40 42.5];
for plnum=1:4
   subplot(2,2,plnum)
   axis(V);
   gbmapss2(V);
   aspect5(41);
   hold on
   
   % start loop
   for n=1:N
      nn=find(z(:,8)==id(n));
      zz=z(nn,:);
      % find subarray
      t=zz(:,1);
      err=0.005;
      I=find(tstart(plnum)-err<=t & t<=tstop(plnum)+err);
      t=zz(I,1);
      x=zz(I,2);
      y=zz(I,3);
      M=length(x);
      xn=x(M,1);
      yn=y(M,1);

      % identify 5-day points
      dt=[tstart(plnum):5:tstop(plnum)];
      K=length(dt);
      J=[];
      for k=1:K-1
        j=find(t==dt(k));
        J=[J j];
      end
      J=J(:);
      xd=x(J);
      yd=y(J);

      % plot trajectory
      h=plot(x,y,xn,yn,'r*');set(h,'linewidth',2) 
      axis(V);
      hold on
   end
   
     % plot mean wind stress
     K=find(tstart(plnum)-err<=t95 & t95<=tstop(plnum)+err);
     txm=mean(tx95(K));
     tym=mean(ty95(K));
     xst1=-66.75;yst1=41.75;
     KK=2;
     KXY=.755;
     yst2=yst1+KK.*tym;
     xst2=xst1+KK.*txm./KXY;
     h=plot([xst1 xst2],[yst1 yst2],'k',xst2,yst2,'k*');
     set(h,'linewidth',2);
          
     % label period
     pdate=[dd2cd1(tstart(plnum)),' - ',dd2cd1(tstop(plnum))];
     title(pdate);
     
     % plot wind stress scale
     xst1=-66.5;yst1=40.25;
     KK=2;
     KXY=.755;
     yst2=yst1;
     xst2=xst1+KK.*.2./KXY;
     h=plot([xst1 xst2],[yst1 yst2],'g',xst2,yst2,'g*');set(h,'linewidth',2);
     hold on

end
