0% found this document useful (0 votes)
27 views

Running The WRF Preprocessing System

1. Edit the namelist.wps file to specify settings for geogrid, ungrib, and metgrid like the model configuration, domains, date range of simulations, and file paths. 2. Run geogrid to define the simulation grids and interpolate static data onto them. 3. Run ungrib to extract meteorological fields from GRIB files onto the geogridded domains. 4. Run metgrid to interpolate the meteorological fields from ungrib onto the simulation grids.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Running The WRF Preprocessing System

1. Edit the namelist.wps file to specify settings for geogrid, ungrib, and metgrid like the model configuration, domains, date range of simulations, and file paths. 2. Run geogrid to define the simulation grids and interpolate static data onto them. 3. Run ungrib to extract meteorological fields from GRIB files onto the geogridded domains. 4. Run metgrid to interpolate the meteorological fields from ungrib onto the simulation grids.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

*

Running the WRF Preprocessing


System

Michael Duda

WRF Users’ Tutorial, 11 - 15 July 2011 *NCAR is sponsored by the


National Science Foundation
Review

 Briefly recall the programs in the WPS

WRF Users’ Tutorial, 11 - 15 July 2011 1


Review

 geogrid (think geographical)


o Define size/location of model domains and interpolate
static terrestrial fields to simulation grids

 ungrib (think un+grib)


o Extract meteorological fields from GRIB files

 metgrid (think meteorological)


o Horizontally interpolate meteorological fields (from
ungrib) to simulation grids (defined by geogrid)

WRF Users’ Tutorial, 11 - 15 July 2011 2


Overview
 How to run through the WPS for basic cases
o Basic steps for running the WPS
 Geogrid
 Ungrib
 Metgrid

 WPS utility programs

 Common WPS mistakes

WRF Users’ Tutorial, 11 - 15 July 2011 3


Running geogrid
STEP 1: Edit namelist.wps
For geogrid, only the &share and &geogrid namelists
need to be edited in namelist.wps
&share &geogrid
wrf_core = 'ARW', parent_id = 1, 1,
max_dom = 2, parent_grid_ratio = 1, 3,
i_parent_start = 1, 20,
io_form_geogrid = 2, j_parent_start = 1, 17,
/ e_we = 220, 181,
e_sn = 175, 181,
geog_data_res = '5m', '2m',
dx = 15000,
dy = 15000,
map_proj = 'lambert',
ref_lat = 37.0,
ref_lon = -97.0,
truelat1 = 45.0,
truelat2 = 30.0,
stand_lon = -97.0,
geog_data_path = '/data/static/geog/'
/

WRF Users’ Tutorial, 11 - 15 July 2011 4


Running geogrid
STEP 1: Edit namelist.wps
Which WRF core?
For ARW, set to ‘ARW’
For NMM, set to ‘NMM’
&share
wrf_core = 'ARW',
Total number of model
max_dom = 2,
io_form_geogrid = 2, domains, including nests, for
/ ARW; number of nesting levels
for NMM.

Format for geogrid output files;


2=netCDF is recommended.

See p. 3-8 and 3-37

WRF Users’ Tutorial, 11 - 15 July 2011 5


Running geogrid
STEP 1: Edit namelist.wps
&geogrid Nesting: Who is the parent?
parent_id = 1, 1, What is the grid ratio for
parent_grid_ratio = 1, 3, each nest? Where is it
i_parent_start = 1, 20, located in its parent?
j_parent_start = 1, 17,
Domain sizes: How many
e_we = 220, grid points does the
181, domain have? What is the
e_sn = 175, 181, grid spacing?
dx = 15000,
dy = 15000,
Static data: What resolution
geog_data_res = '5m', '2m', of source data to
interpolate from for each
... domain?
/ See p. 3-9, 3-19, and 3-38 ‘30s’, ‘2m’, ‘5m’, or ‘10m’?

WRF Users’ Tutorial, 11 - 15 July 2011 6


Running geogrid
STEP 1: Edit namelist.wps
&geogrid

