function oms_plotall(infile)
% OMS_PLOTALL - Create graphs of record data in a netcdf file
%
% Use as; oms_plotall(infile)
%
% Inputs: infile = an oms netcdf object


% Brian Schlining
% 06 Jan 2000

OK = oms_checkfile(infile);
FLAG = OK;
if ~OK
   if strcmp(lower(char(infile.project(:))), 'simbios')
      OK = 1;
   end
end

if OK
   mooring = char(infile.mooring(:));
end


[filePath fileName fileExt] = fileparts(char(ncnames(infile)));

V = recvar(infile);
count = 0;
for i = 1:length(V)
   if iscoord(V{i})
      X = nctime(infile);
      XName = char(ncnames(V{i}));
   else
      count = count + 1;
      good(count) = i;
   end
end
V = V(good);


for i = 1:length(V)
   fH = figure;
   Y = V{i}(:);
   bad = find(Y == V{i}.FillValue_(:));
   Y(bad) = NaN;
   plot(X, Y,'k');
   if OK
      if FLAG
         tH = title([mooring ': ' char(ncnames(V{i})) ': ' char(V{i}.long_name(:)) ' [' sprintf('%+0.1f',V{i}.instrumentDepth(:)*-1 ) 'm]']);
      else
         tH = title([mooring ': ' char(ncnames(V{i})) ': ' char(V{i}.long_name(:))]);
      end
      
      set(tH,'interpreter','none')
      ylabel([V{i}.symbol(:) '[' V{i}.units(:) ']']);
      datetick('x');
   else
      title(char(ncnames(V{i})))
   end
   xlabel(XName);
   grid('on')
   set(gcf,'PaperPosition',[0 0 4 3])
   setfontsize(7);
   writegif([fileName '.' char(ncnames(V{i})) '.gif'], fH)
   close(fH);
   
end


