User’s Guide for Advanced Research WRF (ARW) Modeling System Version 2

 

Chapter 3: The WRF Preprocessing System (WPS) – Preparing Input Data

Table of Contents

 

 

Introduction

The WRF Preprocessing System (WPS) is a set of three programs whose collective role is to prepare input to the real.exe program for real-data simulations. Each of the programs performs one stage of the preparation: geogrid defines model domains and interpolates static geographical data to the grids; ungrib extracts meteorological fields from GRIB-formatted files; and metgrid horizontally interpolates the meteorological fields extracted by ungrib to the model grids defined by geogrid. The work of vertically interpolating meteorological fields to WRF eta levels is now performed within the real.exe program, a task that was previously performed by the vinterp program in the WRF SI.

 

 

 

 

The data flow between the programs of the WPS is shown in the figure above. Each of the WPS programs reads parameters from a common namelist file, as shown in the figure. This namelist file has separate namelist records for each of the programs and a shared namelist record, which defines parameters that are used by more than one WPS program. Not shown in the figure are additional table files that are used by individual programs. These tables provide additional control over the programs’ operation, though they generally do not need to be changed by the user. The purpose, contents, and format of these tables are documented elsewhere, and for now, the user need not be concerned with them.

The build mechanism for the WPS, which is very similar to the build mechanism used by the WRF model, provides options for compiling the WPS on a variety of platforms. When MPICH libraries and suitable compilers are available, the metgrid and geogrid programs may be compiled for distributed memory execution, which allows larger model domains to be processed in less time. The work performed by the ungrib program is not amenable to parallelization, so ungrib may only be run on a single processor.

 

Function of Each WPS Program

The WPS consists of three independent programs: geogrid, ungrib, and metgrid. Also included in the WPS are several utility programs, which are described in the section on utility programs. A brief description of each of the three main programs is given below, with further details presented in subsequent sections.

Program geogrid

The purpose of geogrid is to define the simulation domains, and interpolate various terrestrial data sets to the model grids. The simulation domain is defined using information specified by the user in the “geogrid” namelist record of the WPS namelist file, namelist.wps. By default, and in addition to computing latitude and longitudes for every grid point, geogrid will interpolate soil categories, land use category, terrain height, annual mean deep soil temperature, monthly vegetation fraction, monthly albedo, maximum snow albedo, and slope category to the model grids. Global data sets for each of these fields are provided through the MMM website, and only need to be downloaded once. Several of the data sets are available in only one resolution, but others are made available in resolutions of 30”, 2’, 5’, and 10’. The user need not download all available resolutions for a data set, although the interpolated fields will generally be more representative if a resolution of source data near to that of the simulation domain is used. However, users who expect to work with domains having grid spacings that cover a large range may wish to eventually download all available resolutions of the terrestrial data.

Besides interpolating the default terrestrial fields, the geogrid program is general enough to be able to interpolate most continuous and categorical fields to the simulation domains. New and additional data sets may be interpolated to the simulation domain through the use of the table file, GEOGRID.TBL. The GEOGRID.TBL file defines each of the fields that will be produced by geogrid; it describes the interpolation methods to be used for a field, as well as the location on the filesystem where the data set for that field is located.

Output from geogrid is written in the WRF I/O API format, and thus, by selecting the NetCDF I/O format, geogrid can be made to write its output in NetCDF for easy visualization using external software packages, including ncview and the new release of RIP4.

Program ungrib

The ungrib program reads GRIB files, degribs the data, and writes the data in a simple format, called the intermediate format (see the section on writing data to the intermediate format for details of the format). The GRIB files contain time-varying meteorological fields and are typically from another regional or global model, such as NCEP's NAM or GFS models. The ungrib program can read GRIB Edition 1 and GRIB Edition 2 files.

GRIB files typically contain more fields than are needed to initialize WRF. Both versions of the GRIB format use various codes to identify the variables and levels in the GRIB file. Ungrib uses tables of these codes – called Vtables, for variable tables – to define which fields to extract from the GRIB file and write to the intermediate format. Details about the codes can be found in the WMO GRIB documentation and in documentation from the originating center. Vtables for common GRIB model output files are provided with the ungrib software.

