function disetne(in,s,d)
% disetne 	- Just outputs the initial flows in NE for ISETNE
%function disene(in,s,d)
%Just outputs the initial flows in NE for ISETNE 
%bulk of program code from dsplaye by OKB
%TYLC

global ns cnms ne Tdeg
sne=size(ne);
ns=ne(:,4:sne(2));

if d<3
   de=d;
else
   de=d-2;
end
lin=length(in);
totl='   Total';
if s<8
   totl=totl(9-s:8);
else
   totl=cext(totl,s);
end
if length(in)==1
   min=ns(in,:)';
   tin=charmx(in,s,0);
   sin=floor((s-5)/2);
else
   min=ns(in,:);
   min=[min;sum(min)]';
   tin=[charmx(in,s,0),totl];
   sin=floor((((lin+1)*s)-5)/2);
end

statein = '';
tempin=charmx((ne(in,1))',s,2);
for i=1:lin
   if ne(in(i),2)==1
      newstate=[cext(' ',(s-7)),'liquid '];
   elseif ne(in(i),2)==2
      newstate=[cext(' ',(s-6)),'vapor '];
   else
      newstate=[cext(' ',(s-6)),'solid '];
   end
   statein=[statein newstate(1:s)];
end
enthin=charmx((ne(in,3))',s,de);

if lin~=1
   tempin=[tempin,cext(' ',s)];
   statein=[statein,cext(' ',s)];
   enthin=[enthin,charmx(sum(ne(in,3)),s,de)];
end
 
min=[min;csum(min)];

inl=cext([cext(' ',sin),'     '],length(tin));
inl=inl(1:length(tin));
cin=[inl;tin;tempin;statein;enthin];
cin=[cin;charmx(min,s,d)];

[nr,nc]=size(cnms);
if nc<8
   bl=blank(nr,8-nc);
   cnms=addcol(cnms,bl);
   nc=8;
end
bl=cext(' ',nc-6);
lft=[cext('       ',nc);[bl,'Stream'];cext(['  Tmp ',Tdeg],nc)];
lft=[lft;cext('  State',nc);cext('  Entlpy',nc);cnms;cext('Total',nc)];

c=addcol(lft,cin);
v=[1 2];
[nri,nc1]=size(min);

for k=1:nr
   if (abs(min(k,nc1))>eps)
       v=[v,k+2];
   end
end
v=v+3;
c=c([1:3,v,nr+6],:);
[nr,nc]=size(c);
candsf=cext('Compound    Stream Flows',nc);
c=[c(1:5,:)
   candsf(1:nc)
   c(6:nr,:)];
   
disp(c);



