Documentation of LP9_eq_tend_terms


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


Help text

  Get windstress if necessary

Cross-Reference Information

This script calls

Listing of script LP9_eq_tend_terms


clear
cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Data
load LP9_detrend_L1-7_EOF_yr101-1000.mat
load LP9_hctend_ALL.mat;
load LP9_hflx_terms.mat;
load LP9_hctend_89.mat
order = ['ubtp'; 'uptb'; 'vbtp'; 'vptb'; 'wbtp'; 'wptb'];
levind = ['13'; '47'; '89'];
lims2 = [180 270 -3 3]; tit = 'EQ'; %  Equatorial index
lims2 = [150 210 -6 6]; tit = 'WEQ'; %  Equatorial index
lims2 = [135 180 3 16]; tit = 'WSTP'; %  WSTP index
lims2 = [120 165 7.5 22.5]; tit = 'WSTP'; %  WSTP index
lims2 = [175 205 25 40]; tit = 'ML COLD'; %  NPAC index
lims2 = [220 240 20 52.5]; tit = 'WEST COAST WARM'; %  NPAC index
lims2 = [180 270 -70 -45]; tit = 'SPAC WARM'; %  NPAC index
for j = 1:3;
  [lat, lon] = getll('u', lims);
  [xk, yk] = keep_var(lims2, lon, lat);
  for i = 1:4;
    eval(['tem = ' order(i,:) levind(j,:) '(:,yk,xk);']);
    if ~iselement(size(tem), 1);
      tem = squeeze(mean2(mean2(shiftdim(tem, 1))));
    else
      tem = squeeze(mean2(squeeze(shiftdim(tem, 1))))';
    end
    eval([order(i,:) '_' levind(j,:) ' = tem;']);
  end
  [lat, lon] = getll('wl', lims);
  [xk, yk] = keep_var(lims2, lon, lat);
  for i = 5:6
    eval(['tem = ' order(i,:) levind(j,:) '(:,yk,xk);']);
    if ~iselement(size(tem), 1);
      tem = squeeze(mean2(mean2(shiftdim(tem, 1))));
    else
      tem = squeeze(mean2(squeeze(shiftdim(tem, 1))));
    end
    eval([order(i,:) '_' levind(j,:) ' = tem;']);
  end
  [lat, lon] = getll('temp', lims);
  [xk, yk] = keep_var(lims2, lon, lat);
  eval(['tem = dhcdt' levind(j,:) '(:,yk,xk);']);
  tem = squeeze(mean2(mean2(shiftdim(tem, 1))));
  eval(['dhcdt_' levind(j,:) ' = tem;']);
end
  [lat, lon] = getll('temp', lims);
  [xk, yk] = keep_var(lims2, lon, lat);
  hflx = squeeze(mean2(mean2(shiftdim(hflx_reg(:,yk,xk), 1))));
  res_13 = -dhcdt_13 - (ubtp_13+vbtp_13+wbtp_13+uptb_13+vptb_13+wptb_13-hflx);
  res_47 = -dhcdt_47 - (ubtp_47+vbtp_47+wbtp_47+uptb_47+vptb_47+wptb_47);
  res_89 = -dhcdt_89 - (ubtp_89+vbtp_89+wbtp_89+uptb_89+vptb_89+wptb_89);
for i = 1:6;
  eval([order(i,:) '_17 = ' order(i,:) '_13 + ' order(i,:) '_47;']);
  eval([order(i,:) '_49 = ' order(i,:) '_89 + ' order(i,:) '_47;']);
end
  dhcdt_17 = dhcdt_13 + dhcdt_47;
  res_17 = -dhcdt_17 - (ubtp_17+vbtp_17+wbtp_17+uptb_17+vptb_17+wptb_17-hflx);
  dhcdt_49 = dhcdt_89 + dhcdt_47;
  res_49 = -dhcdt_49 - (ubtp_49+vbtp_49+wbtp_49+uptb_49+vptb_49+wptb_49);
order = ['evp'; 'sgn'; 'hfl'; 'rgn'];
[lat, lon, tem, lm] = getll('temp', lims);
[xk, yk] = keep_var(lims2, lon, lat);
for j = 1:4;
  for i = 1:length(lags);
    eval([order(j,:) '_reg(i,find(isnan(lm))) = NaN;']);
  end
