
% [Vm,~,~,~] = quikread_llc(fnamV,4320,1,'real*4','~dmenemen/llc_4320/grid/',-90,90,0,360);
% [Um,~,~,~] = quikread_llc(fnamU,4320,1,'real*4','~dmenemen/llc_4320/grid/',-90,90,0,360);
% [cs,~,~,~] = quikread_llc('~dmenemen/llc_4320/grid/AngleCS.data',4320,1,'real*4','~dmenemen/llc_4320/grid/',-90,90,0,360);
% [sn,~,~,~] = quikread_llc('~dmenemen/llc_4320/grid/AngleSN.data',4320,1,'real*4','~dmenemen/llc_4320/grid/',-90,90,0,360);

nx = 4320;
% for ii = 1 : length(Vm)
%     
%     if ii~= 3
%         %UV = sqrt(Vm{ii}.^2 + Um{ii}.^2);
%         Vn{ii} = sn{ii}.*Um{ii} + cs{ii}.*Vm{ii};
%         Un{ii} = cs{ii}.*Um{ii} - sn{ii}.*Vm{ii};
%         %UV = sqrt(Vm{ii}.^2 + Um{ii}.^2);
%       
%     end
% end  

landV = quikreadpcolor_llc('~dmenemen/llc_4320/grid/hFacS.data',nx);
landU = quikreadpcolor_llc('~dmenemen/llc_4320/grid/hFacW.data',nx);

fnamVm ='/nobackupp8/awinetee/global_4320/V_30hLPF_hamming_daily/V_4320x56160.2011-12-06';
fnamUm ='/nobackupp8/awinetee/global_4320/U_30hLPF_hamming_daily/U_4320x56160.2011-12-06';
[Um,Vm] = quikreadpcolor_uv_llc(fnamUm,fnamVm,nx);

Um(landU==0) = nan;
Vm(landV==0) = nan;

fig = figure('color','white','units','normalized','outerposition',[0 0 1 1],'name','1');
quikpcolor((sqrt(Um.^2 + Vm.^2))');
colormap([160/255 160/255 160/255 ; flipud(brewermap(256,'Spectral'))])

c = colorbar;
caxis([0 1])
title('Total Model (MITgcm) Velocity (1d avg)')
xlabel(c,'Velocity (m/s)')
set(get(gca,'title'),'fontsize',16);
a = get(c,'xlabel');
set(a,'fontsize',16);
set(gca,'xtick',[])
set(gca,'ytick',[])
daspect([1 1 1])
print('-dpng','-r600','magnitude_currents_4320.png')


fig = figure('color','white','units','normalized','outerposition',[0 0 1 1],'name','1');
quikpcolor(Vm');
c = colorbar;
caxis([-.5 .5])
title('V Model (MITgcm) Velocity for March 7, 2011 (1d avg)')
xlabel(c,'Velocity (m/s)')
set(get(gca,'title'),'fontsize',16);
a = get(c,'xlabel');
set(a,'fontsize',16);
set(gca,'xtick',[])
set(gca,'ytick',[])
daspect([1 1 1])
print('-dpng','-r300','V_global_mar_07_2011_2160.png')





figure(3)
quikpcolor(Eta');
colorbar
caxis([-2 2])
daspect([1 1 1])
title('Eta 9 day')
print('-dpng','-r600','eta_9day_global.png')
figure(4)
quikpcolor(Vout');
colorbar
caxis([-.3 1])
title('Vmit (model)')
daspect([1 1 1])
print('-dpng','-r600','Vmit_9day_global.png')

