seq = 0;
outnames = names;        
delv = [];
        
        for i = 1:mfiles
                
                seq = seq + 1;
                delv(seq,:) = keys(i,1);
                maxvars = keys(i,2);    
                
                if statdata(keys(i,1),3) == 1

                        for j = 1:maxvars
                                
                                varposn = keys(i,1) + j;

                                if statdata(varposn,3) == 1
                                        startout = gregorian...
                                                   (timswant(indstart)); 
                                else
                                        seq = seq + 1;
                                        delv(seq,:) = varposn;
                                end     % if statdata(varposn,3) == 1

                        end     % for j = 1:maxvars

                else
                        
                        for j = 1:maxvars
                                varposn = keys(i,1) + j;
                                seq = seq + 1;
                                delv(seq,:) = varposn;
                        end     % for j = 1:maxvars          
                
                end     % if statdata(keys(i,1)) == 1
        
        end     % for i = 1:mfiles

outnames(delv,:) = [];
units(delv,:)    = [];
tmout = deltat*3600;
cmt = ['Comment handling to be determined - Gerry Martineau'];
[kr,kc] = size(dataout);
dout = dataout(:,2:kc);
cdf_name = 'linedup.cdf';

disp('outkb #1');
keyboard;

create_ts(cdf_name,dout,outnames,lat,lon,startout,tmout,...
        wdepth,idepth,units,cmt);