Map projection: What
map_proj = 'lambert', projection to use? What
ref_lat = 37.0, are the parameters of the
ref_lon = -97.0,
projection?
truelat1 = 45.0,
truelat2 = 30.0, See p. 3-9 and 3-40
stand_lon = -97.0,

geog_data_path = '/data/static/geog/' Static data: Where are the


/ data directories (e.g.,
topo_30s) located?
See p. 3-41

WRF Users’ Tutorial, 11 - 15 July 2011 7


Running geogrid
STEP 2: Make sure GEOGRID.TBL is linked to
the correct version of GEOGRID.TBL

 There are multiple GEOGRID.TBL files to support


multiple dynamical cores in WRF
 GEOGRID.TBL.ARW must be used for ARW
 GEOGRID.TBL.NMM must be used for NMM

> ls geogrid/GEOGRID.TBL
GEOGRID.TBL -> GEOGRID.TBL.ARW

WRF Users’ Tutorial, 11 - 15 July 2011 8


Running geogrid
STEP 3: Run geogrid.exe
Geogrid processes each
Parsed 11 entries in GEOGRID.TBL domain individually.
Processing domain 1 of 2
Processing XLAT and XLONG
There will be one section
Processing MAPFAC of messages for each
Processing F and E domain.
Processing ROTANG
Processing LANDUSEF
Calculating landmask from LANDUSEF
As each field is
Processing HGT_M processed, a message
will be written to the

screen and to the
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! geogrid.log file.
! Successful completion of geogrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WRF Users’ Tutorial, 11 - 15 July 2011 9


Running geogrid
STEP 4: Check that geogrid ran successfully

If geogrid ran sucessfully, this message should be printed:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of geogrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If there was an error, check for an ERROR or


WARNING message in the geogrid.log file, or
for a system error, like “Segmentation fault”.

WRF Users’ Tutorial, 11 - 15 July 2011 10


Running geogrid
After running
geo_em.d01.nc geogrid, we
geo_em.d02.nc should have
or
geo_nmm.d01.nc these files
geogrid geo_nmm_nest.l01.nc

metgrid
real

ungrib

WRF Users’ Tutorial, 11 - 15 July 2011 11


Running ungrib
STEP 1: Edit namelist.wps
For ungrib, only the &share and &ungrib namelists
need to be edited

&share &ungrib
wrf_core = 'ARW', out_format = 'WPS',
max_dom = 2, prefix = 'GFS',
start_date = '2006-04-01_00:00:00', /
end_date = '2006-04-01_12:00:00',
interval_seconds = 21600
io_form_geogrid = 2,
/

WRF Users’ Tutorial, 11 - 15 July 2011 12


Running ungrib
STEP 1: Edit namelist.wps
&share
wrf_core = 'ARW',
max_dom = 2,
Data time range: Between
start_date = '2006-04-01_00:00:00',
which times should ungrib
end_date = '2006-04-01_12:00:00',
process GRIB data?
interval_seconds = 21600
Data frequency: How
io_form_geogrid = 2, many seconds between
/ output files for ungrib?
E.g., 10800 s = 3 hrs

See p. 3-14, and 3-38

WRF Users’ Tutorial, 11 - 15 July 2011 13


Running ungrib
STEP 1: Edit namelist.wps
Intermediate file format: Which
format to use for intermediate
&ungrib files? ‘WPS’, ‘SI’, or ‘MM5’ are
out_format = 'WPS', possible; ‘WPS’ is recommended.
prefix = 'GFS',
/ Intermediate file names: Gives prefix
for intermediate files.
Prefix can include a path.
E.g., ‘XZY’ would give intermediate
files named XYZ:yyyy-mm-dd_hh.

See p. 3-14, 3-23, and 3-41

WRF Users’ Tutorial, 11 - 15 July 2011 14


Running ungrib
STEP 2: Link the correct Vtable to the file
name “Vtable” in the run directory
 Some Vtables are provided with WPS in the WPS/
ungrib/Variable_Tables directory
o E.g., Vtable.GFS, Vtable.SST, Vtable.ECMWF See p. 3-15

 Ungrib always expects to find a file named


