lon=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/SST/dat/air.mon.mean.nc','lon');
lat=ncread('/Users/yangyang/Aerosol_Variaiton/IRUN/SST/dat/air.mon.mean.nc','lat');
year=1:14;

SST_YEAR=ncread('~/Aerosol_Variaiton/IRUN/SST/ncfile/SST_NCEP.nc','SST_ANN');

NINO34=zeros(length(year),1);
NINO34(:)=mean(mean(SST_YEAR(77:97,35:39,:),2),1);   %120W?170W, 5S?5N

save('NINO34_yearly_NCEP.mat','NINO34')

nccreate('NINO34_yearly_NCEP.nc','Year','Dimensions',{'time',Inf},'Format','classic')
ncwrite('NINO34_yearly_NCEP.nc','Year', year)
ncwriteatt('NINO34_yearly_NCEP.nc','Year','long_name','Year')
nccreate('NINO34_yearly_NCEP.nc','NINO34','Dimensions',{'year',length(year)},'Format','classic')
ncwrite('NINO34_yearly_NCEP.nc','NINO34', NINO34)
ncdisp('NINO34_yearly_NCEP.nc')