Processing output from Global Circulation Models 2
After setting up cdo and netcdf you need to download some scenarios from cera.
The distribution modelling project we are working on is looking at a wide range of simulations in order to look at the effects of credible patterns of change in the global climate on tree species diversity in MesoAmerica. There are still relatively few simulations that have specifically represented the new emisions scenarios in the IPCC fourth assessment report. Many of the available model data sets were derived using the Special Report on Emission Scenarios (IPCC 2000, SRES).
The SRES data sets were classified into four different scenario families (A1, A2, B1, B2).
SRES. The A2 storyline describes a very heterogeneous world with the underlying theme of self-reliance and preservation of local identities. It results in this scenario a continous increasing population together with a slower economic growth and technological change. The Hadley Centre Circulation Model is a 3-dim AOGCM described by (Gordon et al., 2000 and Pope et al., 2000).
The atmospheric component has a 19 levels horizontal resolution, comparable with spectral resolution of T42, while the ocean component has a 20 levels resolution. HADCM3(http://www.meto.gov.uk/research/hadleycentre/models/HadCM3.html )
Here I will show a simple use way to look at the HADCM3_A2 scenario in R.
For simple interpretation and use of climate model output three variables are of most interest. Maximum temperature, minimum temperature and precipitation. A great deal of processing can be done in cdo,but here we move the precipitation data set to R using cdo to rewrite the file in netcdf format.
cdo -f nc copy HADCM3_A2_prec_1-1800.grb HADCM3_A2_prec_1-1800.nc
Now in R we can open the file using ncdf.
library(ncdf)
library(maptools)
library(maps)
library(RColorBrewer)
prec.nc <- open.ncdf(”HADCM3_A2_prec_1-1800.nc”)
x <-get.var.ncdf( prec.nc, “lon”)
y <-get.var.ncdf( prec.nc, “lat”)
z<- get.var.ncdf( prec.nc, “var61″)
time <-get.var.ncdf( prec.nc, “time”)
This reads all the data in. Notice that this global grid is quite a low resolution so the whole simulation can be read into memory in one go. Subsets of netcdf files can be taken if they are larger.
The order of the x and y vector has to be changed to be strictly ascending and the matrix rearranged accordingly.
z<-z[,73:1,]
y<-sort(y)
x[x>180]<- (-(360-x[x>180]))
xorder<-order(x)
z<-z[xorder,,]
x<-sort(x)
Now we can average the first fifty years monthly precipitation and subtract this from each month’s simulated precipitation in order to show the simulated pattern of rainfall anomalies over the next fifty years.
for (i in 600:1200){
j<-i%%12;j[j<1]<-12
a<-seq(j,600,by=12)
aa<-apply(z[,,a],c(1,2),mean)
a<-z[,,i] -aa
image(x,y,a,col=brewer.pal(8,”RdBu”),zlim=c(-10,10))
map(”world”,add=T)
title(main=paste(substr(time[i],1,4),substr(time[i],5,6)))
Sys.sleep(0.2)
}
It is not easy to draw conclusions from this visualization alone. However what seems clear is that the largest anomalies and fluctuations in rainfall patterns (areas of dark red or dark blue) are concentrated in the tropics. This is in part due to the fact that the shading represents absolute variation. The tropics receive more rainfall, thus variability is naturally higher. What would be useful would be look in more detail of the pattern for different areas of the global simulation and contrast them after taking into account natural interannual variability.
In order to look at the trend for any part of the world we can make a small function in R that will select a pixel from the map using the locator function and then use stl to produce a seasonally adjusted analysis similar to the one used here.
plot.trend<-function(){
image(x,y,z[,,1],col=brewer.pal(8,”RdBu”)[8:1],zlim=c(-10,10))
map(”world”,add=T)
l<-locator(1)
a<-z[which(abs(l$x-x)==min(abs(l$x-x))),which(abs(l$y-y)==min(abs(l$y-y))),]
a<-ts(a,start=c(1950,1),frequency=12)
plot(stl(a,s.window=12))
}
Select Chiapas.
The units are in mm per day. Thus the third graph represents the annual trend after seasonal effects (second panel) are extracted. At present averaged over the Chiapas grid square annual rainfall averages just over 3 mm per day ( 1000 - 1200 mm per year) . There is around 40% variability in this between years. The simulation suggests that in general terms the pattern of variability will be maintained for the next fifty years. However the end of the simulation shows a rather sudden, sharp drop in rainfall by the end of the century.
There is a great deal of uncertainty in climate model simulations, not only regarding the amount of greenhouse gas forcing but also the complex patterns of feedbacks in the global systems. An alternative scenario from HADCM3 (the B2 scenario) shows a slightly different pattern for Southern Mexico.
¿Por qué uso Linux?
Hay razones ideológicas de apoyar el movimiento de software libre. Tengo simpatía con ellos. Pero uso Linux (Ubuntu) en mi laptop por razones puramente prácticas.
Un sistema operativo no es más que una plataforma para correr programas. Como tal, mientras todos los programas corren bien, uno no debe pensar sobre el asunto. Este es especialmente importante cuando se trata de la maquina que usas todo el tiempo. El problema con Windows es que simplemente no hace lo que prometa hacer.
1. No quiero arriesgar la perdida de tiempo asociado con infecciones de virus.
2. No quiero spyware.
3. No quiero estar constantemente checando todos los archivos que recibo por virus
4. No quiero tener que reiniciar la maquina varios veces al día si abro mas de tres programas para recuperar la memoria (Windows XP).
5. No quiero tener que reinstalar el sistema operativa cada seis meses para mantenerlo funcionando a la velocidad inicial (Windows XP)
6. No quiero tener un sistema instalada que no puedo fácilmente reinstalar (Windows Vista)
7. No quiero que el sistema operativa decide cuales programas puedo instalar (Windows Vista)
8. No quiero comprar mas de 1GB de memoria para correr el sistema operativa (Windows Vista)
9. No quiero esperar constantemente para abrir programas.
10. No quiero pensar que mi laptop ha costado mil pesos mas que vale por haber sido forzado a comprar el sistema operativa al mismo tiempo (gracias a Dell este no es siempre cierto)
11. Quiero un diseño con interface moderno , atractivo y fácil de usar (Ubuntu)
12. Quiero tener la confianza que siempre puedo reinstalar el sistema rápidamente si pasa algo.
13. Quiero correr programas gratis y abiertos como Open Office, GRASS, Qgis, Gimp en una forma eficiente. (Nota: Los versiones de los mismos para Windows son disponibles pero no corren tan rápidamente)
14. Quiero instalar programas en línea en vez de buscar discos de instalación que se puede perder.
15. Quiero tener disponible herramientas practicas para procesar datos y imágenes usando “scripts” (Image Magick, Awk, Python, wget etc)
16. Quiero configurar mi laptop como servidor (Apache2, MySQL etc)
17. Quiero usar bases de datos potentes y geográficamente explicitas (Postgresql)
18. Quiero usar la memoria eficientemente para que puedo correr otros sistemas operativas como maquinas virtuales si un programa que tengo que usar no es disponible para el sistema nativa (e.g Word, Excel etc).
19. Quiero tener varios espacios de trabajo (Vista si tiene, XP no)
20. Quiero divertirme de vez en cuando haciendo el sistema visualmente atractiva (Beryl o Compiz )
21. Quiero encontrar información para arreglar mis propios problemas si el sistema no funciona.
Quiero que la pantalla que esta en frente de mis ojos tantas horas por dia se ve asi …….

