load ~/NC/grid
day=1:92;

PRECT_temp=ncread('~/Aerosol_Variaiton/IRUN/read_nc/ncfile/read_nc_PREC_daily.nc','PRECT')*1e3*60*60*24;
PRECT_DAILY=PRECT_temp(:,:,152:243);

save('PRECT_daily.mat','PRECT_DAILY')

nccreate('PRECT_daily.nc','Day','Dimensions',{'time',Inf},'Format','classic')
ncwrite('PRECT_daily.nc','Day', day)
ncwriteatt('PRECT_daily.nc','Day','long_name','Day')
nccreate('PRECT_daily.nc','lat','Dimensions',{'lat',96},'Format','classic')
ncwrite('PRECT_daily.nc','lat', lat)
ncwriteatt('PRECT_daily.nc','lat','units','degrees_north')
ncwriteatt('PRECT_daily.nc','lat','long_name','Latitude')
nccreate('PRECT_daily.nc','lon','Dimensions',{'lon',144},'Format','classic')
ncwrite('PRECT_daily.nc','lon', lon)
ncwriteatt('PRECT_daily.nc','lon','units','degrees_east')
ncwriteatt('PRECT_daily.nc','lon','long_name','Longitude')
nccreate('PRECT_daily.nc','PRECT_DAILY','Dimensions',{'lon',144,'lat',96,'day',length(day)},'Format','classic')
ncwrite('PRECT_daily.nc','PRECT_DAILY', PRECT_DAILY)
ncdisp('PRECT_daily.nc')