%make a movie of sea-ice thickness southern ocean

%define input
 ifil='../../data/processed/ocean_bling_1993_1998_reference.nc'


%plotting details
 xlims=[0 360];
 ylims=[-78.15 -20];
 in=[0 0.05 0.2:0.2:1 1.5 2 2.5];
 cla=[1 3:1:length(in)];

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

%some ini
 n=0;

 D=ncread(ifil,'po4_b'); 
 D=squeeze(D(:,:,1));

 I=find(D<=0); D(I)=NaN; 
 D=double(D).*1e6;
    n=n+1;
    figure; drawnow
        % m_proj('Mercator','long',xlims,'lat', ylims);
          m_proj('stereographic','lat',-90,'long',0,'radius',60);
          hold on
          [xxtt,yytt]=m_ll2xy(X,Y);
          flat_pcolor(xxtt,yytt,squee(D(:,:,1))'), shading flat;
          amcolormap(jet,in); amcaxis(in);

          [cc]=amcolorbar('horiz',in);
          set(cc,'linewidth',2,'tickdir','out','fontweight','bold', ...
                  'xtick',in(cla),'xticklabel',in(cla),'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:30:20],'linest','-', ...
                 'color','k','xticklabels',[],'yticklabels',[]);

          m_coast('patch',[0.7 0.7 0.7])
          legend('off')
  brighten(0.2)
  print -dtiff ../ps/PO4Surf1993_1998.tiff 
  close
