%
clg
whole=0
%whole=1
%load bbwhole
load bath40
% add wind
cdf_groups(4,:)='bb_stress ';
wlp(:,4)=bb_strlp(:)*10;
lonlat(4,2)=42.5; lonlat(4,1)=lonlat(1,1);
%
!rm rose.met
[m,n]=size(wlp);
is=seasons(jdlp);
nind=length(is);
%
%  get coastline and 40 m isobath
load coast
[nc]=length(coast(:,1));
coast(nc+1:nc+4,1)=[-70 -71.1 -71.1 -70.71]';
coast(nc+1:nc+4,2)=[41.8127 41.8127 42.6273 42.6273]';
load bath40_1
load bath40_2
%  set up plot
%lat_mid=42.3;
%lon_mid=-70.4;
%dlon=1.4;   
lat_mid=42.4;
lon_mid=-70.8;
dlon=0.5;
%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];
%
% tunnel
%tx=[-(70+48/60) -(70+46.5/60)];
%ty=[42+23.25/60 42+23.5/60];
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=1:8;    % sum 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
plot(bath40_1(:,1),bath40_1(:,2),'w')
plot(bath40_2(:,1),bath40_2(:,2),'w')
%plot(tx,ty,'g')
%
% legend 
   ticint=5;
   len=10;
   legx=-71.02;
   legy=42.5;
%   text(legx+.5*len*xfac,legy+.03,[int2str(len) '%']);
   plot([legx legx+len*xfac],[legy legy]);
   xtic=[legx:xfac*ticint:legx+len*xfac];
   xtic(2,:)=xtic(1,:);
   ytic=legy*ones(xtic);
   ytic(2,:)=ytic(2,:)+.01;
   plot(xtic,ytic,'r-');
%
 str2='   4-8 m';
%str2=' 18-28 m';
%str2=' <= 10 mab';
clg
for i=1:4,
   if(whole==1),
     i1=1;
     i2=length(wlp(:,1));
   else,
     i1=is(k);
     i2=is(k+1);
   end
   ii=i1:i2;
   str1=date_lbl(gregorian(jdlp(i1)+.1),gregorian(jdlp(i2+.1)));
   z=denan(wlp(ii,i));
  if(length(z)>60),
   i 
   int2str(length(z));
   xr=boxx*xfac+lonlat(i,1);
   yr=boxy*yfac+lonlat(i,2);
   clr=['c' int2str(i+4) '-'];
   plot(xr,yr,clr)
   [z1]=arrow(mean(z));;
   xr=real(z1)*xfac+lonlat(i,1);
   yr=imag(z1)*yfac+lonlat(i,2);
   plot(xr,yr,clr)
   hold on
   [z1]=ellplt(z);
   xr=real(z1)*xfac+xr(2);
   yr=imag(z1)*yfac+yr(2);
   plot(xr,yr,clr)
  end
end
title([str1 str2]);
if (exist('rose.met')~=2)
  meta rose
else
  meta
end
hold off
pause
end