Vtables are available for NAM 104 and 212 grids, the NAM AWIP format, GFS, the NCEP/NCAR Reanalysis archived at NCAR, RUC (pressure level data and hybrid coordinate data), and AFWA's AGRMET land surface model output. Users can create their own Vtable for other model output using any of the Vtables as a template; further details on the meaning of fields in a Vtable are provided in the section on creating and editing Vtables.

Ungrib can write intermediate data files in any one of three user-selectable formats: WPS – a new format containing additional information useful for the downstream programs; SI – the previous intermediate format of the WRF system; and MM5 format, which is included here so that ungrib can be used to provide GRIB2 input to the MM5 modeling system. Any of these formats may be used by WPS to initialize WRF, although the WPS format is recommended.

Program metgrid

The metgrid program horizontally interpolates the intermediate-format meteorological data that are extracted by the ungrib program onto the simulation domains defined by the geogrid program. The interpolated metgrid output can then be ingested by the real.exe program. The range of dates that will be interpolated by metgrid are defined in the “share” namelist record of the WPS namelist file, and date ranges must be specified individually in the namelist for each simulation domain. Since the work of the metgrid program, like that of the ungrib program, is time-dependent, metgrid is run every time a new simulation is initialized.

Control over how each meteorological field is interpolated is provided by the METGRID.TBL file. The METGRID.TBL file provides one section for each field, and within a section, it is possible to specify options such as the interpolation methods to be used for the field, the field that acts as the mask to be used for masked interpolations, and the staggering (e.g., U, V in ARW; H, V in NMM) to which a field is to be interpolated.

Output from metgrid is written in the WRF I/O API format, and thus, by selecting the NetCDF I/O format, metgrid can be made to write its output in NetCDF for easy visualization using external software packages, including the new version of RIP4.

 

Installing the WPS

The WRF Preprocessing System uses a build mechanism similar to that used by the WRF model. External libraries for geogrid and metgrid are limited to those required by the WRF model, since the WPS uses the WRF model's implementations of the I/O API; consequently, WRF must be compiled prior to installation of the WPS so that the I/O API libraries in the “external” directory of WRF will be available to WPS programs. Additionally, the ungrib program requires three compression libraries for GRIB Edition 2 support; however, if support for GRIB2 data is not needed, ungrib can be compiled without these compression libraries.

Required Libraries

The only library that is required to build the WRF model is NetCDF.  The user can find the source code, precompiled binaries, and documentation at the UNIDATA home page (http://www.unidata.ucar.edu/software/netcdf/). Most users will select the NetCDF I/O option for WPS due to the easy access to utility programs that support the NetCDF data format.

Where WRF adds a software layer between the model and the communications package, the WPS parallel programs make MPI calls directly. Most multi-processor machines come preconfigured with a version of MPI, so it is unlikely that users will need to install this package by themselves.

Three libraries are required by the ungrib program for GRIB Edition 2 compression support. Users are encouraged to engage their system administrators for the installation of these packages so that traditional library paths and include paths are maintained. Paths to user-installed compression libraries are handled in the configure.wps file.

 

1) JasPer (an implementation of the JPEG2000 standard for "lossy" compression)

http://www.ece.uvic.ca/~mdadams/jasper/

Go down to “JasPer software”, one of the "click here" parts is the source.

 

      > ./configure

      > make

      > make install

 

2) zlib (another compression library, which is used by the PNG library)

http://www.zlib.net/

Go to "The current release is publicly available here" section and download.

 

      > ./configure

      > make

      > make install

 

3) PNG (compression library for "lossless" compression)

http://www.libpng.org/pub/png/libpng.html

Scroll down to "Source code" and choose a mirror site.

 

      > ./configure

      > make check

      > make install

 

To get around portability issues, the NCEP GRIB libraries, w3 and g2, have been included in the WPS distribution. The original versions of these libraries are available for download from NCEP at http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/. The specific tar files to download are g2lib and w3lib. Because the ungrib program requires modules from these files, they are not suitable for usage with a traditional library option during the link stage of the build.

