function cbcstruct=read_cbc(flnm)
% These .cbc files will be organized as
% L1:case name 
% L2:comment 
% L3:start day month year second
% L4:NTS DT 
% L5:NN NNV 
% L6->L(NTS*NN*NNV) 
% timestep boundnodenumber nodenumber lev f 
eol='\n';
fp=fopen(flnm,'r');
x.casename=fgetl(fp);
x.comment=fgetl(fp);
l=fgetl(fp);
s=sscanf(l,'%i',[1,4]);
x.day=s(1);
x.month=s(2);
x.year=s(3);
x.second=s(4);
l=fgetl(fp);
s=sscanf(l,'%i',[1,2]);
x.NTS=s(1);
x.DT=s(2);
l=fgetl(fp);
s=sscanf(l,'%i',[1,2]);
x.NN=s(1);
x
%x.NNV=s(2);
x.f=zeros(x.NTS,x.NN);
for t=1:x.NTS,
	for bn=1:x.NN,
        l=fgetl(fp);
%        if t==1,
%            s=sscanf(l,'%i',[1,4]);
%            x.node(bn)=s(3);
%         end
         s=sscanf(l,'%f',[1,4]);
         x.f(t,bn)=s(4);
         x.node(bn)=floor(s(3));
      end
end
fclose(fp);
cbcstruct=x;
