Documentation of ceof_reg_oce_current


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


Help text

  Load CPCs

Cross-Reference Information

This script calls

Listing of script ceof_reg_oce_current


clear
lev = 1:7;
tim = 101:550;
cd /home/disk/hayes2/dvimont/csiro/data
nc = netcdf('ul_L1-10.nc', 'nowrite');
  depth = nc{'depth'}(:);
  lat = nc{'latitude'}(:);
  lon = nc{'longitude'}(:);
  ctlim = [110 300 -60 60];
  [xk, yk] = keep_var(ctlim, lon, lat);
  u = nc{'u'}(tim, lev, yk, xk);
  mv = nc{'u'}.missing_value(:);
nc = close(nc);
nc = netcdf('vl_L1-10.nc', 'nowrite');
  v = nc{'v'}(tim, lev, yk, xk);
  mv = nc{'v'}.missing_value(:);
nc = close(nc);
u(u == mv) = NaN;
v(v == mv) = NaN;
lat2 = lat(yk); lon2 = lon(xk);
[ntim, nlev, nlat, nlon] = size(u);
d1 = depth(1);
depthw = [];
for i = 1:nlev;
  depthw = [depthw; depth(i)+d1];
  d1 = depth(i+1) - depth(i) - d1;
end
dz = diff([0; depthw]);
u = reshape(shiftdim(u, 1), nlev, nlat*nlon*ntim);
v = reshape(shiftdim(v, 1), nlev, nlat*nlon*ntim);
u = dz'*u ./ sum(dz);
v = dz'*v ./ sum(dz);
u = shiftdim(reshape(u, nlat, nlon, ntim), 2);
v = shiftdim(reshape(v, nlat, nlon, ntim), 2);
[u, clim] = remove_mean(u);
[v, clim] = remove_mean(v);

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

%  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));
u = reshape(u, ntim, nlat*nlon);
v = reshape(v, ntim, nlat*nlon);
clear ureg vreg
for i = 1:nfrm
  wgt = conj(exp(j * ((i-1) * pi/(lg2*nfrm) + lg) ));
  temtim(:,i) = squeeze(real(wgt .* timeseries));
  ureg(i, :) = temtim(:,i)' * u ./ ntim;
  vreg(i, :) = temtim(:,i)' * v ./ ntim;
end
ureg = reshape(ureg, nfrm, nlat, nlon);
vreg = reshape(vreg, nfrm, nlat, nlon);

%  Plot the data

default_global; XAX = lon2; YAX = lat2;

figure(1); figure_orient;
for i = 1:nfrm
  temu = squeeze(ureg(i,:,:));
  temv = squeeze(vreg(i,:,:));
  
  subplot(3,2,i);
    [h, a, c] = gquiv(temu, temv, 2, 2);
    dc
    title(['Phase = ' num2str((i-1)*180/nfrm + lag)]);
    xlabel(['Max = ' num2str(round(c(2)*100)/100) ' cm s^-^1'])
end
subplot(3,2,3);
  ylabel([tit ':  Vertical Mean Ocean Velocity regressed on HC CPC1;  '...
          'Depth = 0:' num2str(depthw(max(lev))/100) 'm']);

cd /home/disk/tao/dvimont/matlab/CSIRO/Heat/Plot_Ceof
eval(['print -dps2 ' ptit '_oce_vel_L1-7.ps']);

end