clear

fig_ps=[752 56 1537 1038];
cm=brewermap(64,'*Spectral'); 
figure(1)
set(gcf,'Position',fig_ps)

% AVISO SLA
nx=1440; ny=720;
dx=0.25;
lon=-179.8750:dx:180;
lat= -89.8750:dx:90;
ll=366;
sst_LLC2=zeros([nx ny ll],'single'); %raw
sst_LLC3=zeros([nx ny ll],'single'); %detided
ssh24=zeros([nx ny 24]);

fn2='AVISO_SLA/SSH_hourly_raw.bin';
fn3='AVISO_SLA/SSH_hourly_detided.bin';

for dy=1:ll
	mydisp(dy)
	ssh24=readbin(fn2,[nx ny 24],1,'real*4',dy-1);
	sst_LLC2(:,:,dy)=mean(ssh24,3);
end

for dy=1:ll
	mydisp(dy)
	ssh24=readbin(fn3,[nx ny 24],1,'real*4',dy-1);
	sst_LLC3(:,:,dy)=mean(ssh24,3);
end


for i=1:ll
%sst_mur = sst_MUR(:,:,i);
sst_llc2 = sst_LLC2(:,:,i);
sst_llc3 =sst_LLC3(:,:,i);
sst_dif = sst_llc2 -sst_llc3; %tide

dd=datestr(datenum(2020,2,28+i));

cx=subplot(221);
mypcolor(lon,lat,sst_llc2')
caxis([-1 1]*3)
thincb(1);
%colormap(cm)
colormap(cx,bluewhitered)
title(['raw SSH'])
plotland0

cx=subplot(223);
mypcolor(lon,lat,sst_llc3')
caxis([-1 1]*3)
thincb(1);
colormap(cx,bluewhitered)
title(['detide SSH'])
plotland0

cx=subplot(222);
mypcolor(lon,lat,sst_dif')
caxis([-1 1]*3);thincb(1);
colormap(cx,bluewhitered)
title(['raw - detide (=tide) SSH @' dd])
plotland0

cx=subplot(224);
mypcolor(lon,lat,sst_dif')
caxis([-1 1]*1);thincb(1);
colormap(cx,bluewhitered)
title(['raw - detide (=tide) SSH @' dd])
plotland0

print('-dpng',['fig_MUR_SST' myint2str(i,3)])
clf

end
