Documentation of wbar_dtprimedz


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


Help text

  First, get wbar

Cross-Reference Information

This script calls

Listing of script wbar_dtprimedz


clear
tim = 101:550;
ctlim = [108 302 -62 62];
lev = 2;
cd /home/disk/hayes2/dvimont/csiro/data

filin = 'wl_L2-10.nc';
nc = netcdf(filin, 'nowrite');
  depthw = nc{'depth'}(:);
  latw = nc{'latitude'}(:);
  lonw = nc{'longitude'}(:);
  [xk, yk] = keep_var(ctlim, lonw, latw);
  wbar = nc{'wl'}(tim,lev,yk,xk);
  mv = nc{'wl'}.missing_value(:);
nc = close(nc);
wbar(wbar == mv) = NaN;
wbar = squeeze(mean2(wbar))/(100*10000);
latw = latw(yk); lonw = lonw(xk);
depthw = depthw/100;

%  Now get tprime

cd /home/disk/hayes2/dvimont/csiro/data
filin = 'temp_L1-10.nc';
nc = netcdf(filin, 'nowrite');
  depth = nc{'depth'}(:);
  latt = nc{'latitude'}(:);
  lont = nc{'longitude'}(:);
  [xk, yk] = keep_var(ctlim, lont, latt);
  temp = nc{'temp'}(tim, (lev:(lev+1)), yk, xk);
  mv = nc{'temp'}.missing_value(:);
nc = close(nc);
temp(temp == mv) = NaN;
latt = latt(yk); lont = lont(xk);
temp = squeeze(temp);
[ntim, nlev, nlat, nlon] = size(temp);
depth = depth/100;

%  Load CPCs

cd /home/disk/hayes2/dvimont/csiro/matlab_data/20Deg_Isotherm
%load 20deg_CEOF_LP10_yr101-550.mat; tit = 'Lowpass Filtered Data ( > 10 Years )';
load 20deg_CEOF_HP8_yr101-550.mat; tit = 'Highpass Filtered Data ( < 8 Years )';
%load 20deg_CEOF_RAW_yr101-550.mat; tit = 'Unfiltered Data';

%  Get regressions

lag = 0; lg = lag*pi/180; lg2 = 1;
num = 1; lind = 1;
nfrm = 6;

%  Store all regressions under one variable

j = sqrt(-1);
timeseries = sqrt(2)*pcs(:,num)./std(pcs(:,num));
temp = reshape(temp, ntim, nlev*nlat*nlon);
clear temtim treg
for i = 1:nfrm
  wgt = conj(exp(j * ((i-1) * pi/(lg2*nfrm) + lg) ));
  temtim(:,i) = squeeze(real(wgt .* timeseries));
  treg(i, :) = temtim(:,i)' * temp ./ ntim;
end
treg = reshape(treg, 6, nlev, nlat, nlon);
temp = reshape(temp, ntim, nlev, nlat, nlon);

%  Get dtdz

treg = reshape(shiftdim(treg, 1), nlev, nlat*nlon*nfrm);
dtdz = diff(treg) ./ diff(depth(lev:(lev+1)));
dtdz = shiftdim(reshape(dtdz, nlat, nlon, nfrm), 2);


%  Plot the data

default_global; XAX = lont; YAX = latt;

figure(1); figure_orient;
cint = 5; clev = [-20:cint:-cint cint:cint:20];
for i = 1:nfrm
  tem = 1e9 * wbar .* squeeze(dtdz(i,:,:));
  subplot(3,2,i);
    gcont(tem, clev);
    dc
  if i > 4;
    xlabel(['Contour Interval:  ' num2str(cint) ' x 10^-^9 K s^-^1']);
  end
end
subplot(3,2,3);
  ylabel([tit ':  Vertical Advelction of T'' by  Wbar;  '...
          'Depth = ' num2str(depthw(max(lev))) 'm']);

cd /home/disk/tao/dvimont/matlab/CSIRO/Velocity/Plots_Tadv
%print -dps2 HP8_wintbar_dtprimedz_L5_yr1.ps