load ~/NC/grid
month=1:1800;

SST_MONTH=ncread('~/Aerosol_Variaiton/ERUN/SST/ncfile/SST_monthly.nc','SST_MONTH');

NINO34=zeros(length(month),1);
NINO34(:)=mean(mean(SST_MONTH(77:97,46:51,:),2),1);


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

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