Documentation of temp_3d_ceof_look


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


Help text

for ind = 1:10;

Cross-Reference Information

This script calls

Listing of script temp_3d_ceof_look


clear
cd /home/disk/hayes2/dvimont/csiro/matlab_data
load LPtemp_3dceof_-22.5to22.5pac.mat; ctlim = [110 300 -22.5 22.5];
load LPtemp_3dceof_22.5to62.5pac.mat; ctlim = [110 300 22.5 62.5];
load LPtemp_3dceof_-67.5to60pac.mat
cd /home/disk/hayes2/dvimont/csiro/data
clear temp depth
filin = ['temp_A_L1-10.nc'];
nc = netcdf(filin, 'nowrite');
  ind = 1:10;
  lind = ind; % 2*(ind-1) + 1;
  depth = nc{'depth'}(lind);
  lat = nc{'latitude'}(:);
  lon = nc{'longitude'}(:);

%  ctlim = [110 300 12.5 62.5];
%  ctlim = [110 300 -30 30];
%  ctlim = [110 300 -72.5 67.5];
%  ctlim = [280 360 -70 90];
  ctlim = [110 300 -67.5 60];
  [xk, yk] = keep_var(ctlim, lon, lat);

  temp(:,ind,:,:) = nc{'temp'}(101:550,lind,yk,xk);
  mv = nc{'temp'}.missing_value(:);

%end
nc = close(nc);
FRAME = ctlim;

temp(find(temp == mv)) = NaN * ones(size(find(temp == mv)));

lat = lat(yk); lon = lon(xk);
[ntim, nlev, nlat, nlon] = size(temp);
get_global; default_global; FRAME = ctlim;

temp = reshape(temp, ntim, nlev*nlat*nlon);
[temp, clim] = remove_mean(temp);
clim = reshape(clim, 10, nlat, nlon);

npt  = length(kp);
weight1 = std(real(pcs));
weight2 = std(imag(pcs));
pcs = real(pcs).*(ones(ntim, 1)*(1./weight1)) + ...
      j*imag(pcs).*(ones(ntim, 1)*(1./weight2));
lds = real(lds).*(ones(npt, 1)*weight1) + ...
      j*imag(lds).*(ones(npt, 1)*weight2);

regmap = pcs.' * temp ./ ntim;
regmap = reshape(regmap, 10, nlev, nlat, nlon);

cd /home/disk/hayes2/dvimont/csiro/matlab_data
%save LPregmap_3deof_-67.5to60pac.mat regmap clim pcs lds npt kp lat lon FRAME per lam
%save LPregmap_3deof_22.5to62.5pac.mat regmap clim pcs lds npt kp lat lon FRAME per lam
%save HPregmap_3deof_-30to30pac.mat regmap clim pcs lds npt kp lat lon FRAME per lam
%save LPregmap_3deof_totpac.mat regmap clim pcs lds npt kp lat lon FRAME per lam
%
%
%






clear
cd /home/disk/hayes2/dvimont/csiro/matlab_data
load LPregmap_3deof_12.5to62.5pac.mat; pcnp = pcs;
load LPregmap_3deof_-30to30pac.mat; pcs(:,2) = pcnp(:,1);
load LPregmap_3deof_totpac.mat
tem = FRAME;
get_global; default_global; FRAME = tem;
ntim = size(pcs, 1);
[nlev, nlat, nlon] = size(clim);

cd /home/disk/hayes2/dvimont/csiro/data

filin = ['temp_A_L1-10.nc'];
nc = netcdf(filin, 'nowrite');
  lind = 1:10;
  depth = nc{'depth'}(lind);
nc = close(nc);

%  Look at various phases of these patterns

figure(1); clf; figure_landscape;
lag = 0; lg = lag*pi/180;
num = 1; lind = 1;
nfrm = 4;

cint = [.1 0 0 .1 0 0 .05 0 0 .025];
for lind = 1:3:10; figure(lind); figure_landscape;
for i = 1:nfrm;

  wgt = conj(exp(j * ((i-1) * pi/nfrm + lg) ));% * ones(npt, 1));  
  tem = squeeze(real(wgt .* regmap(num,lind,:,:)));

     subplot(2,2,i);
       if ismap(gca); clma; end
       gcont(tem, [-1:cint(lind):1]); dc;%, 'giso', [0 mean(FRAME(1:2))]);
       title(['LP:  <TEMP, CPC' num2str(num) '>, Phase = ' num2str(((i-1)*180)/nfrm+lag) ...
              ', Depth = ' num2str(depth(lind)/100) 'm'])
       xlabel(['Contour Interval:  ' num2str(cint(lind)) ' K std^-^1'])

end

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots3
eval(['print -dps2 LP_CEOF3D_lev' num2str(lind) '_-67.5to60pac.ps']);

end

%  Look at pure imag and real components

num = 1;

