Documentation of tendency_terms2


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


Help text

  Get pcs

Cross-Reference Information

This script calls

Listing of script tendency_terms2


clear

biff2 = 1;
cd /home/disk/hayes2/dvimont/csiro/matlab_data/Heat_Content
if biff2 == 1;
  load LP10_L1-7_EOF.mat; tit = 'Lowpass Filtered Data ( > 10 Years )';
elseif biff2 == 2;
  load HP8_L1-7_EOF.mat; tit = 'Highpass Filtered Data ( < 8 Years )';
elseif biff2 == 3;
  load RAW_L1-7_EOF.mat; tit = 'Unfiltered Data';
end
pcs = -1*pcs;

%for biff = 1:2;
biff = 2;
if biff == 1;
  lims = [150 210 -5 5];
elseif biff == 2;
  lims = [178 272 -5 5];
end

lags = [-10:12];
tim = 101:550;
lev = 1;

cd /home/disk/tao/dvimont/matlab/CSIRO/Heat/Lagged_regressions
global RADIAN DEGREE RADUS

%  Get udtdx terms

   [ubtp, uptb, lat_out, lon_out, depth_out] = ...
        Lagged_regressions/get_udtdx.html">get_udtdx(pcs, lims, lags, lev, tim);
   [nfrm, nlat, nlon] = size(ubtp);
   dx = mean(diff(lon_out)); dy = mean(diff(lat_out));
   lon_out = [lon_out; max(lon_out)+dx] - dx/2;
   lat_out = [lat_out; max(lat_out)+dy] - dy/2;
   A = RADUS * ( diff(sin(RADIAN * lat_out)) ) * ( RADIAN * diff(lon_out) )'; 
   A = reshape(A, 1, nlat*nlon);
   uptb = -1 * A * reshape(uptb, nfrm, nlat*nlon)' ./ sum(A);
   ubtp = -1 * A * reshape(ubtp, nfrm, nlat*nlon)' ./ sum(A);

%  Get vdtdy terms

   [vbtp, vptb, lat_out, lon_out, depth_out] = ...
        Lagged_regressions/get_vdtdy.html">get_vdtdy(pcs, lims, lags, lev, tim);
   [nfrm, nlat, nlon] = size(vbtp);
   dx = mean(diff(lon_out)); dy = mean(diff(lat_out));
   lon_out = [lon_out; max(lon_out)+dx] - dx/2;
   lat_out = [lat_out; max(lat_out)+dy] - dy/2;
   A = RADUS * ( diff(sin(RADIAN * lat_out)) ) * ( RADIAN * diff(lon_out) )'; 
   A = reshape(A, 1, nlat*nlon);
   vptb = -1 * A * reshape(vptb, nfrm, nlat*nlon)' ./ sum(A);
   vbtp = -1 * A * reshape(vbtp, nfrm, nlat*nlon)' ./ sum(A);

%  Get wdtdz terms

   if lev == 1; lev = 2; end;
   [wbtp, wptb, lat_out, lon_out, depth_out] = ...
        Lagged_regressions/get_wdtdz.html">get_wdtdz(pcs, lims, lags, lev, tim);
   [nfrm, nlat, nlon] = size(wbtp);
   dx = mean(diff(lon_out)); dy = mean(diff(lat_out));
   lon_out = [lon_out; max(lon_out)+dx] - dx/2;
   lat_out = [lat_out; max(lat_out)+dy] - dy/2;
   A = RADUS * ( diff(sin(RADIAN * lat_out)) ) * ( RADIAN * diff(lon_out) )'; 
   A = reshape(A, 1, nlat*nlon);
   wptb = -1 * A * reshape(wptb, nfrm, nlat*nlon)' ./ sum(A);
   wbtp = -1 * A * reshape(wbtp, nfrm, nlat*nlon)' ./ sum(A);

