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=1:67;

UWND_DJF=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/UWND/ncfile/UWND_NCEP.nc','UWND_DJF');
VWND_DJF=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/VWND/ncfile/VWND_NCEP.nc','VWND_DJF');

UWND_MAM=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/UWND/ncfile/UWND_NCEP.nc','UWND_MAM');
VWND_MAM=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/VWND/ncfile/VWND_NCEP.nc','VWND_MAM');

WIND_DJF=sqrt(UWND_DJF.*UWND_DJF+VWND_DJF.*VWND_DJF);
WIND_MAM=sqrt(UWND_MAM.*UWND_MAM+VWND_MAM.*VWND_MAM);


save('WIND_NCEP.mat','WIND_DJF','WIND_MAM')

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