clear

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



% WOA18
colormap(cm)
load WOA18/WOA_LLC_temp.mat
load WOA18/WOA_LLC_salt.mat

%grid
dx=1/4;
lon=-180+dx/2:dx:180;
lat= -90+dx/2:dx:90;
dpt=[0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 550 600 650 700 750 800 850 900 950 1000 1050 1100 1150 1200 1250 1300 1350 1400 1450 1500 1550 1600 1650 1700 1750 1800 1850 1900 1950 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500];
[LAT LON]=meshgrid(lat,lon);



depth=[5 100 300 900 2000];
kk=depth;
for i=1:5
kk(i)=closest(depth(i),dpt);
disp([depth(i) dpt(kk(i))])
end

%%
ccmn={[-2 30], [-2 26], [0 16], [0 8], [-.5 3.5]};
ccdd=[2 2 1.5 1.0 0.5];
for i=1:5
k=kk(i);
figure(i)
set(gcf,'Position',fig_ps)
obs1=temp_woa(:,:,k); mod1=temp_llc(:,:,k);
ix=find(isnan(obs1)|isnan(mod1));
subplot(221);
mypcolor(lon,lat,obs1')
caxis(ccmn{i})
thincb(1);
colormap(cm)
title(['WOA18 temp @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

subplot(222)
mypcolor(lon,lat,mod1')
caxis(ccmn{i})
thincb(1);
colormap(cm)
title(['LLC2160 temp @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

cx=subplot(223);
mypcolor(lon,lat,mod1'-obs1')
caxis([-1 1]*ccdd(i));thincb(1);
colormap(cx,bluewhitered)
title(['LLC2160 - WOA18 temp @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

%print('-dpng',['fig_WOA18_T_' num2str(dpt(i))])
end
%%

%{
ccmn={[32 38], [33 37], [34.0 36.2], [34.2 35.6], [34.6 35.2]};
ccdd=[2 1.2 0.6 0.2 0.1];
for i=1:5
k=kk(i);
figure(i)
set(gcf,'Position',fig_ps)
obs1=salt_woa(:,:,k); mod1=salt_llc(:,:,k);
ix=find(isnan(obs1)|isnan(mod1));
subplot(221);
mypcolor(lon,lat,obs1')
caxis(ccmn{i})
thincb(1);
colormap(cm)
title(['WOA18 salt @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

subplot(222)
mypcolor(lon,lat,mod1')
caxis(ccmn{i})
thincb(1);
colormap(cm)
title(['LLC2160 salt @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

cx=subplot(223);
mypcolor(lon,lat,mod1'-obs1')
caxis([-1 1]*ccdd(i));
thincb(1);
colormap(cx,bluewhitered)
title(['LLC2160 - WOA18 salt @' num2str(dpt(k)) 'm'])
%hold on
%plot(LON(ix),LAT(ix),'.','Color',[1 1 1]*.6,'MarkerSize',1e-4)
plotland0

%print('-dpng',['fig_WOA18_S_' int2str(i)])
end
%}

