More on Retrieving KNMI Data

I’ve done a considerable upgrade to my function for retrieving model data from KNMI within R. This builds on the KNMI webpage but IMO is a considerable enhancement of it. I’ve made the script available here .

The function read.knmi.models is built as an emulator of the radio buttons.

Geert’s radio buttons (if I’m understanding things right) build a command in OpenDAP – the command excerpt “cgi?” comes from OpenDAP. OpenDAP was developed in the US for external retrieval of relevant portions of geographically structured data sets without downloading terabytes of data. There are some online manuals on OpenDAP, but I must confess that I’ve worked using Geert’s command structure as a template. The manuals on OpenDAP describe an installation program.

However, the system here: using R to access the KNMI installation seems to rather neatly accomplish the objectives of OpenDAP while working in a language and framework that is much more widely understood.

KNMI does not appear to have a convenient data frame of models and scenarios. I’ve collated information from their webpage as at a couple of months ago and placed it online. It is read as part of calling the functions, which can be done as follows:

source(“http://data.climateaudit.org/scripts/models/collation.knmi.functions.txt”)
dim(knmi.info) #86 4
# 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

Now logon using your email. KNMI asks users to register. I’ve done so. Their retrieval command requires an email address and the script here assumes that you have an email address on file with KNMI (the email address yourname@you.com is a placeholder.) The function download_html pings the website to log on, assuming that you’re registered.

email=Email=”yourname@you.com” ##REGISTER FIRST
logon=download_html( paste(“http://climexp.knmi.nl/start.cgi?”,Email,sep=””))

Here’s a sample of retrieving model data. I’ll describe the fields in a minute.

test= read.knmi.models(field=”tas”,model=”giss_aom”,scenario=”sresa1b”,
landtype=”land”, lat=c(-20,20), long=c(0,360), version=”anomaly”)
plot.ts(test,main=paste(“giss_aom”, “sresa1b”) )

I experimented with recovering the centigrade values – something that Lucia asked for this morning, but haven’t debugged this.

The fields are as follows:

field – “tas” is the field name for temperature. Only one tested so far
model – use alias nomenclature from knmi.info.
scenario- use nomenclature from knmi.info. “20c3m” and “sresa1b” are examples. Radio “Scenario Runs” for nomenclature.
landtype – default is all. Can be “land” or “sea”
lat – south to north. default c(-90,90)
long – 0 to 360. default c(0,360)
version – default is anomaly. “centigrade” gets Centigrade
Info – requires knmi.info

2 Comments

  1. Posted Jun 15, 2009 at 3:57 AM | Permalink

    Geert’s radio buttons (if I’m understanding things right) build a command in OpenDAP – the command excerpt “cgi?” comes from OpenDAP. OpenDAP was developed in the US for external retrieval of relevant portions of geographically structured data sets without downloading terabytes of data.

    “cgi” stands for Common Gateway Interface. What the start.cgi script probably does is make a call to OpenLDAP (does anyone use the full DAP protocol?) to authenticate using the credentials sent.

  2. MikeN
    Posted Jun 17, 2009 at 10:26 AM | Permalink

    Is it possible to see the physical parameters behind these model runs? All they say is the carbon scenario, but what about aerosol forcing, clouds, ocean sensitivity?

    I don’t see any A2 model runs with warming above 4, or below 3, yet the AR4 reports 2-5 warming for this scenario.

One Trackback

  1. By NRO on Global Warming – Cynical Heretic on Jul 26, 2009 at 11:16 AM

    […] McIntyre has written on his experiences on trying to retrieve some of this information here and here. He has also written extensively on his difficulties in getting access to other data the pertain to […]