cd ~dmenemen/llc_4320/regions/Kerguelen
nx=3360;
ny=1605;
nz=89;
ix=1551:1600;
iy=851:900;
iz=1:89;
U=read_ijk('U/U_3360x1605x89.20111001T000000',ix,iy,iz,nx,ny,nz);
V=read_ijk('V/V_3360x1605x89.20111001T000000',ix,iy,iz,nx,ny,nz);
W=read_ijk('W/W_3360x1605x89.20111001T000000',ix,iy,iz,nx,ny,nz);
hFacC=read_ijk('grid/hFacC_3360x1605x89',ix,iy,iz,nx,ny,nz);
RAC=read_ijk('grid/RAC_3360x1605',ix,iy,1,nx,ny,1);
DXG=read_ijk('grid/DXG_3360x1605',ix,iy,1,nx,ny,1);
DYG=read_ijk('grid/DYG_3360x1605',ix,iy,1,nx,ny,1);
load ../../grid/thk90

x=1:(length(ix)-1);
y=1:(length(iy)-1);
z=10;
ui = U(x,y,z)   .* DYG(x,y)   * thk90(z) ;
uo = U(x+1,y,z) .* DYG(x+1,y) * thk90(z) ;
vi = V(x,y,z)   .* DXG(x,y)   * thk90(z) ;
vo = V(x,y+1,z) .* DXG(x,y+1) * thk90(z) ;
wi = W(x,y,z+1) .* RAC(x,y) ;
wo = W(x,y,z)   .* RAC(x,y) ;
div=ui-uo+vi-vo+wi-wo;
clf
subplot(431),quikpcolor(ui'); colorbar
subplot(432),quikpcolor(uo'); colorbar
subplot(433),quikpcolor(ui'-uo'); colorbar
subplot(434),quikpcolor(vi'); colorbar
subplot(435),quikpcolor(vo'); colorbar
subplot(436),quikpcolor(vi'-vo'); colorbar
subplot(437),quikpcolor(wi'); colorbar
subplot(438),quikpcolor(wo'); colorbar
subplot(439),quikpcolor(wi'-wo'); colorbar
subplot(4,3,10),quikpcolor(div'); colorbar
