Global Index (short | long) | Local contents | Local Index (short | long)
[varargout] = getc(varargin);
[out1, ...] = getc(var1, ... , xylim, tim); tim = time indices lev = level indices xylim = x and y limits Possible fields: evp : evaporation (mm/day) hfl : sensible heat flux (W m^-^2) rgn : Net LW at ground (W m^-^2) sgn : Net SW at ground (W m^-^2) rnd : Precipitation (mm/day) ico : Ice concentration (??)
function [varargout] = getc(varargin); nvar = 0; for i = 1:nargin; if isstr(varargin{i}); nvar = nvar + 1; end end xylim = [100 310 -65 65]; tim = 101:1000; if nargin < nargout; error('Input and output arguments must match'); end if nargin > nargout; xylim = varargin{nvar+1}; end; if nargin > nargout+1; tim = varargin{nvar+2}; end; if nargin > nargout+2; error('Too many input arguments'); end cdtem = ['cd ' eval('pwd')]; cd /home/disk/hayes2/dvimont/csiro/data for i = 1:nvar; filin = ['s' varargin{i} 'A_c10_056-1055.nc']; nc = netcdf(filin, 'nowrite'); lat = nc{'latitude'}(:); lon = nc{'longitude'}(:); [xk, yk] = keep_var(xylim, lon, lat); tem = nc{varargin{i}}(tim, yk, xk); sf = nc{varargin{i}}.scale_factor(:); ao = nc{varargin{i}}.add_offset(:); nc = close(nc); tem = squeeze(tem)*sf + ao; if strcmp(varargin{i}, 'evp') tem = tem * 2.5e6 / (3600*24); end if strcmp(varargin{i}, 'sgn'); tem = -1*tem; end varargout{i} = tem; end eval(cdtem);