Documentation of eof_heat_content


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


Help text

  Filter Heat

Cross-Reference Information

This script calls

Listing of script eof_heat_content


clear
cd /home/disk/hayes2/dvimont/csiro/data
filin = ['temp_A_L1-10.nc'];
nc = netcdf(filin, 'nowrite');
  depth = nc{'depth'}(:);
  lat = nc{'latitude'}(:);
  lon = nc{'longitude'}(:);
  ctlim = [110 300 -75 65];
  [xk, yk] = keep_var(ctlim, lon, lat);
  temp = nc{'temp'}(:,:,yk,xk);
  mv = nc{'temp'}.missing_value(:);
nc = close(nc);
[ntim, nlev, nlat, nlon] = size(temp);
temp(find(temp == mv)) = NaN * ones(size(find(temp == mv)));
lat = lat(yk); lon = lon(xk);
get_global; default_global; FRAME = ctlim;
middepth = [0; (depth(1:7)+depth(2:8)) / 2];
wgt = diff(middepth)/100;
temp = shiftdim(temp, 1);
temp = reshape(temp, nlev, nlat*nlon*ntim);
heat = wgt' * temp(1:7,:);
heat = shiftdim(reshape(heat, nlat, nlon, ntim), 2);
clear temp
heat = reshape(heat, ntim, nlat*nlon);
heat = detrend(heat);
heat = cosweight(heat, lat);
clim = mean(heat);
kp = find(~isnan(clim));
heat = heat(:, kp);

yr = 4.5;
[b,a]=butter(6,(2/yr));
[b2, a2] = butter(6, (2/50));
heatlp = filtfilt(b2, a2, heat);
heatbp = heatlp - filtfilt(b2, a2, heat);
heathp = heat - heatlp;

%c = heatbp*heatbp';
%c = heathp*heathp';
c = heatlp*heatlp';
%c = heat*heat';
[lam, pcs, per] = eof(c);

pc10 = pcs(:,1:10);
pc10 = (pc10 - ones(ntim, 1)*mean(pc10)) ./ (ones(ntim, 1)*std(pc10));

pc10 = pc10hp;
lds10 = pc10'*heathp;

num = 1;
tem = NaN*ones(1, nlat*nlon);
tem(kp) = lds10(num,:);
temtim = pc10(:,num);
tem = reshape(tem, nlat, nlon)/1000;

figure(3); figure_orient;
sd(1);
     gshade(tem, [-30:5:45]);
     dc;
     colorbar2
sd(2);
     plot(1:1000, temtim);

lab = 'hp';
eval(['pc10' lab ' = pc10; ld10' lab ' = lds10; per_' lab ' = per(1:10);']);

cd /home/disk/tao/dvimont/matlab/CSIRO/Data
save eofs_heat.mat pc10lp pc10hp ld10lp ld10hp per_hp per_lp kp lat lon