function [x,y,zr,wr,cde,depth]=bot_param(cdf,itime);
% function [x,y,zr,wr,cde,depth]=bot_param(cdf,itime);
mexcdf('setopts',0);
ncid=mexcdf('open',cdf,'nowrite');

[nam,nz]=mexcdf('diminq',ncid,'zpos');
[nam,nx]=mexcdf('diminq',ncid,'xpos');
[nam,ny]=mexcdf('diminq',ncid,'ypos');
[nam,nt]=mexcdf('diminq',ncid,'time');
sigma=mexcdf('varget',ncid,'sigma',0,nz);
sigma=.5*(sigma(1:(nz-1))+sigma(2:nz));
depth=mexcdf('varget',ncid,'depth',[0 0],[ny nx]);
cde=mexcdf('varget',ncid,'cd',[itime-1 0 0],[1 ny nx]);
z=depth*sigma(nz-1);
zr=z+depth;

base_date=[0 0 0 0 0 0];
base_date(1:3)=mexcdf('attget',ncid,'global','base_date');
t=mexcdf('varget',ncid,'time',itime-1,1);
jd0=julian(base_date);
jd=jd0+t;

mexcdf('close',ncid);
[wr,x,y]=ksliceuv(cdf,itime,nz-1);
ind=find(depth<-88888);
wr(ind)=wr(ind)*nan;
zr(ind)=zr(ind)*nan;
depth(ind)=depth(ind)*nan;
cde(ind)=cde(ind)*nan;
