function [xg,yg,varg1,varg2,varg3]=...
    slicecomp5(cdf,itime,clev1,clev2,clev3,depth,itype);

if (exist('coast')~=1),
  load /usr/users/rps/gom/dino/wgom_half_sp
% coast=wgom_half/1000.;
% ind=find(coast(:,1)>370|coast(:,2)>350);
% coast(ind,:)=[];
end
%load /usr/users/rps/gom/dino/gom2.dig.sp

%coast=[coast; nan nan; gom2(:,[1 2])/1000];
%ps=get(gcf,'pos');
set(gcf,'pos',[10 10 640 480]);
colordef black
set(gcf,'color','black');
jd=ecomtime(cdf);
jd=jd(itime);
start=greg2str(gregorian(jd));
titl=['Red Tide Model Results at ' int2str(abs(depth)) ' m : '];
titl=[titl start(1:10)];

[varg1,xg,yg]=zslice(cdf,'conc',itime,-abs(depth));

% river concentration was arbitrarily set at 100 cells/l.
% multiply the output by 16 to make comparable to 1600 cells/l,
% which seems to be a little more in the ballpark of the data.
varg1=16*varg1;

iflip1=0;

[varg2,xg,yg]=zslice(cdf,'salt',itime,-abs(depth));
iflip2=1;

[varg3,xg,yg]=zslice(cdf,'temp',itime,-abs(depth));
iflip3=0;


%         itype :  1= fill, label 
%                  2= fill, no label
%                  3= nofill, label
%
clf
if(exist('itype')~=1),
 itype=1;
end
colormap(jet(64));
if(iflip1),
  varg1=max(clev1)-(varg1-min(clev1));
end
if(iflip2),
  varg2=max(clev2)-(varg2-min(clev2));
end
if(iflip3),
  varg3=max(clev3)-(varg3-min(clev3));
end

% panel 1
axes('pos',[.0 .1 .4 .8]);
cax=[min(clev1) max(clev1)];
if(itype==1),
  pslice2(xg/1000,yg/1000,varg1,[min(clev1) max(clev1)]);...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==2),
  extcontour(xg/1000,yg/1000,varg1,clev1,'fill');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==3),
  extcontour(xg/1000,yg/1000,varg1,clev1,'label');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
else
  disp('invalid itype');
  return
end
text(260,360,'Cells (#/liter)','fontweight','bold','fontsize',14);
text(300,380,titl,'fontweight','bold','fontsize',14);
tau=ecomtau(cdf);
tau=tau(itime);
fac=sqrt(abs(tau));
text(340,210,'Wind','fontweight','bold','fontsize',14);
fatarrow(355,180,tau/fac*100,'yellow');
set(gca,'visible','off');
%  hh=gca;
%  dif=max(clev1)-min(clev1);
%  mid=floor(dif/2);
%  inc=floor(dif/2)/5;
%  hb=cbar(hh,'h',inc,mid,'fontsize',9);
%  axes(hh);

%panel2
axes('pos',[.3 .1 .4 .8]);
colormap(jet(64));
if(itype==1),
  pslice2(xg/1000,yg/1000,varg2,[min(clev2) max(clev2)]);...
%  line(data(:,1)/1000,data(:,2)/1000,'color',[1 1 .9],'linestyle','x');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==2),
  extcontour(xg/1000,yg/1000,varg2,clev2,'fill');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==3),
  extcontour(xg/1000,yg/1000,varg2,clev2,'label');
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
else
  disp('invalid itype');
  return
end
text(260,360,'Salinity (psu)','fontweight','bold','fontsize',14);
set(gca,'visible','off');
%  hh=gca;
% dif=max(clev3)-min(clev3);
%  mid=floor(dif/2);
%  inc=floor(dif/2)/5;
%  hb=cbar(hh,'h',inc,mid,'fontsize',9);
%  axes(hh);

%panel3
axes('pos',[.6 .1 .4 .8]);
colormap(jet(64));
if(itype==1),
  pslice2(xg/1000,yg/1000,varg3,[min(clev3) max(clev3)]);...
%  line(data(:,1)/1000,data(:,2)/1000,'color',[1 1 .9],'linestyle','x');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==2),
  extcontour(xg/1000,yg/1000,varg3,clev3,'fill');...
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
elseif(itype==3),
  extcontour(xg/1000,yg/1000,varg3,clev3,'label');
  line(coast(:,1),coast(:,2),'color','white');...
  set(gca,'asp',[nan 1]);
else
  disp('invalid itype');
  return
end
text(260,360,'Temperature (C)','fontweight','bold','fontsize',14);
set(gca,'visible','off');
%  hh=gca;
%  dif=max(clev3)-min(clev3);
  %mid=floor(dif/2);
%  inc=floor(dif/2)/5;
%  hb=cbar(hh,'h',inc,mid,'fontsize',9);
  %axes(hh);

% colorbar
% colorbar
 pclegend(clev1',[.07 .7 .02 .2]);
% pclegend(clev1,[.05 .85 .09 .02]);
%pclegend(clev1',[.28 .33 .02 .2]);
 pclegend(clev2,[.35 .05 .18 .02]);
%pclegend(clev2',[.60 .33 .02 .2]);
%pclegend(clev2,[.45 .85 .09 .02]);
 set(gca,'xticklabels',['33';'31';'29'])
 pclegend(clev3',[.92 .33 .02 .2]);
%pclegend(clev3,[.75 .85 .09 .02]);
 set(gca,'xticklabels',[' 4';'  ';' 8';'  ';'12']);

axh=get(gcf,'children');
for i=1:length(axh);
set(axh(i),'fontsize',14,'fontweight','bold');
end
%writegif('/usr/www/foo.gif');
