load /Users/yang146/Aerosol_Variaiton/OBS/ncfile/Dust_1981_2007.mat
year=1981:2007;

WIND_year=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/WIND/ncfile/WIND_NCEP_10th_1981_2007.nc','WIND_year');

dust_weak_temp=zeros(length(lon_site),3);

n=0;
for yearID=1:length(year)
    if WIND_year(yearID)==1
        n=n+1;
        dust_weak_temp(:,n)=dust(:,yearID);
    end
end
dust_weak=mean(dust_weak_temp,2);
dust_aveg=mean(dust,2);
dust_diff=dust_weak-dust_aveg;

dust_diff(dust_diff==0)=-999;


save('Dust_10th_1981_2007','dust_weak','dust_aveg','dust_diff','lon_site','lat_site')



nccreate('Dust_10th_1981_2007.nc','lat','Dimensions',{'site',length(lat_site)},'Format','classic')
ncwrite('Dust_10th_1981_2007.nc','lat', lat_site)
ncwriteatt('Dust_10th_1981_2007.nc','lat','units','degrees_north')
ncwriteatt('Dust_10th_1981_2007.nc','lat','long_name','Latitude')
nccreate('Dust_10th_1981_2007.nc','lon','Dimensions',{'site',length(lat_site)},'Format','classic')
ncwrite('Dust_10th_1981_2007.nc','lon', lon_site)
ncwriteatt('Dust_10th_1981_2007.nc','lon','units','degrees_east')
ncwriteatt('Dust_10th_1981_2007.nc','lon','long_name','Longitude')
nccreate('Dust_10th_1981_2007.nc','dust_weak','Dimensions',{'site',length(lat_site)},'Format','classic')
ncwrite('Dust_10th_1981_2007.nc','dust_weak', dust_weak)
nccreate('Dust_10th_1981_2007.nc','dust_aveg','Dimensions',{'site',length(lat_site)},'Format','classic')
ncwrite('Dust_10th_1981_2007.nc','dust_aveg', dust_aveg)
nccreate('Dust_10th_1981_2007.nc','dust_diff','Dimensions',{'site',length(lat_site)},'Format','classic')
ncwrite('Dust_10th_1981_2007.nc','dust_diff', dust_diff)






                
    