ph=menu('phase?','load & plot larvae',...
    'load temps & plot both',...
    'plot one year');
%ph=1;
if ph==1;
% load larvae data if not already
  ie=exist('b'); 
  if ie==0;


%   "i" counts the total observations
    i=0;

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bong92.dat
    for k=1:length(bong92);
      x(i+k)=bong92(k,2);
      y(i+k)=bong92(k,1);
      sn(i+k)=bong92(k,3);
      yr(i+k)=92;
      c(i+k)=bong92(k,6)*bong92(k,4)/100;
      h(i+k)=bong92(k,7)*bong92(k,4)/100;
      cs(i+k)=bong92(k,6);
      hs(i+k)=bong92(k,7);
    end;
    i=length(bong92);

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bong93.dat
    for k=1:length(bong93);
      x(i+k)=-1*bong93(k,7);
      y(i+k)=bong93(k,6);
      sn(i+k)=bong93(k,1);
      yr(i+k)=93;
      c(i+k)=bong93(k,2);
      h(i+k)=NaN;
      cs(i+k)=bong93(k,3);
      hs(i+k)=NaN;
    end;
    i=i+length(bong93);

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bong94_old.dat
    for k=1:length(bong94_old);
      x(i+k)=bong94_old(k,7);
      y(i+k)=bong94_old(k,6);
      sn(i+k)=bong94_old(k,1);
      yr(i+k)=94;
      c(i+k)=bong94_old(k,10);
      h(i+k)=bong94_old(k,12);
      cs(i+k)=bong94_old(k,11);
      hs(i+k)=bong94_old(k,13);
    end;
    i=i+length(bong94_old);

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bong95.dat
    for k=1:length(bong95);
      x(i+k)=bong95(k,2);
      y(i+k)=bong95(k,1);
      sn(i+k)=bong95(k,3);
      yr(i+k)=95;
      c(i+k)=bong95(k,4);
      h(i+k)=bong95(k,5);
      cs(i+k)=bong95(k,6);
      hs(i+k)=bong95(k,7);
    end;
    i=i+length(bong95);

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bonga97.dat
    for k=1:length(bonga97);
      x(i+k)=bonga97(k,2);
      y(i+k)=bonga97(k,1);
      sn(i+k)=bonga97(k,3);
      yr(i+k)=97;
      c(i+k)=bonga97(k,4);
      h(i+k)=bonga97(k,5);
      cs(i+k)=bonga97(k,6);
      hs(i+k)=bonga97(k,7);
    end;
    i=i+length(bonga97);

    load /home3/ocn/jmanning/gbs95/bongo/92_95/bongm97.dat
    for k=1:length(bongm97);
      x(i+k)=bongm97(k,2);
      y(i+k)=bongm97(k,1);
      sn(i+k)=bongm97(k,3);
      yr(i+k)=97;
      c(i+k)=bongm97(k,4);
      h(i+k)=bongm97(k,5);
      cs(i+k)=bongm97(k,6);
      hs(i+k)=bongm97(k,7);
    end;
    i=i+length(bongm97);

%   save the final matrix
    cruise=['al9205';'al9306';'al9403';'sj9507';' oc301';' oc303'];
    b=[yr; sn; x; y; c; h; cs; hs]';
 
    save bongall.dat b -ascii

%   end of data loading
  end;



% set base map
  clf
  georbat
  hold on;

% (Note: Ideally we should be calling "sizesym.m")

% form a color string matrix to send
  for k=1:length(c);
    cst(k,:)=['c',num2str(97-yr(k))];
  end;

%  plot w/logarithmic scales
  disp('Hardcoded to linear (not log) scale');
%  sizesym(x,y,c,-1,0,cst);
  sizesym(x,y,c,1,1,cst);
 
  lllabel
  axis([-69 -67 40 41.25]);
  lllabel(60,60,40,42,-69,-66)
% set(gca,'position',[.2 .4 .3 .3],'xticklabels',' ');

% TEXT
%  text(max(x)+.1,max(y)+.40,'  COD','FontSize',14)
  title('No. Cod Larvae Per Haul');
  text(-67.5,40.3,'1992','color',['c',num2str(5)])
  text(-67.5,40.2,'1993','color',['c',num2str(4)])
  text(-67.5,40.1,'1994','color',['c',num2str(3)])
  text(-67.5,40.0,'1995','color',['c',num2str(2)])
  text(-67.5,39.9,'1997','color',['c',num2str(1)])


% label the maximum catch
      id=find(c==max(c));
      h1=text(x(id),y(id),num2str(c(id)));
      set(h1,'verticalalignment','middle','horizontalalignment','center');
      set(h1,'fontsize',10,'color','w');


  xlabel('Longitude ');
  set(gca,'box','on','aspectratio',[1 .78]);

  disp('Press return for phase two');
  pause;
end;

if ph==2;

% phase two subplots of 1992-1995
% note:
  cruise=['al9205';'al9306';'al9403';'sj9507';'oc9704'];
    hsec

% end of phase 2 
end;

%%%%%%%%%%%%%   Plot a single year %%%%%%%%%%%%%%
if ph==3;
  yr=input('Year? ');
  coh=menu('Which?','cod','had','both');
  chostd=menu('Which?','catch per haul','catch per 100m3');
  if chostd==1;
    sv=4;
  else;
    sv=6;
  end;
  load bongall.dat
  b=bongall;
%   pick out the portion of grid desired
%   misn=input('minimum sta#: ');
   misn=96
%   masn=input('maximum sta#: ');
   masn=145
  id=find(b(:,1)==yr&b(:,2)>=misn&b(:,2)<=masn);
  if coh==3;
    if chostd==2;
      lab=['    Cod No./100m^3';'Haddock No./100m^3' ]
    else;
      lab=['    Cod (no./haul)';'Haddock (no./haul)' ]
    end;
    for k=1:2;
      subplot(2,1,k)
      georbat
      sizesym(b(id,3),b(id,4),-1*b(id,sv+k),1,.5);
      axis([min(b(id,3)) max(b(id,3)) min(b(id,4)) max(b(id,4))]);
      lllabel
      title(lab(k,:),'fontsize',18)
      if k==1;set(gca,'xticklabels',' ');xlabel(' ');end;
    end
  else;
      georbat
      sizesym(b(id,3),b(id,4),-1*b(id,sv+coh),1,.5);
      axis([min(b(id,3)) max(b(id,3)) min(b(id,4)) max(b(id,4))]);
      lllabel
  end;
  
end;