function process_cloud_fraction(fileName)
% question: is cloud fraction > 50%?
% question: is cloud fraction in 2006-7 > cloud fraction in 2011-12?
% What is greater, the liquid cloud fraction or the ice cloud fraction?


info=hdfinfo(fileName);
datacfl=double(hdfread(fileName,'Cloud_Fraction_Liquid_FMean'));
datacfi=double(hdfread(fileName,'Cloud_Fraction_Ice_FMean'));

datacfl(find(datacfl(:)==-9999))=NaN;
datacfi(find(datacfi(:)==-9999))=NaN;

datacfl=datacfl./1e4;
datacfi=datacfi./1e4;

ind=findstr(fileName,'MOD08_M3.');

fileName1=['C',fileName((ind+10):(ind+16)),'_liquid.csv'];
fileName2=['C',fileName((ind+10):(ind+16)),'_ice.csv'];
fileName3=['C',fileName((ind+10):(ind+16)),'_all.csv'];


long=[NaN, -179.5:1:179.5];
lat=89.5:-1:-89.5;
dat=[lat',datacfl];dat=[long;dat];
csvwrite(fileName1,dat);

dat=[lat',datacfi];dat=[long;dat];
csvwrite(fileName2,dat);

dat=[lat',datacfl+datacfi];dat=[long;dat];
csvwrite(fileName3,dat);

str1=['!rm ',fileName];
eval(str1);

