lon=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/UWND/dat/uwnd.mon.mean.nc','lon');
lat=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/UWND/dat/uwnd.mon.mean.nc','lat');
year=1980:2015;

WIND_year=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/WIND/ncfile/WIND_NCEP_10th.nc','WIND_year');
VWND=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/VWND/ncfile/VWND_NCEP.nc','VWND_DJF');

VWND_ECHINA=zeros(length(year),1);
VWND_ECHINA(:)=mean(mean(VWND(45:50,19:29,length(year)-35:length(year)),2),1);

VWND_weak_temp=zeros(length(lon),length(lat));
VWND_ECHINA_weak=0;
n=0;
for yearID=length(year)-35:length(year)
    if WIND_year(yearID)==1
        n=n+1;
        VWND_weak_temp(:,:,n)=VWND(:,:,yearID);
        VWND_ECHINA_weak=VWND_ECHINA_weak+VWND_ECHINA(yearID)/sum(WIND_year);
    end
end
VWND_weak=mean(VWND_weak_temp,3);

VWND_aveg=mean(VWND(:,:,length(year)-35:length(year)),3);
VWND_diff=VWND_weak-VWND_aveg;

VWND_ECHINA_aveg=mean(VWND_ECHINA);
VWND_ECHINA_diff=VWND_ECHINA_weak-VWND_ECHINA_aveg;

save('VWND_NCEP_10th_1980_2015.mat','VWND_weak','VWND_aveg','VWND_diff')

nccreate('VWND_NCEP_10th_1980_2015.nc','lat','Dimensions',{'lat',length(lat)},'Format','classic')
ncwrite('VWND_NCEP_10th_1980_2015.nc','lat', lat)
ncwriteatt('VWND_NCEP_10th_1980_2015.nc','lat','units','degrees_north')
ncwriteatt('VWND_NCEP_10th_1980_2015.nc','lat','long_name','Latitude')
nccreate('VWND_NCEP_10th_1980_2015.nc','lon','Dimensions',{'lon',length(lon)},'Format','classic')
ncwrite('VWND_NCEP_10th_1980_2015.nc','lon', lon)
ncwriteatt('VWND_NCEP_10th_1980_2015.nc','lon','units','degrees_east')
ncwriteatt('VWND_NCEP_10th_1980_2015.nc','lon','long_name','Longitude')
nccreate('VWND_NCEP_10th_1980_2015.nc','VWND_weak','Dimensions',{'lon',length(lon),'lat',length(lat)},'Format','classic')
ncwrite('VWND_NCEP_10th_1980_2015.nc','VWND_weak', VWND_weak)
nccreate('VWND_NCEP_10th_1980_2015.nc','VWND_aveg','Dimensions',{'lon',length(lon),'lat',length(lat)},'Format','classic')
ncwrite('VWND_NCEP_10th_1980_2015.nc','VWND_aveg', VWND_aveg)
nccreate('VWND_NCEP_10th_1980_2015.nc','VWND_diff','Dimensions',{'lon',length(lon),'lat',length(lat)},'Format','classic')
ncwrite('VWND_NCEP_10th_1980_2015.nc','VWND_diff', VWND_diff)
ncdisp('VWND_NCEP_10th_1980_2015.nc')