load ~/NC/grid
load ~/NC/area_1.9_2.5.mat
year=1:150;

SSLTSF1_temp=ncread('~/Aerosol_Variaiton/IRUN/read_nc/ncfile/read_nc_SSLTSF.nc','SSLTSF1');
SSLTSF1_ANN=zeros(144,96,150);
SSLTSF1_ANN(:,:,:)=mean(SSLTSF1_temp,3);


save('SSLTSF1.mat','SSLTSF1_ANN')

nccreate('SSLTSF1.nc','Year','Dimensions',{'time',Inf},'Format','classic')
ncwrite('SSLTSF1.nc','Year', year)
ncwriteatt('SSLTSF1.nc','Year','long_name','Year')
nccreate('SSLTSF1.nc','lat','Dimensions',{'lat',96},'Format','classic')
ncwrite('SSLTSF1.nc','lat', lat)
ncwriteatt('SSLTSF1.nc','lat','units','degrees_north')
ncwriteatt('SSLTSF1.nc','lat','long_name','Latitude')
nccreate('SSLTSF1.nc','lon','Dimensions',{'lon',144},'Format','classic')
ncwrite('SSLTSF1.nc','lon', lon)
ncwriteatt('SSLTSF1.nc','lon','units','degrees_east')
ncwriteatt('SSLTSF1.nc','lon','long_name','Longitude')
nccreate('SSLTSF1.nc','SSLTSF1_ANN','Dimensions',{'lon',144,'lat',96,'year',length(year)},'Format','classic')
ncwrite('SSLTSF1.nc','SSLTSF1_ANN', SSLTSF1_ANN)
ncdisp('SSLTSF1.nc')