Required Compilers and Scripting Languages

The WPS requires the same Fortran and C compilers used to build the WRF model. The following table lists the currently supported operating system and compiler combinations for WPS.

Architecture

OS

Compiler

IBM POWER-4/5

AIX

xlf90

Compaq Alpha

OSF1

f90

PC x86

GNU/Linux 32-bit

PGI (pgf90)

PC x86

GNU/Linux 32-bit

Intel (ifort)

PC x86

GNU/Linux 32-bit

g95

PC x86_64

GNU/Linux 32-bit

PGI (pgf90)

PC x86_64

GNU/Linux 32-bit

PathScale (pathf90)

SGI

IRIX64

f90

SGI Altix

Linux

Intel (ifort)

Sun

SunOS

f90

Apple G5

OS X

xlf90

 

Installation Steps

      >ls

 

      -rw-r--r--  1  537490 Oct 30 16:38 WPS.tar.gz

      drwxr-xr-x 17     512 Oct 30 16:18 WRFV2

 

      >tar xf WPS.tar.gz

 

      >ls

 

      drwxr-xr-x  8     512 Oct 30 16:38 WPS

      -rw-r--r--  1  537490 Oct 30 16:38 WPS.tar.gz

      drwxr-xr-x 17     512 Oct 30 16:18 WRFV2

 

      >cd WPS

 

      >./configure

o        Choose one of the configure options

      >./compile >& compile.output

      >ls

 

      drwxr-xr-x 2     512 Oct 30 16:38 arch

      -rwxr-xr-x 1    1672 Sep  8 18:50 clean

      -rwxr-xr-x 1    3349 Sep 12 11:11 compile

      -rw-r--r-- 1  100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1    4257 Jul 19 13:47 configure

      -rw-r--r-- 1    2465 Nov  1 10:00 configure.wps

      drwxr-xr-x 5     512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1      23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rwxr-xr-x 1    1138 Aug  3 10:09 link_grib.csh

      drwxr-xr-x 4     512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1      23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1    1638 Oct 30 11:54 namelist.wps

      -rw-r--r-- 1    5074 Sep 15 13:05 README

      drwxr-xr-x 7     512 Oct 30 16:38 test_suite

      drwxr-xr-x 4     512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1      21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      drwxr-xr-x 3     512 Nov  1 10:02 util

      -rw-r--r-- 1      13 Oct 30 16:38 VERSION

 

Running the WPS

There are essentially three main steps to running the WRF Preprocessing System:

1.      Define a model domain and nests with geogrid.

2.      Extract meteorological data from GRIB data sets for the simulation period with ungrib.

3.      Horizontally interpolate meteorological data to the model domains with metgrid.

When multiple simulations are to be run for the same model domains, it is only necessary to perform the first step once; thereafter, only time-varying data need to be processed for each simulation using steps two and three. Below, the details of each of the three steps are explained.

Step 1: Define model domains with geogrid.

In the root of the WPS directory structure, symbolic links to the programs geogrid.exe, ungrib.exe, and metgrid.exe should exist if the WPS software was successfully installed. In addition to these three links, a namelist.wps file should exist. Thus, a listing of the WPS root directory should look something like:

      >ls

 

      drwxr-xr-x 2     512 Oct 30 16:38 arch

      -rwxr-xr-x 1    1672 Sep  8 18:50 clean

      -rwxr-xr-x 1    3349 Sep 12 11:11 compile

      -rw-r--r-- 1  100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1    4257 Jul 19 13:47 configure

      -rw-r--r-- 1    2465 Nov  1 10:00 configure.wps

      drwxr-xr-x 5     512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1      23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rwxr-xr-x 1    1138 Aug  3 10:09 link_grib.csh

      drwxr-xr-x 4     512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1      23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1    1638 Oct 30 11:54 namelist.wps

      -rw-r--r-- 1    5074 Sep 15 13:05 README

      drwxr-xr-x 7     512 Oct 30 16:38 test_suite

      drwxr-xr-x 4     512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1      21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      drwxr-xr-x 3     512 Nov  1 10:02 util

      -rw-r--r-- 1      13 Oct 30 16:38 VERSION

 

 

