Global Index (short | long) | Local contents | Local Index (short | long)
Save the data
This script calls | |
---|---|
clean cd /home/disk/tao/data/nmc.reanalysis load landmask.mat lims = [100 270 20 65]; [xk, yk] = keep_var(lims, lon, lat); lm = lm(yk,xk); lm(lm==-1)=NaN; tim = 1:624; varn = 'air'; filin = 'air.mon.mean.sfc.48mar01.nc'; lev = 1; cd /home/disk/tao/data/nmc.reanalysis/monthly [sst, lat, lon] = getnc2(filin, varn, lims, lev, tim); sst = squeeze(sst); sst = annave(sst); sst = detrend(sst); sst = cosweight(sst, lat); [ntim, nlat, nlon] = size(sst); kp = find(~isnan(lm)); sst = sst(:, kp); [lam, lds, pcs, per] = eof_dan(sst); cd /home/disk/tao/dvimont/matlab/NMC/Data save npac_sst_eofs.mat lat lon lims tim lm kp nlat nlon ntim ... lam lds pcs per % Look at regression patterns clean cd /home/disk/tao/dvimont/matlab/NMC/Data load npac_sst_eofs.mat lims2 = [85 305 -50 80]; cd /home/disk/tao/data/nmc.reanalysis/monthly [sst, lat, lon] = getnc2('air.mon.mean.sfc.48mar01.nc', 'air', ... lims2, 1, tim); [hgt5] = getnc2('hgt.mon.mean.nc', 'hgt', ... lims2, 500, tim); [slp] = getnc2('slp.monthly.nc', 'slp', ... lims2, 1, tim); [uwn5] = getnc2('uwnd.mon.mean.nc', 'uwnd', ... lims2, 500, tim); sst = annave(sst); slp = annave(slp); uwn5 = annave(squeeze(uwn5)); hgt5 = annave(squeeze(hgt5)); [xkc, ykc] = keep_var([180 270 -6 6], lon, lat); ct = squeeze(mean2(mean2(shiftdim(sst(:,ykc,xkc), 1)))); [pat1sst, c1sst] = regress_eof(sst, pcs(:,1), 0); [pat2sst, c2sst] = regress_eof(sst, pcs(:,2), 0); [pat3sst, c3sst] = regress_eof(sst, pcs(:,3), 0); [pat1slp, c1slp] = regress_eof(slp, pcs(:,1), 0); [pat2slp, c2slp] = regress_eof(slp, pcs(:,2), 0); [pat3slp, c3slp] = regress_eof(slp, pcs(:,3), 0); [pat1uwn5, c1uwn5] = regress_eof(uwn5, pcs(:,1), 0); [pat2uwn5, c2uwn5] = regress_eof(uwn5, pcs(:,2), 0); [pat3uwn5, c3uwn5] = regress_eof(uwn5, pcs(:,3), 0); [pat1hgt5, c1hgt5] = regress_eof(hgt5, pcs(:,1), 0); [pat2hgt5, c2hgt5] = regress_eof(hgt5, pcs(:,2), 0); [pat3hgt5, c3hgt5] = regress_eof(hgt5, pcs(:,3), 0); % Save the data cd /home/disk/tao/dvimont/matlab/NMC/Data save npac_sst_eof_regs.mat lat lon lims2 tim lam lds pcs per ct ... pat1sst c1sst pat2sst c2sst pat3sst c3sst ... pat1slp c1slp pat2slp c2slp pat3slp c3slp ... pat1uwn5 c1uwn5 pat2uwn5 c2uwn5 pat3uwn5 c3uwn5 ... pat1hgt5 c1hgt5 pat2hgt5 c2hgt5 pat3hgt5 c3hgt5 % Plot the regressions clean cd /home/disk/tao/dvimont/matlab/NMC/Data load npac_sst_eof_regs.mat figure(1); fo(1); clf; % Set up figure window get_global; figure(1); fo(1); clf; sz = get(gcf, 'PaperSize'); FRAME = [89.9 300.1 -40.1 70]; hw = 1/sz(1); vw = 1/sz(2); hsz = hw*(2.75); vsz = vw*1.75; bmarg = (sz(2) - 8.5)*0.5; tmarg = (sz(2) - 8.5)*0.5; midv = 0.25; midh = 0.5; GRDX = 30; GRDY = 20; cint = [0.1 0.4 5 .5] clev = .1; shcolor = 0.8; perstr = round(10*per)/10; yr = [1948:1/12:(1999+11/12)]; lppcs = standardize(rave(rave(pcs, 5), 7)); ct = rave(standardize(ct), 5); % Mode 1 dg(lat, lon); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(-pat1sst, cint(1), 'mollweid'); dcmfill(1); color_shadem(squeeze(c1sst.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SAT', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); xx = get(gca, 'Xlim'); yy = get(gca, 'YLim'); tx = text(mean(xx), yy(2)+0.5, '\bf{NPAC: SST EOF1}', ... 'fontsize', 12, 'horizontalalignment', 'center'); tx2 = text(mean(xx), yy(2)+0.15, [num2str(perstr(1)) '% Var Expl'], ... 'fontsize', 12, 'horizontalalignment', 'center'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(-pat1slp, cint(2), 'mollweid'); dcmfill(-1); color_shadem(-squeeze(c1slp.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SLP', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(-pat1hgt5, cint(3), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c1hgt5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('HGT500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(-pat1uwn5, cint(4), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c1uwn5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('UWN500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-2*midv)-3*vsz 2*hsz+midh*hw vsz]); cla ind = 1:264; pp = plot(yr(ind), -pcs(ind,1), 'k', yr(ind), -lppcs(ind), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1940 1970 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1940:5:1970, 'YTick', -5:5); ylabel('STD', 'fontsize', 9); legend('PC1', 'LPPC1', 'CT'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-3*midv)-4*vsz 2*hsz+midh*hw vsz]); cla ind = 265:624; pp = plot(yr(ind), -pcs(ind,1), 'k', yr(ind), -lppcs(ind), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1970 2000 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1970:5:2000, 'YTick', -5:5); ylabel('STD', 'fontsize', 9); % Mode 2 figure(2); fo(1); clf; dg(lat, lon); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(pat2sst, cint(1), 'mollweid'); dcmfill(1); color_shadem(squeeze(c2sst.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SAT', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); xx = get(gca, 'Xlim'); yy = get(gca, 'YLim'); tx = text(mean(xx), yy(2)+0.5, '\bf{NPAC: SST EOF2}', ... 'fontsize', 12, 'horizontalalignment', 'center'); tx2 = text(mean(xx), yy(2)+0.15, [num2str(perstr(1)) '% Var Expl'], ... 'fontsize', 12, 'horizontalalignment', 'center'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(pat2slp, cint(2), 'mollweid'); dcmfill(-1); color_shadem(-squeeze(c2slp.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SLP', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(pat2hgt5, cint(3), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c2hgt5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('HGT500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(pat2uwn5, cint(4), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c2uwn5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('UWN500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-2*midv)-3*vsz 2*hsz+midh*hw vsz]); cla ind = 1:264; pp = plot(yr(ind), pcs(ind,2), 'k', yr(ind), lppcs(ind, 2), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1940 1970 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1940:5:1970, 'YTick', -5:5); ylabel('STD', 'fontsize', 9); legend('PC2', 'LPPC2', 'CT'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-3*midv)-4*vsz 2*hsz+midh*hw vsz]); cla ind = 265:624; pp = plot(yr(ind), pcs(ind,2), 'k', yr(ind), lppcs(ind, 2), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1970 2000 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1970:5:2000, 'YTick', -5:5); ylabel('STD', 'fontsize', 9); % Mode 3 figure(3); fo(1); clf; dg(lat, lon); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(-pat3sst, cint(1), 'mollweid'); dcmfill(1); color_shadem(squeeze(c3sst.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SAT', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); xx = get(gca, 'Xlim'); yy = get(gca, 'YLim'); tx = text(mean(xx), yy(2)+0.5, '\bf{NPAC: SST EOF3}', ... 'fontsize', 12, 'horizontalalignment', 'center'); tx2 = text(mean(xx), yy(2)+0.15, [num2str(perstr(1)) '% Var Expl'], ... 'fontsize', 12, 'horizontalalignment', 'center'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(-pat3slp, cint(2), 'mollweid'); dcmfill(-1); color_shadem(-squeeze(c3slp.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('SLP', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg)-vsz hsz vsz]); cla mcont2(-pat3hgt5, cint(3), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c3hgt5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('HGT500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5+midh*hw/2 ... vw*(sz(2)-tmarg-midv)-2*vsz hsz vsz]); cla mcont2(-pat3uwn5, cint(4), 'mollweid'); dcmfill(-1); color_shadem(squeeze(c3uwn5.^2), clev, shcolor*[1 1 1]) gridm on; setm(gca, 'plinelocation', GRDY, 'mlinelocation', GRDX); axis_limits; set(gca, 'fontsize', 8, 'visible', 'off'); t1 = ylabel('UWN500', 'fontsize', 9, 'visible', 'on'); pos = get(t1, 'Position'); set(t1, 'Position', [0.9*pos(1) pos(2:3)]); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-2*midv)-3*vsz 2*hsz+midh*hw vsz]); cla ind = 1:264; pp = plot(yr(ind), -pcs(ind,3), 'k', yr(ind), -lppcs(ind,3), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1940 1970 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1940:5:1970, 'YTick', -5:5); ylabel('STD', 'fontsize', 9); legend('PC3', 'LPPC3', 'CT'); subplot('position', [0.5-hsz-midh*hw/2 ... vw*(sz(2)-tmarg-3*midv)-4*vsz 2*hsz+midh*hw vsz]); cla ind = 265:624; pp = plot(yr(ind), -pcs(ind,3), 'k', yr(ind), -lppcs(ind,3), 'b', ... yr(ind), ct(ind), 'r'); set(pp(2:3), 'linewidth', 2); axis([1970 2000 -3 3]); grid on; set(gca, 'fontsize', 8, 'XTick', 1970:5:2000, 'YTick', -5:5); ylabel('STD', 'fontsize', 9);