Documentation of compare_fields


Global Index (short | long) | Local contents | Local Index (short | long)


Help text

  Start off with the typical variables.

Cross-Reference Information

This script calls

Listing of script compare_fields



clean
cd /home/disk/hayes2/dvimont/ccm/ccm3.6/data

[cpc, cpl, ch, cps] = getnc('cgr.nc', 'PRECC', 'PRECL', 'Z3', 'PS');
[wpc, wpl, wh, wps] = getnc('wgr.nc', 'PRECC', 'PRECL', 'Z3', 'PS');
[ipc, ipl, ih, ips] = getnc('india.nc', 'PRECC', 'PRECL', 'Z3', 'PS');
[clpc, clpl, clh, clps] = getnc('clim.nc', 'PRECC', 'PRECL', 'Z3', 'PS');
[lat, lon, lev, hyam, hybm, P0] = getll('cct.nc');

whos

cp = squeeze(mean(cpc+cpl))*(24*3600*1000);
wp = squeeze(mean(wpc+wpl))*(24*3600*1000);
ip = squeeze(mean(ipc+ipl))*(24*3600*1000);
clp = squeeze(mean(clpc+clpl))*(24*3600*1000);

ch = squeeze(mean(ch));
wh = squeeze(mean(wh));
ih = squeeze(mean(ih));
clh = squeeze(mean(clh));
cps = squeeze(mean(cps));
wps = squeeze(mean(wps));
ips = squeeze(mean(ips));
clps = squeeze(mean(clps));

levs = [1000 925 850 500 250];
chgt = atlev(ch, levs, cps, hyam, hybm, P0);
whgt = atlev(wh, levs, wps, hyam, hybm, P0);
ihgt = atlev(ih, levs, ips, hyam, hybm, P0);
clhgt = atlev(clh, levs, clps, hyam, hybm, P0);



%  Try some plots:  NOTE:  The variable 'weight' is calculated
%  somewhere else, and must be used here to scale the india run.
%  In this case, just scroll down and you'll find it.

lev = 500;
ind = find(levs == lev);

top = squeeze(whgt(ind, :, :) - clhgt(ind, :, :))/1.0;
%bot = squeeze(whgt(ind, :, :) + chgt(ind, :, :) - 2*clhgt(ind, :, :));
%bot = squeeze(ihgt(ind, :, :) - clhgt(ind, :, :))/(1.4*weight);
%top = top - bot;
bot = squeeze(chgt(ind, :, :) - clhgt(ind, :, :))/1.0;
cind = 10;
origin = [90 270];
%origin = [-90 270];

%get_global
default_global

figure(1)
sp(1)
     mcont(top, [-500:cind:500], origin)
     title(['CT:  WARM - CLIM ' num2str(lev) 'mb HGT']);
     xlabel(['Contour Interval:  ' num2str(cind) 'm']);
sp(2)
     mcont(bot, [-500:cind:500], origin)
     title(['CT:  COLD - CLIM ' num2str(lev) 'mb HGT']);
     xlabel(['Contour Interval:  ' num2str(cind) 'm']);


%  NOTE:  Here's one way to get the variable 'weight'.

top = wp - clp;
%bot = wp + cp - 2*clp;
bot = ip - clp;
cint = 2;
FRAME = [30 120 -5 15];

figure(1)
sp(1)
     mcont(top, [-20:cint:20], 'giso', [0 180]);
     title(['CT:  WARM - CLIM Precipitation'])
     xlabel(['Contour Interval:  ' num2str(cint) 'mm (day)^-^1'])
sp(2)
     mcont(bot, [-20:cint:20], 'giso', [0 180]);
     title(['CT:  COLD - CLIM Precipitation'])
     xlabel(['Contour Interval:  ' num2str(cint) 'mm (day)^-^1'])

[ix, iy] = keep_var([60 105 0 10], lon, lat);
weight = mean(mean(bot(ix, iy))) / mean(mean(top(ix, iy)));

%  Here's another:

cd /home/disk/hayes2/dvimont/ccm/ccm3.6/data
[wzt, wct] = getnc('wct.nc', 'ZMDT', 'CMFDT');
[izt, ict] = getnc('india.nc', 'ZMDT', 'CMFDT');
[clzt, clct] = getnc('clim.nc', 'ZMDT', 'CMFDT');

tem1 = (wzt + wct - clzt - clct);
tem1 = squeeze(mean(mean(mean(mean(tem1(:,8:18,iy,ix))))));
tem2 = (izt + ict - clzt - clct);
tem2 = squeeze(mean(mean(mean(mean(tem2(:,8:18,iy,ix))))));
weight = tem2 / tem1

%  Check out SST's:

wts = getnc('wgr.nc', 'TS');
cts = getnc('cgr.nc', 'TS');
clts = getnc('clim.nc', 'TS');

top = squeeze(mean(wts-clts))/2;
bot = squeeze(mean(cts-clts))/2;

cint = 0.2;
default_global;

figure(1)
sp(1)
     mcont(top, [-5:cint:5], 'giso', [0 180]);
     title(['CT:  WARM - CLIM Precipitation'])
     xlabel(['Contour Interval:  ' num2str(cint) 'mm (day)^-^1'])
sp(2)
     mcont(bot, [-5:cint:5], 'giso', [0 180]);
     title(['CT:  COLD - CLIM Precipitation'])
     xlabel(['Contour Interval:  ' num2str(cint) 'mm (day)^-^1'])






filin = 'hgt.mon.mean.nc';
varn = 'hgt'
cd /home/disk/tao/dvimont/matlab/CCM/CT
[ppat, npat, pat, clim] = pn_reg_ct(filin, varn, 500);
cd /home/disk/tao/data/nmc.reanalysis/monthly
[lat, lon] = getll(filin);

if (strcmp(varn, 'prate'));
  ppat = ppat*(24*3600);
  npat = npat*(24*3600);
end

get_global
default_global
%FRAME = [0 360 -40 40];
cint = 10

figure(1)
sp(1)
%     mcont(ppat, [-5:cint:5], 'giso', [0 180]);
     mcont(ppat, [-500:cint:500]);
     title(['NMC:  WARM CT* Weighted Average 500mb HGT'])
     xlabel(['Contour Interval ' num2str(cint) 'm'])
sp(2)
%     mcont(npat, [-5:cint:5], 'giso', [0 180]);
     mcont(npat, [-500:cint:500]);
     title(['NMC:  COLD CT* Weighted Average 500mb HGT'])
     xlabel(['Contour Interval ' num2str(cint) 'm'])

cd /home/disk/tao/dvimont/matlab/CCM/CT/CT_Plots/WA