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

SSLTSF3_temp=ncread('~/Aerosol_Variaiton/IRUN/read_nc/ncfile/read_nc_SSLTSF.nc','SSLTSF3');
SSLTSF3_ANN=zeros(144,96,150);
SSLTSF3_ANN(:,:,:)=mean(SSLTSF3_temp,3);


save('SSLTSF3.mat','SSLTSF3_ANN')

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