cd ~dmenemen/llc_4320/regions/Boxes/Box12
% cd /data8/llc/llc_4320/regions/Boxes/Box12
load matlab/thk90
m=936;
n=1062;
k=90;

XC=readbin('grid/XC_936x1062',[m n]);
YC=readbin('grid/YC_936x1062',[m n]);
Depth=readbin('grid/Depth_936x1062',[m n]);
hFacC=readbin('grid/hFacC_936x1062x90',[m n k]);

fld='Eta';
suf='_10609.6859.1_936.1062.1';
ts=1489536;
fin=[fld '/' myint2str(ts,10) '_' fld suf];
tmp=readbin(fin,[m n]);

%%%%%%%%%%%%%
clf
subplot(221)
quikpcolor(hFacC(:,:,1)');
e=0*tmp(:,:);
e(find(tmp))=1;
subplot(222)
quikpcolor(e');







%%%%%%%%%%%%%%%
suf='_10609.6859.1_936.1062.90';
ts=1489536;
fin=['U/' myint2str(ts,10) '_V' suf];
tmp=readbin(fin,[m n k]);

%%%%%%%%%%%%%
k=80;
clf
subplot(221)
quikpcolor(hFacC(:,:,k)');
V=0*tmp(:,:,1);
V(find(tmp(:,:,k)))=1;
subplot(222)
quikpcolor(V');



%%%%%%%%%%%%%
lat_indx=500;
V_on_lon_Depth=squeeze(tmp(:,lat_indx,:));  %this one extrats lon-depth slices
H_on_lon_Depth=squeeze(hFacC(:,lat_indx,:));  %this one extrats lon-depth slices

clf
subplot(211)
quikpcolor(squeeze(XC(:,1,1)),-dpt90,H_on_lon_Depth');colormap jet;
hold on;
plot(squeeze(XC(:,1,1)),-Depth(:,lat_indx),'k','linewidth',2);
thincolorbar
subplot(212)
quikpcolor(squeeze(XC(:,1,1)),-dpt90,V_on_lon_Depth');colormap jet;
caxis([-1 1]*.1);
hold on;
plot(squeeze(XC(:,1,1)),-Depth(:,lat_indx),'w','linewidth',2);
thincolorbar

