# co2warming_read_graph.R 2019-09-16 MASUDA Kooiti # # Making a simple graph of a result of # a simple energy balance model of global warming (relaxation to steady state response tempearture) ##### Constants tssrdouble <- 3 # steady state response temp. to CO2 doubling [K] relax <- 1.5 # relaxation coefficient [W/(m2 K)] depth <- 500 # depth of layer of water [m] kscenario <- 2 # 1:RCP2.6, 2:RCP4.5, 3:RCP6.0, 4:RCP8.5 ##### Reading data infilename <- "co2warming_rcp45_depth500_tssrdouble3_relax1_5.txt" df <- read.table(infilename, header=T, sep=" ") ##### Graph plot(df$time, df$temp, las=1, ylim=c(0, 8), xlab="Year", ylab="Temperature (deg.C, base year 1850)", main="Temperature, actual (circles) and steady-state response (triangles)" ) points(df$time, df$tssr, pch=2) text(2010, 7.5, "Scenario:", adj=0) str_scenario = c("RCP 2.6", "RCP 4.5", "RCP 6.0", "RCP 8.5") text(2090, 7.5, str_scenario[kscenario], adj=1) text(2010, 7.0, "Depth:", adj=0) str_plot = paste(sprintf("%7.1f", depth), " m") text(2090, 7.0, str_plot, adj=1) text(2010, 6.5, "TSSR_double:", adj=0) str_plot = paste(sprintf("%6.2f", tssrdouble), " K") text(2090, 6.5, str_plot, adj=1) text(2010, 6.0, "Relax. coef.:", adj=0) str_plot = paste(sprintf("%6.2f", relax), " W / m2 K") text(2090, 6.0, str_plot, adj=1)