Documentation of regress_20dISO_taux_obs


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


Help text

  Get 20dISO depth

Cross-Reference Information

This script calls

Listing of script regress_20dISO_taux_obs


clear
cd /home/disk/tao/dvimont/Data/20dISO
nc = netcdf('20dISO_1980_2000_mon.cdf', 'nowrite');
  lat1 = nc{'Y', 1}(:);
  lon1 = nc{'X', 1}(:);
  data1 = nc{'D20eq'}(:,:,:);
  time1 = nc{'T', 1}(:);
nc = close(nc);
data1 = 100*data1; % convert to cgs

%  Get zonal wind stress (FSU);
nc = netcdf('fsu_taux_data.cdf', 'nowrite');
  lat2 = nc{'Y', 1}(:);
  lon2 = nc{'X', 1}(:);
  data2 = nc{'taux'}(:,:,:);
  time2 = nc{'T', 1}(:);
nc = close(nc);

ind = find(ismember(time2, time1));

data2 = data2(ind,:,:);

[data1, data1c] = annave(data1);
[data2, data2c] = annave(data2);

%  Now form indices 

global RADUS
dtcddx = diff(data1, 1, 2)./((pi/180)*mean(diff(lon1))*RADUS*100);
dtcddxc = diff(data1c, 1, 2)./((pi/180)*mean(diff(lon1))*RADUS*100);
lon1dx = lon1(1:(length(lon1)-1))+0.5*mean(diff(lon1));


%  Start with 20dISO
figure(1); fo(1); clf;

subplot(4,1,1);
  plot(lon1, -mean2(data1c), 'k');
  axis([120 280 -21000 1000]);
  set(gca, 'YTick', [-20000:5000:0], 'YTickLabel', [20000:-5000:0]);
  grid on
  title('Mean 20^\circ Isotherm Depth');
  
subplot(4,1,2);
  plot(lon1, std2(data1), 'k');
  axis([120 280 750 3250]);
  set(gca, 'YTick', [0:500:3000], 'YTickLabel', [0:500:3000]);
  grid on
  title('STD 20^\circ Isotherm Depth');
  
subplot(4,1,3);
  plot(lon1dx, mean2(dtcddxc), '-k')
  axis([120 280 -2.5e-5 2.5e-5])
  set(gca, 'YTick', 1e-5*[-2:2], 'YTickLabel', [-2:2]);
  grid on 
  title('Mean 20^\circ Isotherm Zonal Gradient ( \times 10^5 )');

subplot(4,1,4);
  plot(lon1dx, std2(dtcddx), '-k')
  axis([120 280 -2.5e-5 2.5e-5])
  set(gca, 'YTick', 1e-5*[-2:2], 'YTickLabel', [-2:2]);
  grid on 
  title('Mean 20^\circ Isotherm Zonal Gradient ( \times 10^5 )');

  
subplot(2,2,3);
  surface(lon1, time1, data1);
  colormap gray
  shading flat
  axis([120 280 240 491 ]);
  set(gca, 'YTick', [240:12:491], 'YTickLabel', [1980:2000]);
  title('20^\circ Isotherm Depth');
  colorbar2
  
subplot(2,2,4);
  surface(lon1, time1, data1-ones(size(data1, 1), 1)*mean2(data1));
  colormap gray
  shading flat
  axis([120 280 240 491 ]);
  set(gca, 'YTick', [240:12:491], 'YTickLabel', [1980:2000]);
  title('20^\circ Isotherm Depth Anomaly');
  colorbar2

cd /home/disk/tao/dvimont/matlab/Ocean/Figs
% print -dps2 20dIso_depth_stats.ps

%  Now, zonal wind stress
[xk, yk] = keep_var([100 300 -6 6], lon2, lat2);
tem2 = data2(:,yk,:);
tem2 = squeeze(mean2(shiftdim(tem2, 1)))';