%  Get dtdt

   if lev == 2; lev = 1; end;
   tim2 = [min(tim)-1 tim max(tim)+1];
   t = getnc('temp', lims, lev, tim2);
   [lat_out, lon_out, depth_out] = getll('temp', lims);
   [t, tem] = remove_mean(t);
   [ntim, nlat, nlon] = size(t);
   t2 = (t(3:ntim,:,:) - t(1:ntim-2,:,:)) / (2*24*3600*365);
   t2 = regress_eof(t2, pcs, lags);
   t = regress_eof(t(tim-99,:,:), pcs, lags);
   [nfrm, nlat, nlon] = size(t);
   dx = mean(diff(lon_out)); dy = mean(diff(lat_out));
   lon_out = [lon_out; max(lon_out)+dx] - dx/2;
   lat_out = [lat_out; max(lat_out)+dy] - dy/2;
   A = RADUS * ( diff(sin(RADIAN * lat_out)) ) * ( RADIAN * diff(lon_out) )'; 
   A = reshape(A, 1, nlat*nlon);
   t = A * reshape(t, nfrm, nlat*nlon)' ./ (sum(A) * 3600*24*365);
   t2 = A * reshape(t2, nfrm, nlat*nlon)' ./ sum(A);

%  Get HFLX

if lev <= 2;
   hflx = getnc('heat', lims, 1, tim);
   [hflx, tem] = remove_mean(hflx);
   [lat_out, lon_out] = getll('heat', lims);
   hflx = regress_eof(hflx, pcs, lags);
   [tem, nlat, nlon] = size(hflx);
   dx = mean(diff(lon_out)); dy = mean(diff(lat_out));
   lon_out = [lon_out; max(lon_out)+dx] - dx/2;
   lat_out = [lat_out; max(lat_out)+dy] - dy/2;
   A = RADUS * ( diff(sin(RADIAN * lat_out)) ) * ( RADIAN * diff(lon_out) )'; 
   A = reshape(A, 1, nlat*nlon);
   hflx = 1 * A * reshape(hflx, nfrm, nlat*nlon)' ./ sum(A);
   hflx = hflx ./ (4.218e3 * 1e3 * 100);
else
   hflx = NaN * ones(size(lags));
end

%  Plot the data

ph = lags;
figure(2); figure_orient(1);
sp(biff);
  h1 = plot(ph, 1e8*ubtp, 'x-k', ...
       ph, 1e8*vbtp, 'o-k', ...
       ph, 1e8*wbtp, 'v-k', ...;
       ph, 1e8*uptb, '*--k', ...
       ph, 1e8*vptb, 's--k', ...
       ph, 1e8*wptb, '^--k', ...
       ph, 1e8*t2, 'd-.k', ...
       ph, 1e8*hflx, '>-.k');
  hold on;
    h3 = plot(ph, 0.2e8*t, '.-k'); 
    set(h3, 'linewidth', 2);
  hold off;
  grid on
  if biff == 1;
    axis([min(lags-1) max(lags+1) -0.1 0.1]);
%    title([tit ':  WSTP [117.5E 170E 7.5N 22.5N] Heat Budget Terms']);
    title([tit ':  Central EQ PAC [150E 150W 5S 5N] L' num2str(lev) ' Temp Tendency']);
  elseif biff == 2;
    axis([min(lags-1) max(lags+1) -0.15 0.15]);
%    title([tit ':  CT [180 270E 5S 5N] Heat Budget Terms']);
    title([tit ':  Eastern EQ PAC [150W 90W 5S 5N] L' num2str(lev) ' Temp Tendency']);
  end
  xlabel('Lag');
  ylabel('10^-^8 K s^-^1');
  set(gca, 'XTick', lags(1:2:nfrm));
  if lev <= 2;
    h2 = legend(h1, 'Ubar dT''dx', 'Vbar dT''dy', 'Wbar dT''dz', 'U'' dTbardx',...
             'V'' dTbardy', 'W'' dTbardz', 'dTdt', 'Net HFLX');
  else
    h2 = legend(h1, 'Ubar dT''dx', 'Vbar dT''dy', 'Wbar dT''dz', 'U'' dTbardx',...
             'V'' dTbardy', 'W'' dTbardz', 'dTdt');
  end

end;