%make a movie of absolute velocity in the southern ocean

%define input
 ifil ='../dat/mod/yearly/ocean_temp_1916_08_21_21.nc'; 

%plotting details
 in=[-2.4:0.2:1.6];

%get grid once
 x=ncread(ifil,'xt_ocean');
 y=ncread(ifil,'yt_ocean');
 z=ncread(ifil,'st_ocean');
 [X,Y]=meshgrid(x,y); 

%some ini
 n=0;
 btemp = zeros(length(x),length(y))+NaN;
 
 t=ncread(ifil,'temp'); 
 I=find(t<-1e10); t(I)=NaN; t(I)=NaN;
 t=double(t);

for i=1:length(x)
 i
 for j=1:length(y)
  I=find(isnan(squee(t(i,j,:)))~=1);
  if length(I)>0 
   if z(I(end))<=1500
    btemp(i,j)=t(i,j,I(end));
   end
  end
 end
end


    figure; drawnow
          m_proj('stereographic','lat',-90,'long',0,'radius',28);
          hold on
          [xxtt,yytt]=m_ll2xy(X,Y);
          flat_pcolor(xxtt,yytt,btemp'), shading flat;
          amcolormap(jet,in); amcaxis(in);

          [cc]=amcolorbar('horiz',in);
          set(cc,'linewidth',2,'tickdir','out','fontweight','bold', ...
                  'xtick',in(1:2:end),'xticklabel',in(1:2:end),'position', ...
                  [0.130+0.15 0.1100+0.1 0.7750-0.3 0.0611/4], ...
                  'fontsize',10)
          m_grid('xtick',12,'tickdir','out','ytick',[-70:20:20],'linest','-', ...
                 'color','k','xticklabels',[],'yticklabels',[]);

          m_coast('patch',[0.7 0.7 0.7])
print -dtiff -r400 ../ps/bottomTempCo.tiff
 