Vtable in the run directory
> ln –s ungrib/Variable_Tables/Vtable.GFS Vtable
> ls Vtable
Vtable -> ungrib/Variable_Tables/Vtable.GFS

WRF Users’ Tutorial, 11 - 15 July 2011 15


Running ungrib
STEP 3: Link GRIB files to the correct file
names in the run directory
 Ungrib always expects GRIB files to be named
GRIBFILE.AAA, GRIBFILE.AAB, GRIBFILE.AAC,
etc., in the run directory
 The link_grib.csh script can be used to link
GRIB files to these file names:
> link_grib.csh /data/GRIB/GFS/gfs* See p. 3-15
> ls GRIBFILE.*
GRIBFILE.AAA -> /data/GRIB/GFS/gfs_060401_00_00

WRF Users’ Tutorial, 11 - 15 July 2011 16


Running ungrib
STEP 4: Run ungrib.exe
*** Starting program ungrib.exe ***
Start_date = 2006-08-16_12:00:00 , End_date = 2006-08-16_12:00:00
output format is WPS
Path to intermediate files is ./
ungrib - grib edition num 2

#############################################################
Inventory for date = 2006-08-16 12:00:00

PRES TT UU VV RH HGT
-------------------------------------------------------------
2013.0 O O O O O O
2001.0 X X X X O X
1000.0 X X X X X
975.0 X X X X X
950.0 X X X X X
925.0 X X X X X
900.0 X X X X X

WRF Users’ Tutorial, 11 - 15 July 2011 17


Running ungrib
STEP 5: Check that ungrib ran successfully

If ungrib ran successfully, this message should be printed:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of ungrib. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If there was an error, check for error message in ungrib’s


printout or in the ungrid.log file.
Common errors are related to incorrect date specifications
in the &share namelist, or because GRIB2 data was used
with a version of WPS compiled without GRIB2 libraries.

WRF Users’ Tutorial, 11 - 15 July 2011 18


Running ungrib
geo_em.d01.nc
geo_em.d02.nc
or
geo_nmm.d01.nc
geogrid geo_nmm_nest.l01.nc

metgrid
real

ungrib FILE:2006-04-01_00 After running


FILE:2006-04-01_06 ungrib, we should
FILE:2006-04-01_12
have files like these

WRF Users’ Tutorial, 11 - 15 July 2011 19


Running metgrid
STEP 1: Edit namelist.wps
For metgrid, only the &share and &metgrid
namelists need to be edited

&share
wrf_core = 'ARW',
max_dom = 2,
start_date = '2006-04-01_00:00:00', '2006-04-01_00:00:00',
end_date = '2006-04-01_12:00:00', '2006-04-01_00:00:00',
interval_seconds = 21600
io_form_geogrid = 2,
/ &metgrid
fg_name = 'GFS',
constants_name = 'SST:2006-04-01_00',
io_form_metgrid = 2,
/

WRF Users’ Tutorial, 11 - 15 July 2011 20


Running metgrid
STEP 1: Edit namelist.wps
&share
wrf_core = 'ARW',
max_dom = 2,

start_date = '2006-04-01_00:00:00', '2006-04-01_00:00:00',


end_date = '2006-04-01_12:00:00', '2006-04-01_00:00:00',

interval_seconds = 21600
io_form_geogrid = 2, Data time range: Time range
/ to process for each domain.
Usually, only the initial time is
needed for ARW nested
domains. Only coarse domain
needed for NMM. See p. 3-17 and 3-37

WRF Users’ Tutorial, 11 - 15 July 2011 21


Running metgrid
STEP 1: Edit namelist.wps
Intermediate file prefixes: Prefix (or
prefixes) of intermediate files to
interpolate to model domain. Should
match prefix given to ungrib.
&metgrid See p. 3-17 and 3-24
fg_name = 'GFS', Constant fields: Optional
name of an intermediate
constants_name = 'SST:2006-04-01_00',
file with fields to be used
for every time period.
io_form_metgrid = 2,
/ Metgrid I/O format: Which I/O
format to use for metgrid output?
2=netCDF is recommended.
See p. 3-17, and 3-41

