%
whole=0
%whole=1
% add wind
cdf_groups(26,:)='bb_stress ';
wlp(:,26)=bb_strlp*10;
lonlat(26,2)=42.1; lonlat(26,1)=-70.9;
%
!rm rose.met
[m,n]=size(wlp);
nind=length(ind);
is=[1 3 6 12 14 16 19 21 24 26];   %surface 4-8 m
im=[2 4 7 13 15 17 20 22 25 26];   % mid 18-28 m
inb=[5 8 9  23 26];        %  33-60 m        % near bot 
ib=[10 11 18 26 ];           % > 60
ibb=[2  5  9 11 13 15  20  23 26]; % 10 m or less from  bottom
%
%  get coastline and 40 m isobath
%  set up plot
%lat_mid=42.3;
%lon_mid=-70.4;
%dlon=1.4;   
lat_mid=42.22;
lon_mid=-70.55;
dlon=1.1;
%lat_mid=42.22;
%lon_mid=-70.5;
%dlon=1.2;
lat_fac=cos(lat_mid*pi/180);
%
boxx=[-.5 .5 .5 -.5 -.5];
boxy=[-.5 -.5 .5 .5 -.5];
%
dlat=dlon*lat_fac;
% factor for roses
%
yfac=3600*24*1.e-5/111.;   % [cm/s] * [s/day] * [km/cm] * [deg/km];
xfac=yfac/lat_fac;

if(whole==1),
  kind=1:1;
else,
  kind=2:2;    % sum 90- spring 91
end
for k=kind
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
%
  str2='   4-8 m';
%  str2=' 18-28 m';
% str2=' <= 10 mab';
for i=is,
   if(whole==1),
     i1=1;
     i2=length(wlp(:,1));
   else,
     i1=ind(k);
     i2=ind(k+1);
   end
   ii=i1:i2;
   str1=date_lbl(gregorian(jdlp(i1)),gregorian(jdlp(i2)));
   z=denan(wlp(ii,i));
  if(length(z)>60),
   int2str(length(z));
% plot box
   xr=boxx*xfac+lonlat(i,1);
   yr=boxy*yfac+lonlat(i,2);
   plot(xr,yr,'r-')
% plot arrow
   [z1]=arrow(mean(z));;
   xr=real(z1)*xfac+lonlat(i,1);
   yr=imag(z1)*yfac+lonlat(i,2);
   plot(xr,yr,'b-')
% plot ellipse
   [z1]=ellplt(z);
   xr=real(z1)*xfac+xr(2);
   yr=imag(z1)*yfac+yr(2);
   plot(xr,yr,'g-')
%
  end
end
title([str1 str2]);
if (exist('rose.met')~=2)
  meta rose
else
  meta
end
hold off
pause
end