end
for i = 1:4;
  eval([order(i,:) ' = squeeze(mean2(mean2(shiftdim(' order(i,:) ...
       '_reg(:,yk,xk), 1))));']);
end
hc13 = getheat(lims2, 1:3, tim);
hc47 = getheat(lims2, 4:7, tim);
hc89 = getheat(lims2, 8:9, tim);
hc_13 = regress_eof(hc13, pcs, nfrm);
hc_47 = regress_eof(hc47, pcs, nfrm);
hc_89 = regress_eof(hc89, pcs, nfrm);
hc_13 = squeeze(mean2(mean2(shiftdim(hc_13, 1))));
hc_47 = squeeze(mean2(mean2(shiftdim(hc_47, 1))));
hc_89 = squeeze(mean2(mean2(shiftdim(hc_89, 1))));
hc_17 = hc_13 + hc_47;
hc_49 = hc_47 + hc_89;

taux = getnc('taux', [150 210 -6 6], 1, tim);
taux = regress_eof(taux, pcs, nfrm);
taux = squeeze(mean2(mean2(shiftdim(taux, 1))));

%  Get windstress curl if necessary

[taux, tauy] = getnc('taux', 'tauy', lims2, 1, tim);
[lat, lon] = getll('taux', lims2);
taux = regress_eof(taux, pcs, nfrm);
tauy = regress_eof(tauy, pcs, nfrm);

for i = 1:length(nfrm);
  tx = squeeze(taux(i,:,:));
  ty = squeeze(tauy(i,:,:));
  curl(i,:,:) = sph_curl1(tx, ty, lat, lon, 0);
end

curl2 = squeeze(mean2(mean2(shiftdim(curl, 1))))';

%  Plot all the terms

figure(2); fl(1);