The model domain and nests are defined in the “geogrid” namelist record of the namelist.wps file, and, in addition, parameters in the “share” namelist record need to be set. An example of these two namelist records is given below, and the user is referred to the description of namelist variables for more information on the purpose and possible values of each variable.

 

&share

 wrf_core = 'ARW',

 max_dom = 2,

 start_date = '2006-08-16_12:00:00','2006-08-16_12:00:00',

 end_date   = '2006-08-16_18:00:00','2006-08-16_12:00:00',

 interval_seconds = 21600

 io_form_geogrid = 2,

 opt_output_from_geogrid_path = './',

 debug_level = 0

/

&geogrid

 parent_id         =   1, 1,

 parent_grid_ratio =   1, 3,

 i_parent_start    =   1, 31

 j_parent_start    =   1, 17

 s_we              =   1, 1,

 e_we              =  74,112,

 s_sn              =   1, 1,

 e_sn              =  61,97,

 geog_data_res     = '10m','2m',

 dx = 30000,

 dy = 30000,

 map_proj = 'lambert',

 ref_lat   = 34.83

 ref_lon   = -81.03

 truelat1  =  30.0,

 truelat2  =  60.0,

 stand_lon = -98.

 geog_data_path = '/data3a/mp/gill/DATA/GEOG'

 opt_geogrid_tbl_path = 'geogrid/'

/

 

To summarize a set of typical changes to the “share” namelist record relevant to geogrid, the WRF dynamical core must first be selected with wrf_core, and the number of nests, including the mother domain, must be chosen with max_dom. Additionally, a location (if not the default – the current working directory) where domain files should be written to may be chosen with opt_output_from_geogrid_path, and the format of these domain files may be changed with io_form_geogrid.

 

In the “geogrid” namelist record, the projection of the simulation domain is defined, as are the size and location of all model grids. Again, the user is referred to a description of the namelist variables for more details on the meaning and possible values for each variable.

 

Having suitably defined the simulation coarse domain and nested domains, the geogrid.exe executable may be run to produce domain files, which are named geo_em.d0N.nc, where N is the number of the nest defined in each file. It is important, to note that the geo_em prefix is used for ARW domain files, while the geo_nmm prefix is used for NMM domain files; also, the file suffix will vary depending on the io_form_geogrid that is selected. To run geogrid, issue the following command:

 

               >geogrid.exe

 

After running geogrid.exe, the success message

 

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

 

should be printed, and a listing of the WPS root directory (or the directory specified by opt_output_from_geogrid_path, if not ‘./’) should show the domain files. If not, the geogrid.log file may be consulted in an attempt to determine the possible cause of failure. For more information on checking the output of geogrid, the user is referred to the section on checking WPS output.

 

      >ls

 

      drwxr-xr-x 2     512 Oct 30 16:38 arch

      -rwxr-xr-x 1    1672 Sep  8 18:50 clean

      -rwxr-xr-x 1    3349 Sep 12 11:11 compile

      -rw-r--r-- 1  100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1    4257 Jul 19 13:47 configure

      -rw-r--r-- 1    2465 Nov  1 10:00 configure.wps

      -rw-r--r-- 1 1831720 Nov  1 10:22 geo_em.d01.nc

      -rw-r--r-- 1 4443720 Nov  1 10:22 geo_em.d02.nc

      drwxr-xr-x 5     512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1      23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rw-r--r-- 1    9672 Nov  1 10:22 geogrid.log

      -rwxr-xr-x 1    1138 Aug  3 10:09 link_grib.csh

      drwxr-xr-x 4     512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1      23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1    1638 Oct 30 11:54 namelist.wps

      -rw-r--r-- 1    5074 Sep 15 13:05 README

      drwxr-xr-x 7     512 Oct 30 16:38 test_suite

      drwxr-xr-x 4     512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1      21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      drwxr-xr-x 3     512 Nov  1 10:02 util

      -rw-r--r-- 1      13 Oct 30 16:38 VERSION

 

 

