Documentation of gu_philander_HP


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


Help text

save gu_philand.mat vbtp wbtp vptb wptb ubtp uptb lims tim lags

Cross-Reference Information

This script calls

Listing of script gu_philander_HP


clear
cd ~/matlab/CSIRO/Thesis/Data
load HP10_detrend_L1-7_EOF_yr101-1000.mat
lims = [150 205 -44 44];
tim = 101:1000;
lags = -15:15;
cd ~/matlab/CSIRO/Thesis/Chap5
[vbtp, wbtp] = ...
              vert_vdtdy_wdtdz(pcs, lims, lags);
[vptb, wptb] = ...
              vert_vptb_wptb(pcs, lims, lags);
[ubtp, uptb] = vert_ubtp_uptb(pcs, lims, lags);
cd ~/matlab/CSIRO/Thesis/Data

cd ~/matlab/CSIRO/Thesis/Data
load gu_philand.mat

temp = getnc('temp', lims, 1:10, [min(tim-1) tim]);
ntim = length(tim)+1;
dtdt = (temp(3:ntim,:,:,:) - temp(1:(ntim-2),:,:,:)) ./ (2*3600*24*365);
dtdt = detrend(dtdt);
[dtreg, dtcoef] = regress_eof(dtdt, -1*pcs(1:(ntim-2),1), lags);
[treg, tcoef] = regress_eof(temp(2:ntim,:,:,:), -1*pcs, lags);

[latt, lont, deptht] = getll('temp', lims);
[latv, lonv, depthv] = getll('v', lims);
[latw, lonw, depthw] = getll('wl', lims);
[latu, lonu, depthu] = getll('u', lims);

ubtp = squeeze(mean2(shiftdim(ubtp, 3)));
vbtp = squeeze(mean2(shiftdim(vbtp, 3)));
wbtp = squeeze(mean2(shiftdim(wbtp, 3)));
uptb = squeeze(mean2(shiftdim(uptb, 3)));
vptb = squeeze(mean2(shiftdim(vptb, 3)));
wptb = squeeze(mean2(shiftdim(wptb, 3)));
dtreg = squeeze(mean2(shiftdim(dtreg, 3)));
treg = squeeze(mean2(shiftdim(treg, 3)));
dtcoef = squeeze(mean2(shiftdim(dtcoef, 3)));
tcoef = squeeze(mean2(shiftdim(tcoef, 3)));

[nlag, nlev, nlat, nlon] = size(vbtp);

for i=1:nlag;
  ubtp2(i,:,:) = interp2(latu, depthu, squeeze(ubtp(i,:,:)), latw', depthw);
  vbtp2(i,:,:) = interp2(latv, depthv, squeeze(vbtp(i,:,:)), latw', depthw);
  uptb2(i,:,:) = interp2(latu, depthu, squeeze(uptb(i,:,:)), latw', depthw);
  vptb2(i,:,:) = interp2(latv, depthv, squeeze(vptb(i,:,:)), latw', depthw);
  treg2(i,:,:) = interp2(latt, deptht, squeeze(dtreg(i,:,:)), latw', depthw);
end

uptb3 = uptb2 + vptb2 + wptb;
ubtp3 = ubtp2 + vbtp2 + wbtp;

tem1 = 1e9*(treg2-uptb3-ubtp3); tit1 = 'Resid';
tem2 = 1e9*ubtp3; tit2 = 'UBTP';
lat1 = latw; depth1 = depthw;

tem1 = 1e9*ubtp3;
tem2 = 1e9*uptb3;

tem1 = 4*dtcoef; tit1 = 'T''_t';
tem2 = 4*tcoef; tit2 = 'T''';
lat1 = latt; depth1 = deptht;

tem2 = 1e9*(treg2 - uptb3 - ubtp3);

for biff = 1:4;

if biff == 1;
tem1 = 1e9*dtreg; tit1 = 'T''_t';
tem2 = 10*treg; tit2 = 'T''';
lat1 = latt; depth1 = deptht;
elseif biff == 2;
tem1 = 1e9*ubtp; tit1 = 'UT''_x';
tem2 = 1e9*uptb; tit2 = 'u''T_x';
lat1 = latu; depth1 = depthu;
elseif biff == 3;
tem1 = 1e9*vbtp; tit1 = 'VT''_y';
tem2 = 1e9*vptb; tit2 = 'v''T_y';
lat1 = latu; depth1 = depthu;
elseif biff == 4;
tem1 = 1e9*wbtp; tit1 = 'WT''_z';
tem2 = 1e9*wptb; tit2 = 'w''T_z';
lat1 = latw; depth1 = depthw;
end

%  Plot the data;

%cint = 0.25; clev = sort([-cint:-cint:min(min(min([tem1; tem2]))) ...
%                           cint:cint:max(max(max([tem1; tem2])))]);
%clev = [-10 -2:.1:2 20];

lagplot = -10:1:-6; lp = length(lagplot);

figure(biff); fo(1); clf;
%figure(2); fo(1); clf; 
%figure(3); fo(1); clf;
%figure(4); fo(1); clf;

for i = 1:lp;
if lagplot(i) < -4;
  cint = 0.1; clev = sort([-cint:-cint:min(min(min([tem1; tem2]))) ...
                           cint:cint:max(max(max([tem1; tem2])))]);
else
  cint = 0.1; clev = sort([-cint:-cint:min(min(min([tem1; tem2]))) ...
                           cint:cint:max(max(max([tem1; tem2])))]);
end
  subplot(lp, 2, 2*i-1);
    tind = find(lags == lagplot(i));
%    contourf(lat1, -1*depth1, squeeze(1*tem1(tind,:,:)), clev);
%    caxis([-2 2]);
    pncont(lat1, -1*depth1, squeeze(1*tem1(tind,:,:)), clev, 0, 'k');
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', -40:10:40);
    axis([-40 40 -545 0]);
%    shading flat
    ylabel(['Lag = ' num2str(lagplot(i))]);
    hold on;
      vline(-40:10:40, ':k');
      hline(-500:125:-125, ':k');
    hold off;
    if i == 1;
      title(tit1);
    end
end

for i = 1:lp;
if lagplot(i) < -4;
  cint = 0.1; clev = sort([-cint:-cint:min(min(min([tem1; tem2]))) ...
                           cint:cint:max(max(max([tem1; tem2])))]);
else
  cint = 0.1; clev = sort([-cint:-cint:min(min(min([tem1; tem2]))) ...
                           cint:cint:max(max(max([tem1; tem2])))]);
end
  subplot(lp, 2, 2*i);
    tind = find(lags == lagplot(i));
%    contourf(lat1, -1*depth1, squeeze(1*tem2(tind,:,:)), clev);
%    caxis([-2 2]);
    pncont(lat1, -1*depth1, squeeze(1*tem2(tind,:,:)), clev, 0, 'k');
    set(gca, 'YTick', -500:125:0, 'YTickLabel', 500:-125:0, ...
             'XTick', -40:10:40);
    axis([-40 40 -545 0]);
%    shading flat
    hold on;
      vline(-40:10:40, ':k');
      hline(-500:125:-125, ':k');
    hold off;
    if i == 1;
      title(tit2);
    end
end

end;  %  biff loop

cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Chap5/Plots