##SCRIPT TO READ MANN DATA AND STORE AS R-TABLES # an updated collation script is used for MM05 # downloads and collates the following. Save commands are commented out, but can be easily restored. #temperature eigenvectors - eof.tab #temperature PCs - pc.tab #temperature eigenvalues - lambda.tab #MBH gridpoints - grid2.tab #PCa weights - pca.weights.tab #5 reconstructed temperature PCs- rpc.tab #NH reconstruction - nhmann.tab #reconstruction weights - weights1.txt #gridcell standard deviations - grid2 #MBH cells with no CRU values - nil #calculated from Jones data #gridcell st dev from CRU - mann.scale #calcualted from Jones data ##COLLATION OF MBH DATA ## EOFs #load 16 EOFs dim 16x1082 #this is also at Corrigendum SI #Sept 2004 url<-"ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS" eof<-array(rep(NA,16*1082),dim=c(1082,16)) id<-c("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16") for ( k in 1: 16 ) { loc<-file.path(url,paste("eof",id[k],".out",sep="")) eof[,k]<-read.table(loc)[,2] } dimnames(eof)[[2]]<-paste("PC",id) ###PCs #note: although PC decomposition is on monthly data from 1902-1993, this is annual data # zeroed to 1902-1980 (matching regression against proxies) # some care has to be taken here #this is also at Corrigendum SI loc1<-c(paste("0",1:9,sep=""),paste("1",0:6,sep="")) loc<-file.path("ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS",paste("pc",loc1,".out",sep="")) pc<-NULL; for (m in 1:16) { g<-read.table(loc[m]) stemp<-g[,2] pc<-cbind(pc,stemp); } dimnames(pc)[[2]]<-paste("PC",loc1) ##EIGENVALUES #also at Corrigendum SI #col1-eigenvector; col2 - standard deviation; col 3- % of total variance; col4 - cumulative pct of total variance loc1<-"ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/tpca-eigenvals.out"; lambda<-scan(file=loc1,n=1082*4,skip=0); lambda<-t(array(lambda,dim=c(4,1082))); ##GRIDPOINTS - SAVE AS TABLE WITH JONES GRID BOXES loc1<-"ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/gridpoints.loc" grid2<-read.table(file=loc1) ##the dimension is 1082x5 and is read as a data.frame ##this corresponds to Mann's 1082 locations #col1 is long index 1,...72 from Greenwich going east; col 2 lat index 1,..36 going N to S; col 3 is grid-box long centre; col 4 is grid-box lat centre; #the Mann lat index is the sames as the Jones lat index; #this script puts Jones long index in col 5 for (i in 1:1082) { latgp<-grid2[i,2];longgp<-grid2[i,1]; if (longgp>36) longgp<-grid2[i,1]-36 else longgp<-grid2[i,1]+36;#converts Mann long-gp to Jones long-gp grid2[i,5]<-72*(latgp-1)+longgp;###saves series # for reference to Jones data } # this is inelegant but I couldn't find mod-function in R #save(grid2,file="c:/climate/data/mann/gridpoints.tab") ##PCA WEIGHTS loc1<-"ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/pca-weights.out"; pcaweights<-scan(file=loc1,n=128*2,skip=0); pcaweights<-t(array(pcaweights,dim=c(2,128))); #save(pcaweights,file="c:/climate/data/mann/pcaweights.tab") ###RECONSTRUCTED PC FROM 1400 TO 1980 (VARYING FIRST YEARS) loc<-c("ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/rpc01.dat", "ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/rpc02.dat", "ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/rpc03.dat", "ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/rpc04.dat", "ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/EIGENVECTORS/rpc05.dat") rpcyear1<-c(1400,1450,1750,1760,1450) n<-1981-rpcyear1; k<-rpcyear1-1399; rpc<-c(rep(NA,581*5)); rpc<-array(rpc,dim=c(5,581)); dim(rpc); for (m in 1:5) { skip1<-1; s<-scan(file=loc[m],n=581*2,skip=skip1); s<-array(s,dim=c(2,n[m])); rpc[m,k[m]+0:(n[m]-1)]<-s[2,]; } rpc<-t(rpc); rpc<-ts(rpc,start=1400,end=1980);##possible conversion to ts format locf<-"c:/climate/data/mann/rpc.tab"; #save(rpc,file=locf); ###NH MEAN 1400-1995 #note: in earlier download this was only to 1995. loc1<-"ftp://eclogite.geo.umass.edu/pub/mann/MANNETAL98/nhmean.dat"; nhmann<-read.table(loc1,skip=1,fill=TRUE) b<-c("year","NH.RECON","NH.RAW","-1.sigma","-2.sigma","+1.sigma","+2.sigma") dimnames(nhmann)[[2]]<-b ##col1-year; col2- NH reconstruction; col3-NH -raw; col4- minus 1 sigma; col5- minus 2 sigma; col6- plus 1 sigma; col7 -plus 2 sigma nhmann[582:599,c(2,4,5,6,7)]<-NA nhmann[1:502,3]<-NA locf<-"c:/climate/data/mann/nhmann.tab"; #save(nhmann,file=locf); ###WEIGHTS IN RECONSTRUCTION #these match wieghts in original email and provide public location. Impossible to tell that these weights are used and not mentioned in Corrigendum: Apr 06 #g<-read.table("ftp://holocene.evsc.virginia.edu/pub/MBH98/PCS/multiproxy.inf") #temp<-(g[,1]<0); weights1<-g[!temp,1] #blocked for me weights1<-scan("http://www.climate2003.com/data/MM03/weights.txt",skip=1) ##GRIDPOINT STANDARD DEVIATIONS #these were not archived originally and original temperature data not then available #so CRU data from summer 2003 was downloaded and standard deviations calculated #see read.jones.txt for this #4 cells had NO data and logical vector keeps track of this mann.scale<-c(read.table("c:/climate/data/mann/mann.scale.txt")) nil<-c(read.table("c:/climate/data/mann/nil.txt")) #these are 4 cells with NO values in updated CRU