# Initializing the WRF model with ERA5

## Summarization

2. Preprocess
3. Automation
4. Geogrid
5. Ungrib
7. Metgrid

if you want to use analysis and one hour resolution, all you need to change are data, area and target. Otherwise, you should change as needed.

This is a little different from downloading ERA-Interim data. ERA-Interim includes Geopotential and Land-sea mask in invariant field. ERA5 includes them in surface dataset. So, we just need to download surface data and model level data.

## Preprocess

Install eccodes or grib_api according to ECMWF.

If you choose grib_api, you must install the new version of grib_api. Otherwise, you will get this error when using grib_set (e.g. grib_api Version 1.12.3):

### Preprocess model level data (necessary)

Finally, you will get these files (the structure of filename is [centre]_[dataDate]_[dataType]_[levelType]_[step].grib[edition]):

|– ecmf_20150531_an_ml_0.grib1
|– ecmf_20150531_an_sfc_0.grib1
|– ecmf_20150601_an_ml_0.grib1
|– ecmf_20150601_an_sfc_0.grib1

You can automate the script rather than change elements one by one (as suggested by Conor).

## Geogrid

run geogrid.exe as usual

## Ungrib

run ungrib.exe by using the following Vtable (as suggested by valerio):

Create the following ecmwf_coeffs table (named ecmwf_coeffs) and run */WPS/util/calc_ecmwf_p.exe:

## Metgrid

Edit namelist.wps like this:

If you just run metgrid.exe, you’ll get these warnings:

You can edit METGRID.TBL to set interpolation method of ST100255 SM100255 and LOGSFP:

Run metgrid.exe with the modified METGRID.TBL.ARW table.

## Note of mozbc

If you’re using MOZART in WRF-Chem, then you need to change LOGSFP field in met* files to PSFC: