clear

fig_ps=[752 56 1537 1038];
cm=brewermap(64,'*Spectral'); 

% AVISO SLA
nx=1440; ny=720;
dx=0.25;
lon=-179.8750:dx:180;
lat= -89.8750:dx:90;
[LAT LON]=meshgrid(lat,lon);

fns=dir('AVISO_SLA/25km/AVISO_LLC_SLA_202*.mat');
ll=length(fns);
sst_MUR=zeros([nx ny ll],'single');
sst_LLC=zeros([nx ny ll],'single');

for i=1:ll
	fn=[fns(i).folder filesep fns(i).name];
	disp(fn)
	load(fn)
	sst_MUR(:,:,i) = sla_aviso;
	sst_LLC(:,:,i) = sla_llc;
	clear sla_aviso sla_llc
end

%two lines below for subtract annual mean:
sst_mur=nanmean(sst_MUR,3);
sst_MUR=sst_MUR-repmat(sst_mur,[1 1 ll]);
sst_mur=nanmean(sst_MUR,3);
sst_llc=nanmean(sst_LLC,3);
sst_DIF=sst_LLC-sst_MUR;

sst_dif=nanmean(sst_DIF,3);
sst_rms=sqrt(nanmean(sst_DIF.^2,3));


figure(1)
set(gcf,'Position',fig_ps)
ix=find(isnan(sst_dif));

cx=subplot(221);
mypcolor(lon,lat,sst_mur')
caxis([-1 1]*.5)
thincb(1);
%colormap(cm)
colormap(cx,bluewhitered)
title(['AVISO SLA'])
plotland0

cx=subplot(222);
mypcolor(lon,lat,sst_llc')
caxis([-1 1]*.5)
thincb(1);
colormap(cx,bluewhitered)
title(['LLC2160 SLA'])
plotland0

cx=subplot(223);
mypcolor(lon,lat,sst_dif')
caxis([-1 1]*.5);thincb(1);
colormap(cx,bluewhitered)
title(['mean LLC2160 - AVISO SLA'])
plotland0

cx=subplot(224);
mypcolor(lon,lat,sst_rms')
caxis([0 .5]);thincb(1);
colormap(cx,jet)
title(['rms LLC2160 - AVISO SLA'])
plotland0

%print('-dpng',['fig_AVISO_SLA'])