Step 2: Extracting meteorological fields from GRIB files with ungrib.

Having already downloaded meteorological data in GRIB format, the first step in extracting fields to the intermediate format involves editing the “share” and “ungrib” namelist records of the namelist.wps file – the same file that was edited to define the simulation domains. An example of the two namelist records is given below.

&share

 wrf_core = 'ARW',

 max_dom = 2,

 start_date = '2006-08-16_12:00:00','2006-08-16_12:00:00',

 end_date   = '2006-08-16_18:00:00','2006-08-16_12:00:00',

 interval_seconds = 21600

 io_form_geogrid = 2,

 opt_output_from_geogrid_path = './',

 debug_level = 0

/

 

&ungrib
 out_format = 'WPS',

 prefix     = 'FILE'
/

 

In the “share” namelist record, the variables that are of relevance to ungrib are the starting and ending times of the mother domain (start_year, start_month, start_day, start_hour, end_year, end_month, end_day, and end_hour) and the interval between meteorological data files (interval_seconds). In the “ungrib” namelist record, the only variable, out_format, defines the format of the intermediate data to be written by ungrib. The metgrid program can read any of the formats supported by ungrib, and thus, any of ‘WPS’, ‘SI’, and ‘MM5’ may be specified for out_format.

 

After suitably modifying the namelist.wps file, a Vtable must be supplied, and the GRIB files must be linked (or copied) to the filenames that are expected by ungrib. The WPS is supplied with Vtable files for many sources of meteorological data, and the appropriate Vtable may simply be symbolically linked to the file “Vtable,” which is the Vtable name expected by ungrib. For example, if the GRIB data are from the GFS model, this may be accomplished with

 

      >ln -s ungrib/Variable_Tables/Vtable.GFS Vtable

 

The ungrib program will try to read GRIB files named GRIBFILE.AAA, GRIBFILE.AAB, …, GRIBFILE.ZZZ. In order to simplify the work of linking the GRIB files to these filenames, a shell script, link_grib.csh, is provided. The link_grib.csh script takes as a command-line argument a list of the GRIB files to be linked. For example, if the GRIB data were downloaded to the directory /mmmtmp/mm5rt/data/gfs, the files could be linked with link_grib.csh as in the following commands:

 

     >ls /mmmtmp/mm5rt/data/gfs

 

      -rw-r--r-- 1  24008620 Nov  1 08:25 gfs_060816_12_00

      -rw-r--r-- 1  27106796 Nov  1 08:28 gfs_060816_12_06

 

      >link_grib.csh /mmmtmp/mm5rt/data/gfs/gfs_061101_12_*

 

After linking the GRIB files and Vtable, a listing of the WPS directory should look something like the following:

 

            >ls

 

      drwxr-xr-x 2      512 Oct 30 16:38 arch

      -rwxr-xr-x 1     1672 Sep  8 18:50 clean

      -rwxr-xr-x 1     3349 Sep 12 11:11 compile

      -rw-r--r-- 1   100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1     4257 Jul 19 13:47 configure

      -rw-r--r-- 1     2465 Nov  1 10:00 configure.wps

      -rw-r--r-- 1  1831720 Nov  1 10:22 geo_em.d01.nc

      -rw-r--r-- 1  4443720 Nov  1 10:22 geo_em.d02.nc

      drwxr-xr-x 5      512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1       23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rw-r--r-- 1     9672 Nov  1 10:22 geogrid.log

      lrwxrwxrwx 1       39 Nov  1 10:35 GRIBFILE.AAA -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_00

      lrwxrwxrwx 1       39 Nov  1 10:35 GRIBFILE.AAB -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_06

      -rwxr-xr-x 1     1138 Aug  3 10:09 link_grib.csh

      drwxr-xr-x 4      512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1       23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1     1638 Oct 30 11:54 namelist.wps

      -rw-r--r-- 1     5074 Sep 15 13:05 README

      drwxr-xr-x 7      512 Oct 30 16:38 test_suite

      drwxr-xr-x 4      512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1       21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      drwxr-xr-x 3      512 Nov  1 10:02 util

      -rw-r--r-- 1       13 Oct 30 16:38 VERSION

      lrwxrwxrwx 1       33 Nov  1 10:35 Vtable -> ungrib/Variable_Tables/Vtable.GFS

 

 