figure(1); fo(1); clf;

subplot(4,1,1);
  plot(lon2, mean2(tem2));
  axis([120 280 -1.1 .6]);
  set(gca, 'YTick', [-1:0.25:1], 'YTickLabel', [-1:0.25:1]);
  grid on
  title('Mean Zonal Wind Stress (dyne cm^-^2)');
  
subplot(4,1,2);
  plot(lon2, std2(tem2));
  axis([120 280 -0.05 0.45]);
  set(gca, 'YTick', [0:.1:.5], 'YTickLabel', [0:.1:.5]);
  grid on
  title('STD Zonal Wind Stress (dyne cm^-^2)');
  
subplot(2,2,3);
  surface(lon2, time1, tem2);
  colormap gray
  caxis([-1 1])
  shading flat
  axis([120 280 240 491 ]);
  set(gca, 'YTick', [240:12:491], 'YTickLabel', [1980:2000]);
  title('Zonal Wind Stress');
  colorbar2
  
subplot(2,2,4);
  surface(lon2, time1, tem2-ones(size(tem2, 1), 1)*mean2(tem2));
  colormap gray
  caxis([-1 1])
  shading flat
  axis([120 280 240 491 ]);
  set(gca, 'YTick', [240:12:491], 'YTickLabel', [1980:2000]);
  title('Zonal Wind Stress Anomaly');
  colorbar2

cd /home/disk/tao/dvimont/matlab/Ocean/Figs
% print -dps2 Zonal_windstress_stats.ps



%  Look at scatter plot of the two.  First, make inidices

%[xk, yk] = keep_var([200 260 -6 6], lon1, lat1);
[xk, yk] = keep_var([220 270 -6 6], lon1, lat1);
tcd = squeeze(mean2(shiftdim(data1(:, xk), 1)))';
%tcd = 100*tcd;  %  Convert to cgs - done earlier
tcdc = (squeeze(mean2(shiftdim(data1c(:, xk), 1))) - mean2(shiftdim(data1c, 1)))';

[xk, yk] = keep_var([150 230 -6 6], lon2, lat2);
tx = squeeze(mean2(mean2(shiftdim(data2(:, yk, xk), 1))));
txc = squeeze(mean2(mean2(shiftdim(data2c(:, yk, xk), 1))));

[xk, yk] = keep_var([150 230 -6 6], lon1dx, lat1);
tcdx = squeeze(mean2(shiftdim(dtcddx(:, xk), 1)));

figure(1); fo(1); clf;

%tem1 = rave((tx - mean(tx))./std(tx), 3);
%tem2 = rave((tcd - mean(tcd))./std(tcd), 3);
%tem3 = rave((tcdx - mean(tcdx))./std(tcdx), 3)';

tem1 = (tx - mean(tx))./std(tx);
tem2 = (tcd - mean(tcd))./std(tcd);
tem3 = (tcdx - mean(tcdx))./std(tcdx);
tem1 = tem1 - rave(rave(tem1, 5), 3);
tem2 = tem2 - rave(rave(tem2, 5), 3);
tem3 = tem3 - rave(rave(tem3, 5), 3);

rcoef1 = tem1'*tem2./(tem2'*tem2);
rcoef2 = tem1'*tem3./(tem3'*tem3);

subplot(4,1,1);
  plot(1:248, tem1, '--k', 1:248, tem2, '-k', ...
       1:248, tem3, '-.k');%(tem1 - rcoef*tem2), '-.k');
  axis([0 249 -3.5 3.5]);
  set(gca, 'XTick', [1:24:248], 'XTickLabel', [1980:2:2000]);
  set(gca, 'YTick', -5:5);
  title(['20^\circ Iso Depth (solid) Zonal Wind Stress ' ...
	 '(dashed), and d/dx 20\circ Iso Depth (dash-dot)']);
  grid on

xtl = ['jfmamjjasond']';

