Global Index (short | long) | Local contents | Local Index (short | long)
compare(varargin);
compare(var1, var2, lev, nlev); varargin is a list of variables to plot. It can be one or two variables long, and will be contoured for one, vectored for two variables.
This function calls | |
---|---|
function compare(varargin); curdir = ['cd ' cd]; cd /home/disk/hayes2/dvimont/ccm/ccm3.6/data nar = nargin; cont_or_vect = -1; for i = 1:nar; if (isstr(varargin{i})) cont_or_vect = cont_or_vect + 1; end end if ~cont_or_vect if nar == 2; nlev = varargin{2}; lev = 1; else nlev = 10; lev = 1; end tem = varargin{1}; wvar = getnc('wct.nc', lev, tem); units = getatt('wct.nc', tem, 'units'); [lat, lon, level] = getll('wct.nc'); cvar = getnc('cct.nc', lev, tem); clvar = getnc('clct.nc', lev, tem); define_global top = squeeze(mean(wvar - clvar)); bot = squeeze(mean(cvar - clvar)); [clev, cint] = get_contour_int([top bot], nlev); figure(1) sp(1) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; WARM - CLIM']) mcont(top, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); sp(2) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; COLD - CLIM']) mcont(bot, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); top = squeeze(mean(wvar - cvar))/2; bot = squeeze(mean(wvar + cvar - 2*clvar))/2; [clev, cint] = get_contour_int([top bot], nlev); figure(2) sp(1) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; WARM - COLD']) mcont(top, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); sp(2) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; WARM + COLD']) mcont(bot, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); else if nar == 3; lev = 1; nlev = varargin{3}; else nlev = 1; lev = 1; end tem1 = varargin{1}; tem2 = varargin{2}; [wvar1, wvar2] = getnc('wct.nc', lev, tem1, tem2); units = getatt('wct.nc', tem1, 'units'); [lat, lon, level] = getll('wct.nc'); [cvar1, cvar2] = getnc('cct.nc', lev, tem1, tem2); [clvar1, clvar2] = getnc('clct.nc', lev, tem1, tem2); define_global top1 = squeeze(mean(wvar1 - clvar1)); bot1 = squeeze(mean(cvar1 - clvar1)); top2 = squeeze(mean(wvar2 - clvar2)); bot2 = squeeze(mean(cvar2 - clvar2)); figure(1) sp(1) title(['GR: <' tem1 ', ' tem2 '>; level: ' num2str(round(level(lev)))... '; WARM - CLIM']) mquiv(top1, top2, nlev, 'giso', [0 180]); % xlabel(['Contour Interval: ' num2str(cint) units]); sp(2) title(['GR: <' tem1 ', ' tem2 '>; level: ' num2str(round(level(lev)))... '; COLD - CLIM']) mquiv(bot1, bot2, nlev, 'giso', [0 180]); % xlabel(['Contour Interval: ' num2str(cint) units]); top = squeeze(mean(wvar - cvar))/2; bot = squeeze(mean(wvar + cvar - 2*clvar))/2; [clev, cint] = get_contour_int([top bot], nlev); figure(2) sp(1) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; WARM - COLD']) mquiv(top, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); sp(2) title(['GR: ' tem '; level: ' num2str(round(level(lev)))... '; WARM + COLD']) mquiv(bot, clev, 'giso', [0 180]); xlabel(['Contour Interval: ' num2str(cint) units]); end eval(curdir);