%
whole=1
%whole=1
load rocky
load bath40
% add wind
cdf_groups(26,:)='bb_stress ';
wlp(:,26)=bb_strlp*5;
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
load coast
load bath40
%  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_fac=cos(lat_mid*pi/180);

dlat=dlon*lat_fac;
% factor for roses
%
yfac=1./400;   % km => deg
xfac=yfac/lat_fac;

if(whole==1),
  kind=1:1;
else,
  kind=4:6;    % fall 90- spring 91
end
for k=kind
hold off
axis('square')
axis([lon_mid-.5*dlon lon_mid+.5*dlon lat_mid-.5*dlat lat_mid+.5*dlat]);
plot(coast(:,1),coast(:,2));
hold on
mplot(bath40,'.')
%
%
ybin = [10    20    30    40    50  60   70   80  ];
wide = 1.5*[ 0     2     4     6     8    10    12    14  ];
rosekey(-70.9,41.98,ybin,wide,5,xfac,yfac);
for i=ibb,
   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),
   cdf_groups(i,:)
   nl=int2str(length(z));
   [xroze,yroze]=makerose(z);
   xroze=xroze*xfac+lonlat(i,1);
   yroze=yroze*yfac+lonlat(i,2); 
   mplot([xroze(:) yroze(:)],'g-')
   hold on
  end
end
%title([str1 ' 4-8 m']);
%title([str1 ' 18-28 m']);
title([str1 ' <= 10 mab']);
if (exist('rose.met')~=2)
  meta rose
else
  meta
end
hold off
pause
end
