Documentation of get_vdtdy


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


Function Synopsis

[ubtp, uptb, lat_out, lon_out, depth_out] = get_udtdx(pcs, lims, lags, lev, tim);

Help text


  [vbtp, vptb, lat_out, lon_out, depth_out] = ...
       get_udtdx(pcs, lims, lags, lev, tim);


Cross-Reference Information

This function calls This function is called by

Listing of function get_vdtdy

function [ubtp, uptb, lat_out, lon_out, depth_out] = get_udtdx(pcs, lims, lags, lev, tim);

if length(lev) > 1;
  error('length(lev) > 1 not supported');
end

cdtem = ['cd ' pwd];

u = getnc('v', lims, lev, tim);
[latu, lonu, depthu] = getll('v', lims);

t = getnc('temp', lims, lev, tim);
[latt, lont, deptht] = getll('temp', lims);

[u, ubar] = remove_mean(u/100);
[t, tbar] = remove_mean(t);
ubar = squeeze(ubar); tbar = squeeze(tbar);
u = squeeze(u); t = squeeze(t);

ureg = regress_eof(u, pcs, lags);
treg = regress_eof(t, pcs, lags);

%  Get dtdx

global RADIAN

szt = size(treg);
treg = (treg(:,:,1:(szt(3)-1)) + treg(:,:,2:szt(3)))/2;
tbar = (tbar(:,(1:szt(3)-1)) + tbar(:,2:szt(3)))/2;
lonr = (lont(1:(szt(3)-1)) + lont(2:szt(3)))/2;

[dtdxb, lon2] = sph_grady1(tbar, RADIAN*latt, RADIAN*lonr, 0);
for i = 1:szt(1);
  dtdxp(i,:,:) = sph_grady1(squeeze(treg(i,:,:)), RADIAN*latt, RADIAN*lonr, 0);
  ubtp(i,:,:) = ubar .* squeeze(dtdxp(i,:,:));
  uptb(i,:,:) = dtdxb .* squeeze(ureg(i,:,:));
end

lon_out = lonu;
lat_out = latu;
depth_out = depthu(lev);