year=1948:2014;
lon=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/RH/dat/RHum.mon.mean.nc','lon');
lat=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/RH/dat/RHum.mon.mean.nc','lat');
load ~/Aerosol_Variaiton/IRUN/RH/ncfile/RH_NCEP.mat
load ~/Aerosol_Variaiton/IRUN/SST/ncfile/ENSO_year_NCEP.mat

RH_EN_temp=RH_ANN(:,:,EN_Year==1);
RH_LL_temp=RH_ANN(:,:,LL_Year==1);

RH_EN=mean(RH_EN_temp,3);
RH_LL=mean(RH_LL_temp,3);
h=zeros(144,73);
for i=1:144
    for j=1:73
        h(i,j)=ttest2(RH_EN_temp(i,j,:),RH_LL_temp(i,j,:));
    end
end

Diff_RH=RH_EN-RH_LL;

save('Diff_RH_NCEP_ENSO.mat','RH_EN','RH_LL','Diff_RH','h')

nccreate('Diff_RH_NCEP_ENSO.nc','lat','Dimensions',{'lat',73},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','lat', lat)
ncwriteatt('Diff_RH_NCEP_ENSO.nc','lat','units','degrees_north')
ncwriteatt('Diff_RH_NCEP_ENSO.nc','lat','long_name','Latitude')
nccreate('Diff_RH_NCEP_ENSO.nc','lon','Dimensions',{'lon',144},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','lon', lon)
ncwriteatt('Diff_RH_NCEP_ENSO.nc','lon','units','degrees_east')
ncwriteatt('Diff_RH_NCEP_ENSO.nc','lon','long_name','Longitude')
nccreate('Diff_RH_NCEP_ENSO.nc','RH_EN','Dimensions',{'lon',144,'lat',73},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','RH_EN', RH_EN)
nccreate('Diff_RH_NCEP_ENSO.nc','RH_LL','Dimensions',{'lon',144,'lat',73},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','RH_LL', RH_LL)
nccreate('Diff_RH_NCEP_ENSO.nc','Diff_RH','Dimensions',{'lon',144,'lat',73},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','Diff_RH', Diff_RH)
nccreate('Diff_RH_NCEP_ENSO.nc','h','Dimensions',{'lon',144,'lat',73},'Format','classic')
ncwrite('Diff_RH_NCEP_ENSO.nc','h', h)
ncdisp('Diff_RH_NCEP_ENSO.nc')