function varsize = nc_varsize(ncfile, varname)
% NC_VARSIZE:  return the size of the requested netncfile variable
%
% USAGE: varsize = nc_varsize( netncfile_file, variable )
%
% PARAMETERS:
%   Input:
%      ncfile:  path to netncfile file
%      var:  name of requested variable
%   Output:
%      varsize: size of requested variable 
%
% In case of an error condition, an exception is thrown.
%
%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $Id: nc_varsize.m 1741 2006-08-29 16:35:33Z johnevans007 $
% $LastChangedDate: 2006-08-29 12:35:33 -0400 (Tue, 29 Aug 2006) $
% $LastChangedRevision: 1741 $
% $LastChangedBy: johnevans007 $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Show usage if too few arguments.
%
if nargin~=2 
	error ( '%s:  Must have two input arguments.\n', mfilename  );
end

if ~ischar(ncfile)
	error ( '%s:  Both inputs must be character.\n', mfilename  );
end
if ~ischar(varname)
	error ( '%s:  Both inputs must be character.\n', mfilename  );
end


v = nc_getvarinfo ( ncfile, varname );

varsize = v.Size;

return