subplot(1,1,1);
  h1 = plot(...
    nfrm, -dhcdt_13, 'd-.k', ...
    nfrm, -1e-8*hc_13, '-k', ...
    nfrm, -hflx, '>-.k', ...
    nfrm, evp, '.-.k', ...
    nfrm, hfl, 'o-.k', ...
    nfrm, rgn, '^-.k', ...
    nfrm, sgn, 'v-.k');
  set(h1(2), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 0-270m Integrated Heat Content Tendency Terms']);
%  axis([-10 10 -1 1]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'dHCdt', 'HC', 'NET HFLX', 'LH', 'SH', 'LW', 'SW');

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

figure(4); figure_landscape(1);
subplot(1,1,1);
  h1 = plot(...
    nfrm, ubtp_13, 'x-k', ...
    nfrm, vbtp_13, 'o-k', ...
    nfrm, wbtp_13, 'v-k', ...;
    nfrm, uptb_13, '*--k', ...
    nfrm, vptb_13, 's--k', ...
    nfrm, wptb_13, '^--k', ...
    nfrm, -hflx, '>-.k', ...
    nfrm, res_13, '.:k', ...
    nfrm, -dhcdt_13, 'd-.k', ...
    nfrm, -1e-8*hc_13, '-k', ...
    nfrm, 5e7*curl2, 'x--k');
%    nfrm, -hflx, '>-.k', ...
  set(h1([10:11]), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 80-270m Integrated Heat Content Tendency Terms']);
  axis([-10 10 -1.5 2.5]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'Ubar dHC''/dx', 'Vbar dHC''/dy', 'Wbar dHC''dz',...
             'U'' dHCbar/dx', 'V'' dHCbardy', 'W'' dHCbardz', 'HFLX', ...
             'Residual', 'dHC''/dt', 'HC (scaled)', 'TAUX (scaled)');

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

%17 47 13 89


%  Plot specific terms:

figure(1); figure_orient(1);

sptalk(2,1,1);
  h1 = plot(...
    nfrm, -dhcdt_13, 'd-.b', ...
    nfrm,  vbtp_13, 'o-r', ...
    nfrm,  wbtp_13, 'v-r', ...
    nfrm,  uptb_13, '*--r', ...
    nfrm,  wptb_13, '^--r', ...
    nfrm, -hflx, '>-.g', ...
    nfrm,  res_13, '.:k', ... 
    nfrm, -1e-8*hc_13, '-k', ...
    nfrm, -35*taux, 'x--k');
  set(h1(7:9), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 0-80m Integrated Equatorial Heat Content Tendency Terms']);
  axis([-10 10 -2 1.5]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'dHC''/dt', ...
             'VT''_y', 'WT''_z', ...
             'u''T_x', 'w''T_z', ...
             'HFLX', 'Residual', 'HC (scaled)', 'TAUX (scaled)');

sptalk(2,1,2);
  h1 = plot(...
    nfrm, -dhcdt_47, 'd-.b', ...
    nfrm,  ubtp_47, 'x-r', ...
    nfrm,  wbtp_47, 'v-r', ...
    nfrm,  uptb_47, '*--r', ...
    nfrm,  wptb_47, '^--r', ...
    nfrm,  res_47, '.:k', ... 
    nfrm, -1e-8*hc_47, '-k');
  set(h1(6:7), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 80-270m Integrated Equatorial Heat Content Tendency Terms']);
  axis([-10 10 -1.5 2.5]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'dHC''/dt', ...
             'UT''_z', 'WT''_z', ...
             'u''T_x', 'w''T_z', ...
             'Residual', 'HC (scaled)');

cd ~/Thesis/Talk
print -dpsc2 LP9_EQtend.ps 


figure(1); fo;
clf
spthes(1);
  h1 = plot(...
    nfrm, -dhcdt_47, 'd-.k', ...
    nfrm,  ubtp_47, 'x-k', ...
    nfrm,  wptb_47, '^--k', ...
    nfrm,  res_47, '.:k', ...
    nfrm, -1e-8*hc_47, '-k', ...
    nfrm,  5e7*curl2, 's--k');
  set(h1(4:6), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 80-270m Integrated WSTP Heat Content Tendency Terms']);
  axis([-10 10 -1.75 1.25]);
  set(gca, 'XTick', -20:2:20);
%  legend(h1, 'dHC''/dt', 'Ubar dHC''dx', 'W'' dHCbardz', ...
%             'Residual', 'HC (scaled)', '-1 x CURL(TAU) (scaled)');


cd /home/disk/tao/dvimont/Thesis/Chap4




%  NPAC:

figure(1); figure_orient;
clf
subplot(2,1,2);
  h1 = plot(...
    nfrm, -dhcdt_47, 'd-.k', ...
    nfrm,  wbtp_47, 'v-k', ...
    nfrm,  vptb_47, 's--k', ...
    nfrm,  wptb_47, '^--k', ...
    nfrm, -1e-8*hc_47, '-k');%, ...
%    nfrm,  5e7*curl2, 's--k');
  set(h1(5), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 80-270m Integrated Heat Content Tendency Terms']);
  axis([-10 10 -1.25 1]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'dHC''/dt', 'Wbar dHC''dz', ...
             'V'' dHCbardy', 'W'' dHCbardz', ...
             'HC (scaled)');%, '-1 x CURL(TAU) (scaled)');

             'Net Heat Flux', 'Residual', ...

cd /home/disk/tao/dvimont/Thesis/Chap4

%  CALIF:

figure(1); figure_orient;
subplot(2,1,2);
  h1 = plot(...
    nfrm, -dhcdt_17, 'd-.k', ...
    nfrm, vptb_17, 's--k', ...
    nfrm, -hflx, '>-.k', ...
    nfrm, -1e-8*hc_17, '-k');
  set(h1(4), 'linewidth', 2);
  grid on
  xlabel('Lag (in years)');
  ylabel('W m^-^2');
  title(['LP9:  ' tit ' 0-270m Integrated Heat Content Tendency Terms']);
  axis([-10 10 -2 2.5]);
  set(gca, 'XTick', -20:2:20);
  legend(h1, 'dHC''/dt', 'V'' dHCbardy', ...
             'Net Heat Flux', ...
             'HC (scaled)');


cd /home/disk/tao/dvimont/Thesis/Chap4