WRF Users’ Tutorial, 11 - 15 July 2011 22


Running metgrid
STEP 2: Make sure METGRID.TBL is linked to
the correct version of METGRID.TBL
 There are multiple METGRID.TBL files to support
multiple dynamical cores in WRF
 METGRID.TBL.ARW should be used for ARW
 METGRID.TBL.NMM should be used for NMM

> ls metgrid/METGRID.TBL
METGRID.TBL -> METGRID.TBL.ARW

WRF Users’ Tutorial, 11 - 15 July 2011 23


Running metgrid
STEP 3: Run metgrid.exe
Processing domain 1 of 2
Fields from constant files
SST:2006-04-01_00 (given using constants_name)
are processed before any time
Processing 2006-04-01_00
GFS
varying fields.
Processing 2006-04-01_06
GFS Metgrid processes all time
Processing 2006-04-01_12
GFS
period for one domain before
processing for the next
Processing domain 2 of 2 domain
SST:2006-04-01_00
Processing 2006-04-01_00
GFS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of metgrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WRF Users’ Tutorial, 11 - 15 July 2011 24


Running metgrid
STEP 4: Check that metgrid ran successfully

If metgrid ran successfully, this message should be printed:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of metgrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If there was an error, check for an ERROR or


WARNING message in the metgrid.log file, or
for a system error, like “Segmentation fault”.

WRF Users’ Tutorial, 11 - 15 July 2011 25


Running metgrid
After running metgrid,
geo_em.d01.nc we should have files
geo_em.d02.nc
or
similar to these
geo_nmm.d01.nc met_em.d01.2006-04-01_00.nc
met_em.d01.2006-04-01_06.nc
geogrid geo_nmm_nest.l01.nc
met_em.d01.2006-04-01_12.nc
met_em.d02.2006-04-01_00.nc
met_em.d03.2006-04-01_00.nc
metgrid
real

met_nmm.d01.2006-04-01_00.n
ungrib FILE:2006-04-01_00 met_nmm.d01.2006-04-01_06.n
FILE:2006-04-01_06
FILE:2006-04-01_12

WRF Users’ Tutorial, 11 - 15 July 2011 26


Overview
 How to run through the WPS for basic cases
o Basic steps for running WPS
 Geogrid
 Ungrib
 Metgrid
 WPS utility programs
 Common WPS mistakes

WRF Users’ Tutorial, 11 - 15 July 2011 27


WPS Utility Programs
 Besides geogrid, ungrib, and metgrid, some simple
utility programs are distributed with WPS:
o For checking contents of intermediate format files
o For listing contents of GRIB1 & GRIB2 files
o To assist in locating domains
o For computing 3d pressure field for ECMWF data

 Some programs use NCAR Graphics libraries for


plotting
o For these utilities, NCAR Graphics must be installed

See p. 3-27

WRF Users’ Tutorial, 11 - 15 July 2011 28


WPS Utility Programs
The utility programs that come with WPS can be
helpful when diagnosing problems with WPS
output

- All utilities are found in the WPS/util directory

- Users are encouraged to make use of these


utilities to examine WPS input and output files

WRF Users’ Tutorial, 11 - 15 July 2011 29


Utility: plotgrids
The plotgrids program plots the locations of
grids defined in namelist.wps

 plotgrids can be used to


iteratively refine the locations of
grids.

 plotgrids uses the namelist.wps


file only, so there is no need to
run geogrid first!

WRF Users’ Tutorial, 11 - 15 July 2011 30


Utility: rd_intermediate
The rd_intermediate lists information about the fields
found in an intermediate-format file
================================================
FIELD = TT
UNITS = K DESCRIPTION = Temperature
DATE = 2000-01-24_12:00:00 FCST = 0.000000
SOURCE = unknown model from NCEP GRID 212
LEVEL = 200100.000000
I,J DIMS = 185, 129
IPROJ = 1
REF_X, REF_Y = 1.000000, 1.000000
REF_LAT, REF_LON = 12.190000, -133.459000
DX, DY = 40.635250, 40.635250
TRUELAT1 = 25.000002
DATA(1,1)=295.910950
================================================

WRF Users’ Tutorial, 11 - 15 July 2011 31


Utility: plotfmt
The plotfmt program plots the fields in the
ungrib intermediate-formatted files

WRF Users’ Tutorial, 11 - 15 July 2011 32


Utility: g1print and g2print
The g1print and g2print programs list the contents of
a GRIB1 or GRIB2 file:
---------------------------------------------------------------------------
rec Prod Cat Param Lvl Lvl Lvl Name Time Fcst
num Disc num code one two hour
---------------------------------------------------------------------------
1 0 3 5 100 100000 0 HGT 2006-08-16_12:00:00 00
2 0 3 5 100 97500 0 HGT 2006-08-16_12:00:00 00
3 0 3 5 100 95000 0 HGT 2006-08-16_12:00:00 00
4 0 3 5 100 92500 0 HGT 2006-08-16_12:00:00 00
5 0 3 5 100 90000 0 HGT 2006-08-16_12:00:00 00
6 0 3 5 100 85000 0 HGT 2006-08-16_12:00:00 00
7 0 3 5 100 80000 0 HGT 2006-08-16_12:00:00 00
8 0 3 5 100 75000 0 HGT 2006-08-16_12:00:00 00
9 0 3 5 100 70000 0 HGT 2006-08-16_12:00:00 00
10 0 3 5 100 65000 0 HGT 2006-08-16_12:00:00 00

WRF Users’ Tutorial, 11 - 15 July 2011 33


Utility: calc_ecmwf_p
The calc_ecmwf_p utility creates intermediate files
with a pressure (and possibly GHT and RH) field

FILE:2009-08-27_00
PSFC / LOGSFP
SOILHGT / SOILGEO
TT
SPECHUMD
PRES:2009-08-27_00
calc_ecmwf_p.exe PRESSURE
RH
emcwf_coeffs GHT
0 0.000000 0.000000 0.0000
1 2.000040 0.000000 0.0200 0.0100
2 3.980832 0.000000 0.0398 0.0299
3 7.387186 0.000000 0.0739 0.0568
4 12.908319 0.000000 0.1291 0.1015
5 21.413612 0.000000 0.2141 0.1716
6 33.952858 0.000000 0.3395 0.2768
7 51.746601 0.000000 0.5175 0.4285
8 76.167656 0.000000 0.7617 0.6396
9 108.715561 0.000000 1.0872 0.9244
See p. 3-28

WRF Users’ Tutorial, 11 - 15 July 2011 34


Overview
 How to run through the WPS for basic cases
o Basic steps for running WPS
 Geogrid
 Ungrib
 Metgrid
 WPS utility programs
 Common WPS mistakes

WRF Users’ Tutorial, 11 - 15 July 2011 35


Common WPS Mistakes
1) All 3-d fields must have same number of levels in
metgrid
WRF_DEBUG: Warning DIM 4 , NAME
num_metgrid_levels REDIFINED by var GHT 27
26 in wrf_io.F90 line 2347
ERROR: Error in ext_pkg_write_field

- This is usually corrected by ensuring that all 3-d


meteorological fields have surface level data
- Try setting debug_level=1000 in &share
namelist, and checking metgrid.log for a table
showing which fields are available at each level

WRF Users’ Tutorial, 11 - 15 July 2011 36


Common WPS Mistakes

2) When using a regional data set (e.g., NAM),


ensure that model domain is completely covered
by the data
- The metgrid program will stop if the model domain
has grid points that are not covered by data

3) For native vertical coordinate data sets (e.g.,


RUCb, ECMWF), ensure that both pressure and
geopotential height fields are available

WRF Users’ Tutorial, 11 - 15 July 2011 37


Questions?

WRF Users’ Tutorial, 11 - 15 July 2011 38

You might also like