##COMPARISON OF MODELS TO HadCRU3v ###FUNCTIONS USED source("http://www.climateaudit.org/scripts/models/functions.collation.knmi.txt") #function to scrape from KNMI source("http://www.climateaudit.org/scripts/rahmstorf/functions.rahmstorf.txt") #emulation of Rahmstorf smooth #Load Hadcru source("http://www.climateaudit.org/scripts/spaghetti/hadcru3v.glb.txt") #hadcru3v, hadcru3v.ann had=hadcru3v.ann had_smooth= ssatrend(window(had,end=2008),M=11) #Rahmsmooth ## SCRAPE SELECTED MODEL email=Email= [##register and insert your email here logon=download_html( paste("http://climexp.knmi.nl/start.cgi?",Email,sep="")) # model alias scenario Runs #1 BCC CM1 bcc_cm1 20c3m 4 #2 BCCR BCM2.0 bccr_bcm2_0 20c3m 1 #4 CGCM3.1 (T47) cccma_cgcm3_1 20c3m 5 scenario="sresa1b" field="tas"; Info=knmi.info[knmi.info$scenario==scenario,] row.names(Info)=1:nrow(Info) Info #gives A1B models at KNMI ##Plot CCCMA plotf(2) ##Make PDF ##this requires that you make the directory first pdf(file="d:/climate/images/2009/models/models_vs_hadcru.pdf",width=5,height=5) for (i in 1:nrow(Info)) plotf(i,gdd=FALSE) #CCCMA dev.off() #this was then uploaded ##SHOW Triangular filter fred=ssatrend(window(had,end=2008),verbose="verbose") M=11 a=rep(sqrt(1/M),M) y=convolve(a,a,type="open")/M #library(GDD) #GDD(file="d:/climate/images/2009/models/tfilt.gif",type="gif", h=360,w=420) barplot( t( cbind(y,fred$tfilt) ),beside=TRUE,col=1:2) legend("topleft",fill=1:2,c("Triangular","Rahmstorf") ) #dev.off()