Documentation of eof_20deg_depth


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


Help text

load depth_20deg_ave_yr101-550.mat

Cross-Reference Information

This script calls

Listing of script eof_20deg_depth


clear
cd /home/disk/hayes2/dvimont/csiro/matlab_data/20Deg_Isotherm
load depth_20deg_ave_yr551-1000.mat

[ntim, nlat, nlon] = size(d20tot);
%[xk, yk] = keep_var([110 180 25 45], lon, lat);
%d20tot(:,yk,xk) = NaN;
%[xk, yk] = keep_var([160 200 -45 -25], lon, lat);
%d20tot(:,yk,xk) = NaN;
d20 = reshape(d20tot, ntim, nlat*nlon);
[d20, clim] = remove_mean(d20);
kp = find(~isnan(mean(d20)));
d20 = cosweight(d20, lat);
d20 = d20(:,kp);


[lam, lds, pcs, per] = complex_eof(d20);


%  Look at CEOFs


default_global

[ntim, nlat, nlon] = size(d20tot);
d20 = reshape(d20tot, ntim, nlat*nlon);
[d20, clim] = remove_mean(d20);

for num = 1:2;
figure(num); figure_orient
timeseries = sqrt(2)*pcs(:,num)./std(pcs(:,num));
lag = 0; lg = lag*pi/180; 
nfrm = 6;
cint = 100; clev = [-5000:cint:5000];
j = sqrt(-1);

for ind = 1:nfrm;
    wgt = conj(exp(j * ((ind-1) * pi/nfrm + lg) ));
    temtim = real(wgt .* timeseries);
    tem = temtim'*d20./ntim;
    ccoef = corr_sig(temtim, d20);
    tem = reshape(tem, nlat, nlon);
    tstat = reshape((abs(ccoef) >= 0.5), nlat, nlon);
    subplot(3,2,ind);
      cla;
      gshade2(abs(tstat), 0.9); hold on;
      gcont(tem, clev); hold off; 
      dc;
      title(['Phase = ' num2str((ind-1)*180/nfrm + lag)]);
      if ind >= 5;
        xlabel(['Cont. Int.:  ' num2str(cint)]);
      end
end
end


%  Plot the CPC's     2222222222222222222222222222222222222222222222222222222222222

ind = 1;
if ind == 1; tim = 101:550; else; tim = 551:1000; end;

figure(4);  figure_orient;
for m = 1:3
     subplot(4,1,m)
     tind = ((ntim/3)*(m-1)+[1:(ntim/3)]);
     plot(tim(tind), real(timeseries(tind)), '-k', ...
	  tim(tind), imag(timeseries(tind)), '--k');
     axis([min(tim(tind)-1) max(tim(tind)+1) -3 3]);
     set(gca, 'YTick', [-3:3.5], 'XTick', [(tim(1)-1):10:max(tim)]);
     grid
end
     subplot(4,1,1)
     title([tit ': CPC1 HEAT:  ' num2str(round(per(1)))...
                '% Variance Explained']);
     subplot(4,1,2)
     ylabel(['Solid = REAL, Dashed = IMAG']);
     subplot(4,1,3)
     xlabel('Years')

if 1;
subplot(4,2,7);
plot(real(timeseries), imag(timeseries), '.k');
axis square
axis([-4 4 -4 4]); grid on
xlabel('Re(CPC1)'); ylabel('Im(CPC1)');
end;

subplot(4,2,7);
binnum = 24;
binind = [(-1*(pi-(pi/binnum))):(2*pi/binnum):(pi-(pi/binnum))];
ph = atan2(imag(timeseries), real(timeseries));
hgram = hist(ph, binind);
bar((180/pi)*binind, hgram);
axis([-180 180 0 30])
set(gca, 'XTick', -180:90:180);
grid on
xlabel('PHASE (deg)');
ylabel('COUNT');


subplot(4,2,8); nind = 1;
tim = 1:450;
v1 = real(timeseries); v2 = imag(timeseries);
lab = ['Re(CPC1)'; 'Im(CPC1)'];
tind = (-8*nind):nind:(8*nind);
a = zeros(length(tind),1);
for lag = tind;
  a((1/nind)*(lag+max(tind))+1) = corr(v1, v2, lag);
end

    bar(tind, a);
    title(['< ' lab(1,:) ', ' lab(2,:) ' >'])
%    xlabel([lab(1,:) ' leads ' lab(2,:) '  |  ' lab(2,:) ' leads ' lab(1,:)])
    xlabel([lab(1,:) ' leads  |  ' lab(2,:) ' leads '])
    axis([min(tind-1) max(tind+1) -1.1 1.1])
    set(gca, 'XTick', min(tind):2*nind:max(tind), 'YTick', -1:.25:1)
    grid on