Wednesday, 15 February 2017

WRF with ERA-Interim on ORR2

Next let's try to run WRF with ERA-Interim data on ORR2.

1) Log on to ORR2

2) Create a directory for these forecasts:

mkdir TESTERA
cd TESTERA/
mkdir DATA
mkdir WPS
mkdir WRF

3) Get ECMWF ERA-Interim data:

3a) Static data doesn't change:

cd DATA/
cp /tmp/CONOR/DATA/ERA_STATIC.grib .

Surface and model-level data need to be downloaded for each forecast time.


3b) Surface Data:

You can get surface data here (you need to log in/register if you haven't done so before):
http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=sfc/

In the "Select Date" box at the top, type a start date and end date. For example:
Start date:  2010-06-01 End date:  2010-06-03

In the "Select Time" box, select all:
00:00:00  06:00:00  12:00:00  18:00:00

In the "Select Step" box, select zero:
0

In the "Select parameter" box, select the following:
- 2 metre dewpoint temperature
- 2 metre temperature
- 10 metre U wind component
- 10 metre V wind component
- Mean sea level pressure
- Sea surface temperature
- Sea-ice cover
- Skin temperature
- Snow density
- Snow depth
- Soil temperature levels 1, 2, 3, 4
- Surface pressure
- Volumetric soil water layer 1, 2, 3, 4

Click on the "Retrieve GRIB" button.

If you want smaller file sizes, you can click on "change" here:
Area: Default (as archived) (change)
- and then fill in the Custom: N / W / S / E values for a smaller area. 

then click "Retrieve now".

When the status of the request is: complete, click on the link to download the surface data:
Download grib

Give it a sensible name, like:
ERA-SFC-20100601.grib

3c) Model-level data:

You can get model-level data here:

In the "Select Date" box at the top, type a start date and end date. For example:
Start date:  2010-06-01 End date:  2010-06-03

In the "Select Time" box, select all:
00:00:00  06:00:00  12:00:00  18:00:00

Click on the following parameter names (that should tick all levels):
- Specific humidity
- Temperature
- U component of wind
- V component of wind

Then click on the "Retrieve GRIB" button, define smaller area if needed and "Retrieve now".

When the status of the request is: complete
Download grib

Rename:
ERA-ML-20100601.grib

Then copy your ERA data to orr2 using scp, and put it in directory:
TESTERA/DATA/

4) Run geogrid:

Change into the WPS directory:

cd ../WPS

Get the namelist.wps file for ERA:

cp /tmp/CONOR/WPS/namelist.wps.era namelist.wps

Get the geogrid files:

mkdir geogrid
cp /tmp/CONOR/WPS/geogrid/GEOGRID.TBL geogrid/
cp /tmp/CONOR/WPS/geogrid.exe .
./geogrid.exe

you should end up with this file:

4.5M Feb 15 16:03 geo_em.d01.nc

5) Run ungrib:

Get the ungrib files:

cp /tmp/CONOR/WPS/Vtable.ERA-interim.ml Vtable
cp /tmp/CONOR/WPS/link_grib.csh .
cp /tmp/CONOR/WPS/ungrib.exe .
./link_grib.csh ../DATA/ERA
./ungrib.exe

you should end up with these files:

115M Feb 17 13:47 FILE:2010-06-01_12
...

6) Convert model level to pressure levels

Get the ecmwf_coeffs file and calc_ecmwf_p.exe program and run it:

cp /tmp/CONOR/WPS/ecmwf_coeffs .
cp /tmp/CONOR/WPS/calc_ecmwf_p.exe .
./calc_ecmwf_p.exe

This should produce the following files:

54M Feb 17 13:48 PRES:2010-06-01_12
...

7) Run metgrid

Create your metgrid directory, copy over required files and run metgrid.exe:

mkdir metgrid
cp /tmp/CONOR/WPS/metgrid/METGRID.TBL metgrid/
cp /tmp/CONOR/WPS/metgrid.exe .
./metgrid.exe

You should now have the following files:

13M Feb 17 13:58 met_em.d01.2010-06-01_12:00:00.nc
...


8) Change into your WRF directory and clean it:

cd ..
cd WRF
rm *

9) Run real:

cp /tmp/CONOR/WRF/* .
cp namelist.input.erai namelist.input
ln -s ../WPS/met_em.d01.2010-06-0* .
qsub QSUBREAL.qsub

You should now have the following files:

8.6M Feb 17 14:14 wrfinput_d01
20M Feb 17 14:14 wrfbdy_d01

10) Run wrf:

qsub QSUBWRF.qsub

When it's finished (around three minutes), you should see the following file:

393M Feb 17 14:20 wrfout_d01_2010-06-01_12:00:00

Woohoo! Now you can run a forecast for anywhere in the world, for any time between 1979 and 2016.