function [varargout] = getnc(varargin);
%  function [out1, ...] = getnc(file, var1,...);
%  file = filename
%  var1 = variable
%  Very basic version of getnc that just grabs the entire field: all levels,
%  times and spatial limits available.

nvar = 0;
for i = 1:nargin;
  if isstr(varargin{i});
    nvar = nvar + 1;
  end
end

% Set defaults
lev = 1; 

if nargin < (nargout+1);
  error('Input and output arguments must match');
end

if nargin > nargout+1,
  error('Too many input arguments');
end

filin=varargin{1};

for i = 2:nvar;

  nc = netcdf(filin, 'nowrite');
  tem = nc{varargin{i}}(:,:);
  mv = nc{varargin{i}}.missing_value(:);
  nc = close(nc);
  if isempty(mv)~=1,
  tem(tem == mv) = NaN;
  end
  varargout{i-1} = squeeze(tem);

end

