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_clr_mon=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','sfc_net_sw_clr_mon');
sfc_net_lw_clr_mon=ncread('/Users/yang146/Aerosol_Variaiton/CERES/dat/CERES_EBAF-Surface_Ed2.8_Subset_200003-201602.nc','sfc_net_lw_clr_mon');

FSNSC_DJF=(sfc_net_sw_clr_mon(:,:,10:12:192)+sfc_net_sw_clr_mon(:,:,11:12:192)+sfc_net_sw_clr_mon(:,:,12:12:192))/3;
FLNSC_DJF=(sfc_net_lw_clr_mon(:,:,10:12:192)+sfc_net_lw_clr_mon(:,:,11:12:192)+sfc_net_lw_clr_mon(:,:,12:12:192))/3;

FNSC_DJF=FSNSC_DJF+FLNSC_DJF;


save('FNSC_2001_2016_DJF.mat','FSNSC_DJF','FLNSC_DJF','FNSC_DJF')

nccreate('FNSC_2001_2016_DJF.nc','lat','Dimensions',{'lat',180},'Format','classic')
ncwrite('FNSC_2001_2016_DJF.nc','lat', lat)
ncwriteatt('FNSC_2001_2016_DJF.nc','lat','units','degrees_north')
ncwriteatt('FNSC_2001_2016_DJF.nc','lat','long_name','Latitude')
nccreate('FNSC_2001_2016_DJF.nc','lon','Dimensions',{'lon',360},'Format','classic')
ncwrite('FNSC_2001_2016_DJF.nc','lon', lon)
ncwriteatt('FNSC_2001_2016_DJF.nc','lon','units','degrees_east')
ncwriteatt('FNSC_2001_2016_DJF.nc','lon','long_name','Longitude')
nccreate('FNSC_2001_2016_DJF.nc','FSNSC_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNSC_2001_2016_DJF.nc','FSNSC_DJF', FSNSC_DJF)
nccreate('FNSC_2001_2016_DJF.nc','FLNSC_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNSC_2001_2016_DJF.nc','FLNSC_DJF', FLNSC_DJF)
nccreate('FNSC_2001_2016_DJF.nc','FNSC_DJF','Dimensions',{'lon',360,'lat',180,'year',length(year)},'Format','classic')
ncwrite('FNSC_2001_2016_DJF.nc','FNSC_DJF', FNSC_DJF)
ncdisp('FNSC_2001_2016_DJF.nc')