#RAOBCORE VERSION 1.4 #see commentary in raobcore.txt get.raobcore.trp=function() { loc="ftp://srvx6.img.univie.ac.at/pub/raobcore14_gridded_2008.nc" download.file(loc,"zonal.nc",mode="wb") v<-open.ncdf("zonal.nc") v$var[[1]]$dim[2][[1]]$vals #anomalies # 85 75 65 55 45 35 25 15 5 -5 -15 -25 -35 -45 -55 -65 -75 -85 instr <- getx.var.ncdf( v, v$var[[1]]) # 1850 2006 dim(instr) # 36 18 12 612 temp= abs(v$var[[1]]$dim[2][[1]]$vals)<20;sum(temp) #4 instr=instr[,temp,,];dim(instr) # 36 4 12 612 instr=aperm(instr,c(4,1,2,3)); dim(instr) # 588 36 4 12 dim0=dim(instr) instr=array(instr,dim=c(dim0[1],144,12) ); dim(instr) # 612 144 12 raobcore= ts( array (NA,dim=c(dim0[1],12) ),start= 1958,freq=12); tsp(raobcore) # 1958.000 2008.917 12.000 for(i in 1:12) raobcore[,i]= apply(instr[,,i],1,mean,na.rm=T) dimnames(raobcore)[[2]]=v$var[[1]]$dim[3][[1]]$vals # 850 700 500 400 300 250 200 150 100 70 50 30 raobcore=round(raobcore,3) return(raobcore) }