The data can be obtained either manually, through the ECMWF web site, or by batch access, using a script written either in Python, Perl, or Java. Regardless of which method is used, a user account must first be created.
You also need to accept the license agreement for the ERA-Interim dataset.
With this completed, you now have access to the ERA-Interim dataset.
There are three separate GRIB files needed to initialize WRF: the time-invariant file, the surface file, and the pressure level file. These can be downloaded either manually or via a batch process. Manual retrieval is easy to do, but it has the disadvantage of saving the data on the local machine first and is also inconvenient for large data volumes. The batch process takes some time to set up, but once it is configured, it is a wholly automated process.
It is easiest to download the time-invariant fields manually through the web portal.
The batch access script can be written in one of three languages supported by ECMWF: Python, Java, or Perl. This documentation will use Java; for other languages, see the ECMWF documentation at https://software.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch/
Prepare the script:
export CLASSPATH=$LIB_DIR:$CLASSPATH
javac *.java
to compile the JSON package. If it does not compile, double check that your $CLASSPATH includes $LIB_DIR . Also, check that the source is in the directories properly (the structure is important for Java packages).
javac *.java
to compile the ECMWF packages.
A sample script is packaged with the ECMWF packages to assist in retrieving the data. It is located in $LIB_DIR.
Here is an outline for a script:
json.put(“dataset”, “interim”);
server.retrieve(json);
Pressure level fields and recommended values:
Fields | Values |
---|---|
dataset | “interim” (ERA-Interim) |
date | YYYY-MM-DD |
levelist (note the typo!) | “1/2/3/5/7/10/20/30/50/70/100/125/150/175/200/225/250/300/350/400/450/500/550/600/650/700/750/775/800/825/850/875/900/925/950/975/1000” (List of desired pressure levels in mb) |
stream | “oper” (Operational) |
levtype | “pl” (Pressure levels) |
param | “129.128/130.128/131.128/132.128/157.128” |
129.128 – Geopotential | |
130.128 – Temperature | |
131.128 – U wind component | |
132.128 – V wind component | |
157.128 – Relative humidity | |
step | “0” (Just the analysis) |
time | “00:00:00/06:00:00/12:00:00/18:00:00” |
type | “an” (Analysis) |
area | N/W/S/E boundaries of domain in degrees; ex. 50/-125/20/-65 |
grid | “0.25/0.25” (0.25 degrees by 0.25 degrees) |
target | “pressurelevels.grib” (Name of output file) |
Surface fields and recommended values:
Fields | Values |
---|---|
dataset | “interim” (ERA-Interim) |
date | YYYY-MM-DD |
stream | “oper” (Operational) |
levtype | “sfc” (Surface) |
param | “165.128/166.128/167.128/168.128/134.128/151.128/235.128/31.128/34.128/33.128/141.128/139.128/170.128/183.128/236.128/39.128/40.128/41.128/42.128” |
165.128 – U wind component | |
166.128 – V wind component | |
167.128 – Temperature | |
168.128 – Dew point | |
134.128 – Surface pressure | |
151.128 – Sea level pressure | |
235.128 – Sea surface temperature (SKINTEMP) | |
31.128 – Sea ice fraction | |
34.128 – Sea surface temperature (SST) | |
33.128 – Snow density | |
141.128 – Snow water equivalent in meters | |
139.128 – 0-7 cm ground layer temperature | |
170.128 – 7-28 cm ground layer temperature | |
183.128 – 28-100 cm ground layer temperature | |
236.128 – 100-255 cm ground layer temperature | |
39.128 – 0-7 cm ground layer moisture | |
40.128 – 7-28 cm ground layer moisture | |
41.128 – 28-100 cm ground layer moisture | |
42.128 – 100-255 cm ground layer moisture | |
step | “0” (Just the analysis) |
time | “00:00:00/06:00:00/12:00:00/18:00:00” |
type | “an” (Analysis) |
area | N/W/S/E boundaries of domain in degrees; ex. 50/-125/20/-65 |
grid | “0.25/0.25” (0.25 degrees by 0.25 degrees) |
target | “surface.grib” (Name of output file) |
Compile the scripts and run:
javac *.java java surface >& surface.log java pressurelevels >& pressurelevels.log
import org.ecmwf.DataServer; import org.json.JSONObject; public class PressureLevels { public static void main(String[] args) throws Exception { DataServer server = new DataServer(); JSONObject request = new JSONObject(); request.put("dataset" , "interim"); request.put("date" , "2011-04-21"); request.put("levelist", "1/2/3/5/7/10/20/30/50/70/100/125/150/175/200/225/250/300/350/400/450/500/550/600/650/700/750/775/800/825/850/875/900/925/950/975/1000"); request.put("stream" , "oper"); request.put("levtype", "pl"); request.put("param", "129.128/130.128/131.128/132.128/157.128"); request.put("step", "0"); request.put("time", "00:00:00/06:00:00/12:00:00/18:00:00"); request.put("type", "an"); request.put("area", "50/-125/20/-65"); request.put("grid", "0.25/0.25"); request.put("target", "preslevels25.grib"); server.retrieve(request); } }
import org.ecmwf.DataServer; import org.json.JSONObject; public class Surface { public static void main(String[] args) throws Exception { DataServer server = new DataServer(); JSONObject request = new JSONObject(); request.put("dataset" , "interim"); request.put("date" , "2011-04-21"); request.put("stream" , "oper"); request.put("levtype", "sfc"); request.put("param", "165.128/166.128/167.128/168.128/134.128/151.128/235.128/31.128/34.128/33.128/141.128/139.128/170.128/183.128/236.128/39.128/40.128/41.128/42.128"); request.put("step", "0"); request.put("time", "00:00:00/06:00:00/12:00:00/18:00:00"); request.put("type", "an"); request.put("area", "50/-125/20/-65"); request.put("grid", "0.25/0.25"); request.put("target", "surface.grib"); server.retrieve(request); } }