load ~/NC/grid.mat
load ~/Aerosol_Variaiton/IRUN/WIND/ncfile/WIND.mat
year=1:150;

WIND_ANN_SD=zeros(144,96);
WIND_ANN_RSD=zeros(144,96);
WIND_DJF_SD=zeros(144,96);
WIND_DJF_RSD=zeros(144,96);
WIND_MAM_SD=zeros(144,96);
WIND_MAM_RSD=zeros(144,96);
WIND_JJA_SD=zeros(144,96);
WIND_JJA_RSD=zeros(144,96);
WIND_SON_SD=zeros(144,96);
WIND_SON_RSD=zeros(144,96);
WIND_JAN_SD=zeros(144,96);
WIND_JAN_RSD=zeros(144,96);
WIND_JUL_SD=zeros(144,96);
WIND_JUL_RSD=zeros(144,96);

for i=1:144
    for j=1:96
        WIND_ANN_SD(i,j)=std(WIND_ANN(i,j,:));
        WIND_ANN_RSD(i,j)=WIND_ANN_SD(i,j)./(mean(WIND_ANN(i,j,:),3));
        WIND_DJF_SD(i,j)=std(WIND_DJF(i,j,:));
        WIND_DJF_RSD(i,j)=WIND_DJF_SD(i,j)./(mean(WIND_DJF(i,j,:),3));
        WIND_MAM_SD(i,j)=std(WIND_MAM(i,j,:));
        WIND_MAM_RSD(i,j)=WIND_MAM_SD(i,j)./(mean(WIND_MAM(i,j,:),3));
        WIND_JJA_SD(i,j)=std(WIND_JJA(i,j,:));
        WIND_JJA_RSD(i,j)=WIND_JJA_SD(i,j)./(mean(WIND_JJA(i,j,:),3));
        WIND_SON_SD(i,j)=std(WIND_SON(i,j,:));
        WIND_SON_RSD(i,j)=WIND_SON_SD(i,j)./(mean(WIND_SON(i,j,:),3));
        WIND_JAN_SD(i,j)=std(WIND_JAN(i,j,:));
        WIND_JAN_RSD(i,j)=WIND_JAN_SD(i,j)./(mean(WIND_JAN(i,j,:),3));
        WIND_JUL_SD(i,j)=std(WIND_JUL(i,j,:));
        WIND_JUL_RSD(i,j)=WIND_JUL_SD(i,j)./(mean(WIND_JUL(i,j,:),3));
    end
end

save('WIND_SD_RSD.mat','WIND_ANN_SD','WIND_ANN_RSD','WIND_DJF_SD','WIND_DJF_RSD','WIND_MAM_SD','WIND_MAM_RSD','WIND_JJA_SD','WIND_JJA_RSD','WIND_SON_SD','WIND_SON_RSD','WIND_JAN_SD','WIND_JAN_RSD','WIND_JUL_SD','WIND_JUL_RSD')

nccreate('WIND_SD_RSD.nc','lat','Dimensions',{'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','lat', lat)
ncwriteatt('WIND_SD_RSD.nc','lat','units','degrees_north')
ncwriteatt('WIND_SD_RSD.nc','lat','long_name','Latitude')
nccreate('WIND_SD_RSD.nc','lon','Dimensions',{'lon',144},'Format','classic')
ncwrite('WIND_SD_RSD.nc','lon', lon)
ncwriteatt('WIND_SD_RSD.nc','lon','units','degrees_east')
ncwriteatt('WIND_SD_RSD.nc','lon','long_name','Longitude')
nccreate('WIND_SD_RSD.nc','WIND_ANN_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_ANN_SD', WIND_ANN_SD)
nccreate('WIND_SD_RSD.nc','WIND_ANN_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_ANN_RSD', WIND_ANN_RSD)
nccreate('WIND_SD_RSD.nc','WIND_DJF_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_DJF_SD', WIND_DJF_SD)
nccreate('WIND_SD_RSD.nc','WIND_DJF_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_DJF_RSD', WIND_DJF_RSD)
nccreate('WIND_SD_RSD.nc','WIND_MAM_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_MAM_SD', WIND_MAM_SD)
nccreate('WIND_SD_RSD.nc','WIND_MAM_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_MAM_RSD', WIND_MAM_RSD)
nccreate('WIND_SD_RSD.nc','WIND_JJA_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JJA_SD', WIND_JJA_SD)
nccreate('WIND_SD_RSD.nc','WIND_JJA_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JJA_RSD', WIND_JJA_RSD)
nccreate('WIND_SD_RSD.nc','WIND_SON_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_SON_SD', WIND_SON_SD)
nccreate('WIND_SD_RSD.nc','WIND_SON_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_SON_RSD', WIND_SON_RSD)
nccreate('WIND_SD_RSD.nc','WIND_JAN_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JAN_SD', WIND_JAN_SD)
nccreate('WIND_SD_RSD.nc','WIND_JAN_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JAN_RSD', WIND_JAN_RSD)
nccreate('WIND_SD_RSD.nc','WIND_JUL_SD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JUL_SD', WIND_JUL_SD)
nccreate('WIND_SD_RSD.nc','WIND_JUL_RSD','Dimensions',{'lon',144,'lat',96},'Format','classic')
ncwrite('WIND_SD_RSD.nc','WIND_JUL_RSD', WIND_JUL_RSD)
ncdisp('WIND_SD_RSD.nc')
