Documentation of advect_backwards


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


Help text

   u,v  ve u,v

   ue  w,we ue
	
   u,v  ve u,v

Cross-Reference Information

This script calls

Listing of script advect_backwards


clear

lims = [88 300 -82 82];
lev = 1:10;
lev2 = 1:9;
tim = 101:200;

u = getnc('u', lims, lev, tim); u = squeeze(mean(u));
v = getnc('v', lims, lev, tim); v = squeeze(mean(v));
w = getnc('wl', lims, lev2, tim); w = squeeze(mean(w));

ue = getnc('ue', lims, lev, tim); ue = squeeze(mean(ue));
ve = getnc('ve', lims, lev, tim); ve = squeeze(mean(ve));
we = getnc('we', lims, lev2, tim); we = squeeze(mean(we));

[nlev, nlat, nlon] = size(u);

u = u + 0.5*(ue(:,1:nlat,:)+ue(:,2:(nlat+1),:));
v = v + 0.5*(ve(:,:,1:nlon)+ve(:,:,2:(nlon+1)));
w = w+we;

[latu, lonu, depthu] = getll('u', lims);
[latv, lonv, depthv] = getll('v', lims);
[latw, lonw, depthw] = getll('wl', lims);

w = [zeros(1,nlat+1,nlon+1); w];
depthw = [0; depthw];

w = 1e-4*w;

[zu, yu, xu] = ndgrid(depthu, latu, lonu);
[zv, yv, xv] = ndgrid(depthv, latv, lonv);
[zw, yw, xw] = ndgrid(depthw, latw, lonw);

global RADUS;
rearth = RADUS * 100;

xu = (pi*rearth/180)*cos((pi/180)*yu).*(xu-180);
xv = (pi*rearth/180)*cos((pi/180)*yv).*(xv-180);
xw = (pi*rearth/180)*cos((pi/180)*yw).*(xw-180);

yu = (pi*rearth/180)*yu;
yv = (pi*rearth/180)*yv;
yw = (pi*rearth/180)*yw;

zu = -zu; zv = -zv; zw = -zw;

%  Time stepping

ndays = 365;
dt = 3600*24;
tf = ndays * dt;

pti = [-50 0 0];
[npt, ndim] = size(pti);

for ptind = 1:npt;
  pt = pti(ptind,:);

  for tind = 1:ndays;
    
    %  Start with w