function []=vecplt7(w,wll,wind,windll)
% VECPLT6 steps through vector currents on a map 
%         using mouse buttons as controls
%
%  Does hard copy
%      right mouse button advances in time
%      middle mouse quits
%      left mouse button goes back in time
%      "p" prints out plot
%
%  click farther right on the plot to take greater time steps
%
% plots surface, mid and deep as different colors
% 0-10 m red
% 10-30 m green
% 30-60 m blue
% > 60 m  yellow
%
%
%  USAGE vecpltp(w,wll,wind,windll)
%        w  matrix where each column is a complex velocity time series
%        wll two-column matrix [lon lat] for velocity stations
%        w  complex wind vector
%        run real runoff vector
%
%        if it's too slow, try increasing nsub
%
[m]=length(w);
w(m+1)=wind;

wll(m+1,:)=windll;
%
%  get coastline and 40 m isobath
load coast
load bath40
%[nbath,foo]=size(bath40);
%bath40=bath40(1:4:nbath,:);
%
%  set up plot
lat_mid=42.22;
lon_mid=-70.55;
dlon=1.1;
lat_fac=cos(lat_mid*pi/180);
dlat=dlon*lat_fac;
%
% factor for arrows
%
 yfac=48*3600/1.e5/111;   % length particles would travel in one day :
 xfac=yfac/lat_fac;
%
% 111 km/ deg lat;
[m]=length(w);
lon=wll(:,1);
lat=wll(:,2);
%  Do movie until user says no!
axis('square');
s='y';
iw=m;   %wind
is=[1 3 6 12 14 16 19 21 24 ];   %surface 4-8 m
im=[2 4 7 13 15 17 20 22 25 ];   % mid 18-28 m
inb=[5 8 9  23 ];        %  33-60 m        % near bot
ib=[10 11 18  ];           % > 60
ibb=[2  5  9 11 13 15  20  23 ]; % 10 m or less from  bottom
clg
hold off
axis('square')
xmin=lon_mid-.5*dlon;
xmax=lon_mid+.5*dlon;
ymin=lat_mid-.5*dlat;
ymax=lat_mid+.5*dlat;
xx = [xmin xmax xmax xmin; xmax xmax xmin xmin];  % x coords of box
yy = [ymin ymin ymax ymax; ymin ymax ymax ymin];  % y coords of box
axis([xmin xmax ymin ymax])          % set axis limits
     hold on
     sca=-12;
     u=real(w);
     v=imag(w);
     arrow3(lon(is),lat(is),u(is),v(is),sca,-2,1,xfac,yfac,'r-')
     arrow3(lon(im),lat(im),u(im),v(im),sca,-2,1,xfac,yfac,'g-')
     arrow3(lon(ibb),lat(ibb),u(ibb),v(ibb),sca,-2,1,xfac,yfac,'b-');
     arrow3(lon(iw),lat(iw),u(iw),v(iw),sca,-2,1,xfac,yfac,'-');
     meta brad
return
