Documentation of gu_philander2


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


Help text

%%%%%%%%%%%%%%%%%%%%  Try a Deser et. al. plot

Cross-Reference Information

This script calls

Listing of script gu_philander2



clear

cd ~/matlab/CSIRO/Thesis/Data
load LP9_detrend_L1-7_EOF_yr101-1000.mat

lims = [150 205 -60 60];
tim = 101:1000;
lev = 1:10;

ct = getnc('temp', [180 270 -6 6], 1, tim);
ct = detrend(ct);
ct = squeeze(mean(mean(ct, 2), 3));

temp = getnc('temp', lims, lev, tim);
tclim = squeeze(mean2(temp));
tclim = squeeze(mean2(shiftdim(tclim, 2)));
temp = detrend(temp);
temp = squeeze(mean2(shiftdim(temp, 3)));
[lat, lon, depth] = getll('temp', lims);

[b, a] = butter(9, 2/15);
temp = filtfilt(b, a, temp);
ct = filtfilt(b, a, temp);

%pcs = -ct;

lags = -20:20;
[treg, tcoef] = regress_eof(temp, pcs, lags);

%  Get depth of climatological 25 20 and 15 degree isotherms

for i = 1:size(tclim, 2);
  if isempty(find(diff(tclim(:, i)) > 0));
    diso(:, i) = interp1(tclim(:, i), depth, [25 20 15]');
  else
    diso(:, i) = NaN * ones(3, 1);
  end
end
diso = diso';

figure(4); fo(1);
lagplot = -14:2:-2; lp = length(lagplot);
for i = 1:lp;
  subplot(lp, 2, 2*i-1);
    tind = find(lags == lagplot(i));
    contourf(lat, -1*depth, squeeze(-1*tcoef(tind,:,:)), [-1:.05:1]);
    caxis([-.5 .5]);
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', -30:10:30);
    axis([-30 30 -545 0]);
    shading flat
    ylabel(['Lag = ' num2str(lagplot(i))]);
    hold on;
      plot(lat, -diso(:, 1), '--k', lat, -diso(:, 2), '--k', ...
           lat, -diso(:, 3), '--k');
      vline(-30:10:30, ':k');
      hline(-500:125:-125, ':k');
    hold off;
end

lagplot = 0:2:12; lp = length(lagplot);
for i = 1:lp;
  subplot(lp, 2, 2*i);
    tind = find(lags == lagplot(i));
    contourf(lat, -1*depth, squeeze(-1*tcoef(tind,:,:)), [-1:.05:1]);
    caxis([-.5 .5]);
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', -30:10:30);
    axis([-30 30 -545 0]);
    shading flat
    ylabel(['Lag = ' num2str(lagplot(i))]);
    hold on;
      plot(lat, -diso(:, 1), '--k', lat, -diso(:, 2), '--k', ...
           lat, -diso(:, 3), '--k');
      vline(-30:10:30, ':k');
      hline(-500:125:-125, ':k');
    hold off;
end

subplot(lp, 2, 1);
  title('Temperature Correlation Coefficient');
subplot(lp, 2, 2);
  title('Temperature Correlation Coefficient');

cd ~/Thesis/Chap5
%print -dps2 150E_155W_lag_Temp_Corr_maps.ps


%%%%%%%%%%%%%%%%%%%%%  Do the same along the equator

clear
cd ~/matlab/CSIRO/Thesis/Data
load LP9_detrend_L1-7_EOF_yr101-1000.mat

lims = [105 300 -6 6];
tim = 101:1000;
lev = 1:10;

temp = getnc('temp', lims, lev, tim);
tclim = squeeze(mean2(temp));
tclim = squeeze(mean2(shiftdim(tclim, 1)));
tclim = tclim';
temp = detrend(temp);
temp = squeeze(mean2(shiftdim(temp, 2)));
temp = shiftdim(temp, 1);
[lat, lon, depth] = getll('temp', lims);

[b, a] = butter(9, 2/9);
temp = filtfilt(b, a, temp);

lags = -20:20;
[treg, tcoef] = regress_eof(temp, pcs, lags);

%  Get depth of climatological 25 20 and 15 degree isotherms

clear diso;
for i = 1:size(tclim, 2);
  if ~isempty(find(~isnan(tclim(:, i))));
    if isempty(find(diff(tclim(:, i)) > 0));
      diso(:, i) = interp1(tclim(:, i), depth, [25 20 15]');
    else
      diso(:, i) = NaN * ones(3, 1);
    end
  else
    diso(:, i) = NaN * ones(3, 1);
  end
end
diso = diso';

xl = ['120E'; '150E'; '180 '; '150W'; '120W'; '90W '];

figure(3); fo(1);
lagplot = -14:2:-2; lp = length(lagplot);
for i = 1:lp;
  subplot(lp, 2, 2*i-1);
    tind = find(lags == lagplot(i));
    contourf(lon, -1*depth, squeeze(-1*tcoef(tind,:,:)), [-1:.05:1]);
    caxis([-.5 .5]);
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', 120:30:300, 'XTickLabel', xl);
    axis([110 280 -545 0]);
    shading flat
    ylabel(['Lag = ' num2str(lagplot(i))]);
    hold on;
      plot(lon, -diso(:, 1), '--k', lon, -diso(:, 2), '--k', ...
           lon, -diso(:, 3), '--k');
      vline(120:30:300, ':k');
      hline(-500:125:-125, ':k');
    hold off;
end


lagplot = 0:2:12; lp = length(lagplot);
for i = 1:lp;
  subplot(lp, 2, 2*i);
    tind = find(lags == lagplot(i));
    contourf(lon, -1*depth, squeeze(-1*tcoef(tind,:,:)), [-1:.05:1]);
    caxis([-.5 .5]);
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', 120:30:300, 'XTickLabel', xl);
    axis([110 280 -545 0]);
    shading flat
    ylabel(['Lag = ' num2str(lagplot(i))]);
    hold on;
      plot(lon, -diso(:, 1), '--k', lon, -diso(:, 2), '--k', ...
           lon, -diso(:, 3), '--k');
      vline(120:30:300, ':k');
      hline(-500:125:-125, ':k');
    hold off;
end

subplot(lp, 2, 1);
  title('Temperature Correlation Coefficient');
subplot(lp, 2, 2);
  title('Temperature Correlation Coefficient');

cd ~/Thesis/Chap5
print -dps2 EQ_lag_Temp_Corr_maps.ps