Documentation of eq_tend_terms


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


Help text

  Plot the data;

Cross-Reference Information

This script calls

Listing of script eq_tend_terms


clear
cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Data
load LP10_detrend_L1-7_yr101-1000.mat
lev = 1:3;
lims = [178 272 -3 3]; 
nfrm = -20:20; lags = nfrm;
tim = 101:1000;
cd ~/matlab/CSIRO/Heat/Old_routines
   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_ubar_gradtprime(pcs, lims, nfrm, tim, lev);
   ubtp13 = squeeze(mean(utem));
   vbtp13 = squeeze(mean(vtem));
   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_uprime_gradtbar(pcs, lims, nfrm, tim, lev);
   uptb13 = squeeze(mean(utem));
   vptb13 = squeeze(mean(vtem));
   [wtem, lat_out, lon_out] = ...
           get_wbar_dtprimedz(pcs, lims, nfrm, tim, lev);
   wbtp13 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';
   [wtem, lat_out, lon_out] = ...
           get_wprime_dtbardz(pcs, lims, nfrm, tim, lev);
   wptb13 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';
   tim2 = 100:1000; ntim = length(tim2);
   hc13 = getheat(lims, lev, tim2);
   dhc13dt = (hc13(3:ntim,:,:) - hc13(1:(ntim-2),:,:)) / (2*3600*24*365);
   hc13 = hc13(2:ntim,:,:); ntim = length(tim);
   hc13 = regress_eof(hc13, pcs, nfrm);
   dhc13dt = regress_eof(dhc13dt, pcs(1:(ntim-1), :), nfrm);
   hc13 = squeeze(mean2(mean2(shiftdim(hc13, 1))))';
   dhc13dt = squeeze(mean2(mean2(shiftdim(dhc13dt, 1))))';
   hflx = getnc('heat', lims, 1, tim);
   hflx = regress_eof(hflx, pcs, nfrm);
   hflx = squeeze(mean2(mean2(shiftdim(hflx, 1))))';

ubtp = -1*(ubtp13 + vbtp13 + wbtp13);
uptb = -1*(uptb13 + vptb13 + wptb13);

figure(1);
subplot(2,1,1);
  h1 = plot(...
       nfrm, ubtp, 'x--k', ...
       nfrm, uptb, 'o--k', ...
       nfrm, hflx, 'v--k', ...
       nfrm, dhc13dt, 'd-.k', ...
       nfrm, 1.5e-8*hc13, '-k');
  axis([-10 10 -2 2]);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title('0-80m Integrated Heat Content Anomaly Tendency Terms');
  legend(h1, 'Ubar Grad(T'')', 'U'' Grad(Tbar)', 'Net Heat Flux', 'dHC/dt', 'HC (scaled)');

%  Get lower layer

cd ~/matlab/CSIRO/Heat/Old_routines

lev = 1:7;
   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_ubar_gradtprime(pcs, lims, nfrm, tim, lev);
   ubtp17 = squeeze(mean(utem));
   vbtp17 = squeeze(mean(vtem));

   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_uprime_gradtbar(pcs, lims, nfrm, tim, lev);
   uptb17 = squeeze(mean(utem));
   vptb17 = squeeze(mean(vtem));

   [wtem, lat_out, lon_out] = ...
           get_wbar_dtprimedz(pcs, lims, nfrm, tim, lev);
   wbtp17 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';

   [wtem, lat_out, lon_out] = ...
           get_wprime_dtbardz(pcs, lims, nfrm, tim, lev);
   wptb17 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';

   tim2 = 100:1000; ntim = length(tim2);
   hc17 = getheat(lims, lev, tim2);
   dhc17dt = (hc17(3:ntim,:,:) - hc17(1:(ntim-2),:,:)) / (2*3600*24*365);
   hc17 = hc17(2:ntim,:,:); ntim = length(tim);
   hc17 = regress_eof(hc17, pcs, nfrm);
   dhc17dt = regress_eof(dhc17dt, pcs(1:(ntim-1), :), nfrm);
   hc17 = squeeze(mean2(mean2(shiftdim(hc17, 1))))';
   dhc17dt = squeeze(mean2(mean2(shiftdim(dhc17dt, 1))))';


