#COLLATION OF HADCRU2 INTO R TABLE #August 2005 download produces and saves R-table of 1791 months from Jan 1856 to Mar 2005 and 2592 columns # columns are 2592 5x5 degreee grdicells, big hand: 26 lat bands N to S; little hand 72 long bands W to E (from dateline) #changes -9999 to NA #some of these steps take a few minutes since the dataset is large #this only goes to c(2005,3) as at August 15, 2005 ############################# #Download Jones data from http://www.cru.uea.ac.uk/ftpdata/hadcrut2.dat.gz #Unzip ############################# #DO IN TWO PARTS: THIS COULD ALL BE DONE IN ONE STEP WITH A LITTLE BETTER COMPUTER THAN I HAVE ###################################### ##FIRST HALF N<-75 loc<-"c:/temp/hadcrut2/hadcrut2.dat" h<-readLines(loc,n=128) #this does not have count line like CRUtem does v<-scan(loc,n=36*75*12*N) #Read 2430000 items months<-12*N v[1] #1851 length(v) v<-array(v, dim=c(75,length(v)/75)) #t temp<-(v[3,]==1) sum(!temp) #0 v<-v[4:75,] # 72 33696 ##column 1 is year; column 2 is latitude group 1,,,36 north to south; column 3 is field in which 1=temperature; columns 4,..,75 are temperature anomalies for longitude groups 1,...72 from west to east (178.5W to 178.5E ##NA values indicated by -9999 #REPLACE -9999 WITH NA marker<- -9000 temp<- (v