subplot(4,2,3);  pos = get(gca, 'Position'); 
  pos(2) = 0.52; set(gca, 'Position', pos);
  plot(1:12, txc, 'k');
  hold on;  hh = line([1 12], mean(txc)*[1 1]); hold off;
  set(hh, 'linestyle', '--', 'color', 'k');
  axis([0 13 -0.65 -0.35])
  set(gca, 'XTick', 1:12, 'XTickLabel', xtl);
  grid on;
  title('Wind Stress Climatology (dynes cm^-^1)');
  xlabel(['Mean = ' num2str(mean(txc))]);
  
subplot(4,2,4); pos = get(gca, 'Position'); 
  pos(2) = 0.52; set(gca, 'Position', pos);
  plot(1:12, tcdc, 'k');
  hold on;  hh = line([1 12], mean(tcdc)*[1 1]); hold off;
  set(hh, 'linestyle', '--', 'color', 'k');
  axis([0 13 -5750 -4250])
  set(gca, 'XTick', 1:12, 'XTickLabel', xtl);
  grid on;
  title('20^\circ Isotherm Depth Climatology (cm)');
  xlabel(['Mean = ' num2str(mean(tcdc))]);
  
%tem1 = rave(rave(rave(tx, 3), 3), 5);
%tem2 = rave(rave(rave(tcd, 3), 3), 5);
%tem3 = rave(rave(rave(tcdx, 3), 3), 5);
%tem1 = rave(tx, 3);
%tem2 = rave(tcd, 3);
%tem3 = rave(tcdx, 3);

tem1 = tx; 
tem2 = tcd;
tem3 = tcdx; 
tem1 = tem1 - rave(tem1, 5);
tem2 = tem2 - rave(tem2, 5);
tem3 = tem3 - rave(tem3, 5);

tem1 = tem1 - mean(tem1);
tem2 = tem2 - mean(tem2);
tem3 = tem3 - mean(tem3);

subplot(2,2,3);
  tim2 = 1:247; tim1 = 2:248;
  plot(tem2(tim1), tem1(tim2), '.k');
  axis square
  axis([-5500 5500 -0.55 0.55]);
  set(gca, 'XTick', -5000:2500:5000, 'YTick', -1:.25:1)
  grid on  
  rcoef = tem1(tim2)'*tem2(tim1)./...
	  (length(tem2(tim1))*std(tem2(tim1))^2); rcoef
  temx = -5500:100:5500; temy = .1179/std(tcd)*temx;%temy = rcoef*temx;
  hold on; plot(temx, temy, '-k'); hold off;
  temx = -5500:100:5500; temy = rcoef*temx;
  hold on; plot(temx, temy, '--k'); hold off;
  title(['Reg. coef = ' num2str(rcoef) ' dyne cm^-^3']);
  xlabel('20^\circ Iso Depth'); ylabel('Zonal Wind Stress');
  
  
subplot(2,2,4);
  plot(tem3, tem1, '.k');
  axis square
  axis([-2e-5 2e-5 -0.55 0.55]);
  set(gca, 'XTick', -2e-5:1e-5:2e-5, 'XTickLabel', [-2:2], ...
	   'YTick', -1:.25:1)
  grid on  
  rcoef = tem1'*tem3'./(length(tem3)*std(tem3)^2);
  temx = -2.5e-5:1e-6:2.5e-5; temy = rcoef*temx;
  hold on; plot(temx, temy, '-k'); hold off;
  title(['Reg. coef = ' num2str(rcoef) ' dyne cm^-^2']);
  xlabel('d/dx 20^\circ Iso Depth'); ylabel('Zonal Wind Stress');
  
cd /home/disk/tao/dvimont/matlab/Ocean/Figs
% print -dps2 regression_tx_20diso.ps
  

  
  
.1179/std(tem2)
ans =
   5.2147e-05

  
rcoef
rcoef =

   3.4039e-05