clear all
close all

fid=fopen('mah_smooth_mth-2d.bin','r','b');
mah=fread(fid,'float32');
mah=reshape(mah,360,160,12);
fclose(fid);
fid=fopen('songmiao_mineral_mth-2d.bin','r','b');
songmin=fread(fid,'float32');
songmin=reshape(songmin,360,160,12);
fclose(fid);
fid=fopen('songmiao_solubile_mth-2d.bin','r','b');
songsol=fread(fid,'float32');
songsol=reshape(songsol,360,160,12);
fclose(fid);
fid=fopen('hamilton20_monthmeanSFe.bin','r','b');
hamisol=fread(fid,'float32');
hamisol=reshape(hamisol,360,160,12);
fclose(fid);
fid=fopen('mahowald2009_solubile_current_smooth_oce_mth-2d.bin','r','b');
mahsol=fread(fid,'float32');
mahsol=reshape(mahsol,360,160,12);
fclose(fid);
fid=fopen('fan_mineral_oce_mth-2d.bin','r','b');
fan=fread(fid,'float32');
fan=reshape(fan,360,160,12);
fclose(fid);
fid=fopen('fan_solubile_oce_mth-2d.bin','r','b');
fansol=fread(fid,'float32');
fansol=reshape(fansol,360,160,12);
fclose(fid);
fid=fopen('cassar_mineral_oce_mth-2d.bin','r','b');
cas=fread(fid,'float32');
cas=reshape(cas,360,160,12);
fclose(fid);
fid=fopen('cassar_solubile_oce_mth-2d.bin','r','b');
cassol=fread(fid,'float32');
cassol=reshape(cassol,360,160,12);
fclose(fid);






X=[.5:1:359.5];
Y=[-79.5:1:79.5];

mah_ann=squeeze(mean(mah,3));
songmin_ann=squeeze(mean(songmin,3));
songsol_ann=squeeze(mean(songsol,3));
hamisol_ann=squeeze(mean(hamisol,3));
mahsol_ann=squeeze(mean(mahsol,3));
cas_ann=squeeze(mean(cas,3));
cassol_ann=squeeze(mean(cassol,3));
fan_ann=squeeze(mean(fan,3));
fansol_ann=squeeze(mean(fansol,3));



filand=find(mah_ann==0);
conv=1e3*365*24*60*60

figure(1), hold off, subplot(1,1,1)
for it=1:9,
  if (it==1), 
    tmp=log10(.04*mah_ann*conv);
    titstr=['Mahowald 4% sol'];
  end % if it 1
  if (it==2),
    tmp=log10(.04*songmin_ann*conv);
    titstr=['Songmin 4% sol'];
  end % if it 2
  if (it==3),
    tmp=log10(songsol_ann*conv);
    titstr=['Songmin var sol'];
  end % if it 3
  if (it==4),
    tmp=log10(mahsol_ann*conv);
    titstr=['Mahowald 2009 var sol'];
  end % if it 3
  if (it==5),
    tmp=log10(hamisol_ann*conv);
    titstr=['Hamilton var sol'];
  end % if it 3
  if (it==6),
    tmp=log10(.04*fan_ann*conv);
    titstr=['Fan 4% sol'];
  end % if it 2
  if (it==7),
    tmp=log10(fansol_ann*conv);
    titstr=['Fan var sol'];
  end % if it 3
  if (it==8),
    tmp=log10(.04*cas_ann*conv);
    titstr=['Cassar 4% sol'];
  end % if it 2
  if (it==9),
    tmp=log10(cassol_ann*conv);
    titstr=['Cassar var sol'];
  end % if it 3


%%
  subplot(3,3,it)
  tmp(filand)=NaN;
  pcolor(X,Y,(tmp)'); 
  caxis([-3.5 .2]);
  shading flat, colorbar
  hold on
  contour(X,Y,tmp',[-2 -1 0],'k-');
% hold on, hp = gca ; hc = colorbar; axes(hc);
% set(gca,'Ytick',[-3 -2 -1 0 ]);
% set(gca,'YTickLabel',['1e-3';'1e-2';'1e-1';'1e0 ']); axes(hp),
%%
  title(titstr);
end % for it