for lev = 1:5;

  figure(lev); figure_orient;
  lind = 2*(lev-1)+1;

  temtim = real(pcs(:,num));
  ph = 0;
  tem = squeeze(real(regmap(num, lind, :, :)));
  if lind < 7;
    cint = .05; clev = [-1:cint:1];
  else
    cint = .025; clev = [-1:cint:1];
  end

  sp(1)
    mcont(tem, clev, 'giso', [0 mean(FRAME(1:2))]);
    title(['CSIRO ' num2str(depth(lind)/100) 'm TEMP '...
           'regressed on REAL CPC ' num2str(num)]);
    xlabel(['Contour Interval:  ' num2str(cint) ' K std^-^1'])

  temtim = real(pcs(:,num));
  tem = squeeze(imag(regmap(num, lind, :, :)));
  cint = .05; clev = [-1:cint:1];

  sp(2)
    mcont(tem, clev, 'giso', [0 mean(FRAME(1:2))]);
    title(['CSIRO ' num2str(depth(lind)/100) 'm TEMP '...
           'regressed on IMAG CPC ' num2str(num)]);
    xlabel(['Contour Interval:  ' num2str(cint) ' K std^-^1'])

end

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots2

%  Plot the time series

figure(3);  figure_orient;
for m = 1:4
     subplot(4,1,m)
     tind = ((ntim/4)*(m-1)+[1:(ntim/4)]);
     plot(tind, real(pcs(tind, num)), '-k', ...
	  tind, imag(pcs(tind, num)), '--k');
     axis([min(tind-1) max(tind+1) -3 3]);
     set(gca, 'YTick', [-3:3], 'XTick', [0:25:ntim]);
     grid
end
     subplot(4,1,1)
     title(['LP\_EQ\_PAC 3D TEMP (-67.5 to 60):  CPC', num2str(num), ...
	    ':  Dashed = IMAG, Solid = REAL']);
     subplot(4,1,4)
     xlabel('Years')

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots2

%  Look at lagged correlations between real and imaginary components

tim = 1:450;
figure(2); figure_orient;
for i = 1:6

  if i == 1;
    v1 = real(pcs(tim,1)); v2 = imag(pcs(tim,1)); lab = ['Re(EQPC)'; 'Im(EQPC)'];
  elseif i == 6;
    v1 = real(pcs(tim,1)); v2 = real(pcs(tim,2)); lab = ['Re(EQPC)'; 'Re(NPPC)'];
  elseif i == 3;
    v1 = real(pcs(tim,1)); v2 = imag(pcs(tim,2)); lab = ['Re(EQPC)'; 'Im(NPPC)'];
  elseif i == 4;
    v1 = imag(pcs(tim,1)); v2 = real(pcs(tim,2)); lab = ['Im(EQPC)'; 'Re(NPPC)'];
  elseif i == 5;
    v1 = imag(pcs(tim,1)); v2 = imag(pcs(tim,2)); lab = ['Im(EQPC)'; 'Im(NPPC)'];
  elseif i == 2;
    v1 = real(pcs(tim,2)); v2 = imag(pcs(tim,2)); lab = ['Re(NPPC)'; 'Im(NPPC)'];
  end


  tind = -10:10;
  a = zeros(length(tind),1);
  for lag = tind;
    a(lag+max(tind)+1) = corr(v1, v2, lag);
  end

  subplot(3,2,i);
    bar(tind, a);
    title(['LP:  < ' 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])
    set(gca, 'XTick', min(tind):5:max(tind), 'YTick', -1:.25:1)
    grid on

end

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots2

%  Look at vertical temperature

figure(1); clf; figure_landscape;
lag = 0; lg = lag*pi/180;
num = 1; lind = 1;
nfrm = 4;
ylim = [-25 -15; -15 -5; -5 5; 5 15; 15 25];
ylim = [15 25;25 35;35 45;45 55];
cint = 0.025

for lind = 1:5; figure(lind); figure_landscape;
  [xk, yk] = keep_var([0 360 ylim(lind,:)], lon, lat);
  for i = 1:nfrm;

    wgt = conj(exp(j * ((i-1) * pi/nfrm + lg) ));% * ones(npt, 1));  
    tem = squeeze(real(wgt .* regmap(num,:,yk,:)));
    tem = shiftdim(squeeze(mean(shiftdim(tem, 1))),1);

     subplot(2,2,i);
       if ismap(gca); clma; end
       pncont(lon, -.01*depth, tem, [-1:cint:1],0,'k');
       title(['LP:  <TEMP, CPC' num2str(num) ...
              '>, Phase = ' num2str(((i-1)*180)/nfrm+lag) ...
              ', Lat = ' num2str(ylim(lind,1)) ' to ' num2str(ylim(lind,2))])
       xlabel(['Contour Interval:  ' num2str(cint) ' K std^-^1'])

  end

%  cd /home/disk/tao/dvimont/matlab/CSIRO/Plots2
%  eval(['print -dps2 LP_CEOF3D_lev' num2str(lind) '_12.5to62.5pac.ps']);

end

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots3