source: Roms_tools/mexcdf/snctools/nc_varsize.m @ 1

Last change on this file since 1 was 1, checked in by cholod, 13 years ago

import Roms_Agrif

File size: 949 bytes
Line 
1function varsize = nc_varsize(ncfile, varname)
2% NC_VARSIZE:  return the size of the requested netncfile variable
3%
4% VARSIZE = NC_VARSIZE(NCFILE,NCVAR) returns the size of the netCDF variable
5% NCVAR in the netCDF file NCFILE.
6%
7
8%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9%
10% $Id: nc_varsize.m 2659 2009-04-01 17:38:36Z johnevans007 $
11% $LastChangedDate: 2009-04-01 13:38:36 -0400 (Wed, 01 Apr 2009) $
12% $LastChangedRevision: 2659 $
13% $LastChangedBy: johnevans007 $
14%
15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17error(nargchk(2,2,nargin,'struct'));
18error(nargoutchk(1,1,nargout,'struct'));
19
20if ~ischar(ncfile)
21        error ( 'SNCTOOLS:NC_VARSIZE:badInputType', 'The input filename must be a string.' );
22end
23if ~ischar(varname)
24        error ( 'SNCTOOLS:NC_VARSIZE:badInputType', 'The input variable name must be a string.' );
25end
26
27
28v = nc_getvarinfo ( ncfile, varname );
29
30varsize = v.Size;
31
32return
33
Note: See TracBrowser for help on using the repository browser.