Documentation of z500_eof


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


Help text

z5 = getnc('NH_500mb_DJF.nc', 'Z3');

Cross-Reference Information

This script calls

Listing of script z500_eof


clear
cd /home/disk/hayes2/dvimont/csm/300yr/annual
ctlim = [0 360 0 90];
z5 = getnc('NH_PSL_DJF.nc', 'PSL');
[lat, lon] = getll('NH_500mb_DJF.nc');
z5 = squeeze(z5);
[z5, clim] = remove_mean(z5);

[ntim, nlat, nlon] = size(z5);
clear z
for i = 1:(nlon/4);
  lonind = 4*(i-1)+[1:4];
  for j = 1:(nlat/4);
    latind = 4*(j-1)+[1:4];
    z(:,j,i) = mean(mean(shiftdim(z5(:,latind,lonind), 1)));
  end
end

lat = mean([lat(1:2:length(lat))'; lat(2:2:length(lat))'])';
lat = mean([lat(1:2:length(lat))'; lat(2:2:length(lat))'])';
lon = mean([lon(1:2:length(lon))'; lon(2:2:length(lon))'])';
lon = mean([lon(1:2:length(lon))'; lon(2:2:length(lon))'])';
default_global;

z = cosweight(z, lat);
[ntim, nlat, nlon] = size(z);
z = reshape(z, ntim, nlat*nlon);
[lam, lds, pcs, per] = eof_dan(z);

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

z5 = reshape(z5, ntim, 32, 128);
[ntim, nlat, nlon] = size(z5);
z5 = reshape(z5, ntim, nlat*nlon);
[lat, lon] = getll('NH_500mb_DJF.nc');
default_global

lag = 0;
ind1 = (1:(ntim-lag)); ind2 = ((1+lag):ntim);
lds2 = ((pcs(ind2,:))'*(z5(ind1,:)) ./ (ntim-lag))';

figure(1); figure_orient;
num = 1;
tem = lds2(:, num);
tem = reshape(tem/10, nlat, nlon);
sd(1);
  gcont(tem, [-60:5:-5 5:5:60]);
  dc
sd(2);
  plot(1:ntim, pcs(:,num));

[sst1, oro1] = getnc('SST_-60to60.nc', 'TS', 'ORO');
[lat, lon] = getll('SST_-60to60.nc');
[sst1, clim] = remove_mean(sst);
default_global; FRAME = [0 360 -60 60];

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

lag = 0;
ind1 = (1:(ntim-lag)); ind2 = ((1+lag):ntim);
lds2 = ((pcs(ind2,:))'*(sst1(ind1,:)) ./ (ntim-lag))';

figure(2); figure_orient;
num = 1;
tem = lds2(:, num);
tem = reshape(tem, nlat, nlon);
sd(1);
  gcont(tem, [-5:.1:-.1 .1:.1:5]);
  dc
sd(2);
  plot(1:ntim, pcs(:,num));

sst2 = reshape(sst1, ntim, 44, nlon);
clear sst3 oro3
[ntim, nlat, nlon] = size(sst2);
for i = 1:(nlon/4);
  lonind = 4*(i-1)+[1:4];
  for j = 1:(nlat/4);
    latind = 4*(j-1)+[1:4];
    sst3(:,j,i) = mean(mean(shiftdim(sst2(:,latind,lonind), 1)));
    oro3(:,j,i) = mean(mean(shiftdim(oro1(:,latind,lonind), 1)));
  end
end
clim = squeeze(mean(oro3));
kp = find(clim == 0);

lat = mean([lat(1:2:length(lat))'; lat(2:2:length(lat))'])';
lat = mean([lat(1:2:length(lat))'; lat(2:2:length(lat))'])';
lon = mean([lon(1:2:length(lon))'; lon(2:2:length(lon))'])';
lon = mean([lon(1:2:length(lon))'; lon(2:2:length(lon))'])';
default_global;

sst3 = cosweight(sst3, lat);
[ntim, nlat, nlon] = size(sst3);
sst3 = sst3(:, kp);

[lam1, lds1, pcs1, per1] = eof_dan(sst3);