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');
month=1:168;

SST_MONTH=ncread('~/Aerosol_Variaiton/IRUN/SST/ncfile/SST_monthly_NCEP.nc','SST_MONTH');

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

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

nccreate('NINO34_monthly_NCEP.nc','Month','Dimensions',{'time',Inf},'Format','classic')
ncwrite('NINO34_monthly_NCEP.nc','Month', month)
ncwriteatt('NINO34_monthly_NCEP.nc','Month','long_name','Month')
nccreate('NINO34_monthly_NCEP.nc','NINO34','Dimensions',{'month',length(month)},'Format','classic')
ncwrite('NINO34_monthly_NCEP.nc','NINO34', NINO34)
ncdisp('NINO34_monthly_NCEP.nc')