Documentation of hofmoeller_depth_temp2


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


Help text

  ctlim = [-.1 360 -6 6];

Cross-Reference Information

This script calls

Listing of script hofmoeller_depth_temp2


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 = [120 290 -45 45];
  [xk, yk] = keep_var(ctlim, lon, lat);
  tim = 466:515;

  temp = nc{'temp'}(tim,:,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);

temp = shiftdim(temp, 1);
temp = reshape(temp, nlev, nlat*nlon*ntim);

%  Get depth of 20 degree isotherm

d20 = NaN * ones(1, nlat*nlon*ntim);
for i = 1:(nlat*nlon*ntim);
  if temp(1,i) > 20;
    if isempty(find(diff(temp(:,i)) > 0));
      d20(i) = interp1(temp(:,i), depth, 20);
    end
  end
end

d20 = shiftdim(reshape(d20, nlat, nlon, ntim), 2);
clim = mean2(d20);

d20 = reshape(d20, ntim, nlat*nlon);
d20 = detrend(d20);
d20 = reshape(d20, ntim, nlat, nlon);

lims = flipud([-25 -15; -15 -5; -5 5; 5 15; 15 25]);% 25 35; 35 45]);
tim = 1:50;

figure(1); figure_orient;
for i = 1:5;

  [xk, yk] = keep_var([ctlim(1:2) lims(i,:)], lon, lat);
  tem = squeeze(mean2(shiftdim(d20(tim,yk,xk),1)));

  subplot(1,5,i);
  contourf(lon(xk), tim, tem', 10);
%  colorbar('horiz');
  title(['<'num2str(lims(i,:)) '>']);
  xlabel('20 K Depth'); ylabel('time');

end




temp = reshape(temp, ntim, nlev*nlat*nlon);
temp = detrend(temp);
%[bl,al]=butter(6,(2/4.5));
%[bh,ah]=butter(6,(2/12));
%temp = filtfilt(bl, al, temp) - filtfilt(bh, ah, temp);
temp = reshape(temp, ntim, nlev, nlat, nlon);