lev = 1:4
   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_ubar_gradtprime(pcs, lims, nfrm, tim, lev);
   ubtp14 = squeeze(mean(utem));
   vbtp14 = squeeze(mean(vtem));

   [utem, vtem, lat_out, lon_out, depth_out] = ...
           get_uprime_gradtbar(pcs, lims, nfrm, tim, lev);
   uptb14 = squeeze(mean(utem));
   vptb14 = squeeze(mean(vtem));

   [wtem, lat_out, lon_out] = ...
           get_wbar_dtprimedz(pcs, lims, nfrm, tim, lev);
   wbtp14 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';

   [wtem, lat_out, lon_out] = ...
           get_wprime_dtbardz(pcs, lims, nfrm, tim, lev);
   wptb14 = squeeze(mean2(mean2(shiftdim(wtem, 1))))';

   tim2 = 100:1000; ntim = length(tim2);
   hc14 = getheat(lev, tim2, lims);
   dhc14dt = (hc14(3:ntim,:,:) - hc14(1:(ntim-2),:,:)) / (2*3600*24*365);
   hc14 = hc14(2:ntim,:,:); ntim = length(tim);
   hc14 = regress_eof(hc14, pcs, nfrm);
   dhc14dt = regress_eof(dhc14dt, pcs(1:(ntim-1), :), nfrm);
   hc14 = squeeze(mean2(mean2(shiftdim(hc14, 1))))';
   dhc14dt = squeeze(mean2(mean2(shiftdim(dhc14dt, 1))))';

   taux = getnc('taux', [165 210 -3 3], 1, tim);
   taux = regress_eof(taux, pcs, nfrm);
   taux = squeeze(mean2(taux'));




%  Plot all the terms

cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Data
load LP10_eq_terms.mat 

ubtp47 = ubtp17 - ubtp13;
vbtp47 = ubtp17 - vbtp13;
wbtp47 = ubtp17 - wbtp13;
uptb47 = uptb17 - uptb13;
vptb47 = vptb17 - vptb13;
wptb47 = wptb17 - wptb13;
hc47 = hc17 - hc13;
dhc47dt = dhc17dt - dhc13dt;

figure(1); figure_landscape(1);

subplot(1,1,1);
  h1 = plot(...
    nfrm, ubtp13, 'x-k', ...
    nfrm, vbtp13, 'o-k', ...
    nfrm, wbtp13, 'v-k', ...;
    nfrm, uptb13, '*--k', ...
    nfrm, vptb13, 's--k', ...
    nfrm, wptb13, '^--k', ...
    nfrm,  -hflx, '>-.k', ...
    nfrm, -dhc13dt, 'd-.k', ...
    nfrm,    -1e-8*hc13, '-k', ...
    nfrm,    -35*taux, '--k');
  set(h1(9:10), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title('LP10:  0-80m Integrated Anomalous Heat Content Tendency Terms');
  axis([-12 12 -2 1.5]);
  legend(h1, 'Ubar dHC''/dx', 'Vbar dHC''/dy', 'Wbar dHC''dz',...
             'U'' dHCbar/dx', 'V'' dHCbardy', 'W'' dHCbardz',...
             'Net Heat Flux', 'dHC''/dt', 'HC (scaled)', 'TAUX (scaled)');

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

figure(2); figure_landscape(1);
  h1 = plot(...
    nfrm, ubtp47, 'x-k', ...
    nfrm, vbtp47, 'o-k', ...
    nfrm, wbtp47, 'v-k', ...;
    nfrm, uptb47, '*--k', ...
    nfrm, vptb47, 's--k', ...
    nfrm, wptb47, '^--k', ...
    nfrm, -dhc47dt, 'd-.k', ...
    nfrm, -1e-8*hc47, '-k', ...;
    nfrm, -35*taux, '--k')
  set(h1(8:9), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title('LP10:  80-270m Integrated Anomalous Heat Content Tendency Terms');
  axis([-10 10 -1 2]);
  legend(h1, 'Ubar dHC''/dx', 'Vbar dHC''/dy', 'Wbar dHC''dz',...
             'U'' dHCbar/dx', 'V'' dHCbardy', 'W'' dHCbardz',...
             'dHC''/dt', 'HC (scaled)', 'TAUX (scaled)');

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


%  Look at heat content and wind stress only

clear

%  Load PCS:

cd /home/disk/hayes2/dvimont/csiro/matlab_data/Heat_Content
load LP10_detrend_L1-7_yr101-1000.mat
load RAW_detrend_L1-7_EOF_yr101-1000.mat
pcs = -1*pcs;

lev = 1:3;
lims = [178 272 -3 3]; 
nfrm = -25:25;
tim = 101:1000;

hc13 = getheat(1:3, tim, lims);
hc46 = getheat(4:6, tim, lims);
hc79 = getheat(7:9, tim, lims);
sst = getnc('temp', lims, 1, tim);
taux = getnc('taux', [165 210 -3 3], 1, tim);
[lat, lon, depthw] = getll('wl', lims);

[tem, hc13] = regress_eof(hc13, pcs, nfrm);
[tem, hc46] = regress_eof(hc46, pcs, nfrm);
[tem, hc79] = regress_eof(hc79, pcs, nfrm);
[tem, sst] = regress_eof(sst, pcs, nfrm);
[tem, taux] = regress_eof(taux, pcs, nfrm);

hc13 = squeeze(mean(mean(shiftdim(hc13, 1))));
hc46 = squeeze(mean(mean(shiftdim(hc46, 1))));
hc79 = squeeze(mean(mean(shiftdim(hc79, 1))));
sst = squeeze(mean(mean(shiftdim(sst, 1))));
taux = squeeze(mean(taux, 2));

taux2 = 1.8 * taux2 / max(taux2);
sst2 = 1.6 * sst2 / max(sst2);
h13 = 1.4 * h13 / max(h13);
h46 = 1.2 * h46 / max(h46);
h79 = 1.0 * h79 / max(h79);


figure(1); figure_landscape;
h1 = plot(...
   nfrm, hc79, ':k',  ...
   nfrm, hc46, '--k', ...
   nfrm, hc13, '-.k', ...
   nfrm, sst, 'o-k', ...
   nfrm, taux, 'x-k');
axis([-15 15 -1 2])
set(gca, 'XTick', [-20:2:20]);
grid on
title(['Lagged Regression (scaled) of Various Equatorial Indices on PC1 ' ...
       'of 0-270m Heat Content']); 
xlabel('Lag in Years');
ylabel('Scaled Regression Coefficient');
legend(h1, '210-470m Heat Content', '80-210m Heat Content', ...
           '0-80m Heat Content', '12.5m Temperature', ...
           'Zonal Wind Stress')

cd /home/disk/tao/dvimont/matlab/CSIRO/Heat/GRL_Figs



%  Look at each level individually

clear

lev = 1:3;
lims = [178 272 -3 3]; 
nfrm = -25:25;
tim = 101:1000;

%  Get CT index

%ct = getnc('temp', [178 272 -6 6], 1, tim);
%ct = getheat([178 272 -6 6], 1:7, tim);
ct = getheat([110 150 0 15], 4:7, tim);
ct = squeeze(mean2(mean2(shiftdim(ct, 1))));
ct = detrend(ct);
[b, a] = butter(6, 2/10);
ct = filtfilt(b, a, ct);
pcs = ct./std(ct);

%  Load PCS:

cd /home/disk/hayes2/dvimont/csiro/matlab_data/Heat_Content
load LP10_detrend_L1-7_yr101-1000.mat
load RAW_detrend_L1-7_EOF_yr101-1000.mat
pcs = -1*pcs;

[lat, lon, depth] = getll('temp', lims);
temp = getnc('temp', lims, 1:10, tim);
temp = squeeze(mean(mean(temp, 3),4));
taux = getnc('taux', [165 210 -3 3], 1, tim);
taux = squeeze(mean(taux, 2));

temp = filtfilt(b, a, detrend(temp));
taux = filtfilt(b, a, detrend(taux));

%  As a doublecheck, band pass this.  Note that when this is done,
%    the resulting plot has everything phase shifted.  There is no
%    contemporaneous beginning at lag -6, as is the case when only
%    a lowpass filter is used.

[b, a] = butter(6, 2/15);
  temp = temp - filtfilt(b, a, temp);
  taux = taux - filtfilt(b, a, taux);
  pcs = pcs - filtfilt(b, a, pcs);

[tem, tcoef] = regress_eof(temp, pcs, nfrm);
[tem, xcoef] = regress_eof(taux, pcs, nfrm);

clear tcoef2;
newdepth = [0:50:400];
for i = 1:length(nfrm);
  tcoef2(i,:) = interp1(depth, tcoef(i,:), newdepth);
end
tcoef2(:,1) = tcoef(:,1);

h1 = plot(...
  nfrm, tcoef2(:,9), 'v-k', ...
  nfrm, tcoef2(:,7), 's-k', ...
  nfrm, tcoef2(:,5), '^-k', ...
  nfrm, tcoef2(:,3), '*-k', ...
  nfrm, tcoef2(:,1), 'o-k', ...
  nfrm, xcoef, 'x-k');
set(h1(6), 'linewidth', 2);
hold on;
h2 = plot(...
  nfrm, tcoef2(:,8), '-k', ...
  nfrm, tcoef2(:,6), '-k', ...
  nfrm, tcoef2(:,4), '-k', ...
  nfrm, tcoef2(:,2), '-k')
hold off

axis([-11 11 -.5 1.1]);
grid on
set(gca, 'XTick', [-20:2:20], 'YTick', [-0.5:.25:1]);
title(['Lagged Correlation between EQ Temp at various depths, and PC1 ' ...
       'of LP10 HC270']); 
xlabel('Lag in Years');
ylabel('Correlation Coefficient');
legend(h1, '400m Temp', '300m Temp', '200m Temp', '100m Temp', '12.5m Temp', ...
           'Zonal Wind Stress');


cd /home/disk/tao/dvimont/matlab/CSIRO/Heat/GRL_Figs


  nfrm, tcoef(:,9), 'v-k', ...
  nfrm, tcoef(:,2), '<-k', ...
  nfrm, tcoef(:,1), 'o-k', ...



cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Data
%save LP10_eq_terms.mat uptb13 ubtp13 vptb13 vbtp13 wptb13 wbtp13 ...
%     uptb17 ubtp17 vptb17 vbtp17 wptb17 wbtp17 ...
%     hc13 hc17 dhc13dt dhc17dt hflx taux lags lims tim nfrm