year=2001:2016;
lat=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','lat');
lon=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','lon');
area=ncread('/Users/yangyang/NC/area_1X1.nc','gridbox_area');

sfc_net_sw_all_mon=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','sfc_net_sw_all_mon');
sfc_net_lw_all_mon=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','sfc_net_lw_all_mon');

FSNS_DJF=sfc_net_sw_all_mon(:,:,10:12:192);
FLNS_DJF=sfc_net_lw_all_mon(:,:,10:12:192);

FNS_DJF=FSNS_DJF+FLNS_DJF;


save('FNS_2001_2016_12.mat','FSNS_DJF','FLNS_DJF','FNS_DJF')

nccreate('FNS_2001_2016_12.nc','lat','Dimensions',{'lat',180},'Format','classic')
ncwrite('FNS_2001_2016_12.nc','lat', lat)
ncwriteatt('FNS_2001_2016_12.nc','lat','units','degrees_north')
ncwriteatt('FNS_2001_2016_12.nc','lat','long_name','Latitude')
nccreate('FNS_2001_2016_12.nc','lon','Dimensions',{'lon',360},'Format','classic')
ncwrite('FNS_2001_2016_12.nc','lon', lon)
ncwriteatt('FNS_2001_2016_12.nc','lon','units','degrees_east')
ncwriteatt('FNS_2001_2016_12.nc','lon','long_name','Longitude')
nccreate('FNS_2001_2016_12.nc','FSNS_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNS_2001_2016_12.nc','FSNS_DJF', FSNS_DJF)
nccreate('FNS_2001_2016_12.nc','FLNS_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNS_2001_2016_12.nc','FLNS_DJF', FLNS_DJF)
nccreate('FNS_2001_2016_12.nc','FNS_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNS_2001_2016_12.nc','FNS_DJF', FNS_DJF)
ncdisp('FNS_2001_2016_12.nc')