Documentation of look_3dceof_vort_div


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


Help text

  Get regressions of fluxes:

Cross-Reference Information

This script calls

Listing of script look_3dceof_vort_div


clear
cd /home/disk/hayes2/dvimont/csiro/matlab_data
load LPregmap_3deof_-67.5to60pac.mat
tem = FRAME;
get_global; default_global; FRAME = tem;
ntim = size(pcs, 1);
[nlev, nlat, nlon] = size(clim);
tim = [101:550];
cd /home/disk/hayes2/dvimont/csiro/data
filin = ['temp_A_L1-10.nc'];
nc = netcdf(filin, 'nowrite');
  lind = 1:10;
  depth = nc{'depth'}(lind);
nc = close(nc);

%FRAME = [-0.1 360 -90 90];
cd /home/disk/hayes2/dvimont/csiro/data
nc = netcdf('zonal_stress_A_1000_years.nc', 'nowrite');
  lat1 = nc{'latitude'}(:);
  lon1 = nc{'longitude'}(:);
  [xk, yk] = keep_var(FRAME, lon1, lat1);
  xk = [min(xk-1); xk; max(xk+1)];
  yk = [min(yk-1); yk; max(yk+1)];

  taux = nc{'smfzon'}(tim,yk,xk);
  mv = nc{'smfzon'}.missing_value(:);
nc = close(nc);
taux(find(taux == mv)) = NaN * ones(size(find(taux == mv)));
nc = netcdf('merid_stress_A_1000_years.nc', 'nowrite');
  tauy = nc{'smfmer'}(tim,yk,xk);
  mv = nc{'smfmer'}.missing_value(:);
nc = close(nc);
tauy(find(tauy == mv)) = NaN * ones(size(find(tauy == mv)));
lat1 = lat1(yk); lon1 = lon1(xk);
[ntim, nlat, nlon] = size(taux);

taux = reshape(taux, ntim, nlat*nlon);
tauy = reshape(tauy, ntim, nlat*nlon);

clim = mean(taux); kpx = find(~isnan(clim));
clim = mean(tauy); kpy = find(~isnan(clim));
taux = detrend(taux); tauy = detrend(tauy);

tauxr = pcs.' * taux ./ ntim;
tauyr = pcs.' * tauy ./ ntim;

tauxr = reshape(tauxr, 10, nlat, nlon);
tauyr = reshape(tauyr, 10, nlat, nlon);

for i = 1:10;
  vort(i,:,:) = sph_curl(squeeze(tauxr(i,:,:)), squeeze(tauyr(i,:,:)), ...
                         lon1, lat1);
  div(i,:,:)  = sph_div( squeeze(tauxr(i,:,:)), squeeze(tauyr(i,:,:)), ...
                         lon1, lat1);
end

%  Plot vort and div
%  Look at various phases of these patterns

figure(1); clf; figure_orient;
lag = 0; lg = lag*pi/180;
num = 1; lind = 1;
nfrm = 4;

FRAME = [110 300 -67.5 60]; XAX = lon1; YAX = lat1;
for i = 1:2;

  wgt = conj(exp(j * ((i-1) * pi/nfrm + lg) ));% * ones(npt, 1));  
  tem = squeeze(real(wgt .* vort(num,:,:))) * 1e8; cint = 2;

     subplot(2,2,i);
       if ismap(gca); clma; end
       gcont(tem, [-20:cint:20]); dc;
       title(['Curl(Wind Stress), Phase = ' num2str(((i-1)*180)/nfrm+lag)]);
       xlabel(['Contour Interval:  ' num2str(cint) ' x 10^8 s^-^2 std^-^1'])

  tem = squeeze(real(wgt .* div(num,:,:))) * 1e8; cint = 1;

     subplot(2,2,i+2);
       if ismap(gca); clma; end
       gcont(tem, [-20:cint:20]); dc;
       title(['Div(Wind Stress), Phase = ' num2str(((i-1)*180)/nfrm+lag)]);
       xlabel(['Contour Interval:  ' num2str(cint) ' x 10^8 s^-^2 std^-^1'])

end

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots4





%  Get data from 20deg Isotherm CEOF

ind = 1;
cd /home/disk/hayes2/dvimont/csiro/matlab_data
if ind == 1;
  load 20degiso_yr101-550_temp.mat
  lag = -60;
  ttit = ['101 - 550'];
elseif ind == 2;
  load 20degiso_yr551-1000_temp.mat
  lag = 90;
  ttit = ['551 - 1000'];
end
ctlim = [110 300 -75 65];
ntim = length(tim); nlat = length(lat); nlon = length(lon);
get_global; default_global;
FRAME = [ctlim(1:2) floor(min(lat)) ceil(max(lat))];

temp3 = NaN * ones(ntim, nlat*nlon);
temp3(:,kp20) = temp20;
temp3 = detrend(temp3);
temp3 = cosweight(temp3, lat);
kp = find(~isnan(mean(temp3)));
temp3 = temp3(:,kp);

[b, a] = butter(6, 2/4.5);
temp3 = filtfilt(b, a, temp3);

%  Do complex eof:

[lam, lds, pcs, per] = complex_eof(temp3);
j = sqrt(-1);

npt  = length(kp);
weight1 = std(real(pcs));
weight2 = std(imag(pcs));
pcs = real(pcs).*(ones(ntim, 1)*(1./weight1)) + ...
      j*imag(pcs).*(ones(ntim, 1)*(1./weight2));
lds = real(lds).*(ones(npt, 1)*weight1) + ...
      j*imag(lds).*(ones(npt, 1)*weight2);

%  Now get taux and tauy stuff (get this from above)

%  And, plot vort and div stuff

figure(2); clf; figure_orient;
lg = lag*pi/180;
num = 1; lind = 1;
nfrm = 6;
XAX = lon1; YAX = lat1;
FRAME = [ctlim(1:2) floor(min(lat)) ceil(max(lat))];

cint = 2; clev = [-20:cint:20];
for i = 1:nfrm;

  wgt = conj(exp(j * ((i-1) * pi/nfrm + lg) ));
  temtim = squeeze(real(wgt .* pcs(:,num)));
  temtim = -1*(temtim - mean(temtim)) ./ std(temtim);

  tem1 = temtim(find(temtim>0))' * taux(find(temtim>0),:) ./ sum(temtim(find(temtim>0)));
  tem1 = reshape(tem1, nlat, nlon);
  tem2 = temtim(find(temtim>0))' * tauy(find(temtim>0),:) ./ sum(temtim(find(temtim>0)));
  tem2 = reshape(tem2, nlat, nlon);
  tem3 = sph_curl(tem1, tem2, lon1, lat1)*1e8;

     subplot(3,2,i);
       gcont(tem3, clev); dc;
       title(['Phase = ' num2str(((i-1)*180)/nfrm+lag)]);
       xlabel(['Contour Interval:  ' num2str(cint) ' x 10^-^8 s^-^1 std^-^1'])

end
subplot(3,2,3);
ylabel(['Curl of Wind Stress Regressed on CPC1 of T'' on 20 Deg. Isotherm;  Years ' ttit]);

cd /home/disk/tao/dvimont/matlab/CSIRO/Plots4
% print -dps2 VORT_20deg_CEOF1_yr101-550.ps