After editing the namelist.wps file and linking the appropriate Vtable and GRIB files, the ungrib.exe executable may be run to produce files of meteorological data in intermediate format. Ungrib may be run by simply typing the following:

 

               >ungrib.exe >& ungrib.log

 

Since the ungrib program may produce a significant volume of output, it is recommended that ungrib output be redirected to a log file, as shown in the command above. If ungrib.exe runs successfully, the message

 

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

 

will be written to the end of the ungrib.log file, and the intermediate files should appear in the current working directory. The intermediate files written by ungrib will have names of the form FILE:YYYY-MM-DD_HH.

 

      >ls

 

      drwxr-xr-x 2       512 Oct 30 16:38 arch

      -rwxr-xr-x 1      1672 Sep  8 18:50 clean

      -rwxr-xr-x 1      3349 Sep 12 11:11 compile

      -rw-r--r-- 1    100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1      4257 Jul 19 13:47 configure

      -rw-r--r-- 1      2465 Nov  1 10:00 configure.wps

      -rw-r--r-- 1  38869928 Nov  1 10:44 FILE:2006-08-16_12

      -rw-r--r-- 1  38869928 Nov  1 10:44 FILE:2006-08-16_18

      -rw-r--r-- 1   1831720 Nov  1 10:22 geo_em.d01.nc

      -rw-r--r-- 1   4443720 Nov  1 10:22 geo_em.d02.nc

      drwxr-xr-x 5       512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1        23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rw-r--r-- 1      9672 Nov  1 10:22 geogrid.log

      lrwxrwxrwx 1        39 Nov  1 10:35 GRIBFILE.AAA -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_00

      lrwxrwxrwx 1        39 Nov  1 10:35 GRIBFILE.AAB -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_06

      -rwxr-xr-x 1      1138 Aug  3 10:09 link_grib.csh

      drwxr-xr-x 4       512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1        23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1      1638 Nov  1 10:42 namelist.wps

      -rw-r--r-- 1      5074 Sep 15 13:05 README

      drwxr-xr-x 7       512 Oct 30 16:38 test_suite

      drwxr-xr-x 4       512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1        21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      -rw-r--r-- 1     29754 Nov  1 10:44 ungrib.log

      drwxr-xr-x 3       512 Nov  1 10:02 util

      -rw-r--r-- 1        13 Oct 30 16:38 VERSION

      lrwxrwxrwx 1        33 Nov  1 10:35 Vtable -> ungrib/Variable_Tables/Vtable.GFS

 

Step 3: Horizontally interpolating meterological data with metgrid.

In the final step of running the WPS, meteorological data extracted by ungrib are horizontally interpolated to the simulation grids defined by geogrid. In order to run metgrid, the namelist.wps file must be edited. In particular, the “share” and “metgrid” namelist records are of relevance to the metgrid program. Examples of these records are shown below.

&share

 wrf_core = 'ARW',

 max_dom = 2,

 start_date = '2006-08-16_12:00:00','2006-08-16_12:00:00',

 end_date   = '2006-08-16_18:00:00','2006-08-16_12:00:00',

 interval_seconds = 21600

 io_form_geogrid = 2,

 opt_output_from_geogrid_path = './',

 debug_level = 0

/

 

&metgrid
 fg_name                      = './FILE'
 io_form_metgrid              = 2,
 opt_output_from_metgrid_path = './',
 opt_metgrid_tbl_path         = 'metgrid/',
/

By this point, there is generally no need to change any of the variables in the “share” namelist record, since those variables should have been suitably set in previous steps. If not, the WRF dynamical core, number of domains, starting and ending times, and path to the domain files must be set in the “share” namelist record.

In the “metgrid” namelist record, the path and prefix of the intermediate meteorological data files must be given with fg_name, and the output format for the horizontally interpolated files should be specified with the io_form_metgrid variable. Other variables in the “metgrid” namelist record, namely, opt_output_from_metgrid_path and opt_metgrid_tbl_path, allow the user to specify where interpolated data files should be written by metgrid and where the METGRID.TBL file may be found.

After suitably editing the namelist.wps file, metgrid may be run by issuing the command

               >metgrid.exe

If metgrid successfully ran, the message

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

will be printed. After successfully running, metgrid output files should appear in the WPS root directory (or in the directory specified by opt_output_from_metgrid_path, if not set to ‘./’). These files will be named met_em.d0N.YYYY-MM-DD_HH:00:00 in the case of ARW domains, where N is the number of the nest whose data reside in the file, or met_nmm.d0N.YYYY-MM-DD_HH:00:00 in the case of NMM domains. Here, YYYY-MM-DD_HH:00:00 refers to the date of the interpolated data in each file. If these files do not exist for each of the times in the range given in the “share” namelist record, the metgrid.log file may be consulted to help in determining the problem in running metgrid.

 

      >ls  

 

      drwxr-xr-x 2       512 Oct 30 16:38 arch

      -rwxr-xr-x 1      1672 Sep  8 18:50 clean

      -rwxr-xr-x 1      3349 Sep 12 11:11 compile

      -rw-r--r-- 1    100168 Nov  1 10:02 compile.output

      -rwxr-xr-x 1      4257 Jul 19 13:47 configure

      -rw-r--r-- 1      2465 Nov  1 10:00 configure.wps

      -rw-r--r-- 1  38869928 Nov  1 10:44 FILE:2006-08-16_12

      -rw-r--r-- 1  38869928 Nov  1 10:44 FILE:2006-08-16_18

      -rw-r--r-- 1   1831720 Nov  1 10:22 geo_em.d01.nc

      -rw-r--r-- 1   4443720 Nov  1 10:22 geo_em.d02.nc

      drwxr-xr-x 5       512 Nov  1 10:02 geogrid

      lrwxrwxrwx 1        23 Nov  1 10:02 geogrid.exe -> geogrid/src/geogrid.exe

      -rw-r--r-- 1      9672 Nov  1 10:22 geogrid.log

      lrwxrwxrwx 1        39 Nov  1 10:35 GRIBFILE.AAA -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_00

      lrwxrwxrwx 1        39 Nov  1 10:35 GRIBFILE.AAB -> /mmmtmp/mm5rt/data/gfs/gfs_060816_12_06

      -rwxr-xr-x 1      1138 Aug  3 10:09 link_grib.csh

      -rw-r--r-- 1   5092340 Nov  1 10:58 met_em.d01.2006-08-16_12:00:00.nc

      -rw-r--r-- 1   5092340 Nov  1 10:58 met_em.d01.2006-08-16_18:00:00.nc

      -rw-r--r-- 1  12356572 Nov  1 10:58 met_em.d02.2006-08-16_12:00:00.nc

      drwxr-xr-x 4       512 Nov  1 10:02 metgrid

      lrwxrwxrwx 1        23 Nov  1 10:02 metgrid.exe -> metgrid/src/metgrid.exe

      -rw-r--r-- 1     62170 Nov  1 10:58 metgrid.log

      -rw-r--r-- 1      1638 Nov  1 10:58 namelist.wps

      -rw-r--r-- 1      5074 Sep 15 13:05 README

      drwxr-xr-x 7       512 Oct 30 16:38 test_suite

      drwxr-xr-x 4       512 Nov  1 10:02 ungrib

      lrwxrwxrwx 1        21 Nov  1 10:02 ungrib.exe -> ungrib/src/ungrib.exe

      -rw-r--r-- 1     29754 Nov  1 10:44 ungrib.log

      drwxr-xr-x 3       512 Nov  1 10:02 util

      -rw-r--r-- 1        13 Oct 30 16:38 VERSION

      lrwxrwxrwx 1        33 Nov  1 10:35 Vtable -> ungrib/Variable_Tables/Vtable.GFS

 

Creating Nested Domains with the WPS