ARWUsers Guide V3
ARWUsers Guide V3
ARWUsers Guide V3
April 2011
Mesoscale & Microscale Meteorology Division • National Center for Atmospheric Research
Foreword
This User’s Guide describes the Advanced Research WRF (ARW) Version 3.3 modeling
system, released in April 2011. As the ARW is developed further, this document will be
continuously enhanced and updated. Please send feedback to wrfhelp@ucar.edu.
For the latest version of this document, please visit the ARW Users’ Web site at
http://www.mmm.ucar.edu/wrf/users/.
1. Overview
− Introduction ................................................................................. 1-1
− The WRF Modeling System Program Components ..................... 1-2
2. Software Installation
− Introduction .................................................................................. 2-1
− Required Compilers and Scripting Languages ............................. 2-2
− Required/Optional Libraries to Download ..................................... 2-2
− Post-Processing Utilities .............................................................. 2-3
− Unix Environment Settings ........................................................... 2-4
− Building the WRF Code ................................................................ 2-5
− Building the WPS Code ................................................................ 2-6
− Building the WRFDA Code ........................................................... 2-7
4. WRF Initialization
− Introduction ................................................................................. 4-1
− Initialization for Ideal Data Cases ................................................ 4-3
− Initialization for Real Data Cases ................................................ 4-6
5. WRF Model
− Introduction ................................................................................ 5-1
− Installing WRF ............................................................................ 5-2
− Running WRF ............................................................................. 5-7
− Examples of namelist for various applications .......................... 5-25
− Check Output ........................................................................... 5-27
− Trouble Shooting ....................................................................... 5-28
− Physics and Dynamics Options ................................................. 5-29
− Description of Namelist Variables ............................................. 5-42
− WRF Output Fields.................................................................... 5-68
8. WRF Software
− Introduction ................................................................................. 8-1
− WRF Build Mechanism................................................................ 8-1
− Registry ....................................................................................... 8-5
− I/O Applications Program Interface (I/O API) ............................ 8-14
− Timekeeping ............................................................................. 8-14
− Software Documentation ........................................................... 8-15
− Performance ............................................................................. 8-15
9. Post-Processing Programs
− Introduction ................................................................................. 9-1
− NCL .. .......................................................................................... 9-2
− RIP4 . ........................................................................................ 9-19
− ARWpost ................................................................................... 9-28
− WPP ........................................................................................ 9-35
− VAPOR ..................................................................................... 9-50
Appendix A: WRF-Fire
− Introduction .................................................................................A-1
− WRF_Fire in idealized cases ......................................................A-3
− Fire variables in namelist.input ...................................................A-3
− namelist.input ..............................................................................A-5
− Running WRF_Fire on real data..................................................A-6
− Fire state variables ....................................................................A-12
− WRF-Fire software ................................................................... A-12
Chapter 1: Overview
Table of Contents
• Introduction
• The WRF ARW Modeling System Program Components
Introduction
The Advanced Research WRF (ARW) modeling system has been in development for the
past few years. The current release is Version 3, available since April 2008. The ARW is
designed to be a flexible, state-of-the-art atmospheric simulation system that is portable
and efficient on available parallel computing platforms. The ARW is suitable for use in a
broad range of applications across scales ranging from meters to thousands of kilometers,
including:
The WRF modeling system software is in the public domain and is freely available for
community use.
The following figure shows the flowchart for the WRF Modeling System Version 3.
As shown in the diagram, the WRF Modeling System consists of these major programs:
WPS
This program is used primarily for real-data simulations. Its functions include 1) defining
simulation domains; 2) interpolating terrestrial data (such as terrain, landuse, and soil
types) to the simulation domain; and 3) degribbing and interpolating meteorological data
from another model to this simulation domain. Its main features include:
• GRIB 1/2 meteorological data from various centers around the world
• USGS 24 category and MODIS 20 category land datasets
• Map projections for 1) polar stereographic, 2) Lambert-Conformal, 3) Mercator and
4) latitude-longitude
• Nesting
• User-interfaces to input other static data as well as met data
WRF-DA
This program is optional, but can be used to ingest observations into the interpolated
analyses created by WPS. It can also be used to update WRF model's initial condition
when WRF model is run in cycling mode. Its main features are as follows.
• It is based on incremental variational data assimilation technique, and has both 3D-
Var and 4D-Var capabilities
• It also include the capability of hybrid data assimilation (Variational + Ensemble)
• Conjugate gradient method is utilized to minimized the cost function in analysis
control variable space
• Analysis is performed on un-staggered Arakawa A-grid
• Analysis increments are interpolated to staggered Arakawa C-grid and it gets added to
the background (first guess) to get final analysis at WRF-model grid
• Conventional observation data input may be supplied both in ASCII or “PREPBUFR”
format via “obsproc” utility
• Multiple satellite observation data input may be supplied BUFR format
• Multiple radar data (reflectivity & radial velocity) input is supplied through ASCII
format
• Multiple outer loop to address the nonlinearity
• Capability to compute adjoint sensitivity
• Horizontal component of the background (first guess) error is represented via
recursive filter (for regional) or power spectrum (for global). The vertical component
is applied through projections on climatologically generated averaged eigenvectors
and its corresponding eigenvalues
• Horizontal and vertical background errors are non-separable. Each eigenvector has its
own horizontal climatologically determined length scale
• Preconditioning of background part of the cost function is done via control variable
transform U defined as B= UUT
• It includes “gen_be” utility to generate the climatological background error
covariance estimate via the NMC-method or ensemble perturbations
• A utility program to update WRF boundary condition file after WRF-DA
ARW Solver
This is the key component of the modeling system, which is composed of several
initialization programs for idealized, and real-data simulations, and the numerical
integration program. The key features of the WRF model include:
Several programs are supported, including RIP4 (based on NCAR Graphics), NCAR
Graphics Command Language (NCL), and conversion programs for other readily
available graphics packages like GrADS.
Program VAPOR, Visualization and Analysis Platform for Ocean, Atmosphere, and
Solar Researchers (http://www.vapor.ucar.edu/), is a 3-dimensional data visualization
tool, and it is developed and supported by the VAPOR team at NCAR (vapor@ucar.edu).
The details of these programs are described more in the chapters in this user's guide.
Table of Contents
• Introduction
• Required Compilers and Scripting Languages
• Required/Optional Libraries to Download
• Post-Processing Utilities
• UNIX Environment Settings
• Building the WRF Code
• Building the WPS Code
• Building the WRFDA Code
Introduction
The WRF modeling system software installation is fairly straightforward on the ported
platforms listed below. The model-component portion of the package is mostly self-
contained. The WRF model does contain the source code to a Fortran interface to ESMF
and the source to FFTPACK . Contained within the WRF system is the WRFDA
component, which has several external libraries that the user must install (for various
observation types and linear algebra solvers). Similarly, the WPS package, separate from
the WRF source code, has additional external libraries that must be built (in support of
Grib2 processing). The one external package that all of the systems require is the
netCDF library, which is one of the supported I/O API packages. The netCDF libraries or
source code are available from the Unidata homepage at http://www.unidata.ucar.edu
(select DOWNLOADS, registration required).
There are three tar files for the WRF code. The first is the WRF model (including the
real and ideal pre-processors). The second is the WRFDA code. The third tar file is for
WRF chemistry. In order to run the WRF chemistry code, both the WRF model and the
chemistry tar file must be combined.
The WRF model has been successfully ported to a number of Unix-based machines. We
do not have access to all of them and must rely on outside users and vendors to supply the
required configuration information for the compiler and loader options. Below is a list of
the supported combinations of hardware and software for WRF.
The WRF model may be built to run on a single processor machine, a shared-memory
machine (that use the OpenMP API), a distributed memory machine (with the appropriate
MPI libraries), or on a distributed cluster (utilizing both OpenMP and MPI). The
WRFDA and WPS packages run on the above listed systems.
The majority of the WRF model, WPS, and WRFDA codes are written in Fortran (what
many refer to as Fortran 90). The software layer, RSL, which sits between WRF and
WRFDA, and the MPI interface is written in C. WPS makes direct calls to the MPI
libraries for distributed memory message passing. There are also ancillary programs that
are written in C to perform file parsing and file construction, which are required for
default building of the WRF modeling code. Additionally, the WRF build mechanism
uses several scripting languages: including perl, Cshell and Bourne shell. The traditional
UNIX text/file processing utilities are used: make, m4, sed, and awk. See Chapter 8:
WRF Software (Required Software) for a more detailed listing of the necessary pieces for
the WRF build.
The only library that is always required is the netCDF package from Unidata (login >
Downloads > NetCDF). Most of the WRF post-processing packages assume that the data
from the WRF model, the WPS package, or the WRFDA program is using the netCDF
libraries. One may also need to add /path-to-netcdf/netcdf/bin to your path so that one
may execute netCDF utility commands, such as ncdump. Use a netCDF version that is
3.6.1 or later. WRF does not currently use any of the additional capabilities that are in
the newer versions of netCDF (such as 4.0 and later): compression, chunking, HDF5, etc.
Note 1: If one wants to compile WRF system components on a Linux system that has
access to multiple compilers, link the correct external libraries. For example, do not link
the libraries built with PathScale when compiling the WRF components with gfortran.
Even more, the same options when building the netCDF libraries must be used when
building the WRF code (32 vs 64 bit, assumptions about underscores in the symbol
names, etc.).
Note 2: If netCDF-4 is used, be sure that it is installed without activating the new
capabilities (such as parallel I/O based on HDF5). The WRF modeling system currently
only uses its classic data model supported in netCDF-4.
If you are going to be running distributed memory WRF jobs, you need a version of MPI.
You can pick up a version of mpich, but you might want your system group to install the
code. A working installation of MPI is required prior to a build of WRF using distributed
memory. Either MPI-1 or MPI-2 are acceptable. Do you already have an MPI lying
around? Try
which mpif90
which mpicc
which mpirun
If these are all defined executables in your path, you are probably OK. Make sure your
paths are set up to point to the MPI lib, include, and bin directories. As with the
netCDF libraries, you must build MPI consistently with the WRF source code.
Note that to output WRF model data in Grib1 format, Todd Hutchinson (WSI) has
provided a complete source library that is included with the software release. However,
when trying to link the WPS, the WRF model, and the WRFDA data streams together,
always use the netCDF format.
Post-Processing Utilities
The more widely used (and therefore supported) WRF post-processing utilities are:
There are only a few environmental settings that are WRF system related. Most of these
are not required, but when things start acting badly, test some out. In Cshell syntax:
• setenv WRF_EM_CORE 1
o if you have OpenMP on your system, this is how to specify the number of
threads
• setenv MP_STACK_SIZE 64000000
o OpenMP blows through the stack size, set it large.
o However, if the model still crashes, it may be a problem of over specifying
stack size. Set stack size sufficiently large, but not unlimited.
o On some system, the equivalent parameter could be KMP_STACKSIZE,
or OMP_STACKSIZE.
• unlimit
The WRF code has a fairly complicated build mechanism. It tries to determine the
architecture that you are on, and then presents you with options to allow you to select the
preferred build method. For example, if you are on a Linux machine, it determines
whether this is a 32 or 64 bit machine, and then prompts you for the desired usage of
processors (such as serial, shared memory, or distributed memory). You select from
among the available compiling options in the build mechanism. For example, do not
choose a PGI build if you do not have PGI compilers installed on your system.
The WRF code supports a parallel build option, an option that compiles separate source
code files in the WRF directories at the same time on separate processors (though those
processors need to share memory) via a parallel make. The purpose of the parallel build
option is to be able to speed-up the time required to construct executables. In practice,
Users may wish to only use a single processor for the build. In which case:
setenv J “-j 1”
Users wishing to run the WRF chemistry code must first download the WRF model tar
file, and untar it. Then the chemistry code is untar’ed in the WRFV3 directory (this is the
chem directory structure). Once the source code from the tar files is combined, then
users may proceed with the WRF chemistry build.
WRFDA uses the same build mechanism as WRF; thus, this mechanism must be
instructed to configure and build the code for WRFDA rather than WRF. Additionally,
the paths to libraries needed by WRFDA code must be set, as described in the steps
below.
setenv BUFR 1
o If you intend to use satellite radiance data, the RTM (Radiative Transfer
Model) is required. The current RTM versions that WRFDA uses are
CRTM v2.0.2 and RTTOV v10. WRFDA can compile with CRTM only,
or RTTOV only, or both CRTM and RTTOV together.
(Note: the latest available CRTM version 2.0.2 is included in this release
version and it will be compiled automatically when the appropriate
For Csh:
For Bash:
gfortran:export GFORTRAN_CONVERT_UNIT="little_endian:94-99"
ifort :export F_UFMTENDIAN="little:94-99"
• ./configure wrfda
o serial means single processor
o smpar means Symmetric Multi-Processing/Shared Memory Parallel
(OpenMP)
o dmpar means Distributed Memory Parallel (MPI)
o dm+sm means Distributed Memory with Shared Memory (for example,
MPI across nodes with OpenMP within a node)
• ./compile all_wrfvar
• ls -ls var/build/*.exe
o If the compilation was successful, da_wrfvar.exe,
da_update_bc.exe, and other executables should be found in the
var/build directory. Their links are in the var/da directory;
obsproc.exe should be found in the var/obsproc/src directory
Table of Contents
• Introduction
• Function of Each WPS Program
• Installing the WPS
• Running the WPS
• Creating Nested Domains with the WPS
• Selecting Between USGS and MODIS-based Land Use Data
• Selecting Static Data for the Gravity Wave Drag Scheme
• Using Multiple Meteorological Data Sources
• Alternative Initialization of Lake SSTs
• Parallelism in the WPS
• Checking WPS Output
• WPS Utility Programs
• Writing Meteorological Data to the Intermediate Format
• Creating and Editing Vtables
• Writing Static Data to the Geogrid Binary Format
• Description of Namelist Variables
• Description of GEOGRID.TBL Options
• Description of index Options
• Description of METGRID.TBL Options
• Available Interpolation Options in Geogrid and Metgrid
• Land Use and Soil Categories in the Static Data
• WPS Output Fields
Introduction
The WRF Preprocessing System (WPS) is a set of three programs whose collective role is
to prepare input to the real 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 performed within the real program.
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 GEOGRID.TBL, METGRID.TBL,
and Vtable files are explained later in this document, though 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 large 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.
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 domains are defined using
information specified by the user in the “geogrid” namelist record of the WPS namelist
file, namelist.wps. In addition to computing the latitude, longitude, and map scale factors
at 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 by default. Global data sets
for each of these fields are provided through the WRF download page, and, because these
data are time-invariant, they 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'; here, " denotes arc seconds and ' denotes arc minutes. 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 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
static 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 or 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 file system 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, NCL, 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, if compiled with a
"GRIB2" option, 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 provided 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), AFWA's AGRMET land surface model output, ECMWF, and other data
sets. 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
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.
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 WRF I/O
API; consequently, WRF must be compiled prior to installation of the WPS so that the I/O
API libraries in the WRF external directory 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, and before configuring the WPS, users should ensure that the environment
variable NETCDF is set to the path of the NetCDF installation.
Where WRF adds a software layer between the model and the communications package,
the WPS programs geogrid and metgrid 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 by the
COMPRESSION_LIBS and COMPRESSION_INC variables.
> ./configure
> make
> make install
Note: The GRIB2 libraries expect to find include files in "jasper/jasper.h", so it may be
necessary to manually create a "jasper" subdirectory in the "include" directory created by
the JasPer installation, and manually link header files there.
> ./configure
> make check
> make install
> ./configure
> make
> 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.
The WPS requires the same Fortran and C compilers as were used to build the WRF
model, since the WPS executables link to WRF's I/O API libraries. After executing the
./configure command in the WPS directory, a list of supported compilers on the
current system architecture are presented.
• Download the WPSV3.TAR.gz file and unpack it at the same directory level as
WRFV3, as shown below.
> ls
-rw-r--r-- 1 563863 WPS.TAR.gz
drwxr-xr-x 18 4096 WRFV3
> gzip -d WPSV3.TAR.gz
> ls
drwxr-xr-x 7 4096 WPS
-rw-r--r-- 1 3491840 WPSV3.TAR
drwxr-xr-x 18 4096 WRFV3
• At this point, a listing of the current working directory should at least include the
directories WRFV3 and WPS. First, compile WRF (see the instructions for
installing WRF). Then, after the WRF executables are generated, change to the
WPS directory and issue the configure command followed by the compile
command as below.
> cd WPS
> ./configure
• After issuing the compile command, a listing of the current working directory
should reveal symbolic links to executables for each of the three WPS programs:
geogrid.exe, ungrib.exe, and metgrid.exe. If any of these links do not exist, check
the compilation output in compile.output to see what went wrong.
> ls
drwxr-xr-x 2 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
drwxr-xr-x 4 4096 geogrid
lrwxrwxrwx 1 23 geogrid.exe -> geogrid/src/geogrid.exe
-rwxr-xr-x 1 1328 link_grib.csh
drwxr-xr-x 3 4096 metgrid
lrwxrwxrwx 1 23 metgrid.exe -> metgrid/src/metgrid.exe
-rw-r--r-- 1 1101 namelist.wps
-rw-r--r-- 1 1987 namelist.wps.all_options
-rw-r--r-- 1 1075 namelist.wps.global
-rw-r--r-- 1 652 namelist.wps.nmm
-rw-r--r-- 1 4786 README
drwxr-xr-x 4 4096 ungrib
lrwxrwxrwx 1 21 ungrib.exe -> ungrib/src/ungrib.exe
drwxr-xr-x 3 4096 util
There are essentially three main steps to running the WRF Preprocessing System:
1. Define a model coarse domain and any nested domains with geogrid.
2. Extract meteorological fields from GRIB data sets for the simulation period with
ungrib.
3. Horizontally interpolate meteorological fields 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. Similarly, if several model domains are being
run for the same time period using the same meteorological data source, it is not
necessary to run ungrib separately for each simulation. Below, the details of each of the
three steps are explained.
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 in the
WPS root directory should look something like:
> ls
drwxr-xr-x 2 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
The model coarse domain and any nested domains are defined in the “geogrid” namelist
record of the namelist.wps file, and, additionally, 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 = '2008-03-24_12:00:00','2008-03-24_12:00:00',
end_date = '2008-03-24_18:00:00','2008-03-24_12:00:00',
interval_seconds = 21600,
io_form_geogrid = 2
/
&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 = '/mmm/users/wrfhelp/WPS_GEOG/'
/
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. If WPS is being run for
an ARW simulation, wrf_core should be set to 'ARW', and if running for an NMM
simulation, it should be set to 'NMM'. After selecting the dynamical core, the total number
of domains (in the case of ARW) or nesting levels (in the case of NMM) must be chosen
with max_dom. Since geogrid produces only time-independent data, the start_date,
end_date, and interval_seconds variables are ignored by geogrid. Optionally, a
location (if not the default, which is the current working directory) where domain files
In the “geogrid” namelist record, the projection of the simulation domain is defined, as
are the size and location of all model grids. The map projection to be used for the model
domains is specified with the map_proj variable. Each of the four possible map
projections in the ARW are shown graphically in the full-page figure below, and the
namelist variables used to set the parameters of the projection are summarized in the
following table.
If the earth’s geographic latitude-longitude grid coincides with the computational grid, a
global ARW domain shows the earth’s surface as it is normally visualized on a regular
latitude-longitude grid. If instead the geographic grid does not coincide with the model
computational grid, geographical meridians and parallels appear as complex curves. The
difference is most easily illustrated by way of example. In top half of the figure below,
the earth is shown with the geographical latitude-longitude grid coinciding with the
computational latitude-longitude grid. In the bottom half, the geographic grid (not shown)
has been rotated so that the geographic poles of the earth are no longer located at the
poles of the computational grid.
When WRF is to be run for a regional domain configuration, the location of the coarse
domain is determined using the ref_lat and ref_lon variables, which specify the
latitude and longitude, respectively, of the center of the coarse domain. If nested domains
are to be processed, their locations with respect to the parent domain are specified with
the i_parent_start and j_parent_start variables; further details of setting up nested
domains are provided in the section on nested domains. Next, the dimensions of the
coarse domain are determined by the variables dx and dy, which specify the nominal grid
distance in the x-direction and y-direction, and e_we and e_sn, which give the number of
velocity points (i.e., u-staggered or v-staggered points) in the x- and y-directions; for the
'lambert', 'mercator', and 'polar' projections, dx and dy are given in meters, and
for the 'lat-lon' projection, dx and dy are given in degrees. For nested domains, only
the variables e_we and e_sn are used to determine the dimensions of the grid, and dx and
dy should not be specified for nests, since their values are determined recursively based
on the values of the parent_grid_ratio and parent_id variables, which specify the
ratio of a nest's parent grid distance to the nest's grid distance and the grid number of the
nest's parent, respectively.
If the regular latitude-longitude projection will be used for a regional domain, care must
be taken to ensure that the map scale factors in the region covered by the domain do not
deviate significantly from unity. This can be accomplished by rotating the projection such
that the area covered by the domain is located near the equator of the projection, since,
for the regular latitude-longitude projection, the map scale factors in the x-direction are
given by the cosine of the computational latitude. For example, in the figure above
showing the unrotated and rotated earth, it can be seen that, in the rotated aspect, New
Zealand is located along the computational equator, and thus, the rotation used there
would be suitable for a domain covering New Zealand. As a general guideline for
rotating the latitude-longitude projection for regional domains, the namelist parameters
pole_lat, pole_lon, and stand_lon may be chosen according to the formulas in the
following table.
For global WRF simulations, the coverage of the coarse domain is, of course, global, so
ref_lat and ref_lon do not apply, and dx and dy should not be specified, since the
nominal grid distance is computed automatically based on the number of grid points.
Also, it should be noted that the latitude-longitude, or cylindrical equidistant, projection
(map_proj = 'lat-lon') is the only projection in WRF that can support a global
domain. Nested domains within a global domain must not cover any area north of
computational latitude +45 or south of computational latitude -45, since polar filters are
applied poleward of these latitudes (although the cutoff latitude can be changed in the
WRF namelist).
Besides setting variables related to the projection, location, and coverage of model
domains, the path to the static geographical data sets must be correctly specified with the
geog_data_path variable. Also, the user may select which resolution of static data
geogrid will interpolate from using the geog_data_res variable, whose value should
match one of the resolutions of data in the GEOGRID.TBL. If the full set of static data
are downloaded from the WRF download page, possible resolutions include '30s', '2m',
'5m', and '10m', corresponding to 30-arc-second data, 2-, 5-, and 10-arc-minute data.
> ls geogrid/GEOGRID.TBL
For more details on the meaning and possible values for each variable, the user is referred
to a description of the namelist variables.
Having suitably defined the simulation coarse domain and nested domains in the
namelist.wps file, the geogrid.exe executable may be run to produce domain files. In the
case of ARW domains, the domain files are named geo_em.d0N.nc, where N is the
number of the nest defined in each file. When run for NMM domains, geogrid produces
the file geo_nmm.d01.nc for the coarse domain, and geo_nmm_nest.l0N.nc files for
each nesting level N. Also, note that the file suffix will vary depending on the
io_form_geogrid that is selected. To run geogrid, issue the following command:
> ./geogrid.exe
should be printed, and a listing of the WPS root directory (or the directory specified by
opt_output_from_geogrid_path, if this variable was set) 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 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
-rw-r--r-- 1 1957004 geo_em.d01.nc
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 = '2008-03-24_12:00:00','2008-03-24_12:00:00',
end_date = '2008-03-24_18:00:00','2008-03-24_12:00:00',
interval_seconds = 21600,
io_form_geogrid = 2
/
&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 coarse domain (start_date and end_date; alternatively,
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 variable out_format is used to select 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, although 'WPS' is recommended. Also in the "ungrib" namelist, the user
may specify a path and prefix for the intermediate files with the prefix variable. For
example, if prefix were set to 'ARGRMET', then the intermediate files created by ungrib
would be named according to AGRMET:YYYY-MM-DD_HH, where YYYY-MM-DD_HH
is the valid time of the data in the file.
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 could be
accomplished with
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 /data/gfs, the files could be linked with
link_grib.csh as follows:
> ls /data/gfs
-rw-r--r-- 1 42728372 gfs_080324_12_00
-rw-r--r-- 1 48218303 gfs_080324_12_06
> ./link_grib.csh /data/gfs/gfs*
After linking the GRIB files and Vtable, a listing of the WPS directory should look
something like the following:
> ls
drwxr-xr-x 2 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
-rw-r--r-- 1 1957004 geo_em.d01.nc
-rw-r--r-- 1 4745324 geo_em.d02.nc
drwxr-xr-x 4 4096 geogrid
lrwxrwxrwx 1 23 geogrid.exe -> geogrid/src/geogrid.exe
-rw-r--r-- 1 11169 geogrid.log
lrwxrwxrwx 1 38 GRIBFILE.AAA -> /data/gfs/gfs_080324_12_00
lrwxrwxrwx 1 38 GRIBFILE.AAB -> /data/gfs/gfs_080324_12_06
-rwxr-xr-x 1 1328 link_grib.csh
drwxr-xr-x 3 4096 metgrid
lrwxrwxrwx 1 23 metgrid.exe -> metgrid/src/metgrid.exe
-rw-r--r-- 1 1094 namelist.wps
-rw-r--r-- 1 1987 namelist.wps.all_options
-rw-r--r-- 1 1075 namelist.wps.global
-rw-r--r-- 1 652 namelist.wps.nmm
-rw-r--r-- 1 4786 README
drwxr-xr-x 4 4096 ungrib
lrwxrwxrwx 1 21 ungrib.exe -> ungrib/src/ungrib.exe
drwxr-xr-x 3 4096 util
lrwxrwxrwx 1 33 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 the
intermediate format. Ungrib may be run by simply typing the following:
Since the ungrib program may produce a significant volume of output, it is recommended
that ungrib output be redirected to a file, as in the command above. If ungrib.exe runs
successfully, the message
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of ungrib. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
will be written to the end of the ungrib.output 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 (unless, of course, the prefix variable
was set to a prefix other than 'FILE').
> ls
drwxr-xr-x 2 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
-rw-r--r-- 1 154946888 FILE:2008-03-24_12
-rw-r--r-- 1 154946888 FILE:2008-03-24_18
-rw-r--r-- 1 1957004 geo_em.d01.nc
-rw-r--r-- 1 4745324 geo_em.d02.nc
drwxr-xr-x 4 4096 geogrid
lrwxrwxrwx 1 23 geogrid.exe -> geogrid/src/geogrid.exe
-rw-r--r-- 1 11169 geogrid.log
lrwxrwxrwx 1 38 GRIBFILE.AAA -> /data/gfs/gfs_080324_12_00
lrwxrwxrwx 1 38 GRIBFILE.AAB -> /data/gfs/gfs_080324_12_06
-rwxr-xr-x 1 1328 link_grib.csh
drwxr-xr-x 3 4096 metgrid
lrwxrwxrwx 1 23 metgrid.exe -> metgrid/src/metgrid.exe
-rw-r--r-- 1 1094 namelist.wps
-rw-r--r-- 1 1987 namelist.wps.all_options
-rw-r--r-- 1 1075 namelist.wps.global
-rw-r--r-- 1 652 namelist.wps.nmm
-rw-r--r-- 1 4786 README
drwxr-xr-x 4 4096 ungrib
lrwxrwxrwx 1 21 ungrib.exe -> ungrib/src/ungrib.exe
-rw-r--r-- 1 1418 ungrib.log
-rw-r--r-- 1 27787 ungrib.output
drwxr-xr-x 3 4096 util
lrwxrwxrwx 1 33 Vtable ->
ungrib/Variable_Tables/Vtable.GFS
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 = '2008-03-24_12:00:00','2008-03-24_12:00:00',
end_date = '2008-03-24_18:00:00','2008-03-24_12:00:00',
interval_seconds = 21600,
io_form_geogrid = 2
/
&metgrid
fg_name = 'FILE',
io_form_metgrid = 2,
/
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
the "share" namelist was not edited while running geogrid and ungrib, however, the WRF
dynamical core, number of domains, starting and ending times, interval between
meteorological data, and path to the static domain files must be set in the “share”
namelist record, as described in the steps to run geogrid and ungrib.
In the “metgrid” namelist record, the path and prefix of the intermediate meteorological
data files must be given with fg_name, the full path and file names of any intermediate
files containing constant fields may be specified with the constants_name variable, and
the output format for the horizontally interpolated files may 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.
As with geogrid and the GEOGRID.TBL file, a METGRID.TBL file appropriate for the
WRF core must be linked in the metgrid directory (or in the directory specified by
opt_metgrid_tbl_path, if this variable is set).
> ls metgrid/METGRID.TBL
After suitably editing the namelist.wps file and verifying that the correct METGRID.TBL
will be used, metgrid may be run by issuing the command
> ./metgrid.exe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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 this
variable was set). These files will be named met_em.d0N.YYYY-MM-DD_HH:mm:ss.nc in
the case of ARW domains, where N is the number of the nest whose data reside in the file,
> ls
drwxr-xr-x 2 4096 arch
-rwxr-xr-x 1 1672 clean
-rwxr-xr-x 1 3510 compile
-rw-r--r-- 1 85973 compile.output
-rwxr-xr-x 1 4257 configure
-rw-r--r-- 1 2486 configure.wps
-rw-r--r-- 1 154946888 FILE:2008-03-24_12
-rw-r--r-- 1 154946888 FILE:2008-03-24_18
-rw-r--r-- 1 1957004 geo_em.d01.nc
-rw-r--r-- 1 4745324 geo_em.d02.nc
drwxr-xr-x 4 4096 geogrid
lrwxrwxrwx 1 23 geogrid.exe -> geogrid/src/geogrid.exe
-rw-r--r-- 1 11169 geogrid.log
lrwxrwxrwx 1 38 GRIBFILE.AAA -> /data/gfs/gfs_080324_12_00
lrwxrwxrwx 1 38 GRIBFILE.AAB -> /data/gfs/gfs_080324_12_06
-rwxr-xr-x 1 1328 link_grib.csh
-rw-r--r-- 1 5217648 met_em.d01.2008-03-24_12:00:00.nc
-rw-r--r-- 1 5217648 met_em.d01.2008-03-24_18:00:00.nc
-rw-r--r-- 1 12658200 met_em.d02.2008-03-24_12:00:00.nc
drwxr-xr-x 3 4096 metgrid
lrwxrwxrwx 1 23 metgrid.exe -> metgrid/src/metgrid.exe
-rw-r--r-- 1 65970 metgrid.log
-rw-r--r-- 1 1094 namelist.wps
-rw-r--r-- 1 1987 namelist.wps.all_options
-rw-r--r-- 1 1075 namelist.wps.global
-rw-r--r-- 1 652 namelist.wps.nmm
-rw-r--r-- 1 4786 README
drwxr-xr-x 4 4096 ungrib
lrwxrwxrwx 1 21 ungrib.exe -> ungrib/src/ungrib.exe
-rw-r--r-- 1 1418 ungrib.log
-rw-r--r-- 1 27787 ungrib.output
drwxr-xr-x 3 4096 util
lrwxrwxrwx 1 33 Vtable ->
ungrib/Variable_Tables/Vtable.GFS
To run the WPS for nested-domain simulations is essentially no more difficult than
running for a single-domain case; the difference with nested-domain simulations is that
the geogrid and metgrid programs process more than one grid when they are run, rather
than a single grid for the simulation. In order to specify the size and location of nests, a
number of variables in the namelist.wps file must be given lists of values, one value per
nest.
&share
wrf_core = 'ARW',
max_dom = 2,
start_date = '2008-03-24_12:00:00','2008-03-24_12:00:00',
end_date = '2008-03-24_18:00:00','2008-03-24_12:00:00',
interval_seconds = 21600,
io_form_geogrid = 2
/
&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 = '/mmm/users/wrfhelp/WPS_GEOG/'
/
The namelist variables that are affected by nests are shown in the (partial) namelist
records above. The example shows namelist variables for a two-domain run (the coarse
domain plus a single nest), and the effect on the namelist variables generalize to multiple
nests in the obvious way: rather than specifying lists of two values, lists of N values must
be specified, where N is the total number of model grids.
In the above example, the first change to the “share” namelist record is to the max_dom
variable, which must be set to the total number of nests in the simulation, including the
coarse domain. Having determined the number of nests, all of the other affected namelist
variables must be given a list of N values, one for each grid. The only other change to the
“share” namelist record is to the starting and ending times. Here, a starting and ending
time must be given for each nest, with the restriction that a nest cannot begin before its
parent domain or end after its parent domain; also, it is suggested that nests be given
starting and ending times that are identical to the desired starting times of the nest when
running WPS. This is because the nests get their lateral boundary conditions from their
parent domain, and thus, only the initial time for a nest needs to be processed by WPS,
except when grid nudging, also called analysis nudging, is used in WRF. It is important
to note that, when running WRF, the actual starting and ending times for all nests must be
given in the WRF namelist.input file.
The remaining changes are to the “geogrid” namelist record. In this record, the parent of
each nest must be specified with the parent_id variable. Every nest must be a child of
exactly one other nest, with the coarse domain being its own parent. Related to the
identity of a nest's parent is the nest refinement ratio with respect to its parent, which is
given by the parent_grid_ratio variable; this ratio determines the nominal grid
spacing for a nest in relation to the grid spacing of the its parent.
Next, the lower-left corner of a nest is specified as an (i, j) location in the nest’s parent
domain; this is done through the i_parent_start and j_parent_start variables, and
the specified location is given with respect to the unstaggered grid. Finally, the
dimensions of each nest, in grid points, are given for each nest using the s_we, e_we,
s_sn, and e_sn variables. The nesting setup in our example namelist is illustrated in the
figure above, where it may be seen how each of the above-mentioned variables is
determined. Currently, the starting grid point values in the south-north (s_sn) and west-
east (s_we) directions must be specified as 1, and the ending grid point values (e_sn and
e_we) determine, essentially, the full dimensions of the nest; to ensure that the upper-
right corner of the nest's grid is coincident with an unstaggered grid point in the parent
domain, both e_we and e_sn must be one greater than some integer multiple of the
nesting ratio. Also, for each nest, the resolution (or list or resolutions; see the description
of namelist variables) of source data to interpolate from is specified with the
geog_data_res variable. For a complete description of these namelist variables, the user
is referred to the description of namelist variables.
By default, the geogrid program will interpolate land use categories from USGS 24-
category data. However, the user may select an alternative set of land use categories
based on the MODIS land-cover classification of the International Geosphere-Biosphere
Programme and modified for the Noah land surface model. Although the MODIS-based
data contain 20 categories of land use, these categories are not a subset of the 24 USGS
categories; users interested in the specific categories in either data set can find a listing of
the land use classes in the section on land use and soil categories. It must be emphasized
that the MODIS-based categories should only be used with the Noah land surface model
in WRF.
The 20-category MODIS-based land use data may be selected instead of the USGS data
at run-time through the geog_data_res variable in the “geogrid” namelist record. This is
accomplished by prefixing each resolution of static data with the string “modis_30s+”.
For example, in a three-domain configuration, where the geog_data_res variable would
ordinarily be specified as
The effect of this change is to instruct the geogrid program to look, in each entry of the
GEOGRID.TBL file, for a resolution of static data with a resolution denoted by
‘modis_30s’, and if such a resolution is not available, to instead look for a resolution
denoted by the string following the ‘+’. Thus, for the GEOGRID.TBL entry for the
LANDUSEF field, the MODIS-based land use data, which is identified with the string
‘modis_30s’, would be used instead of the ‘10m’, ‘2m’, and ‘30s’ resolutions of USGS
data in the example above; for all other fields, the ‘10m’, ‘2m’, and ‘30s’ resolutions
would be used for the first, second, and third domains, respectively. As an aside, when
none of the resolutions specified for a domain in geog_data_res are found in a
GEOGRID.TBL entry, the resolution denoted by ‘default’ will be used.
The gravity wave drag by orography (GWDO) scheme in the ARW requires ten static
fields from the WPS. In fact, these fields will be interpolated by the geogrid program
regardless of whether the GWDO scheme will be used in the model. When the GWDO
scheme will not be used, the fields will simply be ignored in WRF, and the user need not
be concerned with the resolution of data from which the fields are interpolated. However,
it is recommended that these fields be interpolated from a resolution of source data that is
slightly lower (i.e., coarser) in resolution than the model grid; consequently, if the
GWDO scheme will be used, care should be taken to select an appropriate resolution of
GWDO static data. Currently, five resolutions of GWDO static data are available: 2-
degree, 1-degree, 30-minute, 20-minute, and 10-minute, denoted by the strings ‘2deg’,
‘1deg’, ‘30m’, ‘20m’, and ‘10m’, respectively. To select the resolution to interpolate
from, the user should prefix the resolution specified for the geog_data_res variable in
the “geogrid” namelist record by the string “XXX+”, where XXX is one of the five
available resolutions of GWDO static data. For example, in a model configuration with a
48-km grid spacing, the geog_data_res variable might typically be specified as
geog_data_res = ‘10m’,
However, if the GWDO scheme were employed, the finest resolution of GWDO static
data that is still lower in resolution than the model grid would be the 30-minute data, in
which case the user should specify
geog_data_res = ‘30m+10m’,
If none of ‘2deg’, ‘1deg’, ‘30m’, or ‘20m’ are specified in combination with other
resolutions of static data in the geog_data_res variable, the ‘10m’ GWDO static data
will be used, since it is also designated as the ‘default’ resolution in the GEOGRID.TBL
file. It is worth noting that, if 10-minute resolution GWDO data are to be used, but a
different resolution is desired for other static fields (e.g., topography height), the user
should simply omit ‘10m’ from the value given to the geog_data_res variable, since
specifying
geog_data_res = ‘10m+30s’,
for example, would cause geogrid to use the 10-mintute data in preference to the 30-
second data for the non-GWDO fields, such as topography height and land use category,
as well as for the GWDO fields.
The metgrid program is capable of interpolating time-invariant fields, and it can also
interpolate from multiple sources of meteorological data. The first of these capabilities
uses the constants_name variable in the &metgrid namelist record. This variable may
be set to a list of filenames – including path information where necessary – of
intermediate-formatted files which contains time-invariant fields, and which should be
used in the output for every time period processed by metgrid. For example, short
simulations may use a constant SST field; this field need only be available at a single
time, and may be used by setting the constants_name variable to the path and filename
of the SST intermediate file. Typical uses of constants_name might look like
&metgrid
constants_name = '/data/ungribbed/constants/SST_FILE:2006-08-16_12'
/
or
&metgrid
constants_name = 'LANDSEA', 'SOILHGT'
/
The second metgrid capability – that of interpolating data from multiple sources – may be
useful in situations where two or more complementary data sets need to be combined to
produce the full input data needed by real.exe. To interpolate from multiple sources of
time-varying, meteorological data, the fg_name variable in the &metgrid namelist record
should be set to a list of prefixes of intermediate files, including path information when
necessary. When multiple path-prefixes are given, and the same meteorological field is
available from more than one of the sources, data from the last-specified source will take
priority over all preceding sources. Thus, data sources may be prioritized by the order in
which the sources are given.
As an example of this capability, if surface fields are given in one data source and upper-
air data are given in another, the values assigned to the fg_name variable may look
something like:
&metgrid
fg_name = '/data/ungribbed/SFC', '/data/ungribbed/UPPER_AIR'
/
To simplify the process of extracting fields from GRIB files, the prefix namelist
variable in the &ungrib record may be employed. This variable allows the user to control
the names of (and paths to) the intermediate files that are created by ungrib. The utility of
this namelist variable is most easily illustrated by way of an example. Suppose we wish
to work with the North American Regional Reanalysis (NARR) data set, which is split
into separate GRIB files for 3-dimensional atmospheric data, surface data, and fixed-field
data. We may begin by linking all of the "3D" GRIB files using the link_grib.csh
script, and by linking the NARR Vtable to the filename Vtable. Then, we may suitably
edit the &ungrib namelist record before running ungrib.exe so that the resulting
intermediate files have an appropriate prefix:
&ungrib
out_format = 'WPS',
prefix = 'NARR_3D',
/
After running ungrib.exe, the following files should exist (with a suitable substitution for
the appropriate dates):
NARR_3D:2008-08-16_12
NARR_3D:2008-08-16_15
NARR_3D:2008-08-16_18
...
Given intermediate files for the 3-dimensional fields, we may process the surface fields
by linking the surface GRIB files and changing the prefix variable in the namelist:
&ungrib
out_format = 'WPS',
prefix = 'NARR_SFC',
/
Again running ungrib.exe, the following should exist in addition to the NARR_3D files:
NARR_SFC:2008-08-16_12
NARR_SFC:2008-08-16_15
NARR_SFC:2008-08-16_18
...
Finally, the fixed file is linked with the link_grib.csh script, and the prefix variable in
the namelist is again set:
&ungrib
out_format = 'WPS',
prefix = 'NARR_FIXED',
/
Having run ungrib.exe for the third time, the fixed fields should be available in addition
to the surface and "3D" fields:
NARR_FIXED:1979-11-08_00
For the sake of clarity, the fixed file may be renamed to remove any date information, for
example, by renaming it to simply NARR_FIXED, since the fields in the file are static. In
this example, we note that the NARR fixed data are only available at a specific time,
1979 November 08 at 0000 UTC, and thus, the user would need to set the correct starting
and ending time for the data in the &share namelist record before running ungrib on the
NARR fixed file; of course, the times should be re-set before metgrid is run.
Given intermediate files for all three parts of the NARR data set, metgrid.exe may be run
after the constants_name and fg_name variables in the &metgrid namelist record are
set:
&metgrid
constants_name = 'NARR_FIXED',
fg_name = 'NARR_3D', 'NARR_SFC'
/
Although less common, another situation where multiple data sources would be required
is when a source of meteorological data from a regional model is insufficient to cover the
entire simulation domain, and data from a larger regional model, or a global model, must
be used when interpolating to the remaining points of the simulation grid.
For example, to use NAM data wherever possible, and GFS data elsewhere, the following
values might be assigned in the namelist:
&metgrid
fg_name = '/data/ungribbed/GFS', '/data/ungribbed/NAM'
/
Then the resulting model domain would use data as shown in the figure below.
If no field is found in more than one source, then no prioritization need be applied by
metgrid, and each field will simply be interpolated as usual; of course, each source should
cover the entire simulation domain to avoid areas of missing data.
The default treatment of sea-surface temperatures – both for oceans and lakes – in the
metgrid program involves simply interpolating the SST field from the intermediate files
to all water points in the WRF domain. However, if the lakes that are resolved in the
WRF domain are not resolved in the GRIB data, and especially if those lakes are
geographically distant from resolved water bodies, the SST field over lakes will most
likely be extrapolated from the nearest resolved water bodies in the GRIB data; this
situation can lead to lake SST values that are either unrealistically warm or unrealistically
cold.
Without a higher-resolution SST field for metgrid to use, one alternative to extrapolating
SST values for lakes is to manufacture a “best guess” at the SST for lakes. In the metgrid
and real programs, this can be done using a combination of a special land use data set that
distinguishes between lakes and oceans, and a field to be used as a proxy for SST over
lakes. A special land use data set is necessary, since WRF’s real pre-processing program
needs to know where the manufactured SST field should be used instead of the
interpolated SST field from the GRIB data.
The alternative procedure for initializing lake SSTs is summarized in the following steps:
1. If they have not already been downloaded (either as a separate tar file or as part of
the ‘full’ geographical data tar file), obtain the special land use data sets that
distinguish between lakes and oceans. Two such data sets – based on USGS and
MODIS land use categories – may be downloaded through the WRF download page.
For simplicity, it is recommended to place the two directories in the same directory as
the other static geographical data sets (e.g., topo_30s, soiltype_top_30s, etc.) used by
geogrid, since doing so will eliminate the need to modify the GEOGRID.TBL file. If
would tell geogrid to use the USGS-based land use data for both domains, and to use
the 10-minute resolution data for other static fields in domain 1 and the 2-minute
resolution data for other static fields in domain 2; for MODIS-based data,
usgs_lakes should be replaced by modis_lakes.
Running geogrid should result in output files that use a separate category for inland
water bodies instead of the general water category used for oceans and seas. The lake
category is identified by the global attribute ISLAKE in the geogrid output files; this
attribute should be set to either 28 (in the case of USGS-based data) or 21 (in the case
of the MODIS-based data). See, e.g., the list of WPS output fields, where a value of
-1 for ISLAKE indicates that there is no separate lake category.
3. After running the ungrib program, use the avg_tsfc.exe utility program to create an
intermediate file containing a daily-average surface air temperature field, which will
be substituted for the SST field only over lakes by the real program; for more
information on the avg_tsfc.exe utility, see the section on WPS utility programs.
4. Before running the metgrid program, add the TAVGSFC file created in the previous
step to the specification of constants_name in the &metgrid record of the
namelist.wps file.
5. Run WRF’s real.exe program as usual after setting the number of land categories
(num_land_cat) in the &physics record of the namelist.input file so that it matches
the value of the global attribute NUM_LAND_CAT in the metgrid files. If the global
attribute ISLAKE in the metgrid files indicates that there is a special land use
category for lakes, the real program will substitute the TAVGSFC field for the SST
field only over those grid points whose category matches the lake category;
additionally, the real program will change the land use category of lakes back to the
general water category (the category used for oceans), since neither the
LANDUSE.TBL nor the VEGPARM.TBL files contain an entry for a lake category.
If the dimensions of the domains to be processed by the WPS become too large to fit in
the memory of a single CPU, it is possible to run the geogrid and metgrid programs in a
distributed memory configuration. In order to compile geogrid and metgrid for distributed
memory execution, the user must have MPI libraries installed on the target machine, and
must have compiled WPS using one of the "DM parallel" configuration options. Upon
successful compilation, the geogrid and metgrid programs may be run with the mpirun or
mpiexec commands, or through a batch queuing system, depending on the machine.
As mentioned earlier, the work of the ungrib program is not amenable to parallelization,
and, further, the memory requirements for ungrib's processing are independent of the
memory requirements of geogrid and metgrid; thus, ungrib is always compiled for a
single processor and run on a single CPU, regardless of whether a "DM parallel"
configuration option was selected during configuration.
Each of the standard WRF I/O API formats (NetCDF, GRIB1, binary) has a
corresponding parallel format, whose number is given by adding 100 to the io_form value
(i.e., the value of io_form_geogrid and io_form_metgrid) for the standard format. It is
not necessary to use a parallel io_form, but when one is used, each CPU will read/write
its input/output to a separate file, whose name is simply the name that would be used
during serial execution, but with a four-digit processor ID appended to the name. For
example, running geogrid on four processors with io_form_geogrid=102 would create
output files named geo_em.d01.nc.0000, geo_em.d01.nc.0001, geo_em.d01.nc.0002, and
geo_em.d01.nc.0003 for the coarse domain.
When running the WPS, it may be helpful to examine the output produced by the
programs. For example, when determining the location of nests, it may be helpful to see
the interpolated static geographical data and latitude/longitude fields. As another
example, when importing a new source of data into WPS – either static data or
meteorological data – it can often be helpful to check the resulting interpolated fields in
order to make adjustments the interpolation methods used by geogrid or metgrid.
By using the NetCDF format for the geogrid and metgrid I/O forms, a variety of
visualization tools that read NetCDF data may be used to check the domain files
processed by geogrid or the horizontally interpolated meteorological fields produced by
metgrid. In order to set the file format for geogrid and metgrid to NetCDF, the user
should specify 2 as the io_form_geogrid and io_form_metgrid in the WPS namelist
file (Note: 2 is the default setting for these options):
&share
io_form_geogrid = 2,
/
&metgrid
io_form_metgrid = 2,
/
Among the available tools, the ncdump, ncview, and new RIP4 programs may be of
interest. The ncdump program is a compact utility distributed with the NetCDF libraries
that lists the variables and attributes in a NetCDF file. This can be useful, in particular,
for checking the domain parameters (e.g., west-east dimension, south-north dimension, or
domain center point) in geogrid domain files, or for listing the fields in a file. The ncview
program provides an interactive way to view fields in NetCDF files. Also, for users
wishing to produce plots of fields suitable for use in publications, the new release of the
RIP4 program may be of interest. The new RIP4 is capable of plotting horizontal
contours, map backgrounds, and overlaying multiple fields within the same plot.
Output from the ungrib program is always written in a simple binary format (either
‘WPS’, ‘SI’, or ‘MM5’), so software for viewing NetCDF files will almost certainly be of
no use. However, an NCAR Graphics-based utility, plotfmt, is supplied with the WPS
source code. This utility produces contour plots of the fields found in an intermediate-
format file. If the NCAR Graphics libraries are properly installed, the plotfmt program is
automatically compiled, along with other utility programs, when WPS is built.
Besides the three main WPS programs – geogrid, ungrib, and metgrid – there are a
number of utility programs that come with the WPS, and which are compiled in the util
directory. These utilities may be used to examine data files, visualize the location of
nested domains, compute pressure fields, and compute average surface temperature
fields.
A. avg_tsfc.exe
The avg_tsfc.exe program computes a daily mean surface temperature given input files in
the intermediate format. Based on the range of dates specified in the "share" namelist
section of the namelist.wps file, and also considering the interval between intermediate
files, avg_tsfc.exe will use as many complete days' worth of data as possible in
computing the average, beginning at the starting date specified in the namelist. If a
complete day's worth of data is not available, no output file will be written, and the
program will halt as soon as this can be determined. Similarly, any intermediate files for
dates that cannot be used as part of a complete 24-hour period are ignored; for example,
if there are five intermediate files available at a six-hour interval, the last file would be
ignored. The computed average field is written to a new file named TAVGSFC using the
same intermediate format version as the input files. This daily mean surface temperature
field can then be ingested by metgrid by specifying 'TAVGSFC' for the constants_name
variable in the "metgrid" namelist section.
B. mod_levs.exe
The mod_levs.exe program is used to remove levels of data from intermediate format
files. The levels which are to be kept are specified in new namelist record in the
namelist.wps file:
&mod_levs
press_pa = 201300 , 200100 , 100000 ,
95000 , 90000 ,
85000 , 80000 ,
75000 , 70000 ,
65000 , 60000 ,
55000 , 50000 ,
45000 , 40000 ,
35000 , 30000 ,
25000 , 20000 ,
15000 , 10000 ,
5000 , 1000
/
Within the &mod_levs namelist record, the variable press_pa is used to specify a list of
levels to keep; the specified levels should match values of xlvl in the intermediate
format files (see the discussion of the WPS intermediate format for more information on
the fields of the intermediate files). The mod_levs program takes two command-line
arguments as its input. The first argument is the name of the intermediate file to operate
on, and the second argument is the name of the output file to be written.
Removing all but a specified subset of levels from meteorological data sets is particularly
useful, for example, when one data set is to be used for the model initial conditions and a
second data set is to be used for the lateral boundary conditions. This can be done by
providing the initial conditions data set at the first time period to be interpolated by
metgrid, and the boundary conditions data set for all other times. If the both data sets
have the same number of vertical levels, then no work needs to be done; however, when
these two data sets have a different number of levels, it will be necessary, at a minimum,
to remove (m – n) levels, where m > n and m and n are the number of levels in each of the
two data sets, from the data set with m levels. The necessity of having the same number
of vertical levels in all files is due to a limitation in real.exe, which requires a constant
number of vertical levels to interpolate from.
C. calc_ecmwf_p.exe
In the course of vertically interpolating meteorological fields, the real program requires
3-d pressure and geopotential height fields on the same levels as the other atmospheric
fields. The calc_ecmwf_p.exe utility may be used to create such these fields for use with
ECMWF sigma-level data sets. Given a surface pressure field (or log of surface pressure
field) and a list of coefficients A and B, calc_ecmwf_p.exe computes the pressure at an
ECMWF sigma level k at grid point (i,j) as Pijk = Ak + Bk*Psfcij. The list of coefficients
used in the pressure computation can be copied from a table appropriate to the number of
sigma levels in the data set from
http://www.ecmwf.int/products/data/technical/model_levels/index.html. This table should
be written in plain text to a file, ecmwf_coeffs, in the current working directory; for
example, with 16 sigma levels, the file emcwf_coeffs would contain something like:
0 0.000000 0.000000000
1 5000.000000 0.000000000
2 9890.519531 0.001720764
3 14166.304688 0.013197623
4 17346.066406 0.042217135
5 19121.152344 0.093761623
6 19371.250000 0.169571340
7 18164.472656 0.268015683
8 15742.183594 0.384274483
9 12488.050781 0.510830879
10 8881.824219 0.638268471
11 5437.539063 0.756384850
12 2626.257813 0.855612755
13 783.296631 0.928746223
14 0.000000 0.972985268
15 0.000000 0.992281914
16 0.000000 1.000000000
Additionally, if soil height (or soil geopotential), 3-d temperature, and 3-d specific
humidity fields are available, calc_ecmwf_p.exe computes a 3-d geopotential height
field, which is required to obtain an accurate vertical interpolation in the real program.
Given a set of intermediate files produced by ungrib and the file ecmwf_coeffs,
calc_ecmwf_p loops over all time periods in namelist.wps, and produces an additional
intermediate file, PRES:YYYY-MM-DD_HH, for each time, which contains pressure and
geopotential height data for each full sigma level, as well as a 3-d relative humidity field.
This intermediate file should be specified to metgrid, along with the intermediate data
produced by ungrib, by adding 'PRES' to the list of prefixes in the fg_name namelist
variable.
D. height_ukmo.exe
The real program requires 3-d pressure and geopotential height fields to vertically
interpolate the output of the metgrid program; however, data sets from the UKMO
Unified Model contain a 3-d pressure field, but do not contain a geopotential height field.
Accordingly, the height_ukmo.exe program may be used to compute a geopotential
height field for data sets from the UKMO Unified Model. The height_ukmo.exe program
requires no command-line arguments, but reads the &metgrid namelist record to get the
prefix of the intermediate files created by ungrib.exe; the intermediate files indicated by
the first prefix in the fg_name variable of the &metgrid namelist record are expected to
contain a SOILHGT field, from which the height_ukmo.exe program computes, with the
aid of an auxiliary table, the 3-d geopotential height field. The computed height field is
written to a new intermediate file with the prefix HGT, and the prefix ‘HGT’ should then
be added to the fg_name namelist variable in the &metgrid namelist record before
running metgrid.exe. The name of the file containing the auxiliary table is currently hard-
wired in the source code of the height_ukmo.exe program, and it is the responsibility of
the user to change this file name in WPS/util/src/height_ukmo.F to the name of the table
with the same number of levels as the GRIB data processed by ungrib.exe; tables for data
with 38, 50, and 70 levels are provided in the WPS/util directory with file names
vertical_grid_38_20m_G3.txt, vertical_grid_50_20m_63km.txt , and
vertical_grid_70_20m_80km.txt, respectively.
E. plotgrids.exe
F. g1print.exe
The g1print.exe program takes as its only command-line argument the name of a GRIB
Edition 1 file. The program prints a listing of the fields, levels, and dates of the data in
the file.
G. g2print.exe
Similar to g1print.exe, the g2print.exe program takes as its only command-line argument
the name of a GRIB Edition 2 file. The program prints a listing of the fields, levels, and
dates of the data in the file.
H. plotfmt.exe
The plotfmt.exe is an NCAR Graphics program that plots the contents of an intermediate
format file. The program takes as its only command-line argument the name of the file to
plot, and produces an NCAR Graphics metafile, which contains contour plots of each
field in input file. The graphics metafile output, gmeta, may be viewed with the idt
command, or converted to another format using utilities such as ctrans.
I. rd_intermediate.exe
Given the name of a singe intermediate format file on the command line, the
rd_intermediate.exe program prints information about the fields contained in the file.
The role of the ungrib program is to decode GRIB data sets into a simple intermediate
format that is understood by metgrid. If meteorological data are not available in GRIB
Edition 1 or GRIB Edition 2 formats, the user is responsible for writing such data into the
intermediate file format. Fortunately, the intermediate format is relatively simple,
consisting of a sequence of unformatted Fortran writes. It is important to note that these
unformatted writes use big-endian byte order, which can typically be specified with
compiler flags. Below, we describe the WPS intermediate format; users interested in the
SI or MM5 intermediate formats can first gain familiarity with the WPS format, which is
very similar, and later examine the Fortran subroutines that read and write all three
intermediate formats (metgrid/src/read_met_module.F90 and
metgrid/src/write_met_module.F90, respectively).
When writing data to the WPS intermediate format, 2-dimensional fields are written as a
rectangular array of real values. 3-dimensional arrays must be split across the vertical
dimension into 2-dimensional arrays, which are written independently. It should also be
noted that, for global data sets, either a Gaussian or cylindrical equidistant projection
must be used, and for regional data sets, either a Mercator, Lambert conformal, polar
! 2) WRITE METADATA
! Cylindrical equidistant
if (iproj == 0) then
write(unit=ounit) hdate, xfcst, map_source, field, &
units, desc, xlvl, nx, ny, iproj
write(unit=ounit) startloc, startlat, startlon, &
deltalat, deltalon, earth_radius
! Mercator
else if (iproj == 1) then
write(unit=ounit) hdate, xfcst, map_source, field, &
units, desc, xlvl, nx, ny, iproj
write(unit=ounit) startloc, startlat, startlon, dx, dy, &
truelat1, earth_radius
! Lambert conformal
else if (iproj == 3) then
write(unit=ounit) hdate, xfcst, map_source, field, &
units, desc, xlvl, nx, ny, iproj
write(unit=ounit) startloc, startlat, startlon, dx, dy, &
xlonc, truelat1, truelat2, earth_radius
! Gaussian
! Polar stereographic
else if (iproj == 5) then
write(unit=ounit) hdate, xfcst, map_source, field, &
units, desc, xlvl, nx, ny, iproj
write(unit=ounit) startloc, startlat, startlon, dx, dy, &
xlonc, truelat1, earth_radius
end if
Although Vtables are provided for many common data sets, it would be impossible for
ungrib to anticipate every possible source of meteorological data in GRIB format. When
a new source of data is to be processed by ungrib.exe, the user may create a new Vtable
either from scratch, or by using an existing Vtable as an example. In either case, a basic
knowledge of the meaning and use of the various fields of the Vtable will be helpful.
Each Vtable contains either seven or eleven fields, depending on whether the Vtable is
for a GRIB Edition 1 data source or a GRIB Edition 2 data source, respectively. The
fields of a Vtable fall into one of three categories: fields that describe how the data are
identified within the GRIB file, fields that describe how the data are identified by the
ungrib and metgrid programs, and fields specific to GRIB Edition 2. Each variable to be
extracted by ungrib.exe will have one or more lines in the Vtable, with multiple lines for
data that are split among different level types – for example, a surface level and upper-air
levels. The fields that must be specified for a line, or entry, in the Vtable depends on the
specifics of the field and level.
The first group of fields – those that describe how the data are identified within the GRIB
file – are given under the column headings of the Vtable shown below.
The "GRIB1 Param" field specifies the GRIB code for the meteorological field, which is
a number unique to that field within the data set. However, different data sets may use
different GRIB codes for the same field – for example, temperature at upper-air levels
has GRIB code 11 in GFS data, but GRIB code 130 in ECMWF data. To find the GRIB
code for a field, the g1print.exe and g2print.exe utility program may be used.
Given a GRIB code, the "Level Type", "From Level1", and "From Level2" fields are
used to specify which levels a field may be found at. As with the "GRIB1 Param" field,
the g1print.exe and g2print.exe programs may be used to find values for the level fields.
The meanings of the level fields are dependent on the "Level Type" field, and are
summarized in the following table.
When layer fields (Level Type 112) are specified, the starting and ending points for the
layer have units that are dependent on the field itself; appropriate values may be found
with the g1print.exe and g2print.exe utility programs.
The second group of fields in a Vtable, those that describe how the data are identified
within the metgrid and real programs, fall under the column headings shown below.
The most important of these three fields is the "metgrid Name" field, which determines
the variable name that will be assigned to a meteorological field when it is written to the
intermediate files by ungrib. This name should also match an entry in the
METGRID.TBL file, so that the metgrid program can determine how the field is to be
horizontally interpolated. The "metgrid Units" and "metgrid Description" fields specify
the units and a short description for the field, respectively; here, it is important to note
that if no description is given for a field, then ungrib will not write that field out to the
intermediate files.
The final group of fields, which provide GRIB2-specific information, are found under the
column headings below.
|GRIB2|GRIB2|GRIB2|GRIB2|
|Discp|Catgy|Param|Level|
+-----------------------+
The GRIB2 fields are only needed in a Vtable that is to be used for GRIB Edition 2 data
sets, although having these fields in a Vtable does not prevent that Vtable from also being
used for GRIB Edition 1 data. For example, the Vtable.GFS file contains GRIB2 Vtable
fields, but is used for both 1-degree (GRIB1) GFS and 0.5-degree (GRIB2) GFS data
sets. Since Vtables are provided for most known GRIB Edition 2 data sets, the
corresponding Vtable fields are not described here at present.
The static geographical data sets that are interpolated by the geogrid program are stored
as regular 2-d and 3-d arrays written in a simple binary raster format. Users with a new
source for a given static field can ingest their data with WPS by writing the data set into
this binary format. The geogrid format is capable of supporting single-level and multi-
level continuous fields, categorical fields represented as dominant categories, and
categorical fields given as fractional fields for each category. The most simple of these
field types in terms of representation in the binary format is a categorical field given as a
dominant category at each source grid point, an example of which is the 30-second USGS
land use data set.
For a categorical field given as dominant categories, the data must first be stored in a
regular 2-d array of integers, with each integer giving the dominant category at the
corresponding source grid point. Given this array, the data are written to a file, row-by-
row, beginning at the bottom, or southern-most, row. For example, in the figure above,
the elements of the n × m array would be written in the order x11, x12, ..., x1m, x21, ..., x2m,
..., xn1, ..., xnm. When written to the file, every element is stored as a 1-, 2-, 3-, or 4-byte
integer in big-endian byte order (i.e., for the 4-byte integer ABCD, byte A is stored at the
lowest address and byte D at the highest), although little-endian files may be used by
setting endian=little in the "index" file for the data set. Every element in a file must
use the same number of bytes for its storage, and, of course, it is advantageous to use the
fewest number of bytes needed to represent the complete range of values in the array.
When writing the binary data to a file, no header, record marker, or additional bytes
should be written. For example, a 2-byte 1000 × 1000 array should result in a file whose
size is exactly 2,000,000 bytes. Since Fortran unformatted writes add record markers, it is
not possible to write a geogrid binary-formatted file directly from Fortran; instead, it is
recommended that the C routines in read_geogrid.c and write_geogrid.c (in the
geogrid/src directory) be called when writing data, either from C or Fortran code.
Multi-level continuous fields are handled much the same as single-level continuous
fields. For an n × m × r array, conversion to a positive, integral field is first performed as
described above. Then, each n × m sub-array is written contiguously to the binary file as
before, beginning with the smallest r-index. Categorical fields that are given as fractional
fields for each possible category can be thought of as multi-level continuous fields, where
each level k, 1 ≤ k ≤ r, is the fractional field for category k.
When writing a field to a file in the geogrid binary format, the user should adhere to the
naming convention used by the geogrid program, which expects data files to have names
of the form xstart-xend.ystart-yend, where xstart, xend, ystart, and yend are five-digit
positive integers specifying, respectively, the starting x-index of the array contained in
the file, the ending x-index of the array, the starting y-index of the array, and the ending
y-index of the array; here, indexing begins at 1, rather than 0. So, for example, an 800 ×
1200 array (i.e., 800 rows and 1200 columns) might be named 00001-01200.00001-
00800.
When a data set is given in several pieces, each of the pieces may be formed as a regular
rectangular array, and each array may be written to a separate file. In this case, the
relative locations of the arrays are determined by the range of x- and y-indices in the file
names for each of the arrays. It is important to note, however, that every tile in a data set
must have the same x- and y-dimensions, and that tiles of data within a data set must not
overlap; furthermore, all tiles must start and end on multiples of the index ranges. For
example, the global 30-second USGS topography data set is divided into arrays of
dimension 1200 × 1200, with each array containing a 10-degree × 10-degree piece of the
data set; the file whose south-west corner is located at (90S, 180W) is named 00001-
01200.00001-01200, and the file whose north-east corner is located at (90N, 180E) is
named 42001-43200.20401-21600.
If a data set is to be split into multiple tiles, and the number of grid points in, say, the x-
direction is not evenly divided by the number of tiles in the x-direction, then the last
column of tiles must be padded with a flag value (specified in the index file using the
missing_value keyword) so that all tiles have the same dimensions. For example, if a
data set has 2456 points in the x-direction, and three tiles in the x-direction will be used,
the range of x-coordinates of the tiles might be 1 – 820, 821 – 1640, and 1641 – 2460,
with columns 2457 through 2460 being filled with a flag value.
Clearly, since the starting and ending indices must have five digits, a field cannot have
more than 99999 data points in either of the x- or y-directions. In case a field has more
than 99999 data points in either dimension, the user can simply split the data set into
several smaller data sets which will be identified separately to geogrid. For example, a
very large global data set may be split into data sets for the Eastern and Western
hemispheres.
Besides the binary data files, geogrid requires one extra metadata file per data set. This
metadata file is always named 'index', and thus, two data sets cannot reside in the same
directory. Essentially, this metadata file is the first file that geogrid looks for when
processing a data set, and the contents of the file provide geogrid with all of the
information necessary for constructing names of possible data files. The contents of an
example index file are given below.
type = continuous
signed = yes
projection = regular_ll
dx = 0.00833333
dy = 0.00833333
known_x = 1.0
known_y = 1.0
known_lat = -89.99583
known_lon = -179.99583
wordsize = 2
tile_x = 1200
tile_y = 1200
tile_z = 1
tile_bdr=3
units="meters MSL"
description="Topography height"
For a complete listing of keywords that may appear in an index file, along with the
meaning of each keyword, the user is referred to the section on index file options.
A. SHARE section
This section describes variables that are used by more than one WPS program. For
example, the wrf_core variable specifies whether the WPS is to produce data for the
ARW or the NMM core – information which is needed by both the geogrid and metgrid
programs.
1. WRF_CORE : A character string set to either 'ARW' or 'NMM' that tells the WPS which
dynamical core the input data are being prepared for. Default value is 'ARW'.
5. START_DAY : A list of MAX_DOM 2-digit integers specifying the starting UTC day
of the simulation for each nest. No default value.
7. END_YEAR : A list of MAX_DOM 4-digit integers specifying the ending UTC year
of the simulation for each nest. No default value.
9. END_DAY : A list of MAX_DOM 2-digit integers specifying the ending UTC day of
the simulation for each nest. No default value.
10. END_HOUR : A list of MAX_DOM 2-digit integers specifying the ending UTC hour
of the simulation for each nest. No default value.
14. ACTIVE_GRID : A list of MAX_DOM logical values specifying, for each grid,
whether that grid should be processed by geogrid and metgrid. Default value is .TRUE..
15. IO_FORM_GEOGRID : The WRF I/O API format that the domain files created by
the geogrid program will be written in. Possible options are: 1 for binary; 2 for NetCDF;
3 for GRIB1. When option 1 is given, domain files will have a suffix of .int; when option
2 is given, domain files will have a suffix of .nc; when option 3 is given, domain files
will have a suffix of .gr1. Default value is 2 (NetCDF).
17. DEBUG_LEVEL : An integer value indicating the extent to which different types of
messages should be sent to standard output. When debug_level is set to 0, only
generally useful messages and warning messages will be written to standard output.
When debug_level is greater than 100, informational messages that provide further
runtime details are also written to standard output. Debugging messages and messages
specifically intended for log files are never written to standard output, but are always
written to the log files. Default value is 0.
B. GEOGRID section
This section specifies variables that are specific to the geogrid program. Variables in the
geogrid section primarily define the size and location of all model domains, and where
the static geographical data are found.
1. PARENT_ID : A list of MAX_DOM integers specifying, for each nest, the domain
number of the nest’s parent; for the coarsest domain, this variable should be set to 1.
Default value is 1.
5. S_WE : A list of MAX_DOM integers which should all be set to 1. Default value is 1.
6. E_WE : A list of MAX_DOM integers specifying, for each nest, the nest’s full west-
east dimension. For nested domains, e_we must be one greater than an integer multiple of
the nest's parent_grid_ratio (i.e., e_ew = n*parent_grid_ratio+1 for some positive
integer n). No default value.
7. S_SN : A list of MAX_DOM integers which should all be set to 1. Default value is 1.
8. E_SN : A list of MAX_DOM integers specifying, for each nest, the nest’s full south-
north dimension. For nested domains, e_sn must be one greater than an integer multiple
of the nest's parent_grid_ratio (i.e., e_sn = n*parent_grid_ratio+1 for some
positive integer n). No default value.
10. DX : A real value specifying the grid distance in the x-direction where the map scale
factor is 1. For ARW, the grid distance is in meters for the 'polar', 'lambert', and
'mercator' projection, and in degrees longitude for the 'lat-lon' projection; for
NMM, the grid distance is in degrees longitude. Grid distances for nests are determined
recursively based on values specified for parent_grid_ratio and parent_id. No
default value.
11. DY : A real value specifying the nominal grid distance in the y-direction where the
map scale factor is 1. For ARW, the grid distance is in meters for the 'polar',
'lambert', and 'mercator' projection, and in degrees latitude for the 'lat-lon'
projection; for NMM, the grid distance is in degrees latitude. Grid distances for nests are
determined recursively based on values specified for parent_grid_ratio and
parent_id. No default value.
12. MAP_PROJ : A character string specifying the projection of the simulation domain.
For ARW, accepted projections are 'lambert', 'polar', 'mercator', and 'lat-lon';
for NMM, a projection of 'rotated_ll' must be specified. Default value is 'lambert'.
13. REF_LAT : A real value specifying the latitude part of a (latitude, longitude) location
whose (i,j) location in the simulation domain is known. For ARW, ref_lat gives the
latitude of the center-point of the coarse domain by default (i.e., when ref_x and ref_y
are not specified). For NMM, ref_lat always gives the latitude to which the origin is
rotated. No default value.
14. REF_LON : A real value specifying the longitude part of a (latitude, longitude)
location whose (i, j) location in the simulation domain is known. For ARW, ref_lon
gives the longitude of the center-point of the coarse domain by default (i.e., when ref_x
and ref_y are not specified). For NMM, ref_lon always gives the longitude to which
the origin is rotated. For both ARW and NMM, west longitudes are negative, and the
value of ref_lon should be in the range [-180, 180]. No default value.
15. REF_X : A real value specifying the i part of an (i, j) location whose (latitude,
longitude) location in the simulation domain is known. The (i, j) location is always given
with respect to the mass-staggered grid, whose dimensions are one less than the
dimensions of the unstaggered grid. Default value is (((E_WE-1.)+1.)/2.) = (E_WE/2.).
16. REF_Y : A real value specifying the j part of an (i, j) location whose (latitude,
longitude) location in the simulation domain is known. The (i, j) location is always given
with respect to the mass-staggered grid, whose dimensions are one less than the
dimensions of the unstaggered grid. Default value is (((E_SN-1.)+1.)/2.) = (E_SN/2.).
17. TRUELAT1 : A real value specifying, for ARW, the first true latitude for the
Lambert conformal projection, or the only true latitude for the Mercator and polar
stereographic projections. For NMM, truelat1 is ignored. No default value.
18. TRUELAT2 : A real value specifying, for ARW, the second true latitude for the
Lambert conformal conic projection. For all other projections, truelat2 is ignored. No
default value.
19. STAND_LON : A real value specifying, for ARW, the longitude that is parallel with
the y-axis in the Lambert conformal and polar stereographic projections. For the regular
latitude-longitude projection, this value gives the rotation about the earth's geographic
poles. For NMM, stand_lon is ignored. No default value.
20. POLE_LAT : For the latitude-longitude projection for ARW, the latitude of the North
Pole with respect to the computational latitude-longitude grid in which -90.0° latitude is
at the bottom of a global domain, 90.0° latitude is at the top, and 180.0° longitude is at
the center. Default value is 90.0.
21. POLE_LON : For the latitude-longitude projection for ARW, the longitude of the
North Pole with respect to the computational lat/lon grid in which -90.0° latitude is at the
bottom of a global domain, 90.0° latitude is at the top, and 180.0° longitude is at the
center. Default value is 0.0.
22. GEOG_DATA_PATH : A character string giving the path, either relative or absolute,
to the directory where the geographical data directories may be found. This path is the
one to which rel_path specifications in the GEOGRID.TBL file are given in relation to.
No default value.
C. UNGRIB section
Currently, this section contains only two variables, which determine the output format
written by ungrib and the name of the output files.
2. PREFIX : A character string that will be used as the prefix for intermediate-format
files created by ungrib; here, prefix refers to the string PREFIX in the filename
PREFIX:YYYY-MM-DD_HH of an intermediate file. The prefix may contain path
information, either relative or absolute, in which case the intermediate files will be
written in the directory specified. This option may be useful to avoid renaming
intermediate files if ungrib is to be run on multiple sources of GRIB data. Default value is
'FILE'.
D. METGRID section
This section defines variables used only by the metgrid program. Typically, the user will
be interested in the fg_name variable, and may need to modify other variables of this
section less frequently.
1. FG_NAME : A list of character strings specifying the path and prefix of ungribbed
data files. The path may be relative or absolute, and the prefix should contain all
characters of the filenames up to, but not including, the colon preceding the date. When
more than one fg_name is specified, and the same field is found in two or more input
sources, the data in the last encountered source will take priority over all preceding
sources for that field. Default value is an empty list (i.e., no meteorological fields).
3. IO_FORM_METGRID : The WRF I/O API format that the output created by the
metgrid program will be written in. Possible options are: 1 for binary; 2 for NetCDF; 3
for GRIB1. When option 1 is given, output files will have a suffix of .int; when option 2
is given, output files will have a suffix of .nc; when option 3 is given, output files will
have a suffix of .gr1. Default value is 2 (NetCDF).
The GEOGRID.TBL file is a text file that defines parameters of each of the data sets to
be interpolated by geogrid. Each data set is defined in a separate section, with sections
being delimited by a line of equality symbols (e.g., ‘==============’). Within each
section, there are specifications, each of which has the form of keyword=value. Some
keywords are required in each data set section, while others are optional; some keywords
are mutually exclusive with other keywords. Below, the possible keywords and their
expected range of values are described.
1. NAME : A character string specifying the name that will be assigned to the
interpolated field upon output. No default value.
2. PRIORITY : An integer specifying the priority that the data source identified in the
table section takes with respect to other sources of data for the same field. If a field has n
sources of data, then there must be n separate table entries for the field, each of which
must be given a unique value for priority in the range [1, n]. No default value.
4. INTERP_OPTION : A sequence of one or more character strings, which are the names
of interpolation methods to be used when horizontally interpolating the field. Available
interpolation methods are: average_4pt, average_16pt, wt_average_4pt,
wt_average_16pt, nearest_neighbor, four_pt, sixteen_pt, search,
average_gcell(r); for the grid cell average method (average_gcell), the optional
argument r specifies the minimum ratio of source data resolution to simulation grid
resolution at which the method will be applied; unless specified, r = 0.0, and the option is
used for any ratio. When a sequence of two or more methods are given, the methods
should be separated by a + sign. No default value.
7. REL_PATH : A character string specifying the path relative to the path given in the
namelist variable geog_data_path. A specification is of the general form
RES_STRING:REL_PATH, where RES_STRING is a character string identifying the
source or resolution of the data in some unique way and may be specified in the namelist
variable geog_data_res, and REL_PATH is a path relative to geog_data_path where
the index and data tiles for the data source are found. More than one rel_path
specification may be given in a table section if there are multiple sources or resolutions
for the data source, just as multiple resolutions may be specified (in a sequence delimited
by + symbols) for geog_data_res. See also abs_path. No default value.
8. ABS_PATH : A character string specifying the absolute path to the index and data tiles
for the data source. A specification is of the general form RES_STRING:ABS_PATH,
where RES_STRING is a character string identifying the source or resolution of the data
in some unique way and may be specified in the namelist variable geog_data_res, and
ABS_PATH is the absolute path to the data source's files. More than one abs_path
specification may be given in a table section if there are multiple sources or resolutions
for the data source, just as multiple resolutions may be specified (in a sequence delimited
by + symbols) for geog_data_res. See also rel_path. No default value.
12. MASKED : Either land or water, indicating that the field is not valid at land or
water points, respectively. If the masked keyword is used for a field, those grid points that
are of the masked type (land or water) will be assigned the value specified by
fill_missing. Default value is null (i.e., the field is not masked).
13. FILL_MISSING : A real value used to fill in any missing or masked grid points in the
interpolated field. Default value is 1.E20.
14. HALT_ON_MISSING : Either yes or no, indicating whether geogrid should halt with
a fatal message when a missing value is encountered in the interpolated field. Default
value is no.
when dominant_only is used, the fractional categorical field will not appear in the
geogrid output. This option can only be used for fields with dest_type=categorical.
Default value is null (i.e., no dominant category will be computed from the fractional
categorical field).
17. DF_DX : When df_dx is assigned a character string value, the effect is to cause
geogrid to compute the directional derivative of the field in the x-direction using a central
difference along the interior of the domain, or a one-sided difference at the boundary of
the domain; the derivative field will be named according to the character string assigned
to the keyword df_dx. Default value is null (i.e., no derivative field is computed).
18. DF_DY : When df_dy is assigned a character string value, the effect is to cause
geogrid to compute the directional derivative of the field in the y-direction using a central
difference along the interior of the domain, or a one-sided difference at the boundary of
the domain; the derivative field will be named according to the character string assigned
to the keyword df_dy. Default value is null (i.e., no derivative field is computed).
19. Z_DIM_NAME : For 3-dimensional output fields, a character string giving the name
of the vertical dimension, or z-dimension. A continuous field may have multiple levels,
and thus be a 3-dimensional field, and a categorical field may take the form of a 3-
dimensional field if it is written out as fractional fields for each category. No default
value.
Related to the GEOGRID.TBL are the index files that are associated with each static data
set. An index file defines parameters specific to that data set, while the GEOGRID.TBL
file describes how each of the data sets should be treated by geogrid. As with the
GEOGRID.TBL file, specifications in an index file are of the form keyword=value.
Below are possible keywords and their possible values.
1. PROJECTION : A character string specifying the projection of the data, which may be
either lambert, polar, mercator, regular_ll, albers_nad83, or polar_wgs84. No
default value.
3. SIGNED : Either yes or no, indicating whether the values in the data files (which are
always represented as integers) are signed in two's complement form or not. Default
value is no.
4. UNITS : A character string, enclosed in quotation marks ("), specifying the units of the
interpolated field; the string will be written to the geogrid output files as a variable time-
independent attribute. No default value.
6. DX : A real value giving the grid spacing in the x-direction of the data set. If
projection is one of lambert, polar, mercator, albers_nad83, or polar_wgs84, dx
gives the grid spacing in meters; if projection is regular_ll, dx gives the grid spacing
in degrees. No default value.
7. DY : A real value giving the grid spacing in the y-direction of the data set. If
projection is one of lambert, polar, mercator, albers_nad83, or polar_wgs84, dy
gives the grid spacing in meters; if projection is regular_ll, dy gives the grid spacing
in degrees. No default value.
12. STDLON : A real value specifying the longitude that is parallel with the y-axis in
conic and azimuthal projections. No default value.
13. TRUELAT1 : A real value specifying the first true latitude for conic projections or
the only true latitude for azimuthal projections. No default value.
14. TRUELAT2 : A real value specifying the second true latitude for conic projections.
No default value.
15. WORDSIZE : An integer giving the number of bytes used to represent the value of
each grid point in the data files. No default value.
16. TILE_X : An integer specifying the number of grid points in the x-direction,
excluding any halo points, for a single tile of source data. No default value.
17. TILE_Y : An integer specifying the number of grid points in the y-direction,
excluding any halo points, for a single tile of source data. No default value.
18. TILE_Z : An integer specifying the number of grid points in the z-direction for a
single tile of source data; this keyword serves as an alternative to the pair of keywords
tile_z_start and tile_z_end, and when this keyword is used, the starting z-index is
assumed to be 1. No default value.
19. TILE_Z_START : An integer specifying the starting index in the z-direction of the
array in the data files. If this keyword is used, tile_z_end must also be specified. No
default value.
20. TILE_Z_END : An integer specifying the ending index in the z-direction of the array
in the data files. If this keyword is used, tile_z_start must also be specified. No
default value
23. TILE_BDR : An integer specifying the halo width, in grid points, for each tile of data.
Default value is 0.
24. MISSING_VALUE : A real value that, when encountered in the data set, should be
interpreted as missing data. No default value.
27. ENDIAN : A character string, either big or little, specifying whether the values in
the static data set arrays are in big-endian or little-endian byte order. Default value is big.
28. ISWATER : An integer specifying the land use category of water. Default value is 16.
29. ISLAKE : An integer specifying the land use category of inland water bodies. Default
value is -1 (i.e., no separate inland water category).
30. ISICE : An integer specifying the land use category of ice. Default value is 24.
31. ISURBAN : An integer specifying the land use category of urban areas. Default value
is 1.
32. ISOILWATER : An integer specifying the soil category of water. Default value is 14.
33. MMINLU : A character string, enclosed in quotation marks ("), indicating which
section of WRF's LANDUSE.TBL and VEGPARM.TBL will be used when looking up
parameters for land use categories. Default value is "USGS".
The METGRID.TBL file is a text file that defines parameters of each of the
meteorological fields to be interpolated by metgrid. Parameters for each field are defined
in a separate section, with sections being delimited by a line of equality symbols (e.g.,
‘==============’). Within each section, there are specifications, each of which has
the form of keyword=value. Some keywords are required in a section, while others are
optional; some keywords are mutually exclusive with other keywords. Below, the
possible keywords and their expected range of values are described.
1. NAME : A character string giving the name of the meteorological field to which the
containing section of the table pertains. The name should exactly match that of the field
as given in the intermediate files (and, thus, the name given in the Vtable used in
generating the intermediate files). This field is required. No default value.
2. OUTPUT : Either yes or no, indicating whether the field is to be written to the metgrid
output files or not. Default value is yes.
3. MANDATORY : Either yes or no, indicating whether the field is required for
successful completion of metgrid. Default value is no.
4. OUTPUT_NAME : A character string giving the name that the interpolated field
should be output as. When a value is specified for output_name, the interpolation options
from the table section pertaining to the field with the specified name are used. Thus, the
effects of specifying output_name are two-fold: The interpolated field is assigned the
specified name before being written out, and the interpolation methods are taken from the
section pertaining to the field whose name matches the value assigned to the
output_name keyword. No default value.
5. FROM_INPUT : A character string used to compare against the values in the fg_name
namelist variable; if from_input is specified, the containing table section will only be
used when the time-varying input source has a filename that contains the value of
from_input as a substring. Thus, from_input may be used to specify different
interpolation options for the same field, depending on which source of the field is being
processed. No default value.
7. IS_U_FIELD : Either yes or no, indicating whether the field is to be used as the wind
U-component field. For ARW, the wind U-component field must be interpolated to the U
staggering (output_stagger=U); for NMM, the wind U-component field must be
interpolated to the V staggering (output_stagger=VV). Default value is no.
8. IS_V_FIELD : Either yes or no, indicating whether the field is to be used as the wind
V-component field. For ARW, the wind V-component field must be interpolated to the V
staggering (output_stagger=V); for NMM, the wind V-component field must be
interpolated to the V staggering (output_stagger=VV). Default value is no.
10. INTERP_MASK : The name of the field to be used as an interpolation mask, along
with the value within that field which signals masked points and an optional relational
symbol, < or >. A specification takes the form field(?maskval), where field is the name of
the field, ? is an optional relational symbol (< or >), and maskval is a real value. Source
data points will not be used in interpolation if the corresponding point in the field field is
equal, greater than, or less than, the value of maskval for no relational symbol, a >
symbol, or a < symbol, respectively. Default value is no mask.
13. FILL_MISSING : A real number specifying the value to be assigned to model grid
points that received no interpolated value, for example, because of missing or incomplete
meteorological data. Default value is 1.E20.
15. DERIVED : Either yes or no, indicating whether the field is to be derived from other
interpolated fields, rather than interpolated from an input field. Default value is no.
16. FILL_LEV : The fill_lev keyword, which may be specified multiple times within a
table section, specifies how a level of the field should be filled if that level does not
already exist. A generic value for the keyword takes the form DLEVEL:FIELD(SLEVEL),
where DLEVEL specifies the level in the field to be filled, FIELD specifies the source
field from which to copy levels, and SLEVEL specifies the level within the source field to
use. DLEVEL may either be an integer or the string all. FIELD may either be the name
of another field, the string const, or the string vertical_index. If FIELD is specified as
const, then SLEVEL is a constant value that will be used to fill with; if FIELD is
specified as vertical_index, then (SLEVEL) must not be specified, and the value of the
vertical index of the source field is used; if DLEVEL is 'all', then all levels from the field
specified by the level_template keyword are used to fill the corresponding levels in the
field, one at a time. No default value.
17. LEVEL_TEMPLATE : A character string giving the name of a field from which a list
of vertical levels should be obtained and used as a template. This keyword is used in
conjunction with a fill_lev specification that uses all in the DLEVEL part of its
specification. No default value.
18. MASKED : Either land, water, or both. Setting MASKED to land or water indicates
that the field should not be interpolated to WRF land or water points, respectively;
however, setting MASKED to both indicates that the field should be interpolated to WRF
land points using only land points in the source data and to WRF water points using only
water points in the source data. When a field is masked, or invalid, the static
LANDMASK field will be used to determine which model grid points the field should be
interpolated to; invalid points will be assigned the value given by the FILL_MISSING
keyword. Whether a source data point is land or water is determined by the masks
specified using the INTERP_LAND_MASK and INTERP_WATER_MASK options. Default value
is null (i.e., the field is valid for both land and water points).
19. MISSING_VALUE : A real number giving the value in the input field that is assumed
to represent missing data. No default value.
21. FLAG_IN_OUTPUT : A character string giving the name of a global attribute which
will be assigned a value of 1 and written to the metgrid output if the interpolated field is
to be output (output=yes). Default value is null (i.e., no flag will be written for the field).
Through the GEOGRID.TBL and METGRID.TBL files, the user can control the method
by which source data – either static fields in the case of geogrid or meteorological fields
in the case of metgrid – are interpolated. In fact, a list of interpolation methods may be
given, in which case, if it is not possible to employ the i-th method in the list, the (i+1)-st
method will be employed, until either some method can be used or there are no methods
left to try in the list. For example, to use a four-point bi-linear interpolation scheme for a
field, we could specify interp_option=four_pt. However, if the field had areas of
missing values, which could prevent the four_pt option from being used, we could
request that a simple four-point average be tried if the four_pt method couldn't be used
by specifying interp_option=four_pt+average_4pt instead. Below, each of the
available interpolation options in the WPS are described conceptually; for the details of
each method, the user is referred to the source code in the file
WPS/geogrid/src/interp_options.F.
The four-point bi-linear interpolation method requires four valid source points a ij ,
1 ≤ i, j ≤ 2 , surrounding the point (x,y), to which geogrid or metgrid must interpolate, as
illustrated in the figure above. Intuitively, the method works by linearly interpolating to
the x-coordinate of the point (x,y) between a 11 and a 12 , and between a 21 and a 22 , and then
linearly interpolating to the y-coordinate using these two interpolated values.
The sixteen_pt overlapping parabolic interpolation method requires sixteen valid source
points surrounding the point (x,y), as illustrated in the figure above. The method works by
fitting one parabola to the points ai1, ai2, and ai3, and another parabola to the points ai2,
ai3, and ai4, for row i, 1 ≤ i ≤ 4 ; then, an intermediate interpolated value pi within row i at
the x-coordinate of the point is computed by taking an average of the values of the two
parabolas evaluated at x, with the average being weighted linearly by the distance of x
from ai2 and ai3. Finally, the interpolated value at (x,y) is found by performing the same
operations as for a row of points, but for the column of interpolated values pi to the y-
coordinate of (x,y).
The four-point average interpolation method requires at least one valid source data point
from the four source points surrounding the point (x,y). The interpolated value is simply
the average value of all valid values among these four points.
The weighted four-point average interpolation method can handle missing or masked
source data points, and the interpolated value is given as the weighted average of all valid
values, with the weight wij for the source point aij, 1 ≤ i, j ≤ 2 , given by
=
wij max{0,1 − ( x − xi ) 2 + ( y − y j ) 2 } .
The sixteen-point average interpolation method works in an identical way to the four-
point average, but considers the sixteen points surrounding the point (x,y).
The weighted sixteen-point average interpolation method works like the weighted four-
point average, but considers the sixteen points surrounding (x,y); the weights in this
method are given by
=
wij max{0, 2 − ( x − xi ) 2 + ( y − y j ) 2 } ,
where xi and yj are as defined for the weighted four-point method, and 1 ≤ i, j ≤ 4 .
The nearest neighbor interpolation method simply sets the interpolated value at (x,y) to
the value of the nearest source data point, regardless of whether this nearest source point
is valid, missing, or masked.
The breadth-first search option works by treating the source data array as a 2-d grid
graph, where each source data point, whether valid or not, is represented by a vertex.
Then, the value assigned to the point (x,y) is found by beginning a breadth-first search at
the vertex corresponding to the nearest neighbor of (x,y), and stopping once a vertex
representing a valid (i.e., not masked or missing) source data point is found. In effect, this
method can be thought of as "nearest valid neighbor".
The grid-cell average interpolator may be used when the resolution of the source data is
higher than the resolution of the model grid. For a model grid cell Γ, the method takes a
simple average of the values of all source data points that are nearer to the center of Γ
than to the center of any other grid cell. The operation of the grid-cell average method is
illustrated in the figure above, where the interpolated value for the model grid cell –
represented as the large rectangle – is given by the simple average of the values of all of
the shaded source grid cells.
The default land use and soil category data sets that are provided as part of the WPS
static data tar file contain categories that are matched with the USGS categories described
in the VEGPARM.TBL and SOILPARM.TBL files in the WRF run directory.
Descriptions of the 24 land use categories and 16 soil categories are provided in the
tables below.
10 Savanna
11 Deciduous Broadleaf Forest
12 Deciduous Needleleaf Forest
13 Evergreen Broadleaf
14 Evergreen Needleleaf
15 Mixed Forest
16 Water Bodies
17 Herbaceous Wetland
18 Wooden Wetland
19 Barren or Sparsely Vegetated
20 Herbaceous Tundra
21 Wooded Tundra
22 Mixed Tundra
23 Bare Ground Tundra
24 Snow or Ice
Below, a listing of the global attributes and fields that are written to the geogrid
program's output files is given. This listing is an abridged version of the output from the
ncdump program when run on a typical geo_em.d01.nc file.
netcdf geo_em.d01 {
dimensions:
Time = UNLIMITED ; // (1 currently)
DateStrLen = 19 ;
west_east = 73 ;
south_north = 60 ;
south_north_stag = 61 ;
west_east_stag = 74 ;
land_cat = 24 ;
soil_cat = 16 ;
month = 12 ;
variables:
char Times(Time, DateStrLen) ;
float XLAT_M(Time, south_north, west_east) ;
XLAT_M:units = "degrees latitude" ;
XLAT_M:description = "Latitude on mass grid" ;
float XLONG_M(Time, south_north, west_east) ;
XLONG_M:units = "degrees longitude" ;
XLONG_M:description = "Longitude on mass grid" ;
float XLAT_V(Time, south_north_stag, west_east) ;
XLAT_V:units = "degrees latitude" ;
XLAT_V:description = "Latitude on V grid" ;
float XLONG_V(Time, south_north_stag, west_east) ;
XLONG_V:units = "degrees longitude" ;
// global attributes:
:TITLE = "OUTPUT FROM GEOGRID V3.3" ;
:SIMULATION_START_DATE = "0000-00-00_00:00:00" ;
:WEST-EAST_GRID_DIMENSION = 74 ;
:SOUTH-NORTH_GRID_DIMENSION = 61 ;
:BOTTOM-TOP_GRID_DIMENSION = 0 ;
:WEST-EAST_PATCH_START_UNSTAG = 1 ;
:WEST-EAST_PATCH_END_UNSTAG = 73 ;
:WEST-EAST_PATCH_START_STAG = 1 ;
:WEST-EAST_PATCH_END_STAG = 74 ;
:SOUTH-NORTH_PATCH_START_UNSTAG = 1 ;
:SOUTH-NORTH_PATCH_END_UNSTAG = 60 ;
:SOUTH-NORTH_PATCH_START_STAG = 1 ;
:SOUTH-NORTH_PATCH_END_STAG = 61 ;
:GRIDTYPE = "C" ;
:DX = 30000.f ;
:DY = 30000.f ;
:DYN_OPT = 2 ;
:CEN_LAT = 34.83001f ;
:CEN_LON = -81.03f ;
:TRUELAT1 = 30.f ;
:TRUELAT2 = 60.f ;
:MOAD_CEN_LAT = 34.83001f ;
:STAND_LON = -98.f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:corner_lats = 28.17127f, 44.36657f, 39.63231f, 24.61906f,
28.17842f, 44.37617f, 39.57811f, 24.57806f, 28.03772f, 44.50592f, 39.76032f,
24.49431f, 28.04484f, 44.51554f, 39.70599f, 24.45341f ;
:corner_lons = -93.64893f, -92.39661f, -66.00165f, -72.6405f, -
93.80048f, -92.59155f, -65.83557f, -72.5033f, -93.65717f, -92.3829f, -65.9313f,
-72.68539f, -93.80841f, -92.57831f, -65.76495f, -72.54843f ;
:MAP_PROJ = 1 ;
:MMINLU = "USGS" ;
:NUM_LAND_CAT = 24;
:ISWATER = 16 ;
:ISLAKE = -1;
:ISICE = 24 ;
:ISURBAN = 1 ;
:ISOILWATER = 14 ;
:grid_id = 1 ;
:parent_id = 1 ;
:i_parent_start = 1 ;
:j_parent_start = 1 ;
:i_parent_end = 74 ;
:j_parent_end = 61 ;
:parent_grid_ratio = 1 ;
:sr_x = 1 ;
:sr_y = 1 ;
:FLAG_MF_XY = 1 ;
}
The global attributes corner_lats and corner_lons contain the lat-lon location of the
corners of the domain with respect to different grid staggerings (mass, u, v, and
unstaggered). The locations referred to by each element of the corner_lats and
corner_lons arrays are summarized in the table and figure below.
In addition to the fields in a geogrid output file (e.g., geo_em.d01.nc), the following
fields and global attributes will also be present in a typical output file from the metgrid
program, run with the default METGRID.TBL file and meteorological data from NCEP's
GFS model.
netcdf met_em.d01.2009-01-05_12:00:00 {
dimensions:
Time = UNLIMITED ; // (1 currently)
DateStrLen = 19 ;
west_east = 73 ;
south_north = 60 ;
num_metgrid_levels = 27 ;
num_sm_levels = 4 ;
num_st_levels = 4 ;
south_north_stag = 61 ;
west_east_stag = 74 ;
z-dimension0012 = 12 ;
z-dimension0016 = 16 ;
z-dimension0024 = 24 ;
variables:
char Times(Time, DateStrLen) ;
float PRES(Time, num_metgrid_levels, south_north, west_east) ;
PRES:units = "" ;
PRES:description = "" ;
float SOIL_LAYERS(Time, num_st_layers, south_north, west_east) ;
SM:units = "" ;
SM:description = "" ;
float SM(Time, num_sm_levels, south_north, west_east) ;
SM:units = "" ;
SM:description = "" ;
float ST(Time, num_st_levels, south_north, west_east) ;
ST:units = "" ;
ST:description = "" ;
float GHT(Time, num_metgrid_levels, south_north, west_east) ;
GHT:units = "m" ;
GHT:description = "Height" ;
float SNOW(Time, south_north, west_east) ;
SNOW:units = "kg m-2" ;
SNOW:description = "Water equivalent snow depth" ;
float SKINTEMP(Time, south_north, west_east) ;
SKINTEMP:units = "K" ;
SKINTEMP:description = "Skin temperature (can use for SST also)" ;
float SOILHGT(Time, south_north, west_east) ;
SOILHGT:units = "m" ;
SOILHGT:description = "Terrain field of source analysis" ;
float LANDSEA(Time, south_north, west_east) ;
LANDSEA:units = "proprtn" ;
LANDSEA:description = "Land/Sea flag (1=land, 0 or 2=sea)" ;
float SEAICE(Time, south_north, west_east) ;
SEAICE:units = "proprtn" ;
SEAICE:description = "Ice flag" ;
float ST100200(Time, south_north, west_east) ;
ST100200:units = "K" ;
ST100200:description = "T 100-200 cm below ground layer (Bottom)"
;
float ST040100(Time, south_north, west_east) ;
ST040100:units = "K" ;
ST040100:description = "T 40-100 cm below ground layer (Upper)" ;
float ST010040(Time, south_north, west_east) ;
ST010040:units = "K" ;
ST010040:description = "T 10-40 cm below ground layer (Upper)" ;
float ST000010(Time, south_north, west_east) ;
ST000010:units = "K" ;
ST000010:description = "T 0-10 cm below ground layer (Upper)" ;
float SM100200(Time, south_north, west_east) ;
SM100200:units = "kg m-3" ;
SM100200:description = "Soil Moist 100-200 cm below gr layer" ;
float SM040100(Time, south_north, west_east) ;
SM040100:units = "kg m-3" ;
SM040100:description = "Soil Moist 40-100 cm below grn layer" ;
float SM010040(Time, south_north, west_east) ;
// global attributes:
:TITLE = "OUTPUT FROM METGRID V3.3" ;
:SIMULATION_START_DATE = "2009-01-05_12:00:00" ;
:WEST-EAST_GRID_DIMENSION = 74 ;
:SOUTH-NORTH_GRID_DIMENSION = 61 ;
:BOTTOM-TOP_GRID_DIMENSION = 27 ;
:WEST-EAST_PATCH_START_UNSTAG = 1 ;
:WEST-EAST_PATCH_END_UNSTAG = 73 ;
:WEST-EAST_PATCH_START_STAG = 1 ;
:WEST-EAST_PATCH_END_STAG = 74 ;
:SOUTH-NORTH_PATCH_START_UNSTAG = 1 ;
:SOUTH-NORTH_PATCH_END_UNSTAG = 60 ;
:SOUTH-NORTH_PATCH_START_STAG = 1 ;
:SOUTH-NORTH_PATCH_END_STAG = 61 ;
:GRIDTYPE = "C" ;
:DX = 30000.f ;
:DY = 30000.f ;
:DYN_OPT = 2 ;
:CEN_LAT = 34.83001f ;
:CEN_LON = -81.03f ;
:TRUELAT1 = 30.f ;
:TRUELAT2 = 60.f ;
:MOAD_CEN_LAT = 34.83001f ;
:STAND_LON = -98.f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:corner_lats = 28.17127f, 44.36657f, 39.63231f, 24.61906f,
28.17842f, 44.37617f, 39.57811f, 24.57806f, 28.03772f, 44.50592f, 39.76032f,
24.49431f, 28.04484f, 44.51554f, 39.70599f, 24.45341f ;
:corner_lons = -93.64893f, -92.39661f, -66.00165f, -72.6405f, -
93.80048f, -92.59155f, -65.83557f, -72.5033f, -93.65717f, -92.3829f, -65.9313f,
-72.68539f, -93.80841f, -92.57831f, -65.76495f, -72.54843f ;
:MAP_PROJ = 1 ;
:MMINLU = "USGS" ;
:NUM_LAND_CAT = 24;
:ISWATER = 16 ;
:ISLAKE = -1;
:ISICE = 24 ;
:ISURBAN = 1 ;
:ISOILWATER = 14 ;
:grid_id = 1 ;
:parent_id = 1 ;
:i_parent_start = 1 ;
:j_parent_start = 1 ;
:i_parent_end = 74 ;
:j_parent_end = 61 ;
:parent_grid_ratio = 1 ;
:sr_x = 1 ;
:sr_y = 1 ;
:NUM_METGRID_SOIL_LEVELS = 4 ;
:FLAG_METGRID = 1 ;
:FLAG_EXCLUDED_MIDDLE = 0 ;
:FLAG_SOIL_LAYERS = 1 ;
:FLAG_SNOW = 1 ;
:FLAG_PSFC = 1 ;
:FLAG_SM000010 = 1 ;
:FLAG_SM010040 = 1 ;
:FLAG_SM040100 = 1 ;
:FLAG_SM100200 = 1 ;
:FLAG_ST000010 = 1 ;
:FLAG_ST010040 = 1 ;
:FLAG_ST040100 = 1 ;
:FLAG_ST100200 = 1 ;
:FLAG_SLP = 1 ;
:FLAG_SOILHGT = 1 ;
:FLAG_MF_XY = 1 ;
}
Table of Contents
• Introduction
• Initialization for Ideal Data Cases
• Initialization for Real Data Cases
Introduction
The WRF model has two large classes of simulations that it is able to generate: those with
an ideal initialization and those utilizing real data. The idealized simulations typically
manufacture an initial condition file for the WRF model from an existing 1-D or 2-D
sounding and assume a simplified analytic orography. The real-data cases usually require
pre-processing from the WPS package, which provides each atmospheric and static field
with fidelity appropriate to the chosen grid resolution for the model. The WRF model
executable itself is not altered by choosing one initialization option over another
(idealized vs. real), but the WRF model pre-processors (the real.exe and ideal.exe
programs) are specifically built based upon a user's selection.
The real.exe and ideal.exe programs are never used together. Both the real.exe and
ideal.exe are the programs that are processed just prior to the WRF model run.
o 1d
_ em_scm_xy – single column model, 4 km, full physics
The selection of the type of forecast is made when issuing the ./compile statement.
When selecting a different case to study, the code must be re-compiled to choose the
correct initialization for the model. For example, after configuring the setup for the
architecture (with the ./configure command), if the user issues the command
./compile em_real, then the initialization program is built using
module_initialize_real.F as the target module (one of the
./WRFV3/dyn_em/module_initialize_*.F files). Similarly, if the user
specifies ./compile em_les, then the Fortran module for the large eddy simulation
(module_initialize_les.F) is automatically inserted into the build for ideal.exe.
Note that the WRF forecast model is identical for both of these initialization programs.
In each of these initialization modules, the same sort of activities goes on:
• compute a base state / reference profile for geopotential and column pressure
• compute the perturbations from the base state for geopotential and column
pressure
• initialize meteorological variables: u, v, potential temperature, vapor mixing ratio
• define a vertical coordinate
• interpolate data to the model’s vertical coordinate
• initialize static fields for the map projection and the physical surface; for many of
the idealized cases, these are simplified initializations such as map factors set to
one, and topography elevation set to zero
Both the real.exe program and ideal.exe programs share a large portion of source code, to
handle the following duties:
• read meteorological and static input data from the WRF Preprocessing System
(WPS)
• prepare soil fields for use in model (usually, vertical interpolation to the required
levels for the specified land surface scheme)
• check to verify soil categories, land use, land mask, soil temperature, sea surface
temperature are all consistent with each other
• multiple input time periods are processed to generate the lateral boundary
conditions, which are required unless processing a global forecast
The “real.exe” program may be run as either a serial or a distributed memory job. Since
the idealized cases only require that the initialization run for a single time period (no
lateral boundary file is required) and are therefore quick to process, all of the “ideal.exe”
programs should be run on a single processor. The Makefile for the 2-D cases will not
allow the user to build the code with distributed memory parallelism. For large 2-D
cases, if the user requires OpenMP, the variables nproc_x and nproc_y must be set in
the domains portion of the namelist file namelist.input (nproc_y must be set
to 1, and nproc_x then set to the number of processors).
The program "ideal.exe" is the program in the WRF system to run for a controlled
scenario. Typically this program requires no input except for the namelist.input
and the input_sounding files (except for the b_wave case which uses a 2-D binary
sounding file). The program outputs the wrfinput_d01 file that is read by the WRF
model executable ("wrf.exe"). Since no external data is required to run the idealized
cases, even for researchers interested in real-data cases, the idealized simulations are an
easy way to insure that the model is working correctly on a particular architecture and
compiler.
Idealized runs can use any of the boundary conditions except "specified", and are
not, by default, set up to run with sophisticated physics (other than from microphysics).
Most have are no radiation, surface fluxes or frictional effects (other than the sea breeze
case, LES, and the global Held-Suarez). The idealized cases are mostly useful for
dynamical studies, reproducing converged or otherwise known solutions, and idealized
cloud modeling.
There are 1-D, 2-D and 3-D examples of idealized cases, with and without topography,
and with and without an initial thermal perturbation. The namelist can control the size of
domain, number of vertical levels, model top height, grid size, time step, diffusion and
damping properties, boundary conditions, and physics options. A large number of
existing namelist settings are already found within each of the directories associated with
a particular case.
The input_sounding file (already in appropriate case directories) can be any set of
levels that goes at least up to the model top height (ztop) in the namelist. The first line
is the surface pressure (hPa), potential temperature (K) and moisture mixing ratio (g/kg).
Each subsequent line has five input values: height (meters above sea-level), potential
temperature (K), vapor mixing ratio (g/kg), x-direction wind component (m/s), y-
direction wind component (m/s). The “ideal.exe” program interpolates the data from the
input_sounding file, and will extrapolate if not enough data is provided.
The base state sounding for idealized cases is the initial sounding minus the moisture, and
so does not have to be defined separately. Note for the baroclinic wave case: a 1-D input
sounding is not used because the initial 3-D arrays are read in from the file input_jet.
This means for the baroclinic wave case the namelist.input file cannot be used to
change the horizontal or vertical dimensions since they are specified in the input_jet
file.
Each of the ideal cases provides an excellent set of default examples to the user. The
method to specify a thermal bubble is given in the super cell case. In the hill2d case, the
topography is accounted for properly in setting up the initial 3-D arrays, so that example
should be followed for any topography cases. A symmetry example in the squall line
cases tests that your indexing modifications are correct. Full physics options are
demonstrated in the seabreeze2d_x case.
The real-data WRF cases are those that have the input data to the “real.exe” program
provided by the WRF Preprocessing System (WPS). This data from the WPS was
originally generated from a previously run external analysis or forecast model. The
original data was probably in GriB format and was probably ingested into the WPS by
first ftp'ing the raw GriB data from one of the national weather agencies’ anonymous ftp
sites.
For example, suppose a single-domain WRF forecast is desired with the following
criteria:
The following files will be generated by the WPS (starting date through ending date, at 6-
h increments):
• met_em.d01.2000-01-24_12:00:00.nc
• met_em.d01.2000-01-24_18:00:00.nc
• met_em.d01.2000-01-25_00:00:00.nc
• met_em.d01.2000-01-25_06:00:00.nc
• met_em.d01.2000-01-25_12:00:00.nc
The convention is to use "met" to signify data that is output from the WPS “metgrid.exe”
program and input into the “real.exe” program. The "d01" portion of the name identifies
to which domain this data refers, which permits nesting. The next set of characters is the
validation date/time (UTC), where each WPS output file has only a single time-slice of
processed data. The file extension suffix “.nc” refers to the output format from WPS
which must be in netCDF for the “real.exe” program. For regional forecasts, multiple
time periods must be processed by “real.exe” so that a lateral boundary file is available to
the model. The global option for WRF requires only an initial condition.
The WPS package delivers data that is ready to be used in the WRF system by the
“real.exe” program.
• The data adheres to the WRF IO API. Unless you are developing special tools,
stick with the netCDF option to communicate between the WPS package and
“real.exe”.
• The data has already been horizontally interpolated to the correct grid-point
staggering for each variable, and the winds are correctly rotated to the WRF
model map projection.
• 3-D meteorological data required from the WPS: pressure, u, v, temperature,
relative humidity, geopotential height
• Optional 3-D hydrometeor data may be provided to the real program at run-time,
but these fields will not be used in the coarse-grid lateral boundary file. Fields
named: QR, QC, QS, QI, QG, QH, QNI (mixing ratio for rain, cloud, snow, ice,
graupel, hail, and number concentration) are eligible for input from the metgrid
output files.
• 3D soil data from the WPS: soil temperature, soil moisture, soil liquid (optional,
depending on physics choices in the WRF model)
• 2D meteorological data from the WPS: sea level pressure, surface pressure,
surface u and v, surface temperature, surface relative humidity, input elevation
• 2-D meteorological optional data from WPS: sea surface temperature, physical
snow depth, water equivalent snow depth
• 2D static data for the physical surface: terrain elevation, land use categories, soil
texture categories, temporally interpolated monthly data, land sea mask, elevation
of the input model’s topography
• 2D static data for the projection: map factors, Coriolis, projection rotation,
computational latitude
• constants: domain size, grid distances, date
• The WPS data may either be isobaric or some more generalized vertical
coordinate, where each column is monotonic in pressure
• All 3-D meteorological data (wind, temperature, height, moisture, pressure) must
have the same number of levels, and variables must have the exact same levels. It
is not acceptable to have more levels for temperature (for example) than height.
Likewise, it is not acceptable to have a 925 mb level for the horizontal wind
components, but not for moisture.
• A test data set is accessible from the WRF download page. Under the "WRF
Model Test Data" list, select the January data. This is a 74x61, 30-km domain
centered over the eastern US.
• Make sure you have successfully built the code (fine-grid nested initial data is
available in the download, so the code may be built with the basic nest option),
./WRFV3/main/real.exe and ./WRFV3/main/wrf.exe must both
exist.
• In the ./WRFV3/test/em_real directory, copy the namelist for the January
case to the default name
o cp namelist.input.jan00 namelist.input
• Link the WPS files (the “met_em*” files from the download) into the
./WRFV3/test/em_real directory.
• For a single processor, to execute the real program, type real.exe (this should
take less than a minute for this small case with five time periods).
• After running the “real.exe” program, the files “wrfinput_d01” and
“wrfbdy_d01” should be in this directory; these files will be directly used by
the WRF model.
• The “wrf.exe” program is executed next (type wrf.exe), this should take a few
minutes (only a 12-h forecast is requested in the namelist file).
• The output file wrfout_d01:2000-01-24_12:00:00 should contain a 12-
h forecast at 3-h intervals.
Table of Contents
• Introduction
• Installing WRF
• Running WRF
o Idealized Case
o Real Data Case
o Restart Run
o Two-Way Nested Runs
o One-Way Nested Run Using ndown
o Moving Nested Run
o Three-dimensional Analysis Nudging
o Observation Nudging
o Global Run
o DFI Run
o Lower Boundary Condition Update
o Adaptive Time Stepping
o Stochastic Kinetic-Energy Backscatter Option
o Run-Time IO
o Output Time Series
o Using IO Quilting
• Examples of namelist for various applications
• Check Output
• Trouble Shooting
• Physics and Dynamics Options
• Summary of Physics Options in Tables
• Description of Namelist Variables
• WRF Output Fields
Introduction
The WRF model is a fully compressible, and nonhydrostatic model (with a runtime
hydrostatic option). Its vertical coordinate is a terrain-following hydrostatic pressure
coordinate. The grid staggering is the Arakawa C-grid. The model uses the Runge-Kutta
2nd and 3rd order time integration schemes, and 2nd to 6th order advection schemes in
both horizontal and vertical. It uses a time-split small step for acoustic and gravity-wave
modes. The dynamics conserves scalar variables.
The WRF model code contains several initialization programs (ideal.exe and real.exe; see
Chapter 4), a numerical integration program (wrf.exe), and a program to do one-way
nesting (ndown.exe). The WRF model Version 3 supports a variety of capabilities. These
include
Other References
Installing WRF
Before compiling WRF code on a computer, check to see if the netCDF library is
installed. This is because one of the supported WRF I/O options is netCDF, and it is the
one commonly used, and supported by the post-processing programs. If the netCDF is
installed in a directory other than /usr/local/, then find the path, and use the
environment variable NETCDF to define where the path is. To do so, type
Often the netCDF library and its include/ directory are collocated. If this is not the case,
create a directory, link both netCDF lib and include directories in this directory, and use
environment variable to set the path to this directory. For example,
If the netCDF library is not available on the computer, it needs to be installed first.
NetCDF source code or pre-built binary may be downloaded from and installation
instruction can be found on the Unidata Web page at http://www.unidata.ucar.edu/.
Hint: If using netCDF-4, make sure that the new capabilities (such as parallel I/O based
on HDF5) are not activated at the install time.
./configure
and a list of choices for your computer should appear. These choices range from
compiling for a single processor job (serial), to using OpenMP shared-memory (smpar)
or distributed-memory parallelization (dmpar) options for multiple processors, or
combination of shared-memory and distributed memory options (dm+sm). When a
selection is made, a second choice for compiling nesting will appear. For example, on a
Linux computer, the above steps may look like:
16. Linux i486 i586 i686 x86_64, PathScale compiler with pathcc
(dmpar)
Enter appropriate options that are best for your computer and application.
When the return key is hit, a configure.wrf file will be created. Edit compile
options/paths, if necessary.
Hint: It is helpful to start with something simple, such as the serial build. If it is
successful, move on to build smpar or dmpar code. Remember to type ‘clean –a’ between
each build.
Hint: If you anticipate generating a netCDF file that is larger than 2Gb (whether it is a
single or multi time period data [e.g. model history]) file), you may set the following
environment variable to activate the large-file support option from netCDF (in c-shell):
setenv WRFIO_NCD_LARGE_FILE_SUPPORT 1
./compile
Usage:
compile em_b_wave
compile em_esmf_exp (example only)
compile em_grav2d_x
compile em_heldsuarez
compile em_hill2d_x
compile em_les
compile em_quarter_ss
compile em_real
compile em_seabreeze2d_x
compile em_squall2d_x
compile em_squall2d_y
compile em_tropical_cyclone
compile exp_real (example of a toy solver)
compile nmm_real (NMM solver)
where em stands for the Advanced Research WRF dynamic solver (which currently is the
'Eulerian mass-coordinate' solver). Type one of the above to compile. When you switch
from one test case to another, you must type one of the above to recompile. The
recompile is necessary to create a new initialization executable (i.e. real.exe, and
ideal.exe - there is a different ideal.exe for each of the idealized test cases),
while wrf.exe is the same for all test cases.
If you want to remove all object files (except those in external/ directory) and
executables, type 'clean'.
Hint: If you have trouble compiling routines like solve_em.F, you can try to run the
configure script with optional argument ‘-s’, i.e.
./configure –s
This will configure to compile solve_em.F and a few other routines with reduced
optimization.
If you would like to turn off optimization for all the code, say during code development
and debugging, you can run configure script with option ‘-d’:
./configure –d
a. Idealized case
For any 2D test cases (labeled in the case names), serial or OpenMP (smpar) compile
options must be used. Suppose you would like to compile and run the 2-dimensional
squall case, type
After a successful compilation, you should have two executables created in the main/
directory: ideal.exe and wrf.exe. These two executables will be linked to the
corresponding test/case_name and run/ directories. cd to either directory to run the
model.
It is a good practice to save the entire compile output to a file. When the executables were
not present, this output is useful to help diagnose the compile errors.
b. Real-data case
When the compile is successful, it will create three executables in the main/directory:
ndown.exe, real.exe and wrf.exe.
Like in the idealized cases, these executables will be linked to test/em_real and
run/ directories. cd to one of these two directories to run the model.
Running WRF
One may run the model executables in either the run/ directory, or the
test/case_name directory. In either case, one should see executables, ideal.exe
or real.exe (and ndown.exe), and wrf.exe, linked files (mostly for real-data
cases), and one or more namelist.input files in the directory.
Hint: If you would like to run the model executables in a different directory, copy or link
the files in test/em_* directory to that directory, and run from there.
a. Idealized case
cd test/em_squall2d_x
If you see a script in the test case directory, called run_me_first.csh, run this one
first by typing:
./run_me_first.csh
This links some physics data files that might be needed to run the case.
./ideal.exe
This program will typically read an input sounding file located in that directory, and
generate an initial condition file wrfinput_d01. All idealized cases do not require
lateral boundary file because of the boundary condition choices they use, such as the
periodic option. If the job is run successfully, the last thing it prints should be: ‘wrf:
SUCCESS COMPLETE IDEAL INIT’.
To run the model and save the standard output to a file, type
Pairs of rsl.out.* and rsl.error.* files will appear with any MPI runs. These
are standard out and error files. Note that the execution command for MPI runs may be
different on different machines and for different MPI installation. Check the user manual.
If the model run is successful, the last thing printed in ‘wrf.out’ or rsl.*.0000 file
should be: ‘wrf: SUCCESS COMPLETE WRF’. Output files wrfout_d01_0001-
01-01* and wrfrst* should be present in the run directory, depending on how
namelist variables are specified for output. The time stamp on these files originates from
the start times in the namelist file.
b. Real-data case
Start with a namelist.input template file in the directory, edit it to match your case.
Running a real-data case requires successfully running the WRF Preprocessing System
programs (or WPS). Make sure met_em.* files from WPS are seen in the run directory
(either link or copy the files):
cd test/em_real
ls –l ../../../WPS/met_em*
ln –s ../../..WPS/met_em* .
start_*, end_*: start and end times for data processing and model integration
interval_seconds: input data interval for boundary conditions
time_step: model time step, and can be set as large as 6*DX (in km)
e_ws, e_sn, e_vert: domain dimensions in west-east, south-north and vertical
dx, dy: model grid distance in meters
To run real-data initialization program compiled using serial or OpenMP (smpar) options,
type
Successful completion of the job should have ‘real_em: SUCCESS EM_REAL INIT’
printed at the end of real.out file. It should also produce wrfinput_d01 and wrfbdy_d01
files. In real data case, both files are required.
./wrf.exe
A successful run should produce one or several output files with names like
wrfout_d<domain>_<date> (where <domain> represents domain ID, and
<date> represents a date string with the format yyyy-mm-dd_hh:mm:ss. For
example, if you start the model at 1200 UTC, January 24 2000, then your first output file
should have the name:
wrfout_d01_2000-01-24_12:00:00
The time stamp on the file name is always the first time the output file is written. It is
always good to check the times written to the output file by typing:
You may have other wrfout files depending on the namelist options (how often you split
the output files and so on using namelist option frames_per_outfile).You may
also create restart files if you have restart frequency (restart_interval in the
namelist.input file) set within your total integration length. The restart file should have
names like
wrfrst_d<domain>_<date>
The time stamp on a restart file is the time that restart file is valid at.
For DM (distributed memory) parallel systems, some form of mpirun command will be
needed to run the executables. For example, on a Linux cluster, the command to run MPI
code and using 4 processors may look like:
poe ./real.exe
poe ./wrf.exe
for an interactive run. (Interactive MPI job is not an option on NCAR IBM bluefire)
c. Restart Run
A restart run allows a user to extend a run to a longer simulation period. It is effectively a
continuous run made of several shorter runs. Hence the results at the end of one or more
restart runs should be identical to a single run without any restart.
In order to do a restart run, one must first create restart file. This is done by setting
namelist variable restart_interval (unit is in minutes) to be equal to or less than
the simulation length in the first model run, as specified by run_* variables or
start_* and end_* times. When the model reaches the time to write a restart file, a
restart file named wrfrst_d<domain>_<date> will be written. The date string
represents the time when the restart file is valid.
When one starts the restart run, edit the namelist.input file, so that your start_*
time will be set to the restart time (which is the time the restart file is written). The other
namelist variable one must set is restart, this variable should be set to .true. for a
restart run.
start_*, end_*: start and end times for restart model integration
restart: logical to indicate whether the run is a restart or not
Hint: Typically the restart file is a lot bigger in size than the history file, hence one may
find that even it is ok to write a single model history output time to a file in netCDF
format (frame_per_outfile=1), it may fail to write a restart file. This is because
the basic netCDF file support is only 2Gb. There are two solutions to the problem. The
first is to simply set namelist option io_form_restart = 102 (instead of 2), and
this will force the restart file to be written into multiple pieces, one per processor. As long
as one restarts the model using the same number of processors, this option works well
(and one should restart the model with the same number of processors in any case). The
second solution is to recompile the code using the netCDF large file support option (see
section on “Installing WRF” in this chapter).
A two-way nested run is a run where multiple domains at different grid resolutions are
run simultaneously and communicate with each other: The coarser domain provides
boundary values for the nest, and the nest feeds its calculation back to the coarser
domain. The model can handle multiple domains at the same nest level (no overlapping
nest), and multiple nest levels (telescoping).
When preparing for a nested run, make sure that the code is compiled with basic nest
options (option 1).
Most of options to start a nest run are handled through the namelist. All variables in the
namelist.input file that have multiple columns of entries need to be edited with
caution. Do start with a namelist template. The following are the key namelist variables
to modify:
start_*, end_*: start and end simulation times for the nest
fine_input_stream: which fields from the nest input file are used in nest
initialization. The fields to be used are defined in the Registry.EM. Typically they include
static fields (such as terrain, landuse), and masked surface fields (such as skin
temperature, soil moisture and temperature). Useful for nest starting at a later time than
the coarse domain.
max_dom: the total number of domains to run. For example, if you want to have one
coarse domain and one nest, set this variable to 2.
grid_id: domain identifier that is used in the wrfout naming convention. The most
coarse grid must have grid_id of 1.
parent_id: used to indicate the parent domain of a nest. grid_id value is used.
i_parent_start/j_parent_start: lower-left corner starting indices of the nest
domain in its parent domain. These parameters should be the same as in
namelist.wps.
parent_grid_ratio: integer parent-to-nest domain grid size ratio. Typically odd
number ratio is used in real-data applications.
parent_time_step_ratio: integer time-step ratio for the nest domain. It may be
different from the parent_grid_ratio, though they are typically set the same.
feedback: this is the key setup to define a two-way nested (or one-way nested) run.
When feedback is on, the values of the coarse domain are overwritten by the values of the
variables (average of cell values for mass points, and average of the cell-face values for
horizontal momentum points) in the nest at the coincident points. For masked fields, only
the single point value at the collocating points is fedback. If the parent_grid_ratio
is even, an arbitrary choice of southwest corner point value is used for feedback. This is
the reason it is better to use odd parent_grid_ratio with this option. When
feedback is off , it is equivalent to a one-way nested run, since nest results are not
reflected in the parent domain.
smooth_option: this a smoothing option for the parent domain in area of the nest if
feedback is on. Three options are available: 0 = no smoothing; 1 = 1-2-1 smoothing; 2 =
smoothing-desmoothing.
For 3-D idealized cases, no nest input files are required. The key here is the specification
of the namelist.input file. What the model does is to interpolate all variables
required in the nest from the coarse domain fields. Set
input_from_file = F, F,
For real-data cases, three input options are supported. The first one is similar to running
the idealized cases. That is to have all fields for the nest interpolated from the coarse
domain (input_from_file = T, F). The disadvantage of this option is obvious,
one will not benefit from the higher resolution static fields (such as terrain, landuse, and
so on).
The second option is to set input_from_file = T for each domain, which means
that the nest will have a nest wrfinput file to read in. The limitation of this option is that
this only allows the nest to start at the same time as the coarse domain.
To run real.exe for a nested run, one must first run WPS and create data for all the
nests. Suppose WPS is run for a 24 hour period, two-domain nest case starting 1200 UTC
Jan 24 2000, and these files should be generated in a WPS directory:
met_em.d01.2000-01-24_12:00:00
met_em.d01.2000-01-24_18:00:00
met_em.d01.2000-01-25_00:00:00
met_em.d01.2000-01-25_06:00:00
met_em.d01.2000-01-25_12:00:00
met_em.d02.2000-01-24_12:00:00
Typically only the first time period of the nest input file is needed to create nest wrfinput
file. Link or move all these files to the run directory.
Edit the namelist.input file and set the correct values for all relevant variables,
described on the previous pages (in particular, set max_dom = 2, for the total number
of domains to run), as well as physics options. Type the following to run:
If successful, this will create all input files for coarse as well as nest domains. For a two-
domain example, these are:
wrfinput_d01
wrfinput_d02
wrfbdy_d01
./wrf.exe
or
mpirun –np 4 ./wrf.exe
If successful, the model should create wrfout files for both domain 1 and 2:
wrfout_d01_2000-01-24_12:00:00
wrfout_d02_2000-01-24_12:00:00
WRF supports two separate one-way nested option. In this section, one-way nesting is
defined as a finer-grid-resolution run made as a subsequent run after the coarser-grid-
resolution run, where the ndown program is run in between the two simulations. The
initial and lateral boundary conditions for this finer-grid run are obtained from the coarse
grid run, together with input from higher resolution terrestrial fields (e.g. terrain, landuse,
etc.), and masked surface fields (such as soil temperature and moisture). The program
that performs this task is ndown.exe. Note that the use of this program requires the
code to be compiled for nesting.
When one-way nesting is used, the coarse-to-fine grid ratio is only restricted to be an
integer. An integer less than or equal to 5 is recommended. Frequent output (e.g. hourly)
from the coarse grid run is also recommended to provide better boundary specifications.
A caveat with using ndown for one-way nesting is that the microphysics variables are
not used for boundary conditions; they are only in the initial conditions. If that is
important to you, use two-way nesting option instead.
This is no different than any of the single domain WRF run as described above.
The purpose of this step is to ingest higher resolution terrestrial fields and corresponding
land-water masked soil fields.
Before doing this step, WPS should be run for one coarse and one nest domains (this
helps to line up the nest with the coarse domain), and for the one time period the one-way
nested run is to start. This generates a WPS output file for the nested domain (domain 2):
met_em.d02.<date>.
Step 3: Make the final fine-grid initial and boundary condition files
- Edit namelist.input again, and this time one needs to edit two columns: one for
dimensions of the coarse grid, and one for the fine grid. Note that the boundary
condition frequency (namelist variable interval_seconds) is the time in seconds
between the coarse-grid model output times. Since V3.2, one must also specify
io_form_auxinput2 = 2 to run ndown successfully.
- Run ndown.exe, with inputs from the coarse grid wrfout file(s), and
wrfndi_d02 file generated from Step 2 above. This will produce wrfinput_d02
and wrfbdy_d02 files.
- If one desires to refine vertical resolution when running ndown, set
vert_refine_fact = integer (new in V3.2). There are no other changes
required in the namelist or in the procedure.
- Another way to refine vertical resolution is to use utility program v_interp (see
chapter for ‘Utilities and Tools’ for details.
Note that program ndown may be run serially or in MPI, depending on the selected
compile option. The ndown program must be built to support nesting, however. To run
the program, type,
./ndown.exe
or
mpirun –np 4 ./ndown.exe
The figure on the next page summarizes the data flow for a one-way nested run using
program ndown.
f. Moving-Nested Run
Two types of moving tests are allowed in WRF. In the first option, a user specifies the
nest movement in the namelist. The second option is to move the nest automatically
based on an automatic vortex-following algorithm. This option is designed to follow the
movement of a well-defined tropical cyclone.
To make the specified moving nested run, select the right nesting compile option (option
‘preset moves’). Note that code compiled with this option will not support static nested
runs. To run the model, only the coarse grid input files are required. In this option, the
nest initialization is defined from the coarse grid data - no nest input is used. In addition
to the namelist options applied to a nested run, the following needs to be added to
namelist section &domains:
num_moves: the total number of moves one can make in a model run. A move of any
domain counts against this total. The maximum is currently set to 50, but it can be
changed by change MAX_MOVES in frame/module_driver_constants.F.
move_id: a list of nest IDs, one per move, indicating which domain is to move for a
given move.
move_interval: the number of minutes since the beginning of the run that a move is
supposed to occur. The nest will move on the next time step after the specified instant of
model time has passed.
move_cd_x,move_cd_y: distance in number of grid points and direction of the nest
move(positive numbers indicating moving toward east and north, while negative numbers
indicating moving toward west and south).
Parameter max_moves is set to be 50, but can be modified in source code file
frame/module_driver_constants.F if needed.
To make the automatic moving nested runs, select the ‘vortex-following’ option when
configuring. Again note that this compile would only support auto-moving nest, and will
not support the specified moving nested run or static nested run at the same time. Again,
no nest input is needed. If one wants to use values other than the default ones, add and
edit the following namelist variables in &domains section:
time_to_move: the time (in minutes) to move a nest. This option may help with the
case when the storm is still too weak to be tracked by the algorithm.
When automatic moving nest is employed, the model dumps the vortex center location,
with minimum mean sea-level pressure and maximum 10 m winds in standard out file
(e.g. rsl.out.0000). Tying ‘grep ATCF rsl.out.0000’ will produce a list of
storm information at 15 minutes interval:
In both types of moving nest runs, the initial location of the nest is specified through
i_parent_start and j_parent_start in the namelist.input file.
Prepare input data to WRF as usual using WPS. If nudging is desired in the nest domains,
make sure all time periods for all domains are processed in WPS. For surface-analysis
nudging (new in Version 3.1), OBSGRID needs to be run after METGRID, and it will
output a wrfsfdda_d01 file that the WRF model reads for this option.
Set the following options before running real.exe, in addition to others described
earlier (see namelist template namelist.input.grid_fdda in test/em_real/
directory for guidance):
grid_fdda = 1
grid_sfdda = 1
Run real.exe as before, and this will create, in addition to wrfinput_d0* and
wrfbdy_d01 files, a file named ‘wrffdda_d0*’. Other grid nudging namelists are
ignored at this stage. But it is a good practice to fill them all before one runs real. In
particular, set
gfdda_inname = “wrffdda_d<domain>”
gfdda_interval = time interval of input data in minutes
gfdda_end_h = end time of grid nudging in hours
sgfdda_inname = “wrfsfdda_d<domain>”
sgfdda_interval = time interval of input data in minutes
sgfdda_end_h = end time of surface egrid nudging in hours
Spectral Nudging is a new upper-air nudging option in Version 3.1. This selectively
nudges the coarser scales only, but is otherwise set up the same way as grid-nudging.
This option also nudges geopotential height. The wave numbers defined here are the
number of waves contained in the domain, and the number is the maximum one that is
nudged.
grid_fdda = 2
xwavenum = 3
ywavenum = 3
In addition to the usual input data preparation using WPS, station observation files are
required. See http://www.mmm.ucar.edu/wrf/users/wrfv2/How_to_run_obs_fdda.html for
instructions. The observation file names expected by WRF are OBS_DOMAIN101 for
domain 1, and OBS_DOMAIN201 for domain 2, etc.
obs_nudge_opt = 1
fdda_start = 0 (obs nudging start time in minutes)
fdda_end = 360 (obs nudging end time in minutes)
Look for example to set other obs nudging namelist variables in namelist template
namelist.input.obs_fdda in test/em_real/ directory. See
http://www.mmm.ucar.edu/wrf/users/wrfv2/How_to_run_obs_fdda.html and
README.obs_fdda in WRFV3/test/em_real/ for more information.
i. Global Run
WRFV3 begins to support global capability. To make a global run, run WPS starting with
namelist template namelist.wps.gloabl. Set map_proj = ‘lat-lon’, and
grid dimensions e_we and e_sn without setting dx and dy in
namelist.wps. The geogrid program will calculate grid distances and their values
can be found in the global attribute section of geo_em.d01.nc file. Type
ncdump –h geo_em.d01.nc to find out the grid distances, which will be needed in
filling out WRF’s namelist.input file. Grid distances in x and y directions may be
different, but it is best they are set similarly or the same. WRF and WPS assume earth is a
sphere, and its radius is 6370 km. There is no restrictions on what to use for grid
dimensions, but for effective use of the polar filter in WRF, the east-west dimension
should be set to 2P*3Q*5R+1 (where P, Q, and R are any integers, including 0).
Run the rest of WPS programs as usual but only for one time period. This is because the
domain covers the entire globe, lateral boundary conditions are no longer needed.
Run program real.exe as usual and for one time period only. Lateral boundary file
wrfbdy_d01 is not needed.
Note that since this is a new option in the model, use it with caution. Not all options have
been tested. For example, all filter options have not been tested, and positive-definite
options are not working for lat-lon grid.
As an extension to the global lat-lon grid, regional domain can be set using lat-lon grid
too. To do so, one need to set both grid dimensions, and grid distances in degrees. Again
geogrid will calculate the grid distance assuming the earth is a sphere and its radius is
6370 km. Find grid distance in meters in the netcdf file, and use the value for WRF’s
namelist.input file.
Digital filter initialization (DFI) is a new option in V3. It is a way to remove initial model
imbalance as, for example, measured by the surface pressure tendency. This might be
important when one is interested in the 0 – 6 hour simulation/forecast. It runs a digital
filter during a short model integration, backward and forward, and then start the forecast.
In WRF implementation, this is all done in a single job. With the V3.3 release, DFI can
be used for multiple domains with concurrent nesting with feedback disabled.
dfi_opt = 3
dfi_nfilter = 7 (filter option: Dolph)
dfi_cutoff_seconds = 3600 (should not be longer than the filter window)
For time specification, it typically needs to integrate backward for 0.5 to 1 hour, and
integrate forward for half of the time.
In Version 3.2, a constant boundary condition option is introduced for DFI. To use it, set
constant_bc = 1 in &bdy_control
If a different time step is used for DFI, one may use time_step_dfi to set it.
The WRF model physics does not predict sea-surface temperature, vegetation fraction,
albedo and sea ice. For long simulations, the model provides an alternative to read in the
time-varying data and update these fields. In order to use this option, one must have
access to time-varying SST and sea ice fields. Twelve monthly values vegetation fraction
and albedo are available from the geogrid program. Once these fields are processed via
WPS, one may activate the following options in namelist record &time_control
before running program real.exe and wrf.exe:
sst_update = 1 in &physics
io_form_auxinput4 = 2
auxinput4_inname = “wrflowinp_d<domain>” (created by real.exe)
auxinput4_interval = 360, 360, 360,
Adaptive time stepping is a way to maximize the time step that the model can use while
keeping the model numerically stable. The model time step is adjusted based on the
domain-wide horizontal and vertical stability criterion. The following set of values would
typically work well.
use_adaptive_time_step = .true.
step_to_output_time = .true. (but nested domains may still be writing output at
the desired time. Try to use adjust_output_times = .true. to make up for this.)
target_cfl = 1.2, 1.2, 1.2,
max_step_increase_pct = 5, 51, 51, (a large percentage value for the nest allows
the time step for the nest to have more freedom to adjust)
starting_time_step = use (-1 means 6*DX at start time)
max_time_step : use fixed values for all domains, e.g. 8*DX
min_time_step : use fixed values for all domains, e.g. 4*DX
adaptation_domain: which domain is driving the adaptive time step
Also see the description of these options in the list of namelist on page 5-35.
WRF has now an option to stochastically perturb forecasts via a stochastic kinetic-energy
backscatter scheme (SKEB, Shutts, 2005, QJRMS). The scheme introduces temporally
and spatially correlated perturbations to the rotational wind components and potential
temperature modulated by the total dissipation rate. In the current version SKEBS 1.0, a
spatially and temporally constant dissipation rate is assumed, but future developments
will include a flow-dependent dissipation rate. There are several options for the vertical
structure of the random pattern generator: barotropic and random phase. Details of the
scheme are available in Berner et. al, 2011 (MWR, in press).
The scheme is controlled via the following optional physics namelist parameters, for each
domain separately:
n. Run-Time IO
With the release of WRF version 3.2, IO decisions may now be updated as a run-time
option. Previously, any modification to the IO (such as which variable is associated with
which stream) was handled via the Registry, and changes to the Registry always
necessitate a cycle of clean –a, configure, and compile. This compile-time
mechanism is still available and it is how most of the WRF IO is defined. However,
should a user wish to add (or remove) variables from various streams, that capability is
available as an option.
First, the user lets the WRF model know where the information for the run-time
modifications to the IO is located. This is a text file, one for each domain, defined in the
namelist.input file, located in the time_control namelist record.
&time_control
iofields_filename = “my_file_d01.txt”, “my_file_d02.txt”
ignore_iofields_warning = .true.,
/
The contents of the text file associates a stream ID (0 is the default history and input)
with a variable, and whether the field is to be added or removed. The state variables must
already be defined in the Registry file. Following are a few examples:
-:h:0:RAINC,RAINNC
would remove the fields RAINC and RAINNC from the standard history file.
+:h:7:RAINC,RAINNC
would add the fields RAINC and RAINNC to an output stream #6.
It is not necessary to remove fields from one stream to insert them in another. It is OK to
have the same field in multiple streams.
Note that any field that can be part of the optional IO (either the input or output streams)
must already be declared as a state variable in the Registry. Care needs to be taken when
specifying the names of the variables that are selected for the run-time IO. The "name"
of the variable to use in the text file (defined in the namelist.input file) is the quoted
string from the Registry file. Most of the WRF variables have the same string for the
name of the variable used inside the WRF source code (column 3 in the Registry file,
non-quoted, and not the string to use) and the name of the variable that appears in the
netCDF file (column 9 in the Registry file, quoted, and that is the string to use).
There is an option to output time series from a model run. To active the option, a file
called “tslist” must be present in the WRF run directory. The tslist file contains a
list of locations defined by their latitude and longitude along with a short description and
an abbreviation for each location. A sample file looks something like this:
#-----------------------------------------------#
# 24 characters for name | pfx | LAT | LON |
#-----------------------------------------------#
Cape Hallett hallt -72.330 170.250
McMurdo Station mcm -77.851 166.713
The first three lines in the file are regarded as header information, and are ignored. Given
a tslist file, for each location inside a model domain (either coarse or nested) a file
containing time series variables at each model time step will be written with the name
pfx.d<domain>.TS, where pfx is the specified prefix for the location in the tslist file.
The maximum number of time series locations is controlled by the namelist variable
max_ts_locs in namelist record &domains. The default value is 5. The time series
output contains selected variables at the surface, including 2 m temperature, vapor mixing
ratio, 10 m wind components, u and v, rotated to the earth coordinate, etc.. More
information for time series output can be found in WRFV3/run/README.tslist.
p. Using IO Quilting
This option allows a few processors to be set alone to do output only. It can be useful and
performance-friendly if the domain sizes are large, and/or the time taken to write a output
time is getting significant when compared to the time taken to integrate the model in
between the output times. There are two variables for setting the option:
A few physics options sets (plus model top and number of vertical levels) are provided
here for reference. They may provide a good starting point for testing the model in your
application. Also note that other factors will affect the outcome. For example, the domain
setup, the distributions of vertical model levels, and input data.
a. 1 – 4 km grid distances, convection-permitting runs for 1- 3 days run (as used for
NCAR spring real-time convection forecast over US):
mp_physics = 8,
ra_lw_physics = 1,
ra_sw_physics = 2,
radt = 10,
sf_sfclay_physics = 2,
sf_surface_physics = 2,
bl_pbl_physics = 2,
bldt = 0,
cu_physics = 0,
ptop_requested = 5000,
e_vert = 35,
b. 20 – 30 km grid distances, 1- 3 day runs (e.g., NCAR daily real-time runs over US):
mp_physics = 4,
ra_lw_physics = 1,
ra_sw_physics = 2,
radt = 10,
sf_sfclay_physics = 2,
sf_surface_physics = 2,
bl_pbl_physics = 2,
bldt = 0,
cu_physics = 5,
cudt = 0,
ptop_requested = 5000,
e_vert = 30,
mp_physics = 4,
ra_lw_physics = 1,
ra_sw_physics = 2,
radt = 10,
sf_sfclay_physics = 2,
sf_surface_physics = 2,
bl_pbl_physics = 2,
bldt = 0,
cu_physics = 1,
cudt = 5,
fractional_seaice = 1,
seaice_threshold = 0.0,
ptop_requested = 1000,
e_vert = 44,
d. Hurricane applications (e.g. 12, 4 and 1.33 km nesting used by NCAR’s real-time
hurricane runs):
mp_physics = 8,
ra_lw_physics = 1,
ra_sw_physics = 2,
radt = 10,
sf_sfclay_physics = 1,
sf_surface_physics = 1,
bl_pbl_physics = 1,
bldt = 0,
cu_physics = 1, (only on 12 km grid)
cudt = 5,
isftcflx = 2,
ptop_requested = 2000,
e_vert = 36,
e. Regional climate case at 10 – 30 km grid sizes (e.g. used in NCAR’s regional climate
runs):
mp_physics = 6,
ra_lw_physics = 3,
ra_sw_physics = 3,
radt = 30,
sf_sfclay_physics = 1,
sf_surface_physics = 2,
bl_pbl_physics = 1,
bldt = 0,
cu_physics = 1,
cudt = 5,
sst_update = 1,
tmn_update = 1,
sst_skin = 1,
bucket_mm = 100.0,
bucket_J = 1.e9,
ptop_requested = 1000,
e_vert = 51,
spec_bdy_width = 10,
spec_zone = 1,
relax_zone = 9,
spec_exp = 0.33,
Check Output
Once a model run is completed, it is a good practice to check a couple of things quickly.
If you have run the model on multiple processors using MPI, you should have a number
of rsl.out.* and rsl.error.* files. Type ‘tail rsl.out.0000’ to see if you
get ‘SUCCESS COMPLETE WRF’. This is a good indication that the model has run
successfully.
Check the output times written to wrfout* file by using netCDF command:
Take a look at either rsl.out.0000 file or other standard out file. This file logs the
times taken to compute for one model time step, and to write one history and restart
output:
and
Timing for Writing wrfout_d02_2006-01-22_00:00:00 for domain 2: 1.17970 elapsed seconds.
Timing for main: time 2006-01-22_00:00:00 on domain 1: 27.66230 elapsed seconds.
Timing for Writing wrfout_d01_2006-01-22_00:00:00 for domain 1: 0.60250 elapsed seconds.
If the model did not run to completion, take a look at these standard output/error files too.
If the model has become numerically unstable, it may have violated the CFL criterion
(for numerical stability). Check whether this is true by typing the following:
When this happens, consider using namelist option w_damping, and/or reducing time step.
Trouble Shooting
If the model aborts very quickly, it is likely that either the computer memory is not large
enough to run the specific configuration, or the input data have some serious problem.
For the first problem, try to type ‘unlimit’ or ‘ulimit -s unlimited’ to see if
more memory and/or stack size can be obtained.
For OpenMP (smpar-compiled code), the stack size needs to be set large, but not
unlimited. Unlimited stack size may crash the computer.
To check if the input data is the problem, use ncview or other netCDF file browser.
Physics Options
WRF offers multiple physics options that can be combined in any way. The options
typically range from simple and efficient to sophisticated and more computationally
costly, and from newly developed schemes to well tried schemes such as those in current
operational models.
The choices vary with each major WRF release, but here we will outline those available
in WRF Version 3.
1. Microphysics (mp_physics)
a. Kessler scheme: A warm-rain (i.e. no ice) scheme used commonly in idealized
cloud modeling studies (mp_physics = 1).
b. Lin et al. scheme: A sophisticated scheme that has ice, snow and graupel processes,
suitable for real-data high-resolution simulations (2).
c. WRF Single-Moment 3-class scheme: A simple efficient scheme with ice and snow
processes suitable for mesoscale grid sizes (3).
d. WRF Single-Moment 5-class scheme: A slightly more sophisticated version of (c)
that allows for mixed-phase processes and super-cooled water (4).
e. Eta microphysics: The operational microphysics in NCEP models. A simple
efficient scheme with diagnostic mixed-phase processes (5).
f. WRF Single-Moment 6-class scheme: A scheme with ice, snow and graupel
processes suitable for high-resolution simulations (6).
g. Goddard microphysics scheme. A scheme with ice, snow and graupel processes
suitable for high-resolution simulations (7). New in Version 3.0.
h. New Thompson et al. scheme: A new scheme with ice, snow and graupel processes
suitable for high-resolution simulations (8). This adds rain number concentration and
updates the scheme from the one in Version 3.0. New in Version 3.1.
i. Milbrandt-Yau Double-Moment 7-class scheme (9). This scheme includes separate
categories for hail and graupel with double-moment cloud, rain, ice, snow, graupel
and hail. New in Version 3.2.
j. Morrison double-moment scheme (10). Double-moment ice, snow, rain and graupel
for cloud-resolving simulations. New in Version 3.0.
k. WRF Double-Moment 5-class scheme (14). This scheme has double-moment rain.
Cloud and CCN for warm processes, but is otherwise like WSM5. New in Version 3.1.
l. WRF Double-Moment 6-class scheme (16). This scheme has double-moment rain.
Cloud and CCN for warm processes, but is otherwise like WSM6. New in Version 3.1.
m. Ston Brook University (Y. Lin) scheme (13). This is a 5-class scheme with riming
intensity predicted to account for mixed-phase processes. New in Version 3.3.
d. QNSE surface layer. Quasi-Normal Scale Elimination PBL scheme’s surface layer
option (4). New in Version 3.1.
e. MYNN surface layer. Nakanishi and Niino PBL’s surface layer scheme (5). New in
Version 3.1.
f. TEMF surface layer. Total Energy – Mass Flux surface layer scheme. New in
Version 3.3.
g. iz0tlnd = 1 (for sf_sfclay_physics = 1 or 2), Chen-Zhang thermal roughness length
over land, which depends on vegetation height, 0 = original thermal roughness length
in each sfclay option. New in Vserion 3.2.
c. MRF scheme: Older version of (a) with implicit treatment of entrainment layer as
part of non-local-K mixed layer (99).
d. ACM2 PBL: Asymmetric Convective Model with non-local upward mixing and
local downward mixing (7). New in Version 3.0.
e. Quasi-Normal Scale Elimination PBL (4). A TKE-prediction option that uses a new
theory for stably stratified regions. New in Version 3.1.
f. Mellor-Yamada Nakanishi and Niino Level 2.5 PBL (5). Predicts sub-grid TKE
terms. New in Version 3.1.
g. Mellor-Yamada Nakanishi and Niino Level 3 PBL (6). Predicts TKE and other
second-moment terms. New in Version 3.1.
h. BouLac PBL (8): Bougeault-Lacarrère PBL. A TKE-prediction option. New in
Version 3.1. Designed for use with BEP urban model.
i. UW (Bretherton and Park) scheme (9). TKE scheme from CESM climate model.
New in Version 3.3.
j. Total Energy - Mass Flux (TEMF) scheme (10). Sub-grid total energy prognostic
variable, plus mass-flux type shallow convection. New in Version 3.3.
k. LES PBL: A large-eddy-simulation (LES) boundary layer is available in Version 3.
For this, bl_pbl_physic = 0, isfflx = 1, and sf_sfclay_physics and sf_surface_physics
are selected. This uses diffusion for vertical mixing and must use diff_opt = 2, and
km_opt = 2 or 3, see below. Alternative idealized ways of running the LESPBL are
chosen with isfflx = 0 or 2. New in Version 3.0.
d. no_mp_heating: When set to 1, it turns off latent heating from microphysics. When
using this option, cu_physics should be set to 0.
e. gwd_opt: Gravity wave drag option. Can be activated when grid size is greater than
10 km. May be beneficial for simulations longer than 5 days and over a large domain
with mountain ranges. New in Version 3.1.
f. windturbines_spec (a character string): Wind turbine drag parameterization scheme.
It represents sub-grid effects of specified turbines on wind and TKE fields. When set
to “none” (default value), the scheme is off. When set to “ideal”, the idealized
specification for turbine’s geometry and characteristics are set by namelist variables
td_*. When set to a file name (which exists in the run directory), the physical
charateristics of the wind farm is described in the file. See README.windturbine in
WRFV3/ directory for more detail. New in Version 3.3, and in this version it only
works with 2.5 level MYNN PBL option (bl_pbl_physics=5).
Diffusion in WRF is categorized under two parameters, the diffusion option and the K
option. The diffusion option selects how the derivatives used in diffusion are calculated,
and the K option selects how the K coefficients are calculated. Note that when a PBL
option is selected, vertical diffusion is done by the PBL scheme, and not by the diffusion
scheme. In Version 3, vertical diffusion is also linked to the surface fluxes.
2. Damping Options
These are independently activated choices.
a. Upper Damping: Either a layer of increased diffusion (damp_opt =1) or a Rayleigh
relaxation layer (2) or an implicit gravity-wave damping layer (3, new in Version 3.0),
can be added near the model top to control reflection from the upper boundary.
b. Vertical velocity damping (w_damping): For operational robustness, vertical motion
can be damped to prevent the model from becoming unstable with locally large
vertical velocities. This only affects strong updraft cores, so has very little impact on
results otherwise.
c. Divergence Damping (sm_div): Controls horizontally propagating sound waves.
d. External Mode Damping (em_div): Controls upper-surface (external) waves.
e. Time Off-centering (epssm): Controls vertically propagating sound waves.
Advection Options
The positive-definite and monotonic options are available for moisture, scalars,
chemical scalers and TKE in the ARW solver. Both the monotonic and positive-
definite transport options conserve scalar mass locally and globally and are consistent
with the ARW mass conservation equation. We recommend using the positive-
definite option for moisture variables on all real-data simulations. The monotonic
option may be beneficial in chemistry applications and for moisture and scalars in
some instances.
When using these options there are certain aspects of the ARW integration scheme
that should be considered in the simulation configuration.
(3) Most of the model physics are not monotonic nor should they be - they represent
sources and sinks in the system. All should be positive definite, although we have not
examined and tested all options for this property.
(4) The monotonic option adds significant smoothing to the transport in regions
where it is active. You may want to consider turning off the other model filters for
variables using monotonic transport (filters such as the second and sixth order
horizontal filters). At present it is not possible to turn off the filters for the scalars but
not for the dynamics using the namelist - one must manually comment out the calls in
the solver.
Added
mp_physics Scheme Reference
Number
mp_physics Scheme Cores Mass Variables
Variables
1 Kessler ARW Qc Qr
3 WSM3 ARW Qc Qr
4 WSM5 ARW/NMM Qc Qr Qi Qs
6 WSM6 ARW/NMM Qc Qr Qi Qs Qg
8 Thompson ARW/NMM Qc Qr Qi Qs Qg Ni Nr
Milbrandt 2- Nc Nr Ni Ns Ng
9 ARW Qc Qr Qi Qs Qg Qh
mom Nh
10 Morrison 2-mom ARW (Chem) Qc Qr Qi Qs Qg Nr Ni Ns Ng
13 SBU-YLin ARW Qc Qr Qi Qs
14 WDM5 ARW Qc Qr Qi Qs Nn** Nc Nr
16 WDM6 ARW Qc Qr Qi Qs Qg Nn** Nc Nr
Added
cu_physics Scheme Reference
5 Grell-3 - 2008
3 GD ARW Qc Qi no no
5 G3 ARW Qc Qi no yes
99 old KF ARW Qc Qr Qi Qs no no
The following is a description of namelist variables. The variables that are a function of
nests are indicated by (max_dom) following the variable. Also see
Registry/Registry.EM and run/README.namelist file in WRFV3/ directory.
0 no microphysics
1 Kessler scheme
2 Lin et al. scheme
3 WSM 3-class simple ice scheme
4 WSM 5-class scheme
5 Ferrier (new Eta) microphysics
6 WSM 6-class graupel scheme
7 Goddard GCE scheme (also use
gsfcgce_hail and gsfcgce_2ice)
8 Thompson graupel scheme (2-moment
scheme in V3.1)
9 Milbrandt-Yau 2-moment scheme
10 Morrison 2-moment scheme
13 SBU-YLin, 5-class scheme
14 double moment, 5-class scheme
16 double moment, 6-class scheme
98 Thompson scheme in V3.0
mp_zero_out For non-zero mp_physics options, this
keeps moisture variables above a threshold
value >= 0. An alternative (and better)
way to keep moisture variables positive is
to use moist_adv_opt.
0 no action taken, no adjustment to any
moisture field
1 except for Qv, all other moisture arrays are
set to zero if they fall below a critical
value
2 Qv >= 0 and all other moisture arrays are
set to zero if they fall below a critical
value
mp_zero_out_thresh 1.e-8 critical value for moisture variable
threshold, below which moisture arrays
(except for Qv) are set to zero (unit: kg/kg)
mp_tend_lim 10.. limit on temp tendency from microphysics
latent heating when radar data assimilation
is used
gsfcgce_hail 0 0: running gsfcgce scheme with graupel
1: running gsfcgce scheme with hail
gsfcgce_2ice 0 0: running gsfcgce scheme with snow, ice
and graupel / hail
1: running gsfcgce scheme with only ice
and snow
2: running gsfcgce scheme with only ice
and graupel (used only in very extreme
situation)
no_mp_heating 0 switch to turn off latent heating from mp
0: normal
1: turn off latent heating from a
microphysics scheme
ra_lw_physics longwave radiation option
(max_dom)
0 no longwave radiation
1 rrtm scheme
3 CAM scheme
4 rrtmg scheme
5 Goddard scheme
99 GFDL (Eta) longwave (semi-supported)
ra_sw_physics shortwave radiation option
(max_dom)
0 no shortwave radiation
1 Dudhia scheme
2 (old) Goddard shortwave scheme
3 CAM scheme
4 rrtmg scheme
5 Goddard scheme
99 GFDL (Eta) longwave (semi-supported)
radt (max_dom) 30 minutes between radiation physics calls.
Recommend 1 minute per km of dx (e.g.
10 for 10 km grid); use the same value for
all nests
co2tf 1 CO2 transmission function flag for GFDL
radiation only. Set it to 1 for ARW, which
allows generation of CO2 function
internally
cam_abs_freq_s 21600 CAM clear sky longwave absorption
calculation frequency (recommended
minimum value to speed scheme up)
levsiz 59 for CAM radiation input ozone levels
paerlev 29 for CAM radiation input aerosol levels
cam_abs_dim1 4 for CAM absorption save array
cam_abs_dim2 same as e_vert for CAM 2nd absorption save array. The
above 5 variables for CAM are
automatically set in V3.2.
sf_sfclay_physics=1, 7
8 Bougeault and Lacarrere (BouLac) TKE,
use sf_sfclay_physics=1, 2
9 Bretherton-Park/UW TKE scheme
10 TEMF
99 MRF scheme (to be removed)
bldt (max_dom) 0 minutes between boundary-layer physics
calls. 0 = call every time step
grav_settling 0 Gravitational settling of fog/cloud droplet,
(max_dom) MYNN PBL only
cu_physics (max_dom) cumulus option
0 no cumulus
1 Kain-Fritsch (new Eta) scheme
2 Betts-Miller-Janjic scheme
3 Grell-Devenyi ensemble scheme
4 Simplied Arakawa-Schubert
5 New Grell scheme (G3)
6 Tiedtke scheme
7 Zhang-McFarlane from CESM (works
with MYJ and UW PBL)
14 New GFS SAS
99 previous Kain-Fritsch scheme
cudt 0 minutes between cumulus physics calls.
0 = call every time step
kfeta_trigger 1 KF trigger function option: = 1, default;
= 2, moisture-adv; = 3, RH
ishallow 0 Shallow convection used with Grell 3D
shcu_physics(max_dom) 2 Bretherton-Park/UW
maxiens 1 Grell-Devenyi and G3 only
maxens 3 G-D only
maxens2 3 G-D only
maxens3 16 G-D only
ensdim 144 G-D only. These are recommended
numbers. If you would like to use any
other number, consult the code, know what
you are doing.
cugd_avedx 1 number of grid boxes over which
subsidence is spread. 1= default, for large
grid sizes; 3=, for small grid sizes (<5km)
cu_diag (max_dom) 0 Additional time-averaged diagnostics from
reduced weight
(max_dom)
2 monotonic
tke_adv_opt (max_dom) 1 positive-define advection of tke
2 monotomic
chem_adv_opt (max_dom) 1 positive-define advection of chem vars
2 monotonic
tracer_adv_opt 1 positive-define advection of tracer (WRF-
(max_dom) Chem activated)
2 monotonic
tke_drag_coefficient 0 surface drag coefficient (Cd,
(max_dom)
dimensionless) for diff_opt=2 only
tke_heat_flux 0 surface thermal flux (H/rho*cp), K m/s)
(max_dom)
for diff_opt = 2 only
fft_filter_lat 45. the latitude above which the polar filter is
turned on for global model
gwd_opt 0 gravity wave drag option (1= on), use
when grid size > 10 km
do_avgflx_em 0 whether to output time-averaged mass-
(max_dom) coupled advective velocities
do_avgflx_cugd 0 whether to output time-averaged
convective mass-fluxes from Grell-
Devenyi ensemble scheme
sfs_opt (max_dom) 0 nonlinear backscatter and anisotropy
(NBA); default off
1 using diagnostic stress terms (km_opt=2,3
for scalars)
2 using tke-based stress terms (km_opt=2
needed)
m_opt (max_dom) 0 =1: adds output of Mij stress terms when
NBA is not used
tracer_opt (max_dom) 0 =2: activate 8 pre-defined tracers in
Registry
rad_nudge 0 option to nudge toward initial sounding in
idealized TC case
b.c. option)
specified (max_dom) .false. specified boundary conditions (only can be
used for to domain 1)
spec_exp 0. exponential multiplier for relaxation zone
ramp for specified=.t. (0.= linear ramp
default; 0.33=~3*dx exp decay factor)
The above 5 namelists are used for real-
data runs only
periodic_x (max_dom) .false. periodic boundary conditions in x
direction
symmetric_xs (max_dom) .false. symmetric boundary conditions at x start
(west)
symmetric_xe (max_dom) .false. symmetric boundary conditions at x end
(east)
open_xs (max_dom) .false. open boundary conditions at x start (west)
open_xe (max_dom) .false. open boundary conditions at x end (east)
periodic_y (max_dom) .false. periodic boundary conditions in y
direction
symmetric_ys (max_dom) .false. symmetric boundary conditions at y start
(south)
symmetric_ye (max_dom) .false. symmetric boundary conditions at y end
(north)
open_ys (max_dom) .false. open boundary conditions at y start (south)
open_ye (max_dom) .false. open boundary conditions at y end (north)
nested (max_dom) .false.,.true.,.true., nested boundary conditions (must be set to
.true. for nests)
polar .false. polar boundary condition (v=0 at
polarward-most v-point) for global
application
constant_bc .false. constant boundary condition used with
DFI.
&grib2
background_proc_id 255 Background generating process identifier,
typically defined by the originating center
to identify the background data that was
used in creating the data. This is octet 13
of Section 4 in the grib2 message
forecast_proc_id 255 Analysis or generating forecast process
identifier, typically defined by the
originating center to identify the forecast
process that was used to generate the data.
This is octet 14 of Section 4 in the grib2
message
production_status 255 Production status of processed data in the
grib2 message. See Code Table 1.3 of the
grib2 manual. This is octet 20 of Section 1
in the grib2 record
compression 40 The compression method to encode the
output grib2 message. Only 40 for
jpeg2000 or 41 for PNG are supported
dfi_radar 0 DFI radar data assimilation switch
&dfi_control digital filter option control (does not yet support nesting)
dfi_opt 3 which DFI option to use
0: no digital filter initialization
1: digital filter launch (DFL)
2: diabatic DFI (DDFI)
3: twice DFI (TDFI) (recommended)
dfi_nfilter 7 digital filter type: 0 – uniform; 1- Lanczos;
2 – Hamming; 3 – Blackman; 4 – Kaiser; 5
– Potter; 6 – Dolph window; 7 – Dolph
(recommended); 8 – recursive high-order
dfi_write_filtered_ .true. whether to write wrfinput file with filtered
input model state before beginning forecast
dfi_write_dfi_history .false. whether to write wrfout files during
filtering integration
dfi_cutoff_seconds 3600 cutoff period, in seconds, for the filter.
Should not be longer than the filter
window
dfi_time_dim 1000 maximum number of time steps for
filtering period, this value can be larger
than necessary
dfi_bckstop_year 2001 four-digit year of stop time for backward
DFI integration. For a model that starts
List of Fields
The following is an edited output list from netCDF command 'ncdump -h'. Note that valid
output fields will depend on the model options used. If the fields have zero values, then
the fields are not computed by the model options selected.
ncdump -h wrfout_d<domain>_<date>
netcdf wrfout_d01_2000-01-24_12:00:00
dimensions:
Time = UNLIMITED ; // (1 currently)
DateStrLen = 19 ;
west_east = 73 ;
south_north = 60 ;
bottom_top = 27 ;
bottom_top_stag = 28 ;
soil_layers_stag = 4 ;
west_east_stag = 74 ;
south_north_stag = 61 ;
variables:
char Times(Time, DateStrLen) ;
float LU_INDEX(Time, south_north, west_east) ;
LU_INDEX:description = "LAND USE CATEGORY" ;
LU_INDEX:units = "" ;
float ZNU(Time, bottom_top) ;
ZNU:description = "eta values on half (mass) levels" ;
ZNU:units = "" ;
float ZNW(Time, bottom_top_stag) ;
ZNW:description = "eta values on full (w) levels" ;
ZNW:units = "" ;
float ZS(Time, soil_layers_stag) ;
ZS:description = "DEPTHS OF CENTERS OF SOIL LAYERS" ;
ZS:units = "m" ;
float DZS(Time, soil_layers_stag) ;
DZS:description = "THICKNESSES OF SOIL LAYERS" ;
DZS:units = "m" ;
float U(Time, bottom_top, south_north, west_east_stag) ;
U:description = "x-wind component" ;
U:units = "m s-1" ;
float V(Time, bottom_top, south_north_stag, west_east) ;
V:description = "y-wind component" ;
V:units = "m s-1" ;
float W(Time, bottom_top_stag, south_north, west_east) ;
W:description = "z-wind component" ;
W:units = "m s-1" ;
float PH(Time, bottom_top_stag, south_north, west_east) ;
PH:description = "perturbation geopotential" ;
PH:units = "m2 s-2" ;
float PHB(Time, bottom_top_stag, south_north, west_east) ;
PHB:description = "base-state geopotential" ;
PHB:units = "m2 s-2" ;
float T(Time, bottom_top, south_north, west_east) ;
T:description = "perturbation potential temperature (theta-t0)" ;
T:units = "K" ;
float MU(Time, south_north, west_east) ;
MU:description = "perturbation dry air mass in column" ;
MU:units = "Pa" ;
float MUB(Time, south_north, west_east) ;
MUB:description = "base state dry air mass in column" ;
MUB:units = "Pa" ;
float NEST_POS(Time, south_north, west_east) ;
NEST_POS:description = "-" ;
NEST_POS:units = "-" ;
float P(Time, bottom_top, south_north, west_east) ;
P:description = "perturbation pressure" ;
P:units = "Pa" ;
float PB(Time, bottom_top, south_north, west_east) ;
PB:description = "BASE STATE PRESSURE" ;
PB:units = "Pa" ;
float SR(Time, south_north, west_east) ;
SR:description = "fraction of frozen precipitation" ;
SR:units = "-" ;
float POTEVP(Time, south_north, west_east) ;
POTEVP:description = "accumulated potential evaporation" ;
POTEVP:units = "W m-2" ;
float SNOPCX(Time, south_north, west_east) ;
SNOPCX:description = "snow phase change heat flux" ;
SNOPCX:units = "W m-2" ;
float SOILTB(Time, south_north, west_east) ;
SOILTB:description = "bottom soil temperature" ;
SOILTB:units = "K" ;
float FNM(Time, bottom_top) ;
FNM:description = "upper weight for vertical stretching" ;
FNM:units = "" ;
float FNP(Time, bottom_top) ;
FNP:description = "lower weight for vertical stretching" ;
FNP:units = "" ;
float RDNW(Time, bottom_top) ;
RDNW:description = "inverse d(eta) values between full (w) levels" ;
RDNW:units = "" ;
float RDN(Time, bottom_top) ;
RDN:description = "inverse d(eta) values between half (mass) levels" ;
RDN:units = "" ;
float DNW(Time, bottom_top) ;
DNW:description = "d(eta) values between full (w) levels" ;
DNW:units = "" ;
float DN(Time, bottom_top) ;
DN:description = "d(eta) values between half (mass) levels" ;
DN:units = "" ;
float CFN(Time) ;
CFN:description = "extrapolation constant" ;
CFN:units = "" ;
float CFN1(Time) ;
CFN1:description = "extrapolation constant" ;
CFN1:units = "" ;
float P_HYD(Time, bottom_top, south_north, west_east) ;
P_HYD:description = "hydrostatic pressure" ;
P_HYD:units = "Pa" ;
float Q2(Time, south_north, west_east) ;
Q2:description = "QV at 2 M" ;
Q2:units = "kg kg-1" ;
float T2(Time, south_north, west_east) ;
T2:description = "TEMP at 2 M" ;
T2:units = "K" ;
float TH2(Time, south_north, west_east) ;
TH2:description = "POT TEMP at 2 M" ;
TH2:units = "K" ;
float PSFC(Time, south_north, west_east) ;
PSFC:description = "SFC PRESSURE" ;
PSFC:units = "Pa" ;
float U10(Time, south_north, west_east) ;
U10:description = "U at 10 M" ;
U10:units = "m s-1" ;
float V10(Time, south_north, west_east) ;
V10:description = "V at 10 M" ;
V10:units = "m s-1" ;
float RDX(Time) ;
RDX:description = "INVERSE X GRID LENGTH" ;
RDX:units = "" ;
float RDY(Time) ;
RDY:description = "INVERSE Y GRID LENGTH" ;
RDY:units = "" ;
float RESM(Time) ;
RESM:description = "TIME WEIGHT CONSTANT FOR SMALL STEPS" ;
RESM:units = "" ;
float ZETATOP(Time) ;
ZETATOP:description = "ZETA AT MODEL TOP" ;
ZETATOP:units = "" ;
float CF1(Time) ;
CF1:description = "2nd order extrapolation constant" ;
CF1:units = "" ;
float CF2(Time) ;
CF2:description = "2nd order extrapolation constant" ;
CF2:units = "" ;
float CF3(Time) ;
CF3:description = "2nd order extrapolation constant" ;
CF3:units = "" ;
int ITIMESTEP(Time) ;
ITIMESTEP:description = "" ;
ITIMESTEP:units = "" ;
float XTIME(Time) ;
XTIME:description = "minutes since simulation start" ;
XTIME:units = "" ;
float QVAPOR(Time, bottom_top, south_north, west_east) ;
QVAPOR:description = "Water vapor mixing ratio" ;
MAPFAC_MX:units = "" ;
float MAPFAC_MY(Time, south_north, west_east) ;
MAPFAC_MY:description = "Map scale factor on mass grid, y direction" ;
MAPFAC_MY:units = "" ;
float MAPFAC_UX(Time, south_north, west_east_stag) ;
MAPFAC_UX:description = "Map scale factor on u-grid, x direction" ;
MAPFAC_UX:units = "" ;
float MAPFAC_UY(Time, south_north, west_east_stag) ;
MAPFAC_UY:description = "Map scale factor on u-grid, y direction" ;
MAPFAC_UY:units = "" ;
float MAPFAC_VX(Time, south_north_stag, west_east) ;
MAPFAC_VX:description = "Map scale factor on v-grid, x direction" ;
MAPFAC_VX:units = "" ;
float MF_VX_INV(Time, south_north_stag, west_east) ;
MF_VX_INV:description = "Inverse map scale factor on v-grid, x direction"
MF_VX_INV:units = "" ;
float MAPFAC_VY(Time, south_north_stag, west_east) ;
MAPFAC_VY:description = "Map scale factor on v-grid, y direction" ;
MAPFAC_VY:units = "" ;
float F(Time, south_north, west_east) ;
F:description = "Coriolis sine latitude term" ;
F:units = "s-1" ;
float E(Time, south_north, west_east) ;
E:description = "Coriolis cosine latitude term" ;
E:units = "s-1" ;
float SINALPHA(Time, south_north, west_east) ;
SINALPHA:description = "Local sine of map rotation" ;
SINALPHA:units = "" ;
float COSALPHA(Time, south_north, west_east) ;
COSALPHA:description = "Local cosine of map rotation" ;
COSALPHA:units = "" ;
float HGT(Time, south_north, west_east) ;
HGT:description = "Terrain Height" ;
HGT:units = "m" ;
float HGT_SHAD(Time, south_north, west_east) ;
HGT_SHAD:description = "Height of orographic shadow" ;
HGT_SHAD:units = "m" ;
float TSK(Time, south_north, west_east) ;
TSK:description = "SURFACE SKIN TEMPERATURE" ;
TSK:units = "K" ;
float P_TOP(Time) ;
P_TOP:description = "PRESSURE TOP OF THE MODEL" ;
P_TOP:units = "Pa" ;
float MAX_MSTFX(Time) ;
MAX_MSTFX:description = "Max map factor in domain" ;
MAX_MSTFX:units = "" ;
float MAX_MSTFY(Time) ;
MAX_MSTFY:description = "Max map factor in domain" ;
MAX_MSTFY:units = "" ;
float RAINC(Time, south_north, west_east) ;
RAINC:description = "ACCUMULATED TOTAL CUMULUS PRECIPITATION" ;
RAINC:units = "mm" ;
float RAINNC(Time, south_north, west_east) ;
RAINNC:description = "ACCUMULATED TOTAL GRID SCALE PRECIPITATION" ;
RAINNC:units = "mm" ;
float PRATEC(Time, south_north, west_east) ;
PRATEC:description = "PRECIP RATE FROM CUMULUS SCHEME" ;
PRATEC:units = "mm s-1" ;
float RAINCV(Time, south_north, west_east) ;
RAINCV:description = "TIME-STEP CUMULUS PRECIPITATION" ;
RAINCV:units = "mm" ;
float SNOWNC(Time, south_north, west_east) ;
SNOWNC:description = "ACCUMULATED TOTAL GRID SCALE SNOW AND ICE" ;
SNOWNC:units = "mm" ;
float GRAUPELNC(Time, south_north, west_east) ;
GRAUPELNC:description = "ACCUMULATED TOTAL GRID SCALE GRAUPEL" ;
GRAUPELNC:units = "mm" ;
float EDT_OUT(Time, south_north, west_east) ;
EDT_OUT:description = "EDT FROM GD SCHEME" ;
EDT_OUT:units = "" ;
float SWDOWN(Time, south_north, west_east) ;
SWDOWN:description = "DOWNWARD SHORT WAVE FLUX AT GROUND SURFACE" ;
// global attributes:
:BOTTOM-TOP_GRID_DIMENSION = 28 ;
:DX = 30000.f ;
:DY = 30000.f ;
:GRIDTYPE = "C" ;
:DIFF_OPT = 1 ;
:KM_OPT = 4 ;
:DAMP_OPT = 0 ;
;DAMPCOEF = 0.2F ;
:KHDIF = 0.f ;
:KVDIF = 0.f ;
:MP_PHYSICS = 3 ;
:RA_LW_PHYSICS = 1 ;
:RA_SW_PHYSICS = 1 ;
:SF_SFCLAY_PHYSICS = 1 ;
:SF_SURFACE_PHYSICS = 2 ;
:BL_PBL_PHYSICS = 1 ;
:CU_PHYSICS = 1 ;
:SURFACE_INPUT_SOURCE = 1 ;
:SST_UPDATE = 0 ;
:GRID_FDDA = 1 ;
:GFDDA_INTERVAL_M = 360 ;
:GFDDA_END_H = 24 ;
:SGFDDA_INTERVAL_M = 0 ;
:SGFDDA_END_H = 0 ;
:SF_URBAN_PHYSICS = 0 ;
:FEEDBACK = 1 ;
:SMOOTH_OPTION = 0 ;
:SWRAD_SCAT = 1.f ;
:W_DAMPING = 0 ;
:MOIST_ADV_OPT = 1 ;
:SCALAR_ADV_OPT = 1 ;
:TKE_ADV_OPT = 1 ;
:DIFF_6TH_OPT = 0 ;
:DIFF_6TH_FACTOR = 0.12f ;
:OBS_NUDGE_OPT = 0 ;
:BUCKET_MM = -1.f ;
:BUCKET_J = -1.f ;
:PREC_ACC_DT = 0.f ;
:OMLCALL = 0 ;
:ISFTCFLX = 0 ;
;ISHALLOW = 0 ;
;DFI_OPT = 0 ;
;SHCU_PHYSICS = 0 ;
:WEST-EAST_PATCH_START_UNSTAG = 1 ;
:WEST-EAST_PATCH_END_UNSTAG = 73 ;
:WEST-EAST_PATCH_START_STAG = 1 ;
:WEST-EAST_PATCH_END_STAG = 74 ;
:SOUTH-NORTH_PATCH_START_UNSTAG = 1 ;
:SOUTH-NORTH_PATCH_END_UNSTAG = 60 ;
:SOUTH-NORTH_PATCH_START_STAG = 1 ;
:SOUTH-NORTH_PATCH_END_STAG = 61 ;
:BOTTOM-TOP_PATCH_START_UNSTAG = 1 ;
:BOTTOM-TOP_PATCH_END_UNSTAG = 27 ;
:BOTTOM-TOP_PATCH_START_STAG = 1 ;
:BOTTOM-TOP_PATCH_END_STAG = 28 ;
:GRID_ID = 1 ;
:PARENT_ID = 0 ;
:I_PARENT_START = 1 ;
:J_PARENT_START = 1 ;
:PARENT_GRID_RATIO = 1 ;
:DT = 180.f ;
:CEN_LAT = 34.83002f ;
:CEN_LON = -81.03f ;
:TRUELAT1 = 30.f ;
:TRUELAT2 = 60.f ;
:MOAD_CEN_LAT = 34.83002f ;
:STAND_LON = -98.f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:GMT = 12.f ;
:JULYR = 2000 ;
:JULDAY = 24 ;
:MAP_PROJ = 1 ;
:MMINLU = "USGS" ;
:NUM_LAND_CAT = 24 ;
:ISWATER = 16 ;
:ISLAKE = -1 ;
:ISICE = 24 ;
:ISURBAN = 1 ;
:ISOILWATER = 14 ;
WRF model outputs the state variables defined in the Registry file, and these state
variables are used in the model's prognostic equations. Some of these variables are
perturbation fields. Therefore some definition for reconstructing meteorological variables
is necessary. In particular, the definitions for the following variables are:
Table of Contents
• Introduction
• Installing WRFDA for 3D-Var Run
• Installing WRFPLUS and WRFDA for 4D-Var Run
• Running Observation Preprocessor (OBSPROC)
• Running WRFDA
• Radiance Data Assimilations in WRFDA
• WRFDA Diagnostics
• Updating WRF Boundary Conditions
• Running gen_be
• WRFDA with Multivariate Background Error (MBE) Statistics
• Additional WRFDA Exercises
• Hybrid Data Assimilation
• Description of Namelist Variables
Introduction
Data assimilation is the technique by which observations are combined with a NWP
product (the first guess or background forecast) and their respective error statistics to
provide an improved estimate (the analysis) of the atmospheric (or oceanic, Jovian,
whatever) state. Variational (Var) data assimilation achieves this through the iterative
minimization of a prescribed cost (or penalty) function. Differences between the analysis
and observations/first guess are penalized (damped) according to their perceived error.
The difference between three-dimensional (3D-Var) and four-dimensional (4D-Var) data
assimilation is the use of a numerical forecast model in the latter.
Various components of the WRFDA system are shown in blue in the sketch below, to-
gether with their relationship with rest of the WRF system.
xb: first guess either from a previous WRF forecast or from WPS/REAL output.
xlbc: lateral boundary from WPS/REAL output.
xa: analysis from WRFDA data assimilation system.
xf: WRF forecast output.
yo: observations processed by OBSPROC. (note: PREPBUFR input, Radar and
Radiance data don’t go through OBSPROC)
B 0 : background error statistics from generic BE data (CV3) or gen_be.
R: observational and representative error statistics.
In this chapter, you will learn how to run the various components of the WRFDA system.
For training purposes, you are supplied with a test case including the following input da-
ta: a) observation file (in the format prior to OBSPROC), b) WRF netCDF background
file (WPS/REAL output used as a first guess of the analysis), and c) Background error
statistics (estimate of errors in the background file). You can download the test dataset
from http://www.mmm.ucar.edu/wrf/users/wrfda/download/testdata.html. In your own
work, you have to create all these input files yourselves. See the section Running Obser-
vation Preprocessor for creating your observation files. See section Running gen_be for
generating your background error statistics file if you want to use cv_options=5 or
cv_options=6.
Before using your own data, we suggest that you start by running through the WRFDA
related programs at least once using the supplied test case. This serves two purposes:
First, you can learn how to run the programs with data we have tested ourselves, and
second you can test whether your computer is adequate to run the entire modeling sys-
tem. After you have done the tutorial, you can try running other, more computationally
intensive, case studies and experimenting with some of the many namelist variables.
WARNING: It is impossible to test every code upgrade with every permutation of com-
puter, compiler, number of processors, case, namelist option, etc. The “namelist” options
that are supported are indicated in the “WRFDA/var/README.namelist”, and these are the
default options.
Running with your own domain, hopefully, our test cases will have prepared you for the
variety of ways in which you may wish to run WRFDA. Please inform us about your ex-
periences.
As a professional courtesy, we request that you include the following reference in any
publications that uses of any component of the community WRFDA system:
Barker, D.M., W. Huang, Y.R. Guo, and Q.N. Xiao., 2004: A Three-Dimensional
(3DVAR) Data Assimilation System For Use With MM5: Implementation and Initial Re-
sults. Mon. Wea. Rev., 132, 897-914.
Running WRFDA requires a Fortran 90 compiler. We have currently tested the WRFDA
on the following platforms: IBM (XLF), SGI Altix (INTEL), PC/Linux (PGI, INTEL,
GFORTRAN), and Apple (G95/PGI). Please let us know if this does not meet your re-
quirements, and we will attempt to add other machines to our list of supported architec-
tures as resources allow. Although we are interested to hear of your experiences on mod-
ifying compile options, we do not yet recommend making changes to the configure file
used to compile WRFDA.
After the tar file is unzipped (gunzip WRFDAV3.3.TAR.gz) and untarred (untar
WRFDAV3.3.TAR), the directory WRFDA should be created; this directory contains the
WRFDA source, external libraries, and fixed files. The following is a list of the system
components and the content for each directory:
Starting from V3.1.1, some external libraries (for example, lapack, blas, and NCEP
BUFR) are included in the WRFDA tar file. To compile the WRFDA code, it is necessary
to have installed the netCDF library, which is the only mandatory library if only conven-
tional observational data from LITTLE_R format file is to be used.
To have NCEP BUFR library compiled and have BUFR-related WRFDA code generated
and compiled after configure/compile.
If satellite radiance data are to be used, in addition to NCEP BUFR library, RTM (Radia-
tive Transfer Model) is required. The current RTM versions that WRFDA uses are
CRTM V2.0.2 and RTTOV V10. WRFDA can compile with CRTM only, or RTTOV
only, or both CRTM and RTTOV together.
Starting from V3.2.1, CRTM V2.0.2 is included in the WRFDA tar file.
To have CRTM library compiled and CRTM-related WRFDA code generated and com-
If RTTOV v10 is the RTM to be used for radiance data assimilation, for the user should
have downloaded and installed the RTTOV library before compiling WRFDA.
Note: Make sure the required libraries were all compiled using the same compiler
that will be used to build WRFDA, since the libraries produced by one compiler may
not be compatible with code compiled with another.
Assuming all required libraries are available and the WRFDA source code is ready, start
to build the WRFDA using the following steps:
A list of configuration options for your computer should appear. Each option combines a
compiler type and a parallelism option; since the configuration script doesn’t check
which compilers are actually available, be sure to select only among the options for com-
pilers that are available on your system. The parallelism option allows for a single-
processor (serial) compilation, shared-memory parallel (smpar) compilation, distributed-
memory parallel (dmpar) compilation and distributed-memory with shared-memory pa-
rallel (sm+dm) compilation. For example, on a Macintosh computer, the above steps look
like:
After running the configuration script and choosing a compilation option, a confi-
gure.wrf file will be created. Because of the variety of ways that a computer can be con-
figured, if the WRFDA build ultimately fails, there is a chance that minor modifications
to the configure.wrf file may be needed.
Note: WRF compiles with –r4 option while WRFDA compiles with –r8. For this rea-
son, WRF and WRFDA cannot reside and be compiled under the same directory.
Hint: It is helpful to start with something simple, such as the serial build. If it is success-
ful, move on to build dmpar code. Remember to type ‘clean –a’ between each build.
da_wrfvar.exe is the main executable for running WRFDA. Make sure it is created after
the compilation. Sometimes (unfortunately) it is possible that other utilities get success-
fully compiled, while the main da_wrfvar.exe fails; please check the compilation log
file carefully to figure out the problem.
da_updated_bc.exe is used for updating WRF low and lateral boundary condition be-
fore and after a new WRFDA analysis is generated.
da_advance_time.exe is a very handy and useful tool for date/time manipulation. Type
“da_advance_time.exe” to see its usage instruction.
In addition to the executables for running WRFDA and gen_be, obsproc.exe (the ex-
ecutable for preparing conventional data for WRFDA) compilation is also included in
“./compile all_wrfvar”. da_advance_time.exe
c. Clean Compilation
clean
clean -a
If you intend to run WRF 4D-Var, it is necessary to have WRFPLUS installed. From
V3.3, we release a new version of WRFDA and WRFPLUS for 4D-Var. WRFPLUS con-
tains the adjoint and tangent linear models based on a simplified WRF model, which only
include dry dynamic processes. We are developing the tangent linear and adjoint codes of
several simplified physical packages.
http://www.mmm.ucar.edu/wrf/users/wrfda/download/wrfplu
s.html
Note: For Version 3.3 WRFDA 4D-Var, parallel run is still under development,
please compile WRFPLUS3.3 with serial mode.
• Compile WRFPLUS
• Before you install WRFDA to run 4D-Var, environment variable should to be set
with,
• If you intend to use observational data with PREPBUFR format or if you intend to
assimilate satellite radiance data, you need set environment variables for BUFR,
CRTM, or RTTOV. This procedure is the same as installing WRFDA for 3D-Var
run.
>./configure 4dvar
Note: Please compile WRFDA for 4D-Var run with serial mode.
>./compile all_wrfvar
• Remove observations outside the time range and domain (horizontal and top).
• Re-order and merge duplicate (in time and location) data reports.
• Retrieve pressure or height based on observed information using the hydrostatic
assumption.
• Check vertical consistency and super adiabatic for multi-level observations.
• Assign observational errors based on a pre-specified error file.
• Write out the observation file to be used by WRFDA in ASCII or BUFR format.
To prepare the observation file, for example, at the analysis time 0h for 3D-Var, all the
observations between ±1h (or ±1.5h) will be processed, as illustrated in the following
figure, which means that the observations between 23h and 1h are treated as the observa-
tions at 0h.
Before running obsproc.exe, create the required namelist file namelist.obsproc (see
WRFDA/var/obsproc/README.namelist, or the section Description of Namelist Variab-
les for details.
Next, edit the namelist file namelist.obsproc by changing the following variables to
accommodate your experiments.
&record1
obs_gts_filename='obs.2008020512'
&record2
time_window_min = '2008-02-05_11:00:00',: The earliest time edge as ccyy-mm-dd_hh:mn:ss
time_analysis = '2008-02-05_12:00:00', : The analysis time as ccyy-mm-dd_hh:mn:ss
time_window_max = '2008-02-05_13:00:00',: The latest time edge as ccyy-mm-dd_hh:mn:ss
&record6,7,8
Edit all the domain settings to conform to your own experiment. You may pay special
attention to NESTIX and NESTJX, which are described in the section Description of
Namelist Variables for details.
&record9
use_for = '3DVAR', ; used for 3D-Var, default
Once obsproc.exe has completed successfully, you will see an observation data file,
obs_gts_2008-02-05_12:00:00.3DVAR, in the obsproc directory. This is the input ob-
servation file to WRFDA.
file are described in the last six lines of the header section.
TOTAL = 9066, MISS. =-888888.,
SYNOP = 757, METAR = 2416, SHIP = 145, BUOY = 250, BOGUS = 0, TEMP =
86,
AMDAR = 19, AIREP = 205, TAMDAR= 0, PILOT = 85, SATEM = 106, SATOB =
2556,
GPSPW = 187, GPSZD = 0, GPSRF = 3, GPSEP = 0, SSMT1 = 0, SSMT2 =
0,
TOVS = 0, QSCAT = 2190, PROFL = 61, AIRSR = 0, OTHER = 0,
PHIC = 40.00, XLONC = -95.00, TRUE1 = 30.00, TRUE2 = 60.00, XIM11 = 1.00, XJM11 =
1.00,
base_temp= 290.00, base_lapse= 50.00, PTOP = 1000., base_pres=100000.,
base_tropo_pres= 20000., base_strat_temp= 215.,
IXC = 60, JXC = 90, IPROJ = 1, IDD = 1, MAXNES= 1,
NESTIX= 60,
NESTJX= 90,
NUMC = 1,
DIS = 60.00,
NESTI = 1,
NESTJ = 1,
INFO = PLATFORM, DATE, NAME, LEVELS, LATITUDE, LONGITUDE, ELEVATION, ID.
SRFC = SLP, PW (DATA,QC,ERROR).
EACH = PRES, SPEED, DIR, HEIGHT, TEMP, DEW PT, HUMID (DATA,QC,ERROR)*LEVELS.
INFO_FMT = (A12,1X,A19,1X,A40,1X,I6,3(F12.3,11X),6X,A40)
SRFC_FMT = (F12.3,I4,F7.2,F12.3,I4,F7.3)
EACH_FMT = (3(F12.3,I4,F7.2),11X,3(F12.3,I4,F7.2),11X,3(F12.3,I4,F7.2))
#------------------------------------------------------------------------------#
…… observations ………
Before running WRFDA, you may find it useful to learn more about various types of data
that will be processed to WRFDA, e.g., their geographical distribution. This file is in
ASCII format and so you can easily view it. For a graphical view about file's content, use
the “MAP_plot” utility to see the data distribution for each type of observations. To use
this utility, proceed as follows.
> cd MAP_plot
> make
Modify the script Map.csh to set the time window and full path of input observation file
(obs_gts_2008-02-05_12:00:00.3DVAR). You will need to set the following strings in
this script as follows:
Map_plot = /users/noname/WRFDA/var/obsproc/MAP_plot
TIME_WINDOW_MIN = ‘2008020511’
TIME_ANALYSIS = ‘2008020512’
TIME_WINDOW_MAX = ‘2008020513’
OBSDATA = ../obs_gts_2008-02-05_12:00:00.3DVAR
Next, type
> Map.csh
When the job has completed, you will have a gmeta file gmeta.{analysis_time} cor-
responding to analysis_time=2008020512. This contains plots of data distribution for
each type of observations contained in the OBS data file: obs_gts_2008-02-
05_12:00:00.3DVAR. To view this, type
It will display (panel by panel) geographical distribution of various types of data. The
following graphic shows the geographic distribution of “sonde” observations for this
case.
To prepare the observation file, for example, at the analysis time 0h for 4D-Var, all ob-
servations from 0h to 6h will be processed and grouped in 7 sub-windows from slot1 to
slot7, as illustrated in following figure. NOTE: The “Analysis time” in the figure below is
not the actual analysis time (0h), it indicates the time_analysis setting in the namelist file
and is set to three hours later than the actual analysis time. The actual analysis time is still
0h.
In the namelist file, you need to change the following variables to accommodate your ex-
periments. In this test case, the actual analysis time is 2008-02-05_12:00:00, but in
namelist, the time_analysis should be set to 3 hours later. The different value of
time_analysis will make the different number of time slots before and after time_analysis.
For example, if you set time_analysis = 2008-02-05_16:00:00, and set the
num_slots_past = 4 and time_slots_ahead=2. The final results will be the same as before.
&record1
obs_gts_filename='obs.2008020512'
&record2
time_window_min = '2008-02-05_12:00:00',: The earliest time edge as ccyy-mm-dd_hh:mn:ss
time_analysis = '2008-02-05_15:00:00', : The analysis time as ccyy-mm-dd_hh:mn:ss
time_window_max = '2008-02-05_18:00:00',: The latest time edge as ccyy-mm-dd_hh:mn:ss
&record6,7,8
Edit all the domain settings according to your own experiment. You may pay special at-
tention to NESTIX and NESTJX, which is described in the section Description of Na-
melist Variables for details.
&record9
Once obsproc.exe has completed successfully, you will see 7 observation data files:
obs_gts_2008-02-05_12:00:00.4DVAR
obs_gts_2008-02-05_13:00:00.4DVAR
obs_gts_2008-02-05_14:00:00.4DVAR
obs_gts_2008-02-05_15:00:00.4DVAR
obs_gts_2008-02-05_16:00:00.4DVAR
obs_gts_2008-02-05_17:00:00.4DVAR
obs_gts_2008-02-05_18:00:00.4DVAR
They are the input observation files to WRF 4D-Var. You can also use “MAP_Plot” to
view the geographic distribution of different observations at different time slots.
Running WRFDA
a) A WRF first guess and boundary input files output from either WPS/real (cold-start)
In the test case, you will store data in a directory defined by the environment variable
$DAT_DIR. This directory can be at any location, and it should have read access. Type
> cd $DAT_DIR
Download the test data for a “Tutorial” case valid at 12 UTC 5th February 2008 from
http://www.mmm.ucar.edu/wrf/users/wrfda/download/testdata.html
Now you should find the following three sub-directories/files under “$DAT_DIR”
You should first go through the section “Running Observation Preprocessor (OB-
SPROC)” and have a WRF-3D-Var-ready observation file (obs_gts_2008-02-
05_12:00:00.3DVAR) generated in your OBSPROC working directory. You could then
copy or move obs_gts_2008-02-05_12:00:00.3DVAR to be in
$DAT_DIR/ob/2008020512/ob.ascii.
If you want to try 4D-Var with Little-R format observations, please go through the sec-
tion “Running Observation Preprocessor (OBSPROC)” and have the WRF-4D-Var-ready
observation files (obs_gts_2008-02-05_12:00:00.4DVAR,……). You could copy or
move the observation files to $DAT_DIR/ob using following commands:
> mv obs_gts_2008-02-05_12:00:00.4DVAR $DAT_DIR/ob/2008020512/ob.ascii+
> mv obs_gts_2008-02-05_13:00:00.4DVAR $DAT_DIR/ob/2008020513/ob.ascii
> mv obs_gts_2008-02-05_14:00:00.4DVAR $DAT_DIR/ob/2008020514/ob.ascii
> mv obs_gts_2008-02-05_15:00:00.4DVAR $DAT_DIR/ob/2008020515/ob.ascii
> mv obs_gts_2008-02-05_16:00:00.4DVAR $DAT_DIR/ob/2008020516/ob.ascii
> mv obs_gts_2008-02-05_17:00:00.4DVAR $DAT_DIR/ob/2008020517/ob.ascii
> mv obs_gts_2008-02-05_18:00:00.4DVAR $DAT_DIR/ob/2008020518/ob.ascii-
At this point you have three of the input files (first guess, observation, and background
error statistics files in directory $DAT_DIR) required to run WRFDA, and have successful-
ly downloaded and compiled the WRFDA code. If this is correct, you are ready to learn
how to run WRFDA.
The data for this case is valid at 12 UTC 5th February 2008. The first guess comes from
the NCEP FNL (Final) Operational Global Analysis data, passed through the WRF-WPS
and real programs.
To run WRF 3D-Var, first create and cd to a working directory, for example,
WRFDA/var/test/tutorial, and then follow the steps below:
> cd WRFDA/var/test/tutorial
> ln -sf WRFDA/run/LANDUSE.TBL ./LANDUSE.TBL
> ln -sf $DAT_DIR/rc/2008020512/wrfinput_d01 ./fg (link first guess file as fg)
> ln -sf WRFDA/var/obsproc/obs_gts_2008-02-05_12:00:00.3DVAR ./ob.ascii (link OBSPROC
processed observation file as ob.ascii)
> ln -sf $DAT_DIR/be/be.dat ./be.dat (link background error statistics as be.dat)
> ln -sf WRFDA/var/da/da_wrfvar.exe ./da_wrfvar.exe (link executable)
If you use PREPBUFR format data, please change the ob_format=1 in &wrfvar3 in na-
melist.input and link the data as ob.bufr,
We will begin by editing the file, namelist.input, which is a very basic namel-
ist.input for running the tutorial test case as shown below and provided as
WRFDA/var/test/tutorial/namelist.input. Only the time and domain settings need
to be specified in this case, if we are using the default settings provided in
WRFDA/Registry/Registry.wrfvar)
&wrfvar1
print_detail_grad=false,
/
&wrfvar2
/
&wrfvar3
/
&wrfvar4
/
&wrfvar5
/
&wrfvar6
/
&wrfvar7
/
&wrfvar8
/
&wrfvar9
/
&wrfvar10
/
&wrfvar11
calculate_cg_cost_fn=.false.
/
&wrfvar12
/
&wrfvar13
/
&wrfvar14
/
&wrfvar15
/
&wrfvar16
/
&wrfvar17
/
&wrfvar18
analysis_date="2008-02-05_12:00:00.0000",
/
&wrfvar19
/
&wrfvar20
/
&wrfvar21
time_window_min="2008-02-05_11:00:00.0000",
/
&wrfvar22
time_window_max="2008-02-05_13:00:00.0000",
/
&wrfvar23
/
&time_control
start_year=2008,
start_month=02,
start_day=05,
start_hour=12,
end_year=2008,
end_month=02,
end_day=05,
end_hour=12,
/
&dfi_control
/
&domains
e_we=90,
e_sn=60,
e_vert=41,
dx=60000,
dy=60000,
/
&physics
mp_physics=3,
ra_lw_physics=1,
ra_sw_physics=1,
radt=60,
sf_sfclay_physics=1,
sf_surface_physics=1,
bl_pbl_physics=1,
cu_physics=1,
cudt=5,
num_soil_layers=5, (IMPORTANT: it’s essential to make sure the setting
here is consistent with the number in your first guess file)
mp_zero_out=2,
co2tf=0,
/
&fdda
/
&dynamics
/
&bdy_control
/
&grib2
/
&namelist_quilt
/
&perturbation
/
The file wrfda.log (or rsl.out.0000 if run in distributed-memory mode) contains im-
portant WRFDA runtime log information. Always check the log after a WRFDA run:
*** VARIATIONAL ANALYSIS ***
DYNAMICS OPTION: Eulerian Mass Coordinate
alloc_space_field: domain 1, 606309816 bytes
allocat
ed
WRF TILE 1 IS 1 IE 89 JS 1 JE 59
WRF NUMBER OF TILES = 1
Set up observations (ob)
Using ASCII format observation input
scan obs ascii
end scan obs ascii
Observation summary
ob time 1
sound 86 global, 86 local
synop 757 global, 750 local
pilot 85 global, 85 local
satem 106 global, 105 local
geoamv 2556 global, 2499 local
polaramv 0 global, 0 local
airep 224 global, 221 local
gpspw 187 global, 187 local
gpsrf 3 global, 3 local
metar 2416 global, 2408 local
ships 145 global, 140 local
ssmi_rv 0 global, 0 local
ssmi_tb 0 global, 0 local
ssmt1 0 global, 0 local
ssmt2 0 global, 0 local
qscat 2190 global, 2126 local
profiler 61 global, 61 local
buoy 247 global, 247 local
bogus 0 global, 0 local
pseudo 0 global, 0 local
radar 0 global, 0 local
1.00000
Jb factor used(3) = 1.00000 1.00000
1.00000 1.00000 1.00000
1.00000 1.00000 1.00000 1.00000
1.00000
Jb factor used(4) = 1.00000 1.00000
1.00000 1.00000 1.00000
1.00000 1.00000 1.00000 1.00000
1.00000
Jb factor used(5) = 1.00000 1.00000
1.00000 1.00000 1.00000
1.00000 1.00000 1.00000 1.00000
1.00000
Jb factor used = 1.00000
Je factor used = 1.00000
VarBC factor used = 1.00000
*** WRF-Var completed successfully ***
A file called namelist.output (which contains the complete namelist settings) will be
generated after a successful da_wrfvar.exe run. The settings appearing in namel-
ist.output, but not specified in your namelist.input, are the default values from
WRFDA/Registry/Registry.wrfvar.
After successful completion of job, wrfvar_output (the WRFDA analysis file, i.e. the
new initial condition for WRF) should appear in the working directory along with a num-
ber of diagnostic files. Various text diagnostics output files will be explained in the next
section (WRFDA Diagnostics).
To understand the role of various important WRFDA options, try re-running WRFDA by
changing different namelist options, for example, making WRFDA convergence criteria
more stringent. This is achieved by reducing the value of the convergence criteria “EPS”
to e.g. 0.0001 by adding "EPS=0.0001" in the namelist.input record &wrfvar6. See
section (WRFDA additional exercises) for more namelist options.
To run WRF 4D-Var, first create and enter into a working directory, for example,
WRFDA/var/test/4dvar.
Note: If you want to setup your own directories to run 4D-Var, please make sure you fol-
low the linkages and namelist.input under WRFDA/var/test/4dvar.
Assume the analysis date is 2008020512 and the test data directories are:
> setenv DATA_DIR /ptmp/$user/DATA
> ls –lr $DATA_DIR
ob/2008020512
ob/2008020513
ob/2008020514
ob/2008020515
ob/2008020516
ob/2008020517
ob/2008020518
rc/2008020512
be
Note: WRFDA 4D-Var is able to assimilate conventional observation data, satellites ra-
diance BUFR data, radar data, and the input data format can be PREPBUFR format data
If you use PREPBUFR format data, please change the ob_format=1 in &wrfvar3 in na-
melist.input and link the data as ob.bufr,
> ln -fs $DATA_DIR/ob/2008020512/gds1.t12.prepbufr.nr ob.bufr
If you would like to assimilate PREPBUFR data at both12hr and 18hr for 4D-Var, you
should linked it as follows,
> ln -fs $DATA_DIR/ob/2008020512/gds1.t12.prepbufr.nr ob01.bufr
> ln -fs $DATA_DIR/ob/2008020518/gds1.t18.prepbufr.nr ob02.bufr
Note: NCEP BUFR files downloaded from NCEP’s public ftp server
ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.${yyyymmddhh} are Fortran-
blocked on big-endian machine and can be directly used on big-endian machines (for ex-
ample, IBM). For most Linux clusters with Intel platforms, users need to download the
byte-swapping code ssrc.c (http://www.dtcenter.org/com-
GSI/users/support/faqs/index.php, the C code ssrc.c located in the /utils directory of the
GSI distribution), and this code will convert a prepbufr file generated on an IBM pla-
tofrm to a prepbufr file that can be read on a Linux or Intel Mac platform. Compile ssrc.c
with any c compiler (e.g., gcc -o ssrc.exe ssrc.c). To convert an IBM prepbufr file,
take the executable (e.g. ssrc.exe), and run it as follows,
ssrc.exe <name of Big Endian prepbufr file> name of Little Endian prepbufr file
3) Run in single processor mode (serial compilation required for WRF 4D-Var)
&wrfvar1
var4d=true,
var4d_lbc=true,
var4d_bin=3600,
……
/
……
&perturbation
trajectory_io=true,
enable_identity=false,
jcdfi_use=true,
jcdfi_diag=1,
jcdfi_penalty=1000.0,
/
> cd $WORK_DIR
> ./da_wrfvar.exe >&! wrfda.log
This section gives a brief description for various aspects related to radiance assimilation
in WRFDA. Each aspect is described mainly from the viewpoint of usage rather than
more technical and scientific details, which will appear in separated technical report and
scientific paper. Namelist parameters controlling different aspects of radiance assimila-
tion will be detailed in the following sections. It should be noted that this section does not
cover general aspects of the WRFDA assimilation. These can be found in other sections
of chapter 6 of this users guide or other WRFDA documentation.
In addition to the basic input files (LANDUSE.TBL, fg, ob.ascii, be.dat) mentioned
in “Running WRFDA” section, the following additional files are required for radiances:
radiance data in NCEP BUFR format, radiance_info files, VARBC.in, RTM (CRTM or
RTTOV) coefficient files.
Currently, the ingest interface for NCEP BUFR radiance data is implemented in
WRFDA. The radiance data are available through NCEP’s public ftp server
ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.${yyyymmddhh} in near real-
time (with 6-hour delay) and can meet requirements both for research purposes and some
real-time applications.
So far, WRFDA can read data from the NOAA ATOVS instruments (HIRS, AMSU-A,
AMSU-B and MHS), the EOS Aqua instruments (AIRS, AMSU-A) and DMSP instru-
ments (SSMIS). Note that NCEP radiance BUFR files are separated by instrument names
(i.e., each file for one type instrument), and each file contains global radiance (generally
converted to brightness temperature) within 6-hour assimilation window from multi-
platforms. For running WRFDA, users need to rename NCEP corresponding BUFR files
(table 1) to hirs3.bufr (including HIRS data from NOAA-15/16/17), hirs4.bufr (including
HIRS data from NOAA-18/19, METOP-2), amsua.bufr (including AMSU-A data from
NOAA-15/16/18/19, METOP-2), amsub.bufr (including AMSU-B data from NOAA-
15/16/17), mhs.bufr (including MHS data from NOAA-18/19 and METOP-2), airs.bufr
(including AIRS and AMSU-A data from EOS-AQUA) and ssmis.bufr (SSMIS data from
DMSP-16, AFWA provided) for WRFDA filename convention. Note that airs.bufr file
contains not only AIRS data but also AMSU-A, which is collocated with AIRS pixels (1
AMSU-A pixels collocated with 9 AIRS pixels). Users must place these files in the work-
ing directory where WRFDA executable is run. It should also be mentioned that WRFDA
reads these BUFR radiance files directly without use if any separate pre-processing pro-
gram is used. All processing of radiance data, such as quality control, thinning and bias
correction and so on, is carried out inside WRFDA. This is different from conventional
observation assimilation, which requires a pre-processing package (OBSPROC) to gener-
ate WRFDA readable ASCII files. For reading the radiance BUFR files, WRFDA must
be compiled with the NCEP BUFR library (see
http://www.nco.ncep.noaa.gov/sib/decoders/BUFRLIB/).
Namelist parameters are used to control the reading of corresponding BUFR files into
WRFDA. For instance, USE_AMSUAOBS, USE_AMSUBOBS, USE_HIRS3OBS,
USE_HIRS4OBS, USE_MHSOBS, USE_AIRSOBS, USE_EOS_AMSUAOBS and
USE_SSMISOBS control whether or not the respective file is read. These are logical
parameters that are assigned to .FALSE. by default; therefore they must be set to .TRUE.
to read the respective observation file. Also note that these parameters only control
whether the data is read, not whether the data included in the files is to be assimilated.
This is controlled by other namelist parameters explained in the next section.
The core component for direct radiance assimilation is to incorporate a radiative transfer
model (RTM, should be accurate enough yet fast) into the WRFDA system as one part of
observation operators. Two widely used RTMs in NWP community, RTTOV (developed
by EUMETSAT in Europe), and CRTM (developed by the Joint Center for Satellite Data
Assimilation (JCSDA) in US), are already implemented in WRFDA system with a flexi-
ble and consistent user interface. Selection a which RTM to use is controlled by a simple
namelist parameter RTM_OPTION (1 for RTTOV, the default, and 2 for CRTM).
WRFDA is designed to be able to compile with only one of two RTM libraries or without
RTM libraries (for those not interested in radiance assimilation) by the definition of envi-
ronment variables “CRTM” and “RTTOV” (see Installing WRFDA section).
Both RTMs can calculate radiances for almost all available instruments aboard various
satellite platforms in orbit. An important feature of WRFDA design is that all data struc-
tures related to radiance assimilation are dynamically allocated during running time ac-
cording to simple namelist setup. The instruments to be assimilated are controlled at run
time by four integer namelist parameters: RTMINIT_NSENSOR (the total number of sen-
sors to be assimilated), RTMINIT_PLATFORM (the platforms IDs array to be assimilated
with dimension RTMINIT_NSENSOR, e.g., 1 for NOAA, 9 for EOS, 10 for METOP and
2 for DMSP), RTMINIT_SATID (satellite IDs array) and RTMINIT_SENSOR (sensor
IDs array, e.g., 0 for HIRS, 3 for AMSU-A, 4 for AMSU-B, 15 for MHS, 10 for SSMIS,
11 for AIRS). For instance, the configuration for assimilating 12 sensors from 7 satellites
The instrument triplets (platform, satellite, and sensor ID) in the namelist can be ranked
in any order. More detail about the convention of instrument triplet can be found on the
web page
http://research.metoffice.gov.uk/research/interproj/nwpsaf/rtm/rttov_description.html
or the tables 2 and 3 in the RTTOV v10 Users Guide
(http://research.metoffice.gov.uk/research/interproj/nwpsaf/rtm/docs_rttov10/users_gui
de_10_v1.3.pdf )
CRTM uses a different instrument naming method. A convert routine inside WRFDA is
already created to make CRTM use the same instrument triplet as RTTOV such that the
user interface remains the same for RTTOV and CRTM.
The RTTOV package is not distributed with WRFDA due to licensing and supporting
issues. Users need to follow the instructions
on http://research.metoffice.gov.uk/research/interproj/nwpsaf/rtm to download the
RTTOV source code and supplement coefficient files and emissivity atlas dataset. Start-
ing from WRFDA V3.3, only RTTOV v10 can be used in WRFDA.
Starting from V3.2.1, the CRTM package is distributed with WRFDA, which is located
in WRFDA/var/external/crtm. The CRTM code in WRFDA is basically the same as the
source code that users can download from the the following link:
ftp://ftp.emc.ncep.noaa.gov/jcsda/CRTM.
d. Channel Selection
Channel selection in WRFDA is controlled by radiance ‘info’ files located in the sub-
directory ‘radiance_info’ under the working directory. These files are separated by satel-
lites and sensors, e.g., noaa-15-amsua.info, noaa-16-amsub.info, dmsp-16-ssmis.info and
so on. An example for 5 channels from noaa-15-amsub.info is shown below. The fourth
column is used by WRFDA to control when to use a corresponding channel. Channels
with the value “-1” indicate that the channel is “not assimilated” (channels 1, 2 and 4 in
this case), with the value “1” means “assimilated” (channels 3 and 5). The sixth column
is used by WRFDA to set the observation error for each channel. Other columns are not
used by WRFDA. It should be mentioned that these error values might not necessarily be
optimal for your applications; It is the user’s responsibility to obtain the optimal error sta-
tistics for your own applications.
e. Bias Correction
Satellite radiance is generally considered biased with respect to a reference (e.g., back-
ground or analysis field in NWP assimilation) due to system error of observation itself,
reference field, and RTM. Bias correction is a necessary step prior to assimilating ra-
diance data. There are two ways of performing bias correction in WRFDA. One is based
on the Harris and Kelly (2001) method and is carried out using a set of coefficient files
pre-calculated with an off-line statistics package, which will apply to a training dataset
for a month-long period. The other is Variational Bias Correction (VarBC). Only VarBC
is introduced here and recommended for users because of its relative simplicity in usage.
Coldstart
Coldstarting means starting the VarBC from scratch i.e. when you do not know the values
of the bias parameters.
The Coldstart is a routine in WRFDA. The bias predictor statistics (mean and standard
deviation) are computed automatically and will be used to normalize the bias parameters.
All coldstarted bias parameters are set to zero, except the first bias parameter (= simple
offset), which is set to the mode (=peak) of the distribution of the (uncorrected) innova-
tions for the given channel.
It is defined through an integer number in the VARBC.in file. This number is related to a
number of observations: the bigger the number, the more inertia constraint. If these num-
bers are set to zero, the predictors can evolve without any constraint.
Scaling factor
The VarBC uses a specific preconditioning, which can be scaled through a namelist op-
tion VARBC_FACTOR (default = 1.0).
MAX_VERT_VAR1=0.0
MAX_VERT_VAR2=0.0
MAX_VERT_VAR3=0.0
MAX_VERT_VAR4=0.0
MAX_VERT_VAR5=0.0
Freeze VarBC
In certain circumstances, you might want to keep the VarBC bias parameters constant in
time (="frozen"). In this case, the bias correction is read and applied to the innovations,
but it is not updated during the minimization. This can easily be achieved by setting the
namelist options:
USE_VARBC=false
FREEZE_VARBC=true
Passive observations
Some observations are useful for preprocessing (e.g. Quality Control, Cloud detection)
but you might not want to assimilate them. If you still need to estimate their bias correc-
tion, these observations need to go through the VarBC code in the minimization. For this
purpose, the VarBC uses a separate threshold on the QC values, called "qc_varbc_bad".
This threshold is currently set to the same value as "qc_bad", but can easily be changed to
any ad hoc value.
RAD_MONITORING (30)
Integer array of dimension RTMINIT_NSENSER, where 0 for assimilating mode,
1 for monitoring mode (only calculate innovation).
THINNING
Logical, TRUE will perform thinning on radiance data.
THINNING_MESH (30)
Real array with dimension RTMINIT_NSENSOR, values indicate thinning mesh
(in KM) for different sensors.
QC_RAD
Logical, control if perform quality control, always set to TRUE.
WRITE_IV_RAD_ASCII
Logical, control if output Observation minus Background files which are in AS-
CII format and separated by sensors and processors.
WRITE_OA_RAD_ASCII
Logical, control if output Observation minus Analysis files (including also O mi-
nus B) which are ASCII format and separated by sensors and processors.
USE_ERROR_FACTOR_RAD
Logical, controls use of a radiance error tuning factor file “radiance_error.factor”,
which is created with empirical values or generated using variational tunning me-
thod (Desroziers and Ivanov, 2001)
ONLY_SEA_RAD
Logical, controls whether only assimilating radiance over water.
TIME_WINDOW_MIN
String, e.g., "2007-08-15_03:00:00.0000", start time of assimilation time window
TIME_WINDOW_MAX
String, e.g., "2007-08-15_09:00:00.0000", end time of assimilation time window
USE_ANTCORR (30)
Logical array with dimension RTMINIT_NSENSER, control if performing An-
tenna Correction in CRTM.
AIRS_WARMEST_FOV
Logical, controls whether using the observation brightness temperature for AIRS
Window channel #914 as criterium for GSI thinning.
USE_CRTM_KMATRIX
Logical, controls whether using CRTM K matrix rather than calling CRTM TL
and AD routines for gradient calculation.
USE_RTTOV_KMATRIX
Logical, controls whether using RTTOV K matrix rather than calling RTTOV TL
and AD routines for gradient calculation.
RTTOV_EMIS_ATLAS_IR
integer, control the use of IR emissivity atlas.
Emissivity atlas data (should be downloaded separately from the RTTOV web
site) need to be copied or linked under the sub-directory emis_data in the working
directory if RTTOV_EMIS_ATLAS_IR is set to 1.
RTTOV_EMIS_ATLAS_MW
integer, control the use of MW emissivity atlas.
Emissivity atlas data (should be downloaded separately from the RTTOV web
site) need to be copied or linked under the sub-directory emis_data in the working
directory if RTTOV_EMIS_ATLAS_MW is set to 1 or 2.
0 means assimilating mode, innovations (O minus B) are calculated and data are
used in minimization.
1 means monitoring mode: innovations are calculated for diagnostics and moni-
toring. Data are not used in minimization.
Run WRFDA with the following namelist variables in record wrfvar14 in namel-
ist.input.
write_iv_rad_ascii=.true.
to write out (observation-background) and other diagnostics information in
plain-text files with prefix inv followed by instrument name and processor
id. For example, 01_inv_noaa-17-amsub.0000 (01 is outerloop index,
0000 is processor index)
write_oa_rad_ascii=.true.
to write out (observation-background), (observation-analysis) and other
diagnostics information in plain-text files with prefix oma followed by in-
strument name and processor id. For example, 01_oma_noaa-18-mhs.0001
Each processor writes out information of one instrument in one file in the
WRFDA working directory.
A Fortran90 program is used to collect the 01_inv* or 01_oma* files and write
out in netCDF format (one instrument in one file with prefix diags followed by in-
strument name, analysis date, and suffix .nc)) for easier data viewing, handling
and plotting with netCDF utilities and NCL scripts.
Step (3) and (4) can be done by running a single ksh script
(WRFDA/var/scripts/da_rad_diags.ksh) with proper settings. In addition to the
settings of directories and what instruments to plot, there are some useful plotting
options, explained below.
There are three input files: WRFDA analysis, wrfinput, and wrfbdy files from
WPS/real.exe, and a namelist file: param.in for running da_update_bc.exe for domain-
1. Before running NWP forecast using the WRF-model with WRFDA analysis, update
the values and tendencies for each predicted variable in the first time period in the lateral
For the nested domains, domain-2, domain-3…, the lateral boundaries are provided by
their parent domains, so no lateral boundary update is needed for these domains; but the
low boundaries in each of the nested domains’ WRFDA analysis files still need to be up-
dated. In these cases, you must set the namelist variable, domain_id > 1 (default is 1 for
domain-1), and no wrfbdy_d01file need to be provided to the namelist variable:
wrf_bdy_file.
Note: Make sure that you have da_update_bc.exe in WRFDA/var/build directory. This
executable should be created when you compiled WRFDA code,
> cd WRFDA/var/test/update_bc
> cp –p $DAT_DIR/rc/2008020512/wrfbdy_d01 ./wrfbdy_d01 (IMPORTANT:
make a copy of wrfbdy_d01 as the wrf_bdy_file will be overwritten
by da_update_bc.exe)
> vi parame.in
&control_param
wrfvar_output_file = './wrfvar_output'
wrf_bdy_file = './wrfbdy_d01'
wrf_input = '$DAT_DIR/rc/2008020512/wrfinput_d01'
At this stage, you should have the files wrfvar_output and wrfbdy_d01 in your
WRFDA working directory. They are the WRFDA updated initial condition and boun-
dary condition for any subsequent WRF model runs. To use, link a copy of
wrfvar_output and wrfbdy_d01 to wrfinput_d01 and wrfbdy_d01, respectively, in
your WRF working directory.
As of V3.2, some changes were made to da_update_bc to address some issues that are
related to sea-ice and snow change during cycling runs and radiance data assimilation.
The new settings in parame.in are introduced as follows. (However, for backward compa-
tibility, the pre-V3.2 parame.in mentioned above still works with V3.2+ da_update_bc)
&control_param
da_file = '../tutorial/wrfvar_output'
wrf_bdy_file = './wrfbdy_d01'
wrf_input = '$DAT_DIR/rc/2008020512/wrfinput_d01'
domain_id = 1
debug = .true.
update_lateral_bdy = .true.
update_low_bdy = .true.
update_lsm = .false.
iswater = 16
/
before running WRFDA, if in cycling mode (especially if you are doing radiance data
assimilation and there is SEA ICE and SNOW in your domain) to get low-bdy updated
first guess (da_file will be overwritten by da_update_bc).
Running gen_be
Starting with WRFDA version 3.1, users have three choices to define the background er-
ror covariance (BE). We call them CV3, cv5, and CV6 respectively. With CV3 and CV5,
the background errors are applied to the same set of the control variables, stream func-
tion, unbalanced potential velocity, unbalanced temperature, unbalanced surface pressure,
and pseudo relative humidity. However, for CV6 the moisture control variable is the un-
balanced part of pseudo relative humidity. With CV3, the control variables are in physi-
cal space while with CV5 and CV6 the control variables are in eigenvector space. So, the
major differences between these two kinds of BE is the vertical covariance. CV3 uses the
vertical recursive filter to model the vertical covariance but CV5 and CV6 use empirical
orthogonal function (EOF) to represent the vertical covariance. The recursive filters to
model the horizontal covariance are also different with these BEs. We have not con-
ducted the systematic comparison of the analyses based on these BEs. However, CV3 (a
BE file provided with our WRFDA system) is a global BE and can be used for any re-
gional domains while CV5 and CV6 BE’s are domain-dependent, which should be gener-
ated based in the forecasts data from the same domain. At this time, it is hard to tell
which BE is better; the impact on analysis may vary case by case.
CV3 is the NCEP background error covariance, it is estimated in grid space by what has
become known as the NMC method (Parrish and Derber 1992) . The statistics are esti-
mated with the differences of 24 and 48-hour GFS forecasts with T170 resolution valid at
the same time for 357 cases distributed over a period of one year. Both the amplitudes
and the scales of the background error have to be tuned to represent the forecast error in
the guess fields. The statistics that project multivariate relations among variables are also
derived from the NMC method.
The variance of each variable and the variance of its second derivative are used to esti-
mate its horizontal scales. For example, the horizontal scales of the stream function can
be estimated from the variance of the vorticity and stream function.
The vertical scales are estimated with the vertical correlation of each variable. A table is
built to cover the range of vertical scales for the variables. The table is then used to find
the scales in vertical grid units. The filter profile and the vertical correlation are fitted lo-
cally. The scale of the best fit from the table is assigned as the scale of the variable at that
vertical level for each latitude. Note that the vertical scales are locally defined so that the
negative correlation further away in the vertical direction is not included.
Theoretically, CV3 BE is a generic background error statistics file which, can be used for
any case. It is quite straightforward to use CV3 in your own case. To use the CV3 BE file
in your case, set cv_options=3 in $wrfvar7 and the be.dat is located in
WRFDA/var/run/be.dat.cv3.
To use CV5 or CV6 background error covariance, it is necessary to generate your do-
main-specific background error statistics with the gen_be utility. The background error
statistics file supplied with the tutorial test case can NOT be used for your applications.
The Fortran main programs for gen_be can be found in WRFDA/var/gen_be. The execu-
tables of gen_be should be created after you have compiled the WRFDA code (as de-
scribed earlier). The scripts to run these codes are in WRFDA/var/scripts/gen_be.
The input data for gen_be are WRF forecasts, which are used to generate model perturba-
tions, used as a proxy for estimates of forecast error. For the NMC-method, the model
perturbations are differences between forecasts (e.g. T+24 minus T+12 is typical for re-
gional applications, T+48 minus T+24 for global) valid at the same time. Climatological
estimates of background error may then be obtained by averaging such forecast differ-
ences over a period of time (e.g. one month). Given input from an ensemble prediction
system (EPS), the inputs are the ensemble forecasts, and the model perturbations created
are the transformed ensemble perturbations. The gen_be code has been designed to work
with either forecast difference, or ensemble-based perturbations. The former is illustrated
in this tutorial example.
It is important to include forecast differences from at least 00Z and 12Z through the pe-
riod, to remove the diurnal cycle (i.e. do not run gen_be using just 00Z or 12Z model per-
turbations alone).
The inputs to gen_be are netCDF WRF forecast output ("wrfout") files at specified fore-
cast ranges. To avoid unnecessary large single data files, it is assumed that all forecast
ranges are output to separate files. For example, if we wish to calculate BE statistics us-
ing the NMC-method with (T+24)-(T+12) forecast differences (default for regional) then
by setting the WRF namelist.input options history_interval=720, and
frames_per_outfile=1 we get the necessary output datasets. Then the forecast output
files should be arranged as follows: directory name is the forecast initial time, time info
in the file name is the forecast valid time. 2008020512/wrfout_d01_2008-02-
06_00:00:00 means a 12-hour forecast valid at 2008020600 initialized at 2008020512.
Example dataset for a test case (90 x 60 x 41 gridpoints) can be downloaded from
http://www.mmm.ucar.edu/wrf/users/wrfda/download/testdata.html, untar the
gen_be_forecasts_20080205.tar.gz, you will have:
>ls $FC_DIR
-rw-r--r-- 1 users 11556492 2008020512/wrfout_d01_2008-02-06_00:00:00
-rw-r--r-- 1 users 11556492 2008020512/wrfout_d01_2008-02-06_12:00:00
-rw-r--r-- 1 users 11556492 2008020600/wrfout_d01_2008-02-06_12:00:00
-rw-r--r-- 1 users 11556492 2008020600/wrfout_d01_2008-02-07_00:00:00
-rw-r--r-- 1 users 11556492 2008020612/wrfout_d01_2008-02-07_00:00:00
-rw-r--r-- 1 users 11556492 2008020612/wrfout_d01_2008-02-07_12:00:00
In the above example, only 1 day (12Z 05 Feb to 12Z 06 Feb. 2002) of forecasts, every
12 hours are supplied to gen_be_wrapper to estimate forecast error covariance. It is only
for demonstration. The minimum number of forecasts required depends on the applica-
tion, number of grid points, etc. Month-long (or longer) datasets are typical for the
NMC-method. Generally, at least a 1-month dataset should be used.
Note: The START_DATE and END_DATE are perturbation valid dates. As show in the
forecast list above, when you have 24-hour and 12-hour forecasts initialized at
2008020512 through 2008020612, the first and final forecast difference valid dates are
2008020612 and 2008020700 respectively.
> gen_be_wrapper.ksh
Once gen_be_wrapper.ksh run is completed, the be.dat can be found under $RUN_DIR
directory.
To get a clear idea about what are included in be.dat, the script
gen_be_plot_wrapper.ksh may be used to plot various data in be.dat, for example:
With the single observation test, you may get some ideas of how the background and ob-
servation error statistics work in the model variable space. Single observation test is done
in WRFDA by setting num_pseudo=1 along with other pre-specified values in record
&wrfvar15 and &wrfvar19 of namelist.input,
With the settings shown below, WRFDA generates a single observation with pre-
specified innovation (Observation – First Guess) value at desired location e.g. at (in terms
of grid coordinate) 23x23, level 14 for “U” observation with error characteristics 1 m/s,
innovation size = 1.0 m/s.
&wrfvar15
num_pseudo = 1,
pseudo_x = 23.0,
pseudo_y = 23.0,
pseudo_z = 14.0,
pseudo_err = 1.0,
pseudo_val = 1.0,
/
&wrfvar19
pseudo_var = “u”, (Note: pseudo_var can be u, v, t, p, q.
If pseudo_var is q, then the reasonable values of pseudo_err and
pseudo_val are 0.001)
/
Note: You may wish to repeat this exercise for other observations like temperature (“t”),
pressure “p”, specific humidity “q” and so on.
Run single observation test with following additional parameters in record &wrfvar7 of
namelist.input
&wrfvar7
len_scaling1 = 0.5, # reduce psi length scale by 50%
len_scaling2 = 0.5, # reduce chi_u length scale by 50%
len_scaling3 = 0.5, # reduce T length scale by 50%
len_scaling4 = 0.5, # reduce q length scale by 50%
len_scaling5 = 0.5, # reduce Ps length scale by 50%
/
Note: You may wish to try the response of an individual variable by setting one parame-
ter at a time. See the spread of analysis increment.
Run the single observation test with following additional parameters in record &wrfvar7
of namelist.input
&wrfvar7
var_scaling1 = 0.25, # reduce psi variance by 75%
var_scaling2 = 0.25, # reduce chi_u variance by 75%
var_scaling3 = 0.25, # reduce T variance by 75%
var_scaling4 = 0.25, # reduce q variance by 75%
var_scaling5 = 0.25, # reduce Ps variance by 75%
/
Note: You may wish to try the response of individual variable by setting one parameter at
one time. See the magnitude of analysis increments.
&wrfvar6
eps = 0.0001,
/
You may wish to compare various diagnostics with the earlier run.
&wrfvar6
max_ext_its = 2,
/
With this setting “outer loop” for the minimization procedure will be activated. You may
wish to compare various diagnostics with earlier run.
The types of observations that WRFDA gets to use actually depend on what is included
in the observation file and the WRFDA namelist settings. For example, if you have
SYNOP data in the observation file, you can suppress its usage in WRFDA by setting
use_synopobs=false in record &wrfvar4 of namelist.input. It is OK if there is no
SYNOP data in the observation file and use_synopobs=true.
Turning on and off certain types of observations is widely used for assessing the impact
of observations on data assimilations.
A new control variable option to implement multivariate background error (MBE) statis-
tics in WRFDA has been introduced. It may be activated by setting the “namelist” varia-
ble “cv_options=6”. This option introduces six additional correlation coefficients in the
definition of balanced part of analysis control variables. Thus with this implementation,
moisture analysis is multivariate in the sense that temperature and wind may lead to
moisture increments and vise-versa. The “gen_be” utility has also been updated to com-
pute the desired MBE statistics required for this option. The updates include basic
“source code”, “scripts” and “graphics” to display some important diagnostics about
MBE statistics. Further details may be seen at:
https://wiki.ucar.edu/download/attachments/60622477/WRFDA__update_for_cv6.pdf
After successfully generating multivariate background error statistics file “be.dat” the
procedure for running WRFDA is straight. If WRFDA is run through “wrapper”
script, declare suitably the namelist variable “NL_CV_OPTIONS=6” in the “wrap-
per” script. If WRFDA is run directly (by executing “da_wrfvar.exe”) then, in-
clude “cv_options=6” in “namelist.input” file under “wrfvar7” list of namelist
options.
Following is the list of nine tuning parameters available in WRFDA. Default values for
these variables are set as “1.0”. By setting corresponding values > 1.0 (< 1.0) will in-
crease (decrease) the corresponding contributions as described in the following Table.
WRFDA Diagnostics
WRFDA produces a number of diagnostic files that contain useful information on how
the data assimilation has performed. This section will introduce you to some of these
files, and what to look for.
Having run WRFDA, it is important to check a number of output files to see if the assimi-
lation appears sensible. The WRFDA package, which includes lots of useful scripts may
be downloaded from http://www.mmm.ucar.edu/wrf/users/wrfda/download/tools.html
cost_fn and grad_fn: These files hold (in ASCII format) WRFDA cost and gradient
function values, respectively, for the first and last iterations. However, if you run with
PRINT_DETAIL_GRAD=true, these values will be listed for each iteration; this can be help-
ful for visualization purposes. The NCL script
WRFDA/var/graphics/ncl/plot_cost_grad_fn.ncl may be used to plot the content of
cost_fn and grad_fn, if these files are generated with PRINT_DETAIL_GRAD=true.
Note: Make sure that you removed first two lines (header) in cost_fn and grad_fn be-
fore you plot. Also, you need to specify the directory name for these two files.
namelist.input: This is the WRFDA input namelist file, which contains all the user
defined non-default options. Any namelist defined options that do not appear in this file,
should have their names checked against values in WRFDA/Registry/Registry.wrfvar.
rsl*: Files containing information of standard WRFDA output from individual proces-
sors when multiple processors are used. It contains host of information on number of ob-
servations, minimization, timings etc. Additional diagnostics may be printed in these files
by including various “print” WRFDA namelist options. To learn more about these addi-
tional “print” options, search “print_” string in WRFDA/Registry/Registry.wrfvar.
statistics: Text file containing OMB (OI), OMA (OA) statistics (minimum, maxi-
mum, mean and standard deviation) for each observation type and variable. This informa-
tion is very useful in diagnosing how WRFDA has used different components of the ob-
serving system. Also contained are the analysis minus background (A-B) statistics i.e.
statistics of the analysis increments for each model variable at each model level. This in-
formation is very useful in checking the range of analysis increment values found in the
analysis, and where they are in the WRF-model grid space.
The WRFDA analysis file is wrfvar_output. It is in WRF (NetCDF) format. It will be-
come the input file “wrfinput_d01” of any subsequent WRF runs after lateral boundary
and/or low boundary conditions are updated by another WRFDA utility (See section
“Updating WRF boundary conditions”).
As an example, if you are aiming to display U-component of the analysis at level 18, ex-
ecute the following command after modifying the script
“WRFDA/var/graphcs/ncl/WRF-Var_plot.ncl”, and make sure the following pieces of
codes are uncommented:
var = "U"
fg = first_guess->U
an = analysis->U
plot_data = an
You may change the variable name, level etc in this script to display the variable of your
choice at the desired eta level.
Take time to look through the text output files to ensure you understand how WRFDA
works. For example:
How closely has WRFDA fitted individual observation types? Look at the statistics
file to compare the O-B and O-A statistics.
How big are the analysis increments? Again, look in the statistics file to see mini-
mum/maximum values of A-B for each variable at various levels. It will give you a feel
for the impact of input observation data you assimilated via WRFDA by modifying the
input analysis first guess.
How long did WRFDA take to converge? Does it really converge? You will get the an-
swers of all these questions by looking into rsl-files, as it indicates the number of itera-
tions taken by WRFDA to converge. If this is the same as the maximum number of itera-
tions specified in the namelist (NTMAX) or its default value (=200) set in
WRFDA/Registry/Registry.wrfvar, then it means that the analysis solution did not
converge. If so, you may need to increase the value of “NTMAX” and rerun your case to
ensure that the convergence is achieved. On the other hand, a normal WRFDA run should
usually converge within 100 iterations. If it still doesn’t converge in 200 iterations, that
means there might be some problem in the observations or first guess.
A good visual way of seeing the impact of assimilation of observations is to plot the
analysis increments (i.e. analysis minus first guess difference). Many different graphics
packages (e.g. RIP4, NCL, GRADS etc) can do this. The plot of level 18 theta increments
below was produced using the particular NCL script. This script is located at
WRFDA/var/graphics/ncl/WRF-Var_plot.ncl.
You need to modify this script to fix the full path for first_guess & analysis files.
You may also use it to modify the display level by setting “kl” and the name of the vari-
able to display by setting “var”. Further details are given in this script.
If you are aiming to display the increment of potential temperature at level 18, after mod-
ifying WRFDA/var/graphcs/ncl/WRF-Var_plot.ncl, make sure following pieces of
codes are uncommented:
var = "T"
fg = first_guess->T ;Theta- 300
an = analysis->T ;Theta- 300
plot_data = an - fg
Note: Larger analysis increments indicate a larger data impact in the corresponding re-
gion of the domain.
The WRFDA system also includes a hybrid data assimilation technique, which is based
on the existing 3DVAR. The difference between hybrid and 3DVAR schemes is that
3DVAR relies solely on a static covariance model to specify the background errors, while
the hybrid system uses a combination of 3DVAR static error covariances and ensemble-
estimated error covariances to incorporate a flow-dependent estimate of the background
error statistics. Please refer to Wang et al. (2008a,b) for a detailed description of the me-
thodology used in the WRF hybrid system. The following section will give a brief intro-
duction of some aspects of using the hybrid system.
a. Source Code
Three executables are used in the hybrid system. If you have successfully compiled the
WRFDA system, you will see the following:
WRFDA/var/build/gen_be_ensmean.exe
WRFDA/var/build/gen_be_ep2.exe
WRFDA/var/build/da_wrfvar.exe
The procedure is the same as running 3DVAR/4DVAR with the exception of some extra
input files and namelist settings. The basic input files for WRFDA are LANDUSE.TBL,
ob.ascii or ob.bufr (depending on which observation format you use), and be.dat (static
background errors). Additional input files required by the hybrid are a single ensemble
mean file (used as the fg for the hybrid application) and a set of ensemble perturbation
files (used to represent flow-dependent background errors).
A set of initial ensemble members must be prepared before the hybrid application can be
started. These ensembles can be obtained from other ensemble model outputs or you can
generate them yourself, for example, adding random noise to the initial conditions at a
previous time and integrating each member to the desired time. Once you have the initial
ensembles, the ensemble mean and perturbations can be calculated following the steps
below.
Copy or link the ensemble forecasts to your working directory. In this example, the time
is 2006102712.
Next, copy the directory that contains two template files (ensemble mean and variance
files) to your working directory. In this case, the directory name is 2006102712, which
contains the template ensemble mean file (wrfout_d01_2006-10-28_00:00:00) and the
template variance file (wrfout_d01_2006-10-28_00:00:00.vari). These template files will
be overwritten by the program that calculates the ensemble mean and variance as dis-
cussed below.
< cp -r /wrfhelp/DATA/VAR/Hybrid/fc/2006102712 .
< vi gen_be_ensmean_nl.nl
&gen_be_ensmean_nl
directory = './2006102712'
filename = 'wrfout_d01_2006-10-28_00:00:00'
num_members = 10
nv = 7
cv = 'U', 'V', 'W', 'PH', 'T', 'MU', 'QVAPOR'
/
Here,
“directory” is the folder you just copied,
“filename” is the name of the ensemble mean file,
“num_members” is the number of ensemble members you are using,
“nv” is the number of variables, which must be consistent with the next “cv” option, and
“cv” is the name of variables used in the hybrid system.
Create another sub-directory in which you will be working to create ensemble perturba-
tions.
A list of binary files will be created under the 2006102800/ep directory. Among them,
tmp.e* are temporary scratch files that can be removed.
In your hybrid working directory, link all the necessary files and directories as follows:
Edit namelist.input and pay special attention to the following hybrid-related settings:
&wrfvar7
je_factor = 2.0
/
&wrfvar16
ensdim_alpha = 10
alphacv_method = 2
alpha_corr_type=3
alpha_corr_scale = 1500.0
alpha_std_dev=1.000
/
Next, run hybrid in serial mode (recommended for initial testing of the hybrid system), or
in parallel mode
The output file lists are the same as when you run WRF 3D-Var.
1) je_factor : ensemble covariance weighting factor. This factor controls the weighting
component of ensemble and static covariances. The corresponding jb_factor =
je_factor/(je_factor - 1).
2) ensdim_alpha: the number of ensemble members. Hybrid mode is activated when ens-
dim_alpha is larger than zero.
3) alphacv_method: 1=perturbations in control variable space
(“psi”,”chi_u”,”t_u”,”rh”,”ps_u”); 2=perturbations in model space (“u”,”v”,”t”,”q”,”ps”).
Option 2 is extensively tested and recommended to use.
4) alpha_corr_type: correlation function. 1=Exponential; 2=SOAR; 3=Gaussian.
5) alpha_corr_scale: hybrid covariance localization scale in km unit. Default value is
1500.
6) alpha_std_dev: alpha standard deviation. Default value is 1.0
num_fgat_time 1 1: 3DVar
> 1: number of time slots for FGAT and 4DVAR
&wrfvar4
thin_conv true for ob_format=1 (NCEP PREPBUFR) only. thining
is mandatory for ob_format=1 as time-duplicate data
are "thinned" within thinning routine, however,
thin_conv can be set to .false. for debugging pur-
pose.
thin_mesh_conv 20. for ob_format=1 (NCEP PREPBUFR) only.
(max_instrumenkm, each observation type can set its thinning mesh
ts) and the index/order follows the definition in
WRFDA/var/da/da_control/da_control.f90
use_synopobs true use_xxxobs - .true.: assimilate xxx obs if available
use_shipsobs true .false.: not assimilate xxx obs even available
use_metarobs true
use_soundobs true
use_pilotobs true
use_airepobs true
use_geoamvobs true
use_polaramvobs true
use_bogusobs true
use_buoyobs true
use_profilerobs true
use_satemobs true
use_gpspwobs true
use_gpsrefobs true
use_qscatobs true
use_radarobs false
use_radar_rv false
use_radar_rf false
use_airsretobs true
; use_hirs2obs, use_hirs3obs, use_hirs4obs, use_mhsobs
; use_msuobs, use_amsuaobs, use_amsubobs, use_airsobs,
; use_eos_amsuaobs, use_hsbobs, use_ssmisobs are
; radiance-related variables that only control if reading
; in corresponding BUFR files into WRFDA or not, but
; do not control if assimilate the data or not.
; Some more variables have to be set in &wrfvar14 in order
; to assimilate radiance data.
use_hirs2obs fasle .true.: to read in data from hirs2.bufr
use_hirs3obs false .true.: to read in data from hirs3.bufr
use_hirs4obs false .true.: to read in data from hirs4.bufr
use_mhsobs false .true.: to read in data from mhs.bufr
use_msuobs false .true.: to read in data from msu.bufr
use_amsuaobs false .true.: to read in data from amsua.bufr
use_amsubobs false .true.: to read in data from amsub.bufr
q.
2 --> supersaturation (rh> 95%) and minimum rh
(rh<11%) check and make the multi-level q adjust-
ment under the constraint of conserved column inte-
grated water vapor
sfc_assi_options 1 1 --> surface observations will be assimilated
based on the lowest model level first guess. Obser-
vations are not used when the height difference of
the elevation of the observing
site and the lowest model level height is larger than
100m.
2 --> surface observations will be assimilated
based on surface similarity theory in PBL. Innova-
tions are computed based on 10-m wind, 2-m tem-
perature and 2-m moisture.
calculate_cg_cost_fn false conjugate gradient algorithm does not require the
computation of cost function at every iteration dur-
ing minimization.
.true.: Compute and write out cost function and gra-
dient of each iteration into files called cost_fn and
grad_fn.
false.: Only the initial and final cost functions are
computed and output.
lat_stats_option false do not change
&wrfvar12
balance_type 1 obsolete
&wrfvar13
vert_corr 2 do not change
vertical_ip 0 obsolete
vert_evalue 1 do not change
max_vert_var1 99.0 specify the maximum truncation value (in percen-
tage) to explain the variance of stream function in
eigenvector decomposition
max_vert_var2 99.0 specify the maximum truncation value (in percen-
tage) to explain the variance of unbalanced poten-
tial velocity in eigenvector decomposition
max_vert_var3 99.0 specify the maximum truncation value (in percen-
tage) to explain the variance of the unbalanced tem-
perature in eigenvector decomposition
max_vert_var4 99.0 specify the maximum truncation value (percentage)
to explain the variance of pseudo relative humidity
in eigenvector decomposition
max_vert_var5 99.0 for unbalanced surface pressure, it should be a non-
zero positive numer.
set max_vert_var5=0.0 only for offline VarBC ap-
plications.
&wrfvar14
the following 4 variables (rtminit_nsensor, rtminit_platform, rtminit_satid, rtminit_sensor) to-
gether control what sensors to be assimilated.
rtminit_nsensor 1 total number of sensors to be assimilated
rtminit_platform -1 platforms IDs array (used dimension: rtmi-
(max_instruments) nit_nsensor); e.g., 1 for NOAA, 9 for EOS, 10
for METOP and 2 for DMSP
rtminit_satid -1.0 satellite IDs array (used dimension: rtmi-
(max_instruments) nit_nsensor)
rtminit_sensor -1.0 sensor IDs array (used dimension: rtmi-
(max_instruments) nit_nsensor); e.g., 0 for HIRS, 3 for AMSU-A, 4
for AMSU-B, 15 for MHS, 10 for SSMIS, 11
for AIRS
rad_monitoring 0 integer array (used dimension: rtminit_nsensor);
(max_instruments) 0: assimilating mode;
1: monitoring mode (only calculate innovations)
thinning_mesh 60.0 real array (used dimension: rtminit_nsensor);
(max_instruments) specify thinning mesh size (in KM) for different
sensors.
thinning false .true.: perform thinning on radiance data
qc_rad true .true.: perform quality control. always .true.
write_iv_rad_ascii false .true.: output radiance Observation minus Back-
ground files, which are in ASCII format and se-
pseudo_err 1.0 set the error of the pseudo ob. Unit the same as
pseudo_val.; if pseudo_var="q", pseudo_err=0.001
is more reasonable.
&wrfvar16 (for hybrid WRFDA/ensemble)
alphacv_method 2 1: ensemble perturbations in control variable space
2: ensemble perturbations in model variable space
ensdim_alpha 0 ensemble size
alpha_corr_type 3 1: alpha_corr_type_exp
2: alpha_corr_type_soar
3: alpha_corr_type_gaussian (default)
alpha_corr_scale 1500.0 km
&wrfvar17
analysis_type “3D-VAR” "3D-VAR": 3D-VAR mode (default);
"QC-OBS": 3D-VAR mode plus extra filtered_obs
output;
"VERIFY": verification mode. WRFDA resets
check_max_iv=.false. and ntmax=0; "RAN-
DOMCV": for creating ensemble perturbations
&wrfvar18 (needs to set &wrfvar21 and &wrfvar22 as well if ob_format=1 and/or ra-
diances are used)
analysis_date “2002-08- specify the analysis time. It should be consistent
03_00:00:00.00 with the first guess time. However, if time differ-
00” ence between analysis_date and date info read in
from first guess is larger than analysis_accu,
WRFDA will issue a warning message ("=======>
Wrong xb time found???"), but won't abort.
&wrfvar19 (needs to be set together with &wrfvar15)
pseudo_var “t” Set the name of the OBS variable:
'u' = X-direction component of wind,
'v' = Y-direction component of wind,
't' = Temperature,
'p' = Prerssure,
'q' = Specific humidity
"pw": total precipitable water
"ref": refractivity
"ztd": zenith total delay
&wrfvar20
documentation_url “http://www.m
mm.ucar.edu/pe
ople/wrfhelp/wr
fvar/code/trunk”
&wrfvar21
time_window_min "2002-08- start time of assimilation time window used for
02_21:00:00.00 ob_format=1 and radiances to select observations
00" inside the defined time_window. Note: Start from
V3.1, this variable is also used for ob_format=2 to
double-check if the obs are within the specified time
window.
&wrfvar22
time_window_max "2002-08- end time of assimilation time window used for
03_03:00:00.00 ob_format=1 and radiances to select observations
00" inside the defined time_window. Note: Start from
V3.1, this variable is also used for ob_format=2 to
double-check if the obs are within the specified time
window.
&perturbation (settings related to the 4D-Var)
jcdfi_use false .true.: Include JcDF term in cost function.
.False.: Ignore JcDF term in cost function.
jcdfi_diag 1 0: Doesn't print out the value of Jc.
1:Print out the value of Jc.
jcdfi_penalty 10 The weight to Jc term.
enable_identity .false. .true.: use identity adjoint and tangent linear model
in 4D-Var.
.false.: use full adjoint and tangent linear model in
4D-Var.
trajectory_io .true. .true.: use memory I/O in 4D-Var for data exchange
.false.: use disk I/O in 4D-Var for data exchange
NESTI The I location in its mother domain of the nest domain's low left
corner -- point (1,1)
NESTI The J location in its mother domain of the nest domain's low left
corner -- point (1,1). For WRF application, NUMC(1), NESTI(1),
and NESTJ(1) are always set to be 1.
&record9
prep- Name of the prebufr OBS file.
bufr_output_filename
prep- 'prepbufr_table_filename' ; not change
bufr_table_filename
output_ob_format output 1, prebufr OBS file only;
2, ASCII OBS file only;
3, Both prebufr and ASCII OBS files.
use_for '3DVAR' obs file, same as before, default
'FGAT ' obs files for FGAT
'4DVAR' obs files for 4DVAR
num_slots_past the number of time slots before time_analysis
num_slots_ahead the number of time slots after time_analysis
write_synop If keep synop obs in obs_gts (ASCII) files.
write_ship If keep ship obs in obs_gts (ASCII) files.
write_metar If keep metar obs in obs_gts (ASCII) files.
write_buoy If keep buoy obs in obs_gts (ASCII) files.
write_pilot If keep pilot obs in obs_gts (ASCII) files.
write_sound If keep sound obs in obs_gts (ASCII) files.
write_amdar If keep amdar obs in obs_gts (ASCII) files.
write_satem If keep satem obs in obs_gts (ASCII) files.
write_satob If keep satob obs in obs_gts (ASCII) files.
write_airep If keep airep obs in obs_gts (ASCII) files.
write_gpspw If keep gpspw obs in obs_gts (ASCII) files.
write_gpsztd If keep gpsztd obs in obs_gts (ASCII) files.
write_gpsref If keep gpsref obs in obs_gts (ASCII) files.
write_gpseph If keep gpseph obs in obs_gts (ASCII) files.
write_ssmt1 If keep ssmt1 obs in obs_gts (ASCII) files.
write_ssmt2 If keep ssmt2 obs in obs_gts (ASCII) files.
write_ssmi If keep ssmi obs in obs_gts (ASCII) files.
write_tovs If keep tovs obs in obs_gts (ASCII) files.
write_qscat If keep qscat obs in obs_gts (ASCII) files.
write_profl If keep profile obs in obs_gts (ASCII) files.
write_bogus If keep bogus obs in obs_gts (ASCII) files.
write_airs If keep airs obs in obs_gts (ASCII) files.
Table of Contents
• Introduction
• Program Flow
• Source of Observations
• Objective Analysis techniques in OBSGRID
• Quality Control for Observations
• Additional Observations
• Surface FDDA option
• Objective Analysis on Model Nests
• How to run OBSGRID
• Output Files
• Plot Utilities
• Observations Format
• OBSGRID Namelist
Introduction
This chapter discusses the objective analysis program, OBSGRID. Discussion of variational
techniques (WRFDA) can be found in Chapter 6 of this User’s Guide.
The analyses input to OBSGRID as the first guess are analyses output from the METGRID part
of the WPS package (see Chapter 3 of this User’s Guide for details regarding the WPS
package).
Program Flow
OBSGRID is run directly after metgrid.exe, and uses the met_em* output files from
metgrid.exe as input. OBSGRID also requires additional observations (A) as input. The
format of these observational files is described in the Observations Format section of this
chapter.
• Provide fields for Initial and Boundary conditions (1). Note that the files metoa_em* are
formatted identical to the met_em* files from metgrid.exe. The only difference is that the
fields in these files now incorporate observational information.
• Provide surface fields for surface-analysis-nudging FDDA (2). Note, when using the
wrfsfdda file as input to WRF, it is also recommended to use the 3-D fdda file (wrffdda
(5) – which is an optional output created when running real.exe) as input to WRF.
• Provide data for observational nudging (3). Note: since version 3.1.1 of OBSGRID this
file can be read directly by the observational nudging code and no longer needs to pass
through an additional perl script.
• Provide ASCII output (4). These files provide information regarding the observations
used and the quality control flags assigned. The information in these files can also be
plotted with the provided plotting utilities.
Source of Observations
OBSGRID reads observations provided by the user in formatted ASCII text files. This allows
users to adapt their own data to use as input to the OBSGRID program. This format (wrf_obs /
little_r format) is the same format used in the MM5 objective analysis program LITTLE_R
(hence the name).
Programs are available to convert NMC ON29 formatted files (see below) into the wrf_obs /
little_r format. Users are responsible for converting other observations they may want to provide
to OBSGRID into this format. A user-contributed (i.e., unsupported) program is available in the
utils/ directory for converting observations files from the GTS to wrf_obs / little_r format.
NCEP operational global surface and upper-air observations subsets as archived by the Data
Support Section (DSS) at NCAR.
NMC Office Note 29 can be found in many places on the World Wide Web, including:
http://www.emc.ncep.noaa.gov/mmb/data_processing/on29.htm
Cressman Scheme
Three of the four objective analysis techniques used in OBSGRID are based on the Cressman
scheme; in which several successive scans nudge a first-guess field toward the neighboring
observed values.
The standard Cressman scheme assigns to each observation a circular radius of influence R. The
first-guess field at each grid point P is adjusted by taking into account all the observations that
influence P.
The differences between the first-guess field and the observations are calculated, and a distance-
weighted average of these difference values is added to the value of the first-guess at P. Once all
grid points have been adjusted, the adjusted field is used as the first guess for another adjustment
cycle. Subsequent passes each use a smaller radius of influence.
Ellipse Scheme
In analyses of wind and relative humidity (fields strongly deformed by the wind) at pressure
levels, the circles from the standard Cressman scheme are elongated into ellipses oriented along
the flow. The stronger the wind, the greater the eccentricity of the ellipses. This scheme reduces
to the circular Cressman scheme under low-wind conditions.
Banana Scheme
In analyses of wind and relative humidity at pressure levels, the circles from the standard
Cressman scheme are elongated in the direction of the flow and curved along the streamlines.
The result is a banana shape. This scheme reduces to the Ellipse scheme under straight-flow
conditions, and the standard Cressman scheme under low-wind conditions.
Multiquadric scheme
The Multiquadric scheme uses hyperboloid radial basis functions to perform the objective
analysis. Details of the multiquadric technique may be found in Nuss and Titley, 1994: "Use of
multiquadric interpolation for meteorological objective analysis." Mon . Wea . Rev ., 122, 1611-
1631. Use this scheme with caution, as it can produce some odd results in areas where only a few
observations are available.
A critical component of OBSGRID is the screening for bad observations. Many of these QC
checks are optional in OBSGRID.
• Gross Error Checks (sane values, pressure decreases with height, etc.)
• Remove spikes from temperature and wind profiles.
• Adjust temperature profiles to remove superadiabatic layers.
• No comparisons to other reports or to the first-guess field.
• Limited user control over data removal. The user may set thresholds, which vary the
tolerance of the error check.
• Limited user control over data removal. The user may set weighting factors, which vary
the tolerance of the error check.
• Observations are compared to both the first guess and neighboring observations.
• If the difference value of an observation (obs - first-guess) varies significantly from the
distance-weighted average of the difference values of neighboring observations, the
observation is discarded.
• Works well in regions with good data density.
Additional Observations
In OBSGRID, additional observations are provided to the program the same way (in the same
wrf_obs / little_r format) as standard observations. Additional observations must be in the same
file as the rest of the observations. Existing (erroneous) observations can be modified easily, as
the observations input format is ASCII text. Identifying an observation report as "bogus" simply
means that it is assumed to be good data -- no quality control is performed for that report.
The surface FDDA option creates additional analysis files for the surface only, usually with a
smaller time interval between analyses (i.e., more frequently) than the full upper-air analyses.
The purpose of these surface analysis files is for later use in WRF with the surface analysis
nudging option.
The LAGTEM option controls how the first-guess field is created for surface analysis files.
Typically, the surface and upper-air first-guess (analysis times) is available at twelve-hour or six-
hour intervals, while the surface analysis interval may be 3 hours (10800 seconds). So at analysis
times, the available surface first-guess is used. If LAGTEM is set to .FALSE., the surface first-
guess at other times will be temporally interpolated from the first-guess at the analysis times. If
LAGTEM is set to .TRUE., the surface first guess at other times is the objective analysis from
the previous time.
OBSGRID have the capability to perform the objective analysis on a nest. This is done manually
with a separate OBSGRID process, performed on met_em_d0x files for the particular nest.
Often, however, such a step is unnecessary; it complicates matters for the user and may introduce
errors into the forecast. At other times, extra information available to the user, or extra detail that
objective analysis may provide on a nest, makes objective analysis on a nest a good option.
The main reason to do objective analysis on a nest is if you have observations available with
horizontal resolution somewhat greater than the resolution of your coarse domain. There may
also be circumstances in which the representation of terrain on a nest allows for better use of
surface observations (i.e., the model terrain better matches the real terrain elevation of the
observation).
The main problem introduced by doing objective analysis on a nest is inconsistency in initial
conditions between the coarse domain and the nest. Observations that fall just outside a nest will
be used in the analysis of the coarse domain, but discarded in the analysis of the nest. With
different observations used right at a nest boundary, one can get very different analyses.
cd OBSGRID
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/ ).
To configure, type:
./configure
./compile
A program is available for users with access to NCAR's computers to download archived
observations and reformat them into the wrf_obs/little_r format.
A program is also available for reformatting observations from the GTS stream (unsupported).
The code expects to find one observational input file per analysis time.
The most critical information you'll be changing most often is the start date, end date, and file
names.
Pay particularly careful attention to the file name settings. Mistakes in observations file names
can go unnoticed because OBSGRID will happily process the wrong files, and if there are no
data in the (wrongly-specified) file for a particular time, OBSGRID will happily provide you
with an analysis of no observations.
Examine the obsgrid.out file for error messages or warning messages. The program should
have created the files called metoa_em*. Additional output files containing information about
observations found and used and discarded will probably be created, as well.
Important things to check include the number of observations found for your objective analysis,
and the number of observations used at various levels. This can alert you to possible problems in
specifying observations files or time intervals. This information is included in the printout file.
You may also want to experiment with a couple of simple plot utility programs, discussed below.
There are a number of additional output files, which you might find useful. These are discussed
below.
Output Files
The OBSGRID program generates some ASCII text files to detail the actions taken on
observations through a time cycle of the program. In support of users wishing to plot the
observations used for each variable (at each level, at each time), a file is created with this
information. Primarily, the ASCII text files are for consumption by the developers for diagnostic
purposes. The main output of the OBSGRID program is the gridded, pressure-level data set to be
passed to the real.exe program (files metoa_em*).
In each of the files listed below, the text ".dn.YYYY-MM-DD_HH:mm:ss.tttt" allows each time
period that is processed by OBSGRID to output a separate file. The only unusual information in
the date string is the final four letters "tttt" which is the decimal time to ten thousandths of a
second. These files will be dependant on the domain being processed.
metoa_em*
The final analysis files at surface and pressure levels. Generating this file is the primary goal of
running OBSGRID.
These files can now be used in place of the met_em* files from WPS to generate initial and
boundary conditions for WRF. To use these files when running real.exe you can do one of two
things:
1. Rename or link the metoa_em* files back to met_em*. This way real.exe will read the
files automatically.
2. Use the auxinput1_inname namelist option in WRF’s namelist.input file to overwrite the
default filename real.exe uses. To do this, add the following to the &time_control section
of the WRF namelist.input file before running real.exe (use the exact syntax as below –
do not substitute the <domain> and <date> for actual numbers):
auxinput1_inname = "metoa_em.d<domain>.<date>"
wrfsfdda_dn
Use of the surface FDDA option in OBSGRID creates a file called wrfsfdda_dn This file
contains the surface analyses at INTF4D intervals, analyses of T, TH, U, V, RH, QV, PSFC,
PMSL, and a count of observations within 250 km of each grid point.
Due to the input requirements of the WRF model, data at the current time (_OLD) and data for
the next time (_NEW) are supplied at each time interval. Due to this requirement, users must
take care to specify the same interval in the WRF fdda section for surface nudging as the interval
used in OBSGRID to create the wrfsfdda_dn file.
OBS_DOMAINdxx
These files can be used in WRF for observational nudging. The format of this file is slightly
different from the standard wrf_obs / little_r format. See Chapter 5 of this User’s Guide for
details on observational nudging.
The “d” in the file name represents the domain number. The “xx” is just a sequential number.
These files contain a list of all of the observations available for use by the OBSGRID program.
• The observations have been sorted and the duplicates have been removed.
• Observations outside of the analysis region have been removed.
• Observations with no information have been removed.
• All reports for each separate location (different levels but at the same time) have been
combined to form a single report.
• Data which has had the "discard" flag internally set (data which will not be sent to the
quality control or objective analysis portions of the code) are not listed in this output.
• The data has gone through an expensive test to determine if the report is within the
analysis region, and the data have been given various quality control flags. Unless a
blatant error in the data is detected (such as a negative sea-level pressure), the
observation data are not typically modified, but only assigned quality control flags.
• Data with qc flags higher than a specified values (user controlled via the namelist), will
be set to missing data.
qc_obs_raw.dn.YYYY-MM-DD_HH:mm:ss.tttt
This file contains a listing of all of the observations available for use by the OBSGRID program.
• The observations have been sorted and the duplicates have been removed.
• Observations outside of the analysis region have been removed.
• Observations with no information have been removed.
• All reports for each separate location (different levels but at the same time) have been
combined to form a single report.
• Data which has had the "discard" flag internally set (data which will not be sent to the
quality control or objective analysis portions of the code) are not listed in this output.
• The data has gone through an expensive test to determine if the report is within the
analysis region, and the data have been given various quality control flags. Unless a
blatant error in the data is detected (such as a negative sea-level pressure), the
observation data are not typically modified, but only assigned quality control flags.
• This data can be used as input to the plotting utility plot_sounding.exe
qc_obs_used.dn.YYYY-MM-DD_HH:mm:ss.tttt
This file contains exactly the same data as in the OBS_DOMAINdxx file, but in this case the
format is standard wrf_obs/little_r data format.
plotobs_out.dn.YYYY-MM-DD_HH:mm:ss.tttt
This file lists data by variable and by level, where each observation that has gone into the
objective analysis is grouped with all of the associated observations for plotting or some other
diagnostic purpose. The first line of this file is the necessary FORTRAN format required to input
the data. There are titles over the data columns to aid in the information identification. Below are
a few lines from a typical file. This data can be used as input to the plotting utility plot_level.exe
( 3x,a8,3x,i6,3x,i5,3x,a8,3x,2(g13.6,3x),2(f7.2,3x),i7 )
Number of Observations 00001214
Variable Press Obs Station Obs Obs-1st X Y QC
Name Level Number ID Value Guess Location Location Value
U 1001 1 CYYT 6.39806 4.67690 161.51 122.96 0
U 1001 2 CWRA 2.04794 0.891641 162.04 120.03 0
U 1001 3 CWVA 1.30433 -1.80660 159.54 125.52 0
U 1001 4 CWAR 1.20569 1.07567 159.53 121.07 0
U 1001 5 CYQX 0.470500 -2.10306 156.58 125.17 0
U 1001 6 CWDO 0.789376 -3.03728 155.34 127.02 0
U 1001 7 CWDS 0.846182 2.14755 157.37 118.95 0
Plot Utilities
The OBSGRID package provides two utility programs for plotting observations. These programs
are called plot_soundings.exe and plot_levels.exe. These optional programs use
NCAR Graphics, and are built. Both programs get additional input options from the
namelist.oa file.
plot_soundings.exe
Program plot_soundings.exe plots soundings. This program generates soundings from the
"qc_obs_raw.dn.YYYY-MM-DD_HH:mm:ss.tttt" and "qc_obs_used.dn.YYYY-MM-
DD_HH:mm:ss.tttt" data files. Only data that are on the requested analysis levels are processed.
The program uses information from &record1, &record2 and &plot_souding in the
namelist.oa file to generate the required output.
plot_level.exe
Program plot_level.exe creates station plots for each analysis level. These plots contain
both observations that have passed all QC tests and observations that have failed the QC tests.
Observations that have failed the QC tests are plotted in various colors according to which test
failed.
The program uses information from &record1 and &record2 in the namelist.oa file to
generate plots from the observations in the file "plotobs_out.dn.YYYY-MM-
DD_HH:mm:ss.tttt".
Observations Format
To make the best use of the OBSGRID program, it is important for users to understand the
wrf_obs/little_r Observations Format.
Examples
Each report in the wrf_obs/little_r Observations Format consists of at least four records:
The report header record is a 600-character long record (much of which is unused and needs
only dummy values) that contains certain information about the station and the report as a whole:
location, station id, station type, station elevation, etc. The report header record is described fully
in the following table. Shaded items in the table are unused:
Following the report header record are the data records. These data records contain the
observations of pressure, height, temperature, dewpoint, wind speed, and wind direction. There
are a number of other fields in the data record that are not used on input. Each data record
contains data for a single level of the report. For report types that have multiple levels (e.g.,
upper-air station sounding reports), each pressure or height level has its own data record. For
report types with a single level (such as surface station reports or a satellite wind observation),
the report will have a single data record. The data record contents and format are summarized in
the following table
The end data record is simply a data record with pressure and height fields both set to -777777.
After all the data records and the end data record, an end report record must appear. The end
report record is simply three integers, which really aren't all that important.
QCFlags
In the observations files, most of the meteorological data fields also have space for an additional
integer quality-control flag. The quality control values are of the form 2n, where n takes on
positive integer values. This allows the various quality control flags to be additive yet permits the
decomposition of the total sum into constituent components. Following are the current quality
control flags that are applied to observations.
OBSGRID Namelist
The OBSGRID namelist file is called "namelist.oa", and must be in the directory from which
OBSGRID is run. The namelist consists of nine namelist records, named "record1" through
"record9", each having a loosely related area of content. Each namelist record, which extends
over several lines in the namelist.oa file, begins with "&record<#>" (where <#> is the namelist
record number) and ends with a slash "/".
Namelist record1
Namelist record2
The data in record2 define the model grid and names of the input files:
If a wrfsfdda is being
created, then similar input
data files are required for
each surface fdda time.
The met_em* files which are being processed must be available in the OBSGRID/ directory.
The obs_filename and interval settings can get confusing, and deserve some additional
explanation. Use of the obs_filename files is related to the times and time interval set in namelist
&record1, and to the F4D options set in namelist &record8. The obs_filename files are used
for the analyses of the full 3D dataset, both at upper-air and the surface. They are also used when
F4D=.TRUE., that is, if surface analyses are being created for surface FDDA nudging. The
obs_filename files should contain all observations, upper-air and surface, to be used for a
particular analysis at a particular time.
Ideally there should be an obs_filename for each time period for which an objective analysis is
desired. Time periods are processed sequentially from the starting date to the ending date by the
time interval, all specified in namelist &record1. All observational files must have a date
associated. If a file is not found, the code will process as if this file contains zero observations,
and then continue to the next time period.
If the F4D option is selected, the obs_filename files are similarly processed for surface analyses,
this time with the time interval as specified by INTF4D.
If a users wishes to include observations from outside the interested model domain, geogrid.exe
(WPS) needs to be run for a slightly large domain that the domain of interest. Setting
trim_domain to .TRUE. will cut all 4 directions of the input domain down by the number of
grid points set in trim_value.
In the example below, the domain of interest is the inner white domain with a total of 100x100
grid points. geogrid.exe have be run for the outer domain (110x110 grid points). By setting
trim_value to 5, the output domain will be trimmed by 5 grid points in each direction,
resulting in the white 100x100 grid point domain.
Namelist record3
The data in the record3 concern space allocated within the program for observations. These are
values that should not frequently need to be modified:
Namelist record4
The data in record4 set the quality control options. There are four specific tests that may be
activated by the user: An error max test; a buddy test; removal of spike, and; the removal of
super-adiabatic lapse rates. For some of these tests a user have control over the tolerances as
well.
For satellite and aircraft observations, data are often horizontally spaced with only a single
vertical level. The following two entries describe how far the user assumes that the data are valid
in pressure space.
max_p_extend_t 1300 Pressure difference (Pa)
through which a single
temperature report may be
extended
max_p_extend_w 1300 Pressure difference (Pa)
through which a single wind
report may be extended
Namelist record5
The data in record5 control the enormous amount of printout that may be produced by the
OBSGRID program. These values are all logical flags, where TRUE will generate output and
FALSE will turn off output.
Namelist record7
The data in record7 concerns the use of the first-guess fields, and surface FDDA analysis
options. Always use the first guess.
Namelist record8
The data in record8 concern the smoothing of the data after the objective analysis. The
differences (observation minus first-guess) of the analyzed fields are smoothed, not the full
fields.
Namelist record9
The data in record9 concern the objective analysis options. There is no user control to select the
various Cressman extensions for the radius of influence (circular, elliptical or banana). If the
Cressman option is selected, ellipse or banana extensions will be applied as the wind conditions
warrant.
When oa_type is set to Cressman, then the Cressman scheme will be performed on all data.
When oa_type is set to MQD, there is a wide variety of options available controlling when the
code will revert back to the Cressman scheme.
• oa_max_switch ; mqd_maximum_num_obs
The code will revert back to Cressman if the switch is set to true and the maximum
number of observations is exceeded.
This is reduce the time the code run and not for physical reasons.
Recommended to left switch set to true and just set the maximum number large.
• oa_min_switch ; mqd_minimum_num_obs
The code will revert back to Cressman if the switch is set to true and there are too few
observations. How and when the code reverts back to Cressman under these conditions,
are controlled by the oa_3D_option parameter.
Recommended to left switch set to true and start with the default minimum settings.
• oa_3D_type=”Cressman”
All upper-air levels will use Cressman scheme, regardless of other settings.
• oa_3D_option
There are three options (0,1,2). For all these options the surface will use MQD as long as
there are enough observations to do so (mqd_maximum_num_obs ;
mqd_minimum_num_obs), else it will also revert to the Cressman scheme.
Note, that if some time periods have enough observations and others does not, the code
will only revert to Cressman for the times without sufficient observations.
1: The code will first check to see if, for a given time, all levels and variables in the
upper-air have sufficient observations for the MQD scheme. If not, the code will revert to
Cressman for that time period. Note, that if some time periods have enough observations
and others does not, the code will only revert to Cressman for the times without sufficient
observations.
2: The code will check per time, level and variable if sufficient observations are available
for the MQD scheme. If not, the code will revert to the Cressman scheme for that
particular time, level and variable. Note, as this can result in uncontrolled switching
between MQD and Cressman, this option is not recommended.
radius_influence
There are three ways to set the radius of influence (RIN) for the Cressman scheme:
• Manually: Set the RIN and number of scans directly. E.g., 5,4,3,2, will result in 4 scans.
The first will use 5 grid points for the RIN and the last 2 points.
• Automatically 1: Set RIN to 0 and the code will calculate the RIN based on the domain
size and an estimated observation density of 325km. By default there will be 4 scans.
• Automatically 2: Set RIN to a negative number and the code will calculate the RIN based
on the domain size and an estimated observation density of 325km. The number of scans
is controlled by the value of the set number. E.g, -5 will result in 5 scans.
Namelist plot_sounding
Table of Contents
• Introduction
• WRF Build Mechanism
• Registry
• I/O Applications Program Interface (I/O API)
• Timekeeping
• Software Documentation
• Performance
Introduction
The WRF build mechanism provides a uniform apparatus for configuring and compiling
the WRF model, WRF-Var system and the WRF pre-processors over a range of platforms
with a variety of options. This section describes the components and functioning of the
build mechanism. For information on building the WRF code, see the chapter on
Software Installation.
Required software:
The WRF build relies on Perl version 5 or later and a number of UNIX utilities: csh and
Bourne shell, make, M4, sed, awk, and the uname command. A C compiler is needed to
compile programs and libraries in the tools and external directories. The WRF code itself
is standard Fortran (commonly referred to as Fortran90). For distributed-memory
processing, MPI and related tools and libraries should be installed.
Directory structure: The directory structure of WRF consists of the top-level directory
plus directories containing files related to the WRF software framework (frame), the
WRF model (dyn_em, phys, chem, share), WRF-Var (da), configuration files
(arch, Registry), helper and utility programs (tools), and packages that are
distributed with the WRF code (external).
Makefiles: The main Makefile (input to the UNIX make utility) is in the top-level
directory. There are also makefiles in most of the subdirectories that come with WRF.
Make is called recursively over the directory structure. Make is not directly invoked by
the user to compile WRF; the compile script is provided for this purpose. The WRF
build has been structured to allow “parallel make”. Before the compile command, the
user sets an environment variable, J, to the number of processors to use. For example, to
use two processors (in csh syntax):
setenv J “-j 2”
On some machines, this parallel make causes troubles (a typical symptom is a missing
mpif.h file in the frame directory). The user can force that only a single processor be
used with the command:
setenv J “-j 1”
Configuration files: The configure.wrf contains compiler, linker, and other build
settings, as well as rules and macro definitions used by the make utility. The
configure.wrf file is included by the Makefiles in most of the WRF source
distribution (Makefiles in tools and external directories do not include configure.wrf).
The configure.wrf file in the top-level directory is generated each time the
configure script is invoked. It is also deleted by clean -a. Thus, configure.wrf is
the place to make temporary changes, such as optimization levels and compiling with
debugging, but permanent changes should be made in the file
arch/configure_new.defaults. The configure.wrf file is composed of
three files: arch/preamble_new arch/postamble_new and
arch_configure_new.defaults.
The Registry directory contains files that control many compile-time aspects of the
WRF code. The files are named Registry.core (where core is for example EM).
The configure script copies one of these to Registry/Registry, which is the file
that tools/registry will use as input. The choice of core depends on settings to
the configure script. Changes to Registry/Registry will be lost; permanent
changes should be made to Registry.core. For the WRF ARW model, the file is
typically Registry.EM.
Environment variables: Certain aspects of the configuration and build are controlled by
environment variables: the non-standard locations of NetCDF libraries or the Perl
command, which dynamic core to compile, machine-specific features, and optional build
libraries (such as Grib Edition 2, HDF, and parallel netCDF).
Configuration: The configure script configures the model for compilation on your
system. The configuration first attempts to locate needed libraries such as netCDF or
HDF and tools such as Perl. It will check for these in normal places, or will use settings
from the user's shell environment. The configure file then calls the UNIX uname
command to discover what platform you are compiling on. It then calls the Perl script
arch/Config_new.pl, which traverses the list of known machine configurations and
displays a list of available options to the user. The selected set of options is then used to
create the configure.wrf file in the top-level directory. This file may be edited but
changes are temporary, since the file will be deleted by clean –a or overwritten by the
next invocation of the configure script. About the only typical option that is included
on the configure command is “-d” (for debug). The code builds relatively quickly
and has the debugging switches enabled, but the model will run very slowly since all of
the optimization has been deactivated. This script takes only a few seconds to run.
Compilation: The compile script is used to compile the WRF code after it has been
configured using the configure script. This csh script performs a number of checks,
constructs an argument list, copies to Registry/Registry the correct
Registry.core file for the core being compiled, and the invokes the UNIX make
command in the top-level directory. The core to be compiled is determined from the
user’s environment; if no core is specified in the environment (by setting
WRF_core_CORE to 1) the default core is selected (currently the Eulerian Mass core for
ARW). The Makefile in the top-level directory directs the rest of the build,
accomplished as a set of recursive invocations of make in the subdirectories of WRF.
Most of these makefiles include the configure.wrf file from the top-level directory.
The order of a complete build is as follows:
2. Make in the tools directory to build the program that reads the
Registry/Registry file and auto-generates files in the inc directory
3. Make in the frame directory to build the WRF framework specific modules
5. Make in the phys directory to build the WRF model layer routines for physics
(non core-specific)
7. Make in the main directory to build the main programs for WRF, symbolic link
to create executable files (location depending on the build case that was selected
as the argument to the compile script)
Source files (.F and, in some of the external directories, .F90) are preprocessed to
produce .f90 files, which are input to the compiler. As part of the preprocessing,
Registry-generated files from the inc directory may be included. Compiling the .f90
files results in the creation of object (.o) files that are added to the library
main/libwrflib.a. Most of the external directories generate their own library
file. The linking step produces the wrf.exe executable and other executables,
depending on the case argument to the compile command: real.exe (a preprocessor
for real-data cases) or ideal.exe (a preprocessor for idealized cases), and the
ndown.exe program, for one-way nesting of real-data cases.
The .o files and .f90 files from a compile are retained until the next invocation of the
clean script. The .f90 files provide the true reference for tracking down run time
errors that refer to line numbers or for sessions using interactive debugging tools such as
dbx or gdb.
Registry
Tools for automatic generation of application code from user-specified tables provide
significant software productivity benefits in development and maintenance of large
applications such as WRF. Just for the WRF model, hundreds of thousands of lines of
WRF code are automatically generated from a user-edited table, called the Registry. The
Registry provides a high-level single-point-of-control over the fundamental structure of
the model data, and thus provides considerable utility for developers and maintainers. It
contains lists describing state data fields and their attributes: dimensionality, binding to
particular solvers, association with WRF I/O streams, communication operations, and run
time configuration options (namelist elements and their bindings to model control
structures). Adding or modifying a state variable to WRF involves modifying a single
line of a single file; this single change is then automatically propagated to scores of
locations in the source code the next time the code is compiled.
The WRF Registry has two components: the Registry file (which the user may edit), and
the Registry program.
The Registry file is located in the Registry directory and contains the entries that
direct the auto-generation of WRF code by the Registry program. There is more than one
Registry in this directory, with filenames such as Registry.EM (for builds using the
Eulerian Mass/ARW core) and Registry.NMM (for builds using the NMM core). The
WRF Build Mechanism copies one of these to the file Registry/Registry and this
file is used to direct the Registry program. The syntax and semantics for entries in the
Registry are described in detail in “WRF Tiger Team Documentation: The Registry” on
http://www.mmm.ucar.edu/wrf/WG2/Tigers/Registry/.
The Registry program is distributed as part of WRF in the tools directory. It is built
automatically (if necessary) when WRF is compiled. The executable file is
tools/registry. This program reads the contents of the Registry file,
Registry/Registry, and generates files in the inc directory. These include files
are inserted (with cpp #include commands) into WRF Fortran source files prior to
compilation. Additional information on these is provided as an appendix to “WRF Tiger
Team Documentation: The Registry (DRAFT)”. The Registry program itself is written in
C. The source files and makefile are in the tools directory.
Figure 8.1. When the user compiles WRF, the Registry Program reads Registry/Registry, producing auto-
generated sections of code that are stored in files in the inc directory. These are included into WRF using
the CPP preprocessor and the Fortran compiler.
In addition to the WRF model itself, the Registry/Registry file is used to build the
accompanying preprocessors such as real.exe (for real data) or ideal.exe (for
ideal simulations), and the ndown.exe program (used for one-way, off-line nesting).
The other very typical activity for users is to define new run-time options, which are
handled via a Fortran namelist file namelist.input in WRF. As with the model
state arrays and variables, the entire model configuration is described in the Registry. As
with the model arrays, adding a new namelist entry is as easy as adding a new line in the
Registry.
While the model state and configuration are by far the most commonly used features in
the Registry, the data dictionary has several other powerful uses. The Registry file
provides input to generate all of the communications for the distributed memory
processing (halo interchanges between patches, support for periodic lateral boundaries,
and array transposes for FFTs to be run in the X, Y, or Z directions). The Registry
associates various fields with particular physics packages, so that the memory footprint
reflects the actual selection of the options, not a maximal value.
Together, these capabilities allow a large portion of the WRF code to be automatically
generated. Any code that is automatically generated relieves the developer of the effort
of coding and debugging that portion of software. Usually, the pieces of code that are
suitable candidates for automation are precisely those that are fraught with “hard to
detect” errors, such as communications, indexing, and IO which must be replicated for
hundreds of variables.
Registry Syntax:
Each entry in the Registry is for a specific variable, whether it is for a new dimension in
the model, a new field, a new namelist value, or even a new communication. For
readability, a single entry may be spread across several lines with the traditional “\” at the
end of a line to denote that the entry is continuing. When adding to the Registry, most
users find that it is helpful to copy an entry that is similar to the anticipated new entry,
and then modify that Registry entry. The Registry is not sensitive to spatial formatting.
White space separates identifiers in each entry.
Note: Do not simply remove an identifier and leave a supposed token blank, use the
appropriate default value (currently a dash character “-“).
Registry Entries:
The WRF Registry has the following types of entries (not case dependent):
Dimspec – Describes dimensions that are used to define arrays in the model
State – Describes state variables and arrays in the domain structure
I1 – Describes local variables and arrays in solve
Typedef – Describes derived types that are subtypes of the domain structure
Rconfig – Describes a configuration (e.g. namelist) variable or array
Package – Describes attributes of a package (e.g. physics)
Halo – Describes halo update interprocessor communications
Period – Describes communications for periodic boundary updates
Xpose – Describes communications for parallel matrix transposes
include – Similar to a CPP #include file
These keywords appear as the first word in a line of the file Registry to define which
type of information is being provided. Following are examples of the more likely
Registry types that users will need to understand.
Registry Dimspec:
The first set of entries in the Registry is the specifications of the dimensions for the fields
to be defined. To keep the WRF system consistent between the dynamical cores and
Chemistry, a unified registry.dimspec file is used (located in the Registry
directory). This single file is included into each Registry file, with the keyword
include. In the example below, three dimensions are defined: i, j, and k. If you do an
“ncdump -h” on a WRF file, you will notice that the three primary dimensions are
named as “west_east”, “south_north”, and “bottom_top”. That information is
contained in this example (the example is broken across two lines, but interleaved).
The WRF system has a notion of horizontal and vertical staggering, so the dimension
names are extended with a “_stag” suffix for the staggered sizes. The list of names in
the <Dim> column may either be a single unique character (for release 3.0.1.1 and prior),
or the <Dim> column may be a string with no embedded spaces (such as my_dim).
When this dimension is used later to dimension a state or i1 variable, it must be
surrounded by curly braces (such as {my_dim}). This <Dim> variable is not case
specific, so for example “i” is the same as an entry for “I”.
A state variable in WRF is a field that is eligible for IO and communications, and
exists for the duration of the model forecast. The I1 variables (intermediate level one)
are typically thought of as tendency terms, computed during a single model time-step,
and then discarded prior to the next time-step. The space allocation and de-allocation for
these I1 variables is automatic (on the stack for the model solver). In this example, for
readability, the column titles and the entries are broken into multiple interleaved lines,
with the user entries in a bold font.
Some fields have simple entries in the Registry file. The following is a state
variable that is a Fortran type real. The name of the field inside the WRF model is
u_gc. It is a three dimension array (igj). This particular field is only for the ARW
core (dyn_em). It has a single time level, and is staggered in the X and Z directions.
This field is input only to the real program (i1). On output, the netCDF name is UU,
with the accompanying description and units provided.
If a variable is not staggered, a “-“ (dash) is inserted instead of leaving a blank space.
The same dash character is required to fill in a location when a field has no IO
specification. The variable description and units columns are used for post-processing
purposes only; this information is not directly utilized by the model.
When adding new variables to the Registry file, users are warned to make sure that
variable names are unique. The <Sym> refers to the variable name inside the WRF
model, and it is not case sensitive. The <DNAME> is quoted, and appears exactly as
typed. Do not use imbedded spaces. While it is not required that the <Sym> and
<DNAME> use the same character string, it is highly recommended. The <DESCRIP>
and the <UNITS> are optional, however they are a good way to supply self-
documenation to the Registry. Since the <DESCRIP> value is used in the automatic
code generation, restrict the variable description to 40 characters or less.
From this example, we can add new requirements for a variable. Suppose that the
variable to be added is not specific to any dynamical core. We would change the <Use>
column entry of dyn_em to misc (for miscellaneous). The misc entry is typical of
fields used in physics packages. Only dynamics variables have more than a single time
level, and this introductory material is not suitable for describing the impact of multiple
time periods on the registry program. For the <Stagger> option, users may select any
subset from {X, Y, Z} or {-}, where the dash character “-“ signifies “no staggering”.
For example, in the ARW model, the x-direction wind component u is staggered in the X
direction, and the y-direction wind component v is staggered in the Y direction.
The <IO> column handles file input and output, and it handles the nesting specification
for the field. The file input and output uses three letters: i (input), r (restart), and h
(history). If the field is to be in the input file to the model, the restart file from the model,
and the history file from the model, the entry would be irh. To allow more flexibility,
the input and history fields are associated with streams. The user may specify a digit
after the i or the h token, stating that this variable is associated with a specified stream
(1 through 9) instead of the default (0). A single variable may be associated with
multiple streams. Once any digit is used with the i or h tokens, the default 0 stream
must be explicitly stated. For example, <IO> entry i and <IO> entry i0 are the same.
However, <IO> entry h1 outputs the field to the first auxiliary stream, but does not
output the field to the default history stream. The <IO> entry h01 outputs the field to
both the default history stream and the first auxiliary stream.
Nesting support for the model is also handled by the <IO> column. The letters that are
parsed for nesting are: u (up as in feedback up), d (down, as in downscale from coarse to
fine grid), f (forcing, how the lateral boundaries are processed), and s (smoothing). As
with other entries, the best coarse of action is to find a field nearly identical to the one
that you are inserting into the Registry file, and copy that line. The user needs to
make the determination whether or not it is reasonable to smooth the field in the area of
the coarse grid, where the fine-grid feeds back to the coarse grid. Variables that are
defined over land and water, non-masked, are usually smoothed. The lateral boundary
forcing is primarily for dynamics variables, and is ignored in this overview presentation.
For non-masked fields (such as wind, temperature, pressure), the downward interpolation
(controlled by d) and the feedback (controlled by u) use default routines. Variables that
are land fields (such as soil temperature TSLB) or water fields (such as sea ice XICE)
have special interpolators, as shown in the examples below (again, interleaved for
readability):
<IO>
i02rhd=(interp_mask_land_field:lu_index)u=(copy_fcnm)
i0124rhd=(interp_mask_water_field:lu_index)u=(copy_fcnm)
Note that the d and u entries in the <IO> section are followed by an “=” then a
parenthesis-enclosed subroutine, and a colon separated list of additional variables to pass
to the routine. It is recommended that users follow the existing pattern: du for non-
masked variables, and the above syntax for the existing interpolators for masked
variables.
Registry Rconfig:
The Registry file is the location where the run-time options to configure the model are
defined. Every variable in the ARW namelist is described by an entry in the Registry
file. The default value for each of the namelist variables is as assigned in the Registry.
The standard form for the entry for two namelist variables is given (broken across lines
and interleaved):
The keyword for this type of entry in the Registry file is rconfig (run-time
configuration). As with the other model fields (such as state and i1), the <Type>
column assigns the Fortran kind of the variable: integer, real, or logical. The
name of the variable in ARW is given in the <Sym> column, and is part of the derived
data type structure as are the state fields. There are a number of Fortran namelist
records in the file namelist.input. Each namelist variable is a member of one of
the specific namelist records. The previous example shows that run_days and
start_year are both members of the time_control record. The <Nentries>
column refers to the dimensionality of the namelist variable (number of entries). For
most variables, the <Nentries> column has two eligible values, either 1 (signifying
that the scalar entry is valid for all domains) or max_domains (signifying that the
variable is an array, with a value specified for each domain). Finally, a default value is
given. This permits a namelist entry to be removed from the namelist.input file if
the default value is acceptable.
The registry program constructs two subroutines for each namelist variable, one to
retrieve the value of the namelist variable, and the other to set the value. For an integer
variable named my_nml_var, the following code snippet provides an example of the
easy access to the namelist variables.
The subroutine takes two arguments. The first is the input integer domain identifier (for
example, 1 for the most coarse grid, 2 for the second domain), and the second argument
is the returned value of the namelist variable. The associated subroutine to set the
namelist variable, with the same argument list, is nl_set_my_nml_var. For namelist
variables that are scalars, the grid identifier should be set to 1.
The rconfig line may also be used to define variables that are convenient to pass
around in the model, usually part of a derived configuration (such as the number of
microphysics species associated with a physics package). In this case, the <How set>
column entry is derived. This variable does not appear in the namelist, but is
accessible with the same generated nl_set and nl_get subroutines.
<Stencil:varlist>
24:u_2,v_2,w_2,t_2,ph_2;24:moist,chem,scalar;4:mu_2,al
#ifdef DM_PARALLEL
# include "HALO_EM_D2_3.inc"
#endif
The parallel communications are only required when the ARW code is built for
distributed-memory parallel processing, which accounts for the surrounding #ifdef.
The period communications are required when periodic lateral boundary conditions are
selected. The Registry syntax is very similar for period and halo communications,
but the stencil size refers to how many grid cells to communicate, in a direction that is
normal to the periodic boundary.
The xpose (a data transpose) entry is used when decomposed data is to be re-
decomposed. This is required when doing FFTs in the x-direction for polar filtering, for
example. No stencil size is necessary.
It is anticipated that many users will add to the the parallel communications portion of the
Registry file (halo and period. It is unlikely that users will add xpose fields.
Registry Package:
The package option in the Registry file associates fields with particular physics
packages. Presently, it is mandatory that all 4-D arrays be assigned. Any 4-D array that
is not associated with the selected physics option at run-time is neither allocated, used for
IO, nor communicated. All other 2-D and 3-D arrays are eligible for use with a
package assignment, but that is not required.
The purpose of the package option is to allow users to reduce the memory used by the
model, since only “necessary” fields are processed. An example for a microphysics
scheme is given below.
The entry keyword is package, and is associated with the single physics option listed
under <NMLAssociated>. The package is referenced in the code in Fortran IF and
CASE statements by the name given in the <PackageName> column, instead of the
more confusing and typical IF ( mp_physics == 1 ) approach. The
<Variables> column must start with a dash character and then a blank “- “ (for
historical reasons of backward compatibility). The syntax of the <Variables> column
then is a 4-D array name, followed by a colon, and then a comma-separated list of the 3-
D arrays constituting that 4-D amalgamation. In the example above, the 4-D array is
moist, and the selected 3-D arrays are qv, qc, and qr. If more than one 4-D array is
required, a “;” separates those sections from each other in the <Variables> column.
In addition to handling 4-D arrays and their underlying component 3-D arrays, the
package entry is able to associate generic state variables, as shown in the example
following. If the namelist variable use_wps_input is set to 1, then the variables
u_gc and v_gc are available to be processed.
The software that implements WRF I/O, like the software that implements the model in
general, is organized hierarchically, as a “software stack”
(http://www.mmm.ucar.edu/wrf/WG2/Tigers/IOAPI/IOStack.html) .
From top (closest to the model code itself) to bottom (closest to the external package
implementing the I/O), the I/O stack looks like this:
Timekeeping
Starting times, stopping times, and time intervals in WRF are stored and manipulated as
Earth System Modeling Framework (ESMF, http://www.esmf.ucar.edu) time manager
objects. This allows exact representation of time instants and intervals as integer numbers
of years, months, hours, days, minutes, seconds, and fractions of a second (numerator and
denominator are specified separately as integers). All time computations involving these
objects are performed exactly by using integer arithmetic, with the result that there is no
accumulated time step drift or rounding, even for fractions of a second.
The WRF implementation of the ESMF Time Manger is distributed with WRF in the
external/esmf_time_f90 directory. This implementation is entirely Fortran90 (as
opposed to the ESMF implementation in C++) and it is conformant to the version of the
ESMF Time Manager API that was available in 2009.
WRF source modules and subroutines that use the ESMF routines do so by use-
association of the top-level ESMF Time Manager module, esmf_mod:
USE esmf_mod
Software Documentation
Performance
Table of Contents
• Introduction
• NCL
• RIP4
• ARWpost
• WPP
• VAPOR
Introduction
Currently the following post-processing utilities are supported, NCL, RIP4, ARWpost
(converter to GrADS), WPP, and VAPOR.
NCL, RIP4, ARWpost and VAPOR can currently only read data in netCDF format, while
WPP can read data in netCDF and binary format.
Required software
The only library that is always required is the netCDF package from Unidata
(http://www.unidata.ucar.edu/: login > Downloads > NetCDF - registration login
required).
netCDF stands for Network Common Data Form. This format is platform independent,
i.e., data files can be read on both big-endian and little-endian computers, regardless of
where the file was created. To use the netCDF libraries, ensure that the paths to these
libraries are set correct in your login scripts as well as all Makefiles.
• NCL (http://www.ncl.ucar.edu)
• GrADS (http://grads.iges.org/home.html)
• GEMPAK (http://my.unidata.ucar.edu/content/software/gempak/index.html)
• VAPOR (http://www.vapor.ucar.edu)
NCL
With the use of NCL Libraries (http://www.ncl.ucar.edu), WRF-ARW data can easily
be displayed.
The information on these pages has been put together to help users generate NCL scripts
to display their WRF-ARW model data.
NCL can process WRF-ARW static, input and output files, as well as WRFDA output
data. Both single and double precision data can be processed.
In July 2007, the WRF-NCL processing scripts have been incorporated into the NCL
Libraries, thus only the NCL Libraries, are now needed.
Major WRF-ARW related upgrades have been added to the NCL libraries in
version 5.1.0, therefore in order to use many of the functions, NCL version 5.1.0 or
higher is required.
Special NCL built-in functions have been added to the NCL libraries to help users
calculate basic diagnostics for WRF-ARW data.
All the FORTRAN subroutines used for diagnostics and interpolation (previously
located in wrf_user_fortran_util_0.f) has been re-coded into NCL in-line functions. This
means users no longer need to compile these routines.
What is NCL
It runs on many different operating systems including Solaris, AIX, IRIX, Linux,
MacOSX, Dec Alpha, and Cygwin/X running on Windows. The NCL binaries are freely
available at: http://www.ncl.ucar.edu/Download/
Necessary software
NCL libraries version 5.1.0 or higher.
Environment Variable
Set the environment variable NCARG_ROOT to the location where you installed the
NCL libraries. Typically (for cshrc shell):
.hluresfile
Create a file called .hluresfile in your $HOME directory. This file controls the color /
background / fonts and basic size of your plot. For more information regarding this file,
see: http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml.
NOTE: This file must reside in your $HOME directory and not where you plan on
running NCL.
Below is the .hluresfile used in the example scripts posted on the web (scripts are
available at: http://www.mmm.ucar.edu/wrf/users/graphics/NCL/NCL.htm). If a different
color table is used, the plots will appear different. Copy the following to your
~/.hluresfile. (A copy of this file is available at:
http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/.hluresfile)
*wkColorMap : BlAqGrYeOrReVi200
*wkBackgroundColor : white
*wkForegroundColor : black
*FuncCode : ~
*TextFuncCode : ~
*Font : helvetica
*wkWidth : 900
*wkHeight : 900
NOTE:
If your image has a black background with white lettering, your .hluresfile has
not been created correctly, or it is in the wrong location.
wkColorMap, as set in your .hluresfile can be overwritten in any NCL script with
the use of the function “gsn_define_colormap”, so you do not need to change
your .hluresfile if you just want to change the color map for a single plot.
begin
; Open input file(s)
; Open graphical output
; Read variables
; Set up plot resources & Create plots
; Output graphics
end
For example, let’s create a script to plot Surface Temperature, Sea Level Pressure and
Wind as shown in the picture below.
begin
;---------------------------------------------------------------
times = wrf_user_list_times(a) ; get times in the file
it = 0 ; only interested in first time
res@TimeLabel = times(it) ; keep some time information
;---------------------------------------------------------------
; Get variables
;---------------------------------------------------------------
; MAKE PLOTS
plot = wrf_map_overlays(a,wks, \
(/contour_tc,contour_psl,vector/),pltres,mpres)
;---------------------------------------------------------------
end
2. Ensure that the environment variable NCARG_ROOT is set to the location where
NCL is installed on your computer. Typically (for cshrc shell), the command will
look as follows:
ncl NCL_script
The output type created with this command is controlled by the line:
wks = gsn_open_wk (type,"Output") ; inside the NCL script
where type can be x11, pdf, ncgm, ps, or eps
For high quality images, create pdf / ps or eps images directly via the ncl scripts (type =
pdf / ps / eps)
See the Tools section in Chapter 10 of this User’s Guide for more information concerning
other types of graphical formats and conversions between graphical formats.
Get fields from netCDF file for any given time. Or all times by setting it = -1.
wrf_user_list_times (nc_file)
Usage: times = wrf_user_list_times (a)
Obtain a list of times available in the input file. The function returns a 1D array
containing the times (type: character) in the input file.
Returns a graphic (contour), of the data to be contoured. This graphic is only created, but
not plotted to a wks. This enables a user to generate many such graphics and overlay
them before plotting the resulting picture to a wks.
The returned graphic (contour) does not contain map information, and can therefore be
used for both real and idealized data ca
ses.
This function can plot both line contours and shaded contours. Default is line contours.
Many resources are set for a user, of which most can be overwritten. Below is a list of
resources you may want to consider changing before generating your own graphics:
General NCL resources (most standard NCL options for cn and lb can be set by the user
to overwrite the default values)
opts@cnFillOn : Set to True for shaded plots. Default is False.
opts@cnLineColor : Color of line plot.
opts@lbTitleOn : Set to False to switch the title on the label bar off. Default is True.
opts@cnLevelSelectionMode ; opts @cnLevels ; opts@cnFillColors ;
optr@cnConstFLabelOn : Can be used to set contour levels and colors manually.
Returns a graphic (vector) of the data. This graphic is only created, but not plotted to a
wks. This enables a user to generate many graphics and overlay them before plotting the
resulting picture to a wks.
The returned graphic (vector) does not contain map information, and can therefore be
used for both real and idealized data cases.
Many resources are set for a user, of which most can be overwritten. Below is a list of
resources you may want to consider changing before generating your own graphics:
opts@Footer : Add some model information to the plot as a footer. Default is True.
opts@InitTime : Plot initial time on graphic. Default is True. If True, the initial time will
be extracted from the input file.
opts@ValidTime : Plot valid time on graphic. Default is True. A user must set
opts@TimeLabel to the correct time.
opts@TimeLabel : Time to plot as valid time.
opts@TimePos : Time position – Left/Right. Default is “Right”.
opts@ContourParameters : A single value is treated as an interval. Three values
represent: Start, End, and Interval.
opts@FieldTitle : Overwrite the field title - if not set the field description is used for the
title.
opts@UnitLabel : Overwrite the field units - seldom needed as the units associated with
the field will be used.
opts@PlotLevelID : Use to add level information to the field title.
opts@NumVectors : Density of wind vectors.
General NCL resources (most standard NCL options for vc can be set by the user to
overwrite the default values)
opts@vcGlyphStyle : Wind style. “WindBarb” is default.
Overlay contour and vector plots generated with wrf_contour and wrf_vector. Can
overlay any number of graphics. Overlays will be done in order give, so always list
shaded plots before line or vector plots, to ensure the lines and vectors are visible and not
hidden behind the shaded plot.
A map background will automatically be added to the plot. Map details are controlled
with the mpres resource. Common map resources you may want to set are:
mpres@mpGeophysicalLineColor ; mpres@mpNationalLineColor ;
mpres@mpUSStateLineColor ; mpres@mpGridLineColor ;
mpres@mpLimbLineColor ; mpres@mpPerimLineColor
If you want to zoom into the plot, set mpres@ZoomIn to True, and mpres@Xstart,
mpres@Xend, mpres@Ystart, mpres@Yend, to the corner x/y positions of the
zoomed plot.
If you want to generate images for a panel plot, set pltres@PanelPot to True.
If you want to add text/lines to the plot before advancing the frame, set
pltres@FramePlot to False. Add your text/lines directly after the call to the
wrf_map_overlays function. Once you are done adding text/lines, advance the frame with
the command “frame (wks)”.
Overlay contour and vector plots generated with wrf_contour and wrf_vector. Can
overlay any number of graphics. Overlays will be done in order give, so always list
shaded plots before line or vector plots, to ensure the lines and vectors are visible and not
hidden behind the shaded plot.
Typically used for idealized data or cross-sections, which does not have map background
information.
If you want to generate images for a panel plot, set pltres@PanelPot to True.
If you want to add text/lines to the plot before advancing the frame, set
pltres@FramePlot to False. Add your text/lines directly after the call to the wrf_overlays
function. Once you are done adding text/lines, advance the frame with the command
“frame (wks)”.
var3d: The variable to interpolate. This can be a array of up to 5 dimensions. The 3 right-
most dimensions must be bottom_top x south_north x west_east.
H: The field to interpolate to. Either pressure (hPa or Pa), or z (m). Dimensionality must
match var3d.
plot_type: “h” for horizontally and “v” for vertically interpolated plots.
loc_param: Can be a scalar, or an array holding either 2 or 4 values.
For plot_type = “h”:
This is a scalar representing the level to interpolate too.
Must match the field to interpolate too (H).
When interpolating to pressure, this can be in hPa or Pa (e.g. 500., to interpolate
to 500 hPa). When interpolating to height this must in in m (e.g. 2000., to
interpolate to 2 km).
For plot_type = “v”:
This can be a pivot point though which a line is drawn – in this case a single x/y
point (2 values) is required. Or this can be a set of x/y points (4 values), indicating
start x/y and end x/y locations for the cross-section.
angle:
Set to 0., for plot_type = “h”, or for plot_type = “v” when start and end locations
of cross-section were supplied in loc_param.
If a single pivot point was supplied in loc_param, angle is the angle of the line
that will pass through the pivot point. Where: 0. is SN, and 90. is WE.
res:
Set to False for plot_type = “h”, or for plot_type = “v” when a single pivot point
is supplied. Set to True if start and end locations are supplied.
Convert a lon/lat location to the nearest x/y location. This function makes use of map
information to find the closest point, so this returned value may potentially be outside the
model domain.
Optional resources:
res@returnInt - If set to False, the return values will be real (default is True with integer
return values)
res@useTime - Default is 0. Set if want the reference longitude/latitudes must come from
a specific time - one will only use this for moving nest output which has been stored in a
single file.
Convert a i/j location to a lon/lat location. This function makes use of map information to
find the closest point, so this returned value may potentially be outside the model domain.
Optional resources:
res@useTime - Default is 0. Set if want the reference longitude/latitudes must come from
a specific time - one will only use this for moving nest output which has been stored in a
single file.
This function unstaggers an array. This function returns an array on ARW WRF mass
points.
unstagDim: Dimension to unstagger. Must be either "X", "Y", or "Z". This is case
sensitive. If not one of these strings, the returning array will be unchanged.
A function has been built into NCL to preview where a potential domain will be placed
(similar to plotgrids.exe from WPS).
The lnres and txres resources are standard NCL Line and Text resources. These are used
to add nests to the preview.
The mpres are used for standard map background resources like:
mpres@mpFillOn ; mpres@mpFillColors ; mpres@mpGeophysicalLineColor ;
mpres@mpNationalLineColor ; mpres@mpUSStateLineColor ;
mpres@mpGridLineColor ; mpres@mpLimbLineColor ;
mpres@mpPerimLineColor
But its main function is to set map resources to preview a domain. These resources are
similar to the resources set in WPS. Below is an example to display 3 nested domains on
a Lambert projection. (The output is shown below).
mpres@max_dom = 3
mpres@parent_id = (/ 1, 1, 2 /)
mpres@parent_grid_ratio = (/ 1, 3, 3 /)
mpres@i_parent_start = (/ 1, 31, 15 /)
mpres@j_parent_start = (/ 1, 17, 20 /)
mpres@e_we = (/ 74, 112, 133/)
mpres@e_sn = (/ 61, 97, 133 /)
mpres@dx = 30000.
mpres@dy = 30000.
mpres@map_proj = "lambert"
mpres@ref_lat = 34.83
mpres@ref_lon = -81.03
mpres@truelat1 = 30.0
mpres@truelat2 = 60.0
mpres@stand_lon = -98.0
A number of NCL built-in functions have been created to help users calculate simply
diagnostics. Full descriptions of these functions are available on the NCL web site
(http://www.ncl.ucar.edu/Document/Functions/wrf.shtml).
Let’s use a routine that calculated temperature (K) from theta and pressure.
!! Variables
integer :: nx, ny, nz
real, dimension (nx,ny,nz) :: tk, pressure, theta
!! Local Variables
integer :: i, j, k
real, dimension (nx,ny,nz):: pi
return
end subroutine compute_tk
For simple routines like this, it is easiest to re-write the routine into a FORTRAN 77
routine.
C Variables
integer nx, ny, nz
real tk(nx,ny,nz) , pressure(nx,ny,nz), theta(nx,ny,nz)
C Local Variables
integer i, j, k
real pi
DO k=1,nz
DO j=1,ny
DO i=1,nx
pi=(pressure(i,j,k) / 1000.)**(287./1004.)
tk(i,j,k) = pi*theta(i,j,k)
ENDDO
ENDDO
ENDDO
return
end
C Variables
integer nx, ny, nz
real tk(nx,ny,nz) , pressure(nx,ny,nz), theta(nx,ny,nz)
C NCLEND
C Local Variables
integer i, j, k
real pi
DO k=1,nz
DO j=1,ny
DO i=1,nx
pi=(pressure(i,j,k) / 1000.)**(287./1004.)
tk(i,j,k) = pi*theta(i,j,k)
ENDDO
ENDDO
ENDDO
return
end
WRAPIT myTK.f
If the subroutine compiles successfully, a new library will be created, called myTK.so.
This library can be linked to an NCL script to calculate TK. See how this is done in the
example below:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl”
external myTK "./myTK.so"
begin
t = wrf_user_getvar (a,”T”,5)
theta = t + 300
p = wrf_user_getvar (a,”pressure”,5)
dim = dimsizes(t)
tk = new( (/ dim(0), dim(1), dim(2) /), float)
end
C NCLEND
NOTE: You may need to copy the WRAPIT script to a locate location and edit it to point
to a FORTRAN 90 compiler.
If the subroutine compiles successfully, a new library will be created, called myTK90.so
(note the change in name from the FORTRAN 77 library). This library can similarly be
linked to an NCL script to calculate TK. See how this is done in the example below:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl”
external myTK90 "./myTK90.so"
begin
t = wrf_user_getvar (a,”T”,5)
theta = t + 300
p = wrf_user_getvar (a,”pressure”,5)
dim = dimsizes(t)
tk = new( (/ dim(0), dim(1), dim(2) /), float)
end
RIP4
RIP (which stands for Read/Interpolate/Plot) is a Fortran program that invokes NCAR
Graphics routines for the purpose of visualizing output from gridded meteorological data
sets, primarily from mesoscale numerical models. It was originally designed for sigma-
coordinate-level output from the PSU/NCAR Mesoscale Model (MM4/MM5), but was
generalized in April 2003 to handle data sets with any vertical coordinate, and in
particular, output from the Weather Research and Forecast (WRF) modeling system. It
can also be used to visualize model input or analyses on model grids. It has been under
continuous development since 1991, primarily by Mark Stoelinga at both NCAR and the
University of Washington.
Code history
Necessary software
RIP4 only requires low level NCAR Graphics libraries. These libraries have been merged
with the NCL libraries since the release of NCL version 5 (http://www.ncl.ucar.edu/), so
if you don’t already have NCAR Graphics installed on your computer, install NCL
version 5.
Unzip and untar the RIP4 tar file. The tar file contains the following directories and files:
• CHANGES, a text file that logs changes to the RIP tar file.
• Doc/, a directory that contains documentation of RIP, most notably the Users'
Guide (ripug).
Environment Variables
The RIP_ROOT environment variable can also be overwritten with the variable rip_root
in the RIP user input file (UIF).
Since the release of version 4.5, the same configure/compile scripts available in all other
WRF programs have been added to RIP4. To compile the code, first configure for your
machine by typing:
./configure
You will see a list of options for your computer (below is an example for a Linux
machine):
This will create a file called configure.rip. Edit compile options/paths, if necessary.
./compile
showtraj, it prompts you for the name of the trajectory position file
to be printed out.
tabdiag If fields are specified in the plot specification table for a trajectory
calculation run, then RIP produces a .diag file that contains values of
those fields along the trajectories. This file is an unformatted Fortran
file; so another program is required to view the diagnostics. tabdiag
serves this purpose.
upscale This program reads in model output (in rip-format files) from a
coarse domain and from a fine domain, and replaces the coarse data
with fine data at overlapping points. Any refinement ratio is allowed,
and the fine domain borders do not have to coincide with coarse
domain grid points.
RIP does not ingest model output files directly. First, a preprocessing step must be
executed that converts the model output data files to RIP-format data files. The primary
difference between these two types of files is that model output data files typically
contain all times and all variables in a single file (or a few files), whereas RIP data has
each variable at each time in a separate file. The preprocessing step involves use of the
program RIPDP (which stands for RIP Data Preparation). RIPDP reads in a model output
file (or files), and separates out each variable at each time.
Running RIPDP
The use of the namelist file is optional. The most important information in the namelist,
is the times you want to process.
As this step will create a large number of extra files, creating a new directory to place
these files in, will enable you to manage the files easier (mkdir RIPDP).
Once the RIP data has been created with RIPDP, the next step is to prepare the user input
file (UIF) for RIP (see Chapter 4 of the RIP users’ guide for details). This file is a text
file, which tells RIP what plots you want and how they should be plotted. A sample UIF,
called rip_sample.in, is provided in the RIP tar file. This sample can serve as a template
for the many UIFs that you will eventually create.
A UIF is divided into two main sections. The first section specifies various general
parameters about the set up of RIP, in a namelist format (userin - which control the
general input specifications; and trajcalc - which control the creation of trajectories).
The second section is the plot specification section, which is used to specify which plots
will be generated.
namelist: userin
The second part of the RIP UIF consists of the Plot Specification Table. The PST
provides all of the user control over particular aspects of individual frames and overlays.
This FSG will generate 5 frames to create a single plot (as shown below):
• Temperature in degrees C (feld=tmc). This will be plotted as a horizontal contour
plot (ptyp=hc), on pressure levels (vcor=p). The data will be interpolated to 850
hPa. The contour intervals are set to 2 (cint=2), and shaded plots (cmth=fill) will
be generated with a color range from light violet to light gray.
• Geopotential heights (feld=ght) will also be plotted as a horizontal contour plot.
This time the contour intervals will be 30 (cint=30), and contour lines, with a line
width of 2 (linw=2) will be used.
• Wind vectors (feld=uuu,vvv), plotted as barbs (vcmax=-1).
• A map background will be displayed (feld=map), and
• Tic marks will be placed on the plot (feld=tic).
Running RIP
Each execution of RIP requires three basic things: a RIP executable, a model data set and
a user input file (UIF). The syntax for the executable, rip, is as follows:
rip-execution-name is the unique name for this RIP execution, and it also defines the
name of the UIF that RIP will look for.
The –f option causes the standard output (i.e., the textual print out) from RIP to be
written to a file called rip-execution-name.out. Without the –f option, the standard output
is sent to the screen.
The default output TYPE is ‘cgm’, metacode file. To view these, use the command ‘idt’.
For high quality images, create pdf or ps images directly (ncarg_type = pdf / ps).
See the Tools section in Chapter 10 of this User’s Guide for more information concerning
other types of graphical formats and conversions between graphical formats.
Examples of plots created for both idealized and real cases are available from:
http://www.mmm.ucar.edu/wrf/users/graphics/RIP4/RIP4.htm
ARWpost
The ARWpost package reads in WRF-ARW model data and creates GrADS output files.
Since version 3.0 (released December 2010), vis5D output is no longer supported. More
advance 3D visualization tools, like VAPOR and IDV, has been developed over the last
couple of years and users are encouraged to explore those for their 3D visualization
needs.
The converter can read in WPS geogrid and metgrid data, and WRF-ARW input and
output files in netCDF format. Since version 3.0 the ARWpost code is no longer
dependant on the WRF IO API. The advantage of this is that the ARWpost code can now
be compiled and executed anywhere without the need to first install WRF. The
disadvantage is that GRIB1 formatted WRF output files are no longer supported.
Necessary software
Obtain the ARWpost TAR file from the WRF Download page
(http://www.mmm.ucar.edu/wrf/users/download/get_source.html)
Environment Variables
Set the environment variable NETCDF to the location where your netCDF libraries are
installed. Typically (for cshrc shell):
To configure - Type:
./configure
You will see a list of options for your computer (below is an example for a Linux
machine):
To compile - Type:
./compile
Set input and output file names and fields to process (&io)
&datetime
start_date; Start and end dates to process.
end_date Format: YYYY-MM-DD_HH:00:00
interval_seconds 0 Interval in seconds between data to process. If data is
available every hour, and this is set to every 3 hours,
the code will skip past data not required.
tacc 0 Time tolerance in seconds.
Any time in the model output that is within tacc
seconds of the time specified will be processed.
debug_level 0 Set higher to debugging is required.
&io
input_root_name ./ Path and root name of files to use as input. All files
starting with the root name will be processed. Wild
characters are allowed.
&interp
interp_method 0 0 - sigma levels,
-1 - code defined "nice" height levels,
1 - user defined height or pressure levels
interp_levels Only used if interp_method=1
Available diagnostics:
cape - 3d cape
cin - 3d cin
mcape - maximum cape
mcin - maximum cin
clfr - low/middle and high cloud fraction
dbz - 3d reflectivity
max_dbz - maximum reflectivity
geopt - geopotential
height - model height in km
lcl - lifting condensation level
lfc - level of free convection
pressure - full model pressure in hPa
rh - relative humidity
rh2 - 2m relative humidity
theta - potential temperature
tc - temperature in degrees C
tk - temperature in degrees K
td - dew point temperature in degrees C
td2 - 2m dew point temperature in degrees C
Run ARWpost
Type:
./ARWpost.exe
For general information about working with GrADS, view the GrADS home
page: http://grads.iges.org/grads/
To help users get started a number of GrADS scripts have been provided:
• The scripts are all available in the scripts/ directory.
• The scripts provided are only examples of the type of plots one can generate with
GrADS data.
• The user will need to modify these scripts to suit their data (e.g., if you did not
specify 0.25 km and 2 km as levels to interpolate to when you run the "bwave"
data through the converter, the "bwave.gs" script will not display any plots, since
it will specifically look for these to levels).
• Scripts must be copied to the location of the input data.
GENERAL SCRIPTS
cbar.gs Plot color bar on shaded plots (from GrADS home page)
rgbset.gs Some extra colors (Users can add/change colors from color number 20
to 99)
Examples of plots created for both idealized and real cases are available from:
http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/ARWpost/
Trouble Shooting
The code executes correctly, but you get "NaN" or "Undefined Grid" for all fields
when displaying the data.
options byteswapped
Remove this line from your .ctl file and try to display the data again.
If this SOLVES the problem, you need to remove the -Dbytesw option from
configure.arwp
options byteswapped
The line "options byteswapped" is often needed on some computers (DEC alpha as an
example). It is also often needed if you run the converter on one computer and use
another to display the data.
WPP
The NCEP WRF Postprocessor was designed to interpolate both WRF-NMM and WRF-
ARW output from their native grids to National Weather Service (NWS) standard levels
(pressure, height, etc.) and standard output grids (AWIPS, Lambert Conformal, polar-
stereographic, etc.) in NWS and World Meteorological Organization (WMO) GRIB
format. This package also provides an option to output fields on the model’s native
vertical levels.
The adaptation of the original WRF Postprocessor package and User’s Guide (by Mike
Baldwin of NSSL/CIMMS and Hui-Ya Chuang of NCEP/EMC) was done by Lígia
Bernardet (NOAA/ESRL/DTC) in collaboration with Dusan Jovic (NCEP/EMC), Robert
Rozumalski (COMET), Wesley Ebisuzaki (NWS/HQTR), and Louisa Nance
(NCAR/DTC). Upgrades to WRF Postprocessor versions 2.2 and higher were performed
by Hui-Ya Chuang and Dusan Jovic (NCEP/EMC).
This document will mainly deal with running the WPP package for the WRF-ARW
modeling system. For details on running the package for the WRF-NMM system, please
refer to the WRF-NMM User’s Guide (http://www.dtcenter.org/wrf-
nmm/users/docs/user_guide/V3/index.htm).
Necessary software
The WRF Postprocessor requires the same Fortran and C compilers used to build the
WRF model. In addition to the netCDF library, the WRF I/O API libraries, which are
included in the WRF model tar file, are also required.
The WRF Postprocessor has some visualization scripts included to create graphics using
either GrADS (http://grads.iges.org/home.html) or GEMPAK
(http://my.unidata.ucar.edu/content/software/gempak/index.html). These packages are
not part of the WPP installation and would need to be installed.
Note: Always obtain the latest version of the code if you are not trying to continue a pre-
existing project. WPPV3 is just used as an example here.
Once the tar file is obtained, gunzip and untar the file.
This command will create a directory called WPPV3. Under the main directory, there are
five subdirectories:
WPP uses a build mechanism similar to that used by the WRF model. First issue the
configure command, followed by the compile command.
../WRFV3
If this is not set, the configure script will prompt you for it.
./configure
Choose one of the configure options listed. Check the configure.wpp file created and
edit for compile options/paths, if necessary.
This command should create four WRF Postprocessor libraries in lib/ (libmpi.a, libsp.a,
libip.a, and libw3.a) and three WRF Postprocessor executables in exec/ (wrfpost.exe,
ndate.exe, and copygb.exe).
clean
WPP Functionalities
The WRF Postprocessor is divided into two parts, wrfpost and copygb:
wrfpost
• Interpolates the forecasts from the model’s native vertical coordinate to NWS
standard output levels (e.g., pressure, height) and computes mean sea level
pressure. If the requested field is on a model’s native level, then no vertical
interpolation is performed.
copygb
• Since wrfpost de-staggers WRF-ARW from a C-grid to an A-grid, WRF-ARW
data can be displayed directly without going through copygb.
• No de-staggering is applied when posting WRF-NMM forecasts. Therefore, the
posted WRF-NMM output is still on the staggered native E-grid and must go
through copygb to be interpolated to a regular non-staggered grid.
• copygb is mainly used by WRF-NMM - see the WRF-NMM User’s Guide
(http://www.dtcenter.org/wrf-nmm/users/docs/user_guide/WPS/index.php).
An additional utility called ndate is distributed with the WRF Postprocessor tar-file. This
utility is used to format the dates of the forecasts to be posted for ingestion by the codes.
The WRF Postprocessor v3.0 has been tested on IBM and LINUX platforms. Only
wrfpost (step 1) is parallelized because it requires several 3-dimensional arrays (the
model’s history variables) for the computations. When running wrfpost on more than one
processor, the last processor will be designated as an I/O node, while the rest of the
processors are designated as computational nodes. For example, if three processors are
requested to run the wrfpost, only the first two processors will be used for computation,
while the third processor will be used to write output to GRIB files.
The wrfpost program is currently set up to read a large number of fields from the WRF
model history files. This configuration stems from NCEP's need to generate all of its
required operational products. A list of the fields that are currently read in by wrfpost is
provided in Table 1. This program is configured such that is will run successfully if an
expected input field is missing from the WRF history file as long as this field is not
required to produce a requested output field. If the pre-requisites for a requested output
field are missing from the WRF history file, wrfpost will abort at run time.
Take care not to remove fields from the wrfout files, which may be needed for diagnostic
purposes by the WPP package. For example, if isobaric state fields are requested, but the
pressure fields on model interfaces (P and PB) are not available in the history file,
wrfpost will abort at run time. In general, the default fields available in the wrfout files
are sufficient to run WPP. The fields written to the WRF history file are controlled by
the settings in the Registry file (see Registry.EM) in the Registry subdirectory of the
main WRFV3 directory).
Table 1: List of all possible fields read in by wrfpost for the WRF-ARW:
T MUB SFROFF
U P_TOP UDROFF
V PHB SFCEVP
QVAPOR PH SFCEXC
QCLOUD SMOIS VEGFRA
QICE TSLB ACSNOW
QRAIN CLDFRA ACSNOM
QSNOW U10 CANWAT
QGRAUP V10 SST
W TH2 THZ0
PB Q2 QZ0
P SMSTAV UZ0
MU SMSTOT VZ0
QSFC HGT ISLTYP
Z0 ALBEDO ISLOPE
UST GSW XLAND
AKHS GLW XLAT
AKMS TMN XLONG
TSK HFX MAPFAC_M
RAINC LH STEPBL
RAINNC GRDFLX HTOP
RAINCV SNOW HBOT
RAINNCV SNOWC
Note: For WRF-ARW, the accumulated precipitation fields (RAINC and RAINNC)
are run total accumulations.
The user interacts with wrfpost through the control file, parm/wrf_cntrl.parm. The
control file is composed of a header and a body. The header specifies the output file
information. The body allows the user to select which fields and levels to process.
The body of the wrf_cntrl.parm file is composed of a series of line pairs, for example:
where,
• The top line specifies the variable (e.g. PRESS) to process, the level type (e.g. ON
MDL SFCS) a user is interested in, and the degree of accuracy to be retained
(SCAL=3.0) in the GRIB output.
SCAL defines the precision of the data written out to the GRIB format.
Positive values denote decimal scaling (maintain that number of
significant digits), while negative values describe binary scaling (precise
to 2^{SCAL}; i.e., SCAL=-3.0 gives output precise to the nearest 1/8).
A list of all possible output fields for wrfpost is provided in Table 2. This table
provides the full name of the variable in the first column and an abbreviated name
in the second column. The abbreviated names are used in the control file. Note
that the variable names also contain the type of level on which they are output.
For instance, temperature is available on “model surface” and “pressure surface”.
• The second line specifies the levels on which the variable is to be posted.
To output a field, the body of the control file needs to contain an entry for the appropriate
variable and output for this variable must be turned on for at least one level (see
"Controlling which levels wrfpost outputs"). If an entry for a particular field is not yet
available in the control file, two lines may be added to the control file with the
appropriate entries for that field.
The second line of each pair determines which levels wrfpost will output. Output on a
given level is turned off by a “0” or turned on by a “1”.
• For isobaric output, 47 levels are possible, from 2 to 1013 hPa (8 levels above 75
mb and then every 25 mb from 75 to 1000mb). The complete list of levels is
specified in sorc/wrfpost/POSTDATA.f
Modify specification of variable LSM in the file CTLBLK.comm to
change the number of pressure levels: PARAMETER (LSM=47)
Modify specification of SPL array in the subroutine POSTDATA.f to
change the values of pressure levels:
DATA SPL/200.,500.,700.,1000.,2000.,3000.
&,5000.,7000.,7500.,10000.,12500.,15000.,17500.,20000., …
• For model-level output, all model levels are possible, from the highest to the
lowest.
• When using the Noah LSM the soil layers are 0-10 cm, 10-40 cm, 40-100 cm, and
100-200 cm.
• When using the RUC LSM the soil levels are 0 cm, 5 cm, 20 cm, 40 cm, 160 cm
and 300 cm. For the RUC LSM it is also necessary to turn on two additional
output levels in the wrf_cntrl.parm to output 6 levels rather than the default 4
layers for the Noah LSM.
• For PBL layer averages, the levels correspond to 6 layers with a thickness of 30
hPa each.
• For flight level, the levels are 914 m, 1524 m, 1829 m, 2134 m, 2743 m, 3658 m,
and 6000 m.
• For AGL RADAR Reflectivity, the levels are 4000 and 1000 m.
• For surface or shelter-level output, only the first position of the line can be turned
on.
For example, the sample control file parm/wrf_cntrl.parm has the
following entry for surface dew point temperature:
Based on this entry, surface dew point temperature will not be output by
wrfpost. To add this field to the output, modify the entry to read:
Running WPP
Number of scripts for running the WRF Postprocessor package is included in the tar file:
run_wrfpost
run_wrfpostandgrads
run_wrfpostandgempak
run_wrfpost_frames
run_wrfpost_gracet
run_wrfpost_minute
Before running any of the above listed scripts, perform the following instructions:
2. Make the following directories. The first will hold the WRF Postprocessor results. The
second is where you will place your copy of the wrf_cntrl.parm file.
mkdir postprd
mkdir parm
Once these directories are set up and the edits outlined above are completed, the scripts
can be run interactively from the postprd directory by simply typing the script name on
the command line.
Note: It is recommended that the user refer to the script while reading this overview.
TOP_DIR: top level directory for source codes (WPPV3 and WRFV3)
DOMAINPATH: top level directory of WRF model run
Note: The scripts are configured such that wrfpost expects the WRF history files
(wrfout* files) to be in subdirectory wrfprd, the wrf_cntrl.parm file to be in the
subdirectory parm and the postprocessor working directory to be a subdirectory called
postprd under DOMAINPATH.
2. Specify dynamic core being run (“ARW” for the WRF-ARW model)
7. Create namelist itag that will be read in by wrfpost.exe from stdin (unit 5). This
namelist contains 4 lines:
i. Name of the WRF output file to be posted.
ii. Format of WRF model output (netCDF or binary).
iii. Forecast valid time (not model start time) in WRF format.
iv. Model name (ARW for the WRF_ARW model).
8. Run wrfpost and check for errors. The execution command in the distributed scripts is
for a single processor wrfpost.exe < itag > outpost. To run wrfpost on multiple
processors, the command line should be:
mpirun -np N wrfpost.exe < itag > outpost (for LINUX-MPI systems)
mpirun.lsf wrfpost.exe < itag > outpost (for IBM)
Upon a successful run, wrfpost will generate the output file WRFPRS_dnn.hh (linked to
wrfpr_dnn.hh), in the post-processor working directory, where “nn” is the domain ID
and “hh” the forecast hour. In addition, the script run_wrfpostandgrads will produce a
suite of gif images named variablehh_dnn_GrADS.gif, and the script
run_wrfpostandgempak will produce a suite of gif images named variable_dnn_hh.gif.
If the run did not complete successfully, a log file in the post-processor working directory
called wrfpost_dnn.hh.out, where “nn” is the domain ID and “hh” is the forecast hour,
may be consulted for further information.
Visualization
GEMPAK
The GEMPAK utility nagrib is able to decode GRIB files whose navigation is on any
non-staggered grid. Hence, GEMPAK is able to decode GRIB files generated by the
WRF Postprocessing package and plot horizontal fields or vertical cross sections.
This script can be modified to customize fields for output. GEMPAK has an online users
guide at
http://www.unidata.ucar.edu/software/gempak/help_and_documentation/manual/.
GrADS
The GrADS utilities grib2ctl.pl and gribmap are able to decode GRIB files whose
navigation is on any non-staggered grid. These utilities and instructions on how to use
them to generate GrADS control files are available from:
http://www.cpc.ncep.noaa.gov/products/wesley/grib2ctl.html.
1. Set the environmental variable GADDIR to the path of the GrADS fonts and auxiliary
files. For example,
2. Add the location of the GrADS executables to the PATH. For example,
3. Link script cbar.gs to the post-processor working directory. (This script is provided in
WPP package, and the run_wrfpostandgrads script makes a link from scripts/ to
postprd/.) To generate the above plots, GrADS script cbar.gs is invoked. This script
can also be obtained from the GrADS library of scripts at:
http://grads.iges.org/grads/gadoc/library.html
Table 2 lists basic and derived fields that are currently produced by wrfpost. The
abbreviated names listed in the second column describe how the fields should be entered
in the control file (wrf_cntrl.parm).
Table 2: Fields produced by wrfpost (column 1), abbreviated names used in the
wrf_cntrl.parm file (column 2), corresponding GRIB identification number for the field
(column 3), and corresponding GRIB identification number for the vertical coordinate
(column 4).
VAPOR
VAPOR is the Visualization and Analysis Platform for Ocean, Atmosphere, and Solar
Researchers. VAPOR was developed at NCAR to provide interactive visualization and
analysis of numerically simulated fluid dynamics. The current (2.0) version of VAPOR
has many capabilities for 3D visualization of WRF-ARW simulation output, including
the ability to directly import wrfout files.
• Flow
- Draw 2D and 3D streamlines and flow arrows, showing the wind motion and
direction, and how wind changes in time.
- Path tracing (unsteady flow) enables visualization of trajectories that particles
take over time. Users control when and where the particles are released.
- Flow images (image based flow visualization) can be used to provide an
animated view of wind motion in a planar section, positioned anywhere in the
scene.
- Field line advection can be used to animate the motion of streamlines of any
vector field in a moving wind field.
• Isosurfaces
The isosurfaces of variables are displayed interactively. Users can control iso-
values, color and transparency of the isosurfaces. Isosurfaces can be colored
according to the values of another variable.
• Animation
Control the time-stepping of the data, for interactive replaying and for recording
animated sequences.
• Image display
Tiff images can be displayed in the 3D scene. If the images are georeferenced (i.e.
geotiffs) then they can be automatically positioned at the correct
latitude/longitude coordinates. Images can be mapped to the terrain surface, or
aligned to an axis-aligned plane. VAPOR also provides several utilities for
obtaining geo-referenced images. Images can be downloaded from various Web
Mapping Services (WMS's), obtaining political boundary maps, rivers, and
satellite images. VAPOR also supports georeferencing and display of NCL plots
from WRF output files. Images with transparency can be overlayed, enabling
combining multiple layers of information.
• Analysis capabilities
VAPOR 2.0 has an embedded Python calculation engine. Derived variables can
be calculated with Python formulas or programs and these will be evaluated as
needed for use in any visualization.
Derived variables can also be calculated in IDL and imported into the current
visualization session. Variables can be calculated in other languages (e.g. NCL)
and adjoined to the Vapor Data Collection.
VAPOR requirements
VAPOR is supported on Linux, Mac, and Windows. VAPOR works best with a recent
graphics card (say 1-2 years old). The advanced features of VAPOR perform best with
nVidia or ATI graphics accelerators.
VAPOR is installed on NCAR visualization systems. Users with UCAR accounts can
connect their (windows or Linux) desktops to the NCAR visualization systems using
NCAR’s VNC-based remote visualization services, to run VAPOR and visualize the
results remotely. Instructions for using this are at:
http://www.cisl.ucar.edu/hss/dasg/index.php?id=docs/remote-vis
Contact dasg@ucar.edu for assistance.
Users are encouraged to provide feedback. Questions, problems, bugs etc. should be
reported to vapor@ucar.edu. The VAPOR development priorities are set by users as well
as by the VAPOR steering committee, a group of turbulence researchers who are
interested in improving the ability to analyze and visualize time-varying simulation
results. Post a feature request to the VAPOR SourceForge website
(http://sourceforge.net/projects/vapor), or e-mail vapor@ucar.edu if you have requests or
suggestions about improving VAPOR capabilities.
1. Install VAPOR
VAPOR installers for Windows, Macintosh and Linux are available on the VAPOR
download page, http://docs.vapor.ucar.edu/page/vapor-download.
For most users, a binary installation is fine. Installation instructions are also provided
in the VAPOR documentation pages, http://www.vapor.ucar.edu/docs/install.
Starting with VAPOR 2.0, you can directly load WRF-ARW output files into
VAPOR. However, if your data is very large, you will be able to visualize it more
interactively by converting it to a Vapor Data Collection (VDC). This conversion
process is described in detail in the VAPOR/WRF Data and Image Preparation Guide,
http://www.vapor.ucar.edu/docs/usage/wrfprep/WRFsupport.pdf.
VAPOR datasets consist of (1) a metadata file (file type .vdf) that describes an entire
VAPOR data collection, and (2) a directory of multi-resolution data files where the
actual data is stored. The metadata file is created by the command wrfvdfcreate, and
the multi-resolution data files are written by the command wrf2vdf. The simplest way
to create a VAPOR data collection is as follows:
where: wrf_files is a list of one or more wrf output files that you want to use.
metadata_file.vdf is the name that you will use for your metadata file.
For example, if the entire data is in one wrfout d02 file one could issue the
following command to create the metadata file "wrfout.vdf"::
using the same arguments (in reversed order) as you used with wrfvdfcreate. Note
that wrf2vdf does most of the work, and may take a few minutes to convert a large
WRF dataset.
After issuing the above commands, all of the 2D and 3D variables on the spatial grid
in the specified WRF output files will be converted, for all the time steps in the files.
If you desire more control over the conversion process, there are many additional
options that you can provide to wrfvdfcreate and wrf2vdf. Type the command with
the argument “-help” to get a short-listing of the command usage. All data
conversion options are detailed in section 1 of the VAPOR/WRF Data and Image
Preparation Guide (http://www.vapor.ucar.edu/docs/usage/wrfprep/WRFsupport.pdf).
Some of the options include:
From the command line, issue the command “vaporgui”, or double-click the VAPOR
desktop icon (on Windows or Mac). This will launch the VAPOR user interface.
To directly import WRF-ARW (NetCDF) output files, click on the Data menu, and
select “Import WRF output files into default session”. Then select all the wrfout files
you want to visualize and click “open”. If instead you converted your data to a
VAPOR Data Collection, then, from the Data menu, choose “Load a dataset into
default session”, and select the metadata file that you associated with your converted
WRF data.
To visualize the data, select a renderer tab (DVR, Iso, Flow, 2D, Image, or
Probe), chose the variable(s) to display, and then, at the top of the tab, check the
box labeled “Instance:1”, to enable the renderer. For example, the above top
image combines volume, flow and isosurface visualization with a terrain image.
The bottom image illustrates hurricane Ike, as it made landfall in 2008. The Texas
terrain has a map of US Counties applied to it, and an NCL image of accumulated
rainfall is shown at ground level in the current region.
For a quick overview of capabilities of VAPOR with WRF data, see “Getting started
with VAPOR and WRF,”
http://www.vapor.ucar.edu/docs/usage/wrfstart/WRFGetStarted.pdf.
Several documents on the VAPOR website (http://www.vapor.ucar.edu) are provided
for visualization of WRF data. Additional resources are available in the VAPOR user
interface to help users quickly get the information they need, and showing how to
obtain the most useful visualizations:
Table of Contents
• Introduction
• read_wrf_nc
• iowrf
• p_interp
• TC Bogus Scheme
• v_interp
• Tools
Introduction
This chapter contains a number of short utilities to read and manipulate WRF-ARW data.
Also included in this chapter are references to some basic third part software, which can
be used to view/change input and output data files.
read_wrf_nc
What is the difference between this utility and the netCDF utility ncdump?
• This utility has a large number of options, to allow a user to look at the specific
part of the netCDF file in question.
• The utility is written in Fortran 90, which will allow users to add options.
•
This utility can be used for both WRF-ARW and WRF-NMM cores.
It can be used for geogrid, metgrid and wrf input / output files.
Only 3 basic diagnostics are available, pressure / height / tk, these can be activated with
the -diag option (these are only available for wrfout files)
Compile
The code should run on any machine with a netCDF library (If you port the code to a
different machine, please forward the compile flags to wrfhelp@ucar.edu)
To compile the code, use the compile flags at the top of the utility.
Run
./read_wrf_nc wrf_data_file_name [-options]
Options: (Note: options [-att] ; [-t] and [-diag] can be used with other
options)
-h / help Print help information.
-att Print global attributes.
-m Print list of fields available for each time, plus the min and max
values for each field.
-M z Print list of fields available for each time, plus the min and max
values for each field.
The min and max values of 3d fields will be for the z level of the
field.
-s Print list of fields available for each time, plus a sample value for
each field.
Sample value is taken from the middle of model domain.
-S x y z Print list of fields available for each time, plus a sample value for
each field.
Sample value is at point x y z in the model domain.
-t t1 [t2] Apply options only to times t1 to t2.
t2 is optional. If not set, options will only apply to t1.
-times Print only the times in the file.
-ts Generate time series output. A full vertical profile for each
variable will be created.
-ts xy X Y VAR VAR …..
will generate time series output for all VAR’s at location X/Y
-ts ll lat lon VAR VAR …..
will generate time series output for all VAR’s at x/y location
nearest to lat/lon
-lev z Work only with option –ts
Will only create a time series for level z
-rot Work only with option –ts
Will rotate winds to earth coordinates
-diag Add if you want to see output for the diagnostics temperature
(K), full model pressure and model height (tk, pressure, height)
-v VAR Print basic information about field VAR.
-V VAR Print basic information about field VAR, and dump the full field
out to the screen.
-w VAR Write the full field out to a file VAR.out
This option allows a user to read a WRF netCDF file, change a specific field and write it
BACK into the WRF netCDF file.
This option will CHANGE your CURRENT WRF netCDF file so TAKE CARE when
using this option.
ONLY one field at a time can be changed. So if you need 3 fields changed, you will need
to run this program 3 times, each with a different "VAR"
IF you have multiple times in your WRF netCDF file – by default ALL times for
variable "VAR" WILL be changed. If you only want to change one time period, also use
the “-t” option.
Make a COPY of your WRF netCDF file before using this option
ADD an IF-statement block for the variable you want to change. This is to
prevent a variable getting overwritten by mistake.
For REAL data arrays, work with array "data_real" and for INTEGER data arrays,
work with the array "data_int".
Example 1:
If you want to change all (all time periods too) values of U to a constant 10.0 m/s,
you would add the following IF-statement:
else if ( var == 'U') then
data_real = 10.0
Example 2:
If you want to change a section of the LANDMASK data to SEA points:
else if ( var == 'LANDMASK') then
data_real(10:15,20:25,1) = 0
Example 3:
Change all ISLTYP category 3 values into category 7 values (NOTE this is an
INTEGER field):
else if ( var == 'ISLTYP') then
where (data_int == 3 )
data_int = 7
end where
iowrf
This utility allows a user to do some basic manipulation on WRF-ARW netCDF files.
• The utility allows a user to thin the data; de-stagger the data; or extract a box from
the data file.
Compile
The code should run on any machine with a netCDF library (If you port the code to a
different machine, please forward the compile flags to wrfhelp@ucar.edu)
To compile the code, use the compile flags at the top of the utility.
Run
p_interp
This utility interpolates WRF-ARW netCDF output files to user specified pressure levels.
Several new capabilities are supported in p_interp since October 2010. These includes:
• The ability to output fields needed to create met_em files, which can be used as
input to real.exe. This output can be used to change the vertical resolution of
WRF input files. Output from p_interp can also be used as input to TC bogusing
or OBSGRID.
• A new namelist option is included to split input files containing multiple times
into multiple output files, each with a separate time.
• p_interp can be compiled and run in parallel to improve the time needed to
processes large input files.
• Output from p_interp can now also be read directly by MET
(http://www.dtcenter.org/met/users/index.php), removing the requirement to first
run WPP before WRF-ARW data can be process by the MET toolkit.
Compile
The code should run on any machine with a netCDF library (If you port the code to a
different machine, please forward the compile flags to wrfhelp@ucar.edu)
To compile the code, use the compile flags at the top of the utility.
split_output .false. .true. will output each time in the input file to a
separate output file.
If met_em_output is set to .true. in the namelist, other options also need to be set:
split_output = .true.
unstagger_grid = .false.
extrapolate = 1
process = 'all'
If you do not set any of the first 3 options as shown above, they will be reset
automatically in the code. If process is set to 'list', the code will stop and the user
will have to set process to 'all'.
Also note that p_interp will stop if met_em* files already exist in the
path_to_output directory. This is to reduce the change of overwriting any met_em*
files created by metgrid.exe.
Run
./p_interp
For distributed memory systems, some form of mpirun will be needed to run the
executable. To run p_interp (compiled with parallel options) interactively, and using x
processors, the command may look like:
On some systems parallel interactive jobs may not be an option, in which case the
command would be
mpirun ./p_interp
run in a batch script. On some IBM systems, the parallel job launcher may be poe or
mpirun.lsf rather than mpirun.
TC Bogus Scheme
The ARW core for the WRF modeling system provides a simple Tropical Cyclone (TC)
Bogussing scheme. It can remove an existing tropical storm, and may optionally bogus in
a Rankine vortex for the new tropical storm. The input to the program is a single time-
period and single domain of metgrid data, and a few namelist variables from the
namelist.input file describing the bogus TC’s location and strength. The output is
also a metgrid-like file. The scheme is currently only set up to process isobaric data.
After running the tc.exe program, the user must manually rename the files so that the
real.exe program can read the modified input.
Namelist Options
The namelist information for the TC scheme is located in an optional namelist record
&tc. Only a single domain is processed. Users with multiple domains should
horizontally interpolate the generated meteorological fields to the fine-grid domains.
Alternatively, users may run the tc.exe program on separate metgrid output files for
different domains, though this is not recommended.
The value for vmax_ratio should be about 0.75 for a 45-km domain and about 0.90
for a 15-km domain. This is a representativeness scale factor. The observed maximum
wind speed is not appropriate for an entire grid cell when the domain is fairly coarse.
For example, assume that a cyclone report came in with the storm centered at 25o N and
75o W, where the maximum sustained winds were observed to be 120 kts, with the
maximum winds about 90 km from the storm center. With a 45-km coarse grid model
domain, the namelist.input file would be:
&tc
insert_bogus_storm = .true.
remove_storm = .false.
latc_loc = 25.0
lonc_loc = -75.0
vmax_meters_per_second = 61.7
rmax = 90000.0
vmax_ratio = 0.75
/
Program tc.exe
The program tc.exe is automatically built along with the rest of the ARW executables.
However this is a serial program. For the time being, it is the best to build this program
using serial and no-nesting options.
Running tc.exe
1) Run all of the WPS programs as normal (geogrid, ungrib, and metgrid).
2) As usual, link in the metgrid output files into either the test/em_real or the run
directory
3) Edit the namelist.input file for usage with the tc.exe program. Add in the
required fields from the &tc record, and only process a single time period.
4) Run tc.exe
5) Rename the output file, auxinput1_d01_<date> to the name that the
real.exe program expects, met_em.d01.<date>, note that this will overwrite
your original metgrid.exe output file for the initial time period.
6) Edit the namelist.input file to process all of the time periods for the real.exe
program.
v_interp
This utility can be used to add vertical levels in WRF-ARW netCDF input. An example
of the usage would be one-way nesting via program ndown. Since program ndown does
not do ‘vertical nesting’ prior to Version 3.2, namely adding vertical levels, this program
can be used after running ndown to achieve the same results. Starting from Version 3.2,
vertical levels may be added in program ndown via namelist option
‘vert_refine_fact’, which allows one to refine vertical levels by an integer factor.
The v_interp utility program can be obtained from the WRF Download page
(http://www.mmm.ucar.edu/wrf/users/download/get_source.html)
Compile
The code should be easily built and run on any machine with a netCDF library. To
compile the code, use the compile flags shown at the top of the utility program.
e.g., for a LINUX machine and pgf90 compiler, one may type:
Run
Edit the namelist file namelist.v_interp (see namelist options below) for the
number of new vertical levels (nvert) and the new set of levels (nlevels). To find
out the existing model levels, check the original WRF namelist.input file used to
create the input files, or type the following:
where file is the input file you want to add the vertical levels to, and file_new is the
output file that contains more vertical levels. To run the program for wrfinput file,
type
namelists:
&newlevels
nvert Number of new vertical levels (statggered)
nlevels Values of new model levels
Program Notes:
When adding vertical levels, please keep the first and the last half levels the same as in
the input file itself. Problem may occur if levels are added outside the range.
For wrfbdy file, please keep the input file name as wrfbdy_* since the program keys on
the file name in order to do the interpolation for special boundary arrays.
proc_oml.f
Compile
To compile the code, use the compile flags shown at the top of the utility program.
For example, for a LINUX machine and pgf90 compiler one may type:
Run
constant_name = ‘MLD’,
V3.2 WPS/metgrid has the additional fields in METGRID.TBL for proper horizontal
interpolation. For more information, please refer to presentation at
http://www.mmm.ucar.edu/wrf/users/tutorial/hurricanes/AHW_nest_ocean.pdf
Tools
Below is a list of tools that are freely available that can be used very successfully to
manipulate model data (both WRF model data as well as other GRIB and netCDF
datasets).
Converting Graphics
ImageMagick
ImageMagick cannot convert ncgm (NCAR Graphics) file format to other file
formats.
NCAR Graphics has tools to convert ncgm files to raster file formats. Once files
are in raster file format, ImageMagick can be used to translate the files into other
formats.
For ncgm files containing multiple frames, first use med (metafile frame editor)
and then ctrans. med will create multiple single frame files called medxxx.ncgm
med -e '1,$ split $' file.ncgm
ctrans -d sun_ med001.ncgm > med001.ras
The WRF model is run on any Unix/Linux machine. Some basic Unix commands
are required to work in this environment. There are numerous web sites one can
visit to learn more about basic and advance Unix commands. A couple of basic
Unix commands are listed below, as well as some web sites where users can
obtain more information.
http://mally.stanford.edu/~sr/computing/basic-unix.html
http://pangea.stanford.edu/computing/unix/shell/commands.php
http://www.math.harvard.edu/computing/unix/unixcommands.html
http://www.washington.edu/computing/unix/unixqr.html
http://www.kb.iu.edu/data/afsk.html
http://en.wikipedia.org/wiki/List_of_Unix_utilities
http://members.unine.ch/philippe.renard/unix2.html
http://www.cs.colostate.edu/helpdocs/vi.html
Both utilities read the domain setup from namelist.wps and create a graphical
output of the model domain.
WPS/util/plotgrids.exe
Is a Fortran program, which creates an ncgm file that can be viewed with the
NCAR Graphics command “idt”, e.g.,
idt gmeta
WPS/util/plotgrids.ncl
Is an NCL script, which can either plot the domain on screen, or create a
variety of different output types (pdf, ps, ncgm). This script must be run
in the same directory where the namelist.wps resides.
If you have created intermediate files manually, it is a very good practice to use
this utility to display the data in your files first before running WPS/metgrid/exe.
Note: If you plan on manually creating intermediate files, refer to
http://www.mmm.ucar.edu/wrf/OnLineTutorial/WPS/IM_files.htm for detailed
information about the file formats and sample programs.
This utility reads intermediate files and creates an ncgm file that can be viewed
with the NCAR Graphics command “idt”, e.g.,
idt gmeta
netCDF data
Documentation:
http://www.unidata.ucar.edu/ (General netCDF documentation)
http://www.unidata.ucar.edu/software/netcdf/fguide.pdf (NETCDF User’s Guide
for FORTRAN)
Utilities:
ncdump
Part of the netCDF libraries. Reads a netCDF file and prints information about the
dataset. e.g.
ncdump –h file (print header information)
ncdump –v VAR file (print header information and the
full field VAR)
ncdump –v Times file (a handy way to see how many
times are available in a WRF output file)
ncview
Display netCDF data graphically. No overlays, no maps and no manipulation of
data possible.
http://meteora.ucsd.edu/~pierce/ncview_home_page.html
ncBrowse
Display netCDF data graphically. Some overlays, maps and manipulation of data
are possible.
http://www.epic.noaa.gov/java/ncBrowse/
read_wrf_nc
A utility to display basic information about WRF netCDF files.
iowrf
A utility to do some basic file manipulation on WRF-ARW netCDF files.
p_interp
A utility to interpolate WRF-ARW netCDF output files to user specified pressure
levels.
netCDF operators
http://nco.sourceforge.net/
Stand alone programs to, which can be used to manipulate data (performing grid
point averaging / file differencing / file ‘appending’). Examples of the available
operators are ncdiff, ncrcat, ncra, and ncks.
ncdiff
Difference two file, e.g.
ncdiff input1.nc input2.nc output.nc
ncrcat
Write specified variables / times to a new file, e.g.
ncrcat -v RAINNC wrfout* RAINNC.nc
ncrcat -d Time,0,231 –v RAINNC wrfout* RAINNC.nc
ncra
Average variables and write to a new file, e.g.
ncra -v OLR wrfout* OLR.nc
GRIB data
Documentation
http://dss.ucar.edu/docs/formats/grib/gribdoc/ (Guide to GRIB 1)
http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc.shtml (Guide to
GRIB2)
http://www.nco.ncep.noaa.gov/pmb/docs/grib2/GRIB2_parmeter_conversion_tabl
e.html (GRIB2 - GRIB1 parameter conversion table)
GRIB codes
It is important to understand the GRIB codes to know which fields are available in
your dataset. For instance, NCEP uses the GRIB1 code 33 for the U-component
of the wind, and 34 for the V-component. Other centers may use different codes,
so always obtain the GRIB codes from the center you get your data from.
GRIB2 uses 3 codes for each field - product, category and parameter.
We would most often be interested in product 0 (Meteorological products).
Category refers to the type of field, e.g., category 0 is temperature, category 1 is
moisture and category 2 is momentum. Parameter is the field number.
So whereas GRIB1 only uses code 33 for the U-component of the wind, GRIB2
will use 0,2,2, for the U-component, and 0,2,3 for the V-component.
GRIB1 data
WPS/util/g1print.exe
wgrib (http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html)
GRIB2 data
WPS/util/g2print.exe
wgrib2 (http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/)
Model Verification
http://www.dtcenter.org/met/users/index.php
Appendix A: WRF-Fire
Table of Contents
• Introduction
• WRF-Fire in idealized cases
• Fire variables in namelist.input
• namelist.fire
• Running WRF-Fire on real data
◦ Building the code
◦ Fire variables in namelist.wps
◦ Geogrid
◦ Conversion to geogrid format
◦ Editing GEOGRID.TBL
◦ Ungrib and Metgrid
◦ Running real case and WRF-Fire
• Fire state variables
• WRF-Fire software
◦ WRF-Fire coding conventions
◦ Parallel execution
◦ Software layers
◦ Initialization in idealized case
Introduction
A wildland fire module has been added to WRF ARW to allow users to model the growth
of a wildland fire and the dynamic feedbacks with the atmosphere. It is implemented as a
physics package with two-way coupling between the fire behavior and the atmospheric
environment allowing the fire to alter the atmosphere surrounding it, i.e. ‘create its own
weather’. Here we address the mechanics, options, parameters, and datasets for using this
module.
The wildland fire module is currently a simple two-dimensional model of a surface fire,
that is, a fire that spreads through fuels on the ground, such as grass, shrubs, and the litter
from trees that has fallen to the surface. It does not yet contain the algorithms needed to
represent crown fires, which consume and spread through the tree canopies. The user
specifies the time, location, and shape of a fire ignition. The evolution of the fireline, the
interface enclosing the burning region, is implemented by the level set method. The level
set function is advanced by the Runge-Kutta method of order 2, with spatial discretization
by the Godunov method. The rate at which this interface expands is calculated at all
points along it using a point-based semi-empirical formula for estimating the rate of
spread of the surface fire based upon the Rothermel (1972) formula, which calculates the
fire rate of spread as a function of local fuel conditions, wind, and terrain slope. A semi-
empirical formula is used as a parameterization since turbulent combustion cannot be
resolved at the spatial scales of atmospheric models; thus, all physical processes involved
in propagating the fire are assumed to be represented in this relationship. Importantly,
the winds used to drive the fire are interpolated from nearby low-level wind velocities,
interpolated by a log profile to a height specified by the user, which are themselves
perturbed by the fire. Once the fireline has passed by, the ignited fuel continues to burn -
the mass of fuel is assumed to decay exponentially with time after ignition, the rate
depending on the size of the fuel particles making up the fuel complex: fine fuels such as
grass are consumed rapidly, while fuels with larger diameters such as twigs and downed
logs are consumed slowly. The fuel burned in each time step is converted to sensible and
latent heat source terms for the lowest levels of the WRF atmospheric model state, where
the water vapor source arises from the release of the intrinsic moisture in cellulosic fuels
and the additional moisture absorbed by fuels from their environment, the fuel moisture
content. The e-folding depth over which the heat and vapor distributed is set by the user,
based on results from wildland fire measurements. The fire may not progress to
locations where the local fuel moisture content is greater than the moisture content of
extinction.
Additional parameters and datasets beyond a standard WRF atmospheric simulation are
required and are described here. The surface fuel available to be burned at each point is
categorized using the Anderson classification system for “fuel models” (3 grass-
dominated types, 4 shrub-dominated types, 3 types of forest litter, and 3 levels of logging
slash) which we will henceforth refer to as “fuel categories” to limit confusion. Each of
these fuel categories is assigned a set of typical properties consisting of the fuel load (the
mass per unit area) and numerous physical properties having to do with fuel geometry,
arrangement, and physical makeup. The user may make the fuels spatially homogeneous
by using one fuel category for the whole domain, alter fuel properties, add custom fuel
categories, or (for real data experiments) project a spatially heterogeneous map of fuel
categories onto the domain from fuel mapping datasets. The user also sets the number of
ignitions, their time, location, and shape, and the fuel moisture content, an important
factor in fire behavior.
One time step of the fire model is performed for every WRF time step. The fire model
runs on a refined grid that covers the same region as the innermost WRF domain. The fire
module supports both distributed and shared memory parallel execution.
Other References
./compile em_fire
to build WRF for one of the several supplied ideal examples. This will create the links
wrf.exe and ideal.exe in the directory test/em_fire. The examples are in its
subdirectories. The links wrf.exe and ideal.exe in the subdirectories point to the
parent directory.
cd test/em_fire
cp examples/small/* .
./ideal.exe
./wrf.exe
There are several more variables in the namelist for developers’ use only to further
develop and tune the numerical methods. Do not alter unless directed to do so.
namelist.fire
This file serves to redefine the fuel categories if the user wishes to alter the default fuel
properties.
Running WRF with real data is a complicated process of converting data formats and
interpolating to the model grid. This process is simplified by the WRF Preprocessing
System (WPS). The purpose of this section is to summarize the use of this system and to
highlight the differences in its use between fire and ordinary atmospheric simulations.
For more complete documentation of WPS, see Chapter 3 of the WRF-ARW User’s
Guide.
The WPS can be configured from inside the top level directory wrf-fire/WPS with the
command
./configure
Upon successful completion the three binaries listed above should exist in the current
directory.
Because the WPS programs are, for the most part, not processor intensive, it is not
generally necessary to compile these programs for parallel execution, even if they do
support it. Typical usage of WRF with real data involves doing all of the preprocessing
work either locally on a workstation or on the head node of a supercomputer. The
intermediate files are all architecture independent, so they can be transferred between
computers safely. If you intend to use a supercomputer for the main simulation, it is
advisable to generate the WPS output locally and transfer the met_em files to the
computer you will be using for WRF-Fire. The met_em files are much smaller than the
wrfinput and wrfbdy files and can be transported easily. This also eases the process of
dealing with the dependencies of the python scripts described below because it may not
be easy or even possible to meet these requirements on a shared parallel computer.
The simulation domain is described in the file namelist.wps. This namelist contains
four sections, one for each of the main binaries created in WPS and one shared among
them all. This file, as distributed with WRF-Fire, is set up for a test case useful for
testing, but in general one needs to modify it for each simulation domain. The following
table lists namelist options that can be modified. Other options in this file are generally
not necessary to change for WRF-Fire simulations. See the WRF-ARW User’s Guide for
more information.
Geogrid
The geogrid executable acts exclusively on static datasets (those that don’t change from
day to day) such as surface elevation and land use. Because these datasets are static, they
can be obtained as a single set of files from the main WPS distribution website in
resolutions of 10 minutes, 2 minutes, and 30 seconds. The geogrid executable extracts
from these global data sets what it needs for the current domain. While resolutions of
this magnitude are acceptable for ordinary atmospheric simulations, these datasets are too
coarse for a high-resolution fire simulation. In particular, a WRF-Fire simulation will
require two additional data sets not present in the standard data.
NFUEL_CAT
The variable NFUEL_CAT contains Anderson 13 fuel category data. This data can be
obtained for the US from the USGS seamless data access server at:
http://landfire.cr.usgs.gov/viewer/. Using the zooming and panning controls, the user can
select the desired region with LANDFIRE 13 Anderson Fire Behavior Fuel Models box
selected. This will open a new window where the user can request the data in specific
projections and data formats.
ZSF
The variable ZSF contains high resolution terrain height information similar to that in the
HGT variable present in atmospheric simulations; however, the standard topographical
data set is only available at a maximum resolution of 30 arc seconds (about 900 meters).
For a simulation using the WRF-Fire routines, data resolution of at least 1/3 of an arc
second is desirable to include the effect of local terrain slope on the rate of spread. Such
a dataset is available for the US at http://seamless.usgs.gov/. This is another USGS
seamless data access server similar to that of LANDFIRE. The desired dataset on this
Once one has collected the necessary data from USGS servers or elsewhere, it is
necessary to convert it from the given format (such as geotiff, Arcgrid, etc.) into geogrid
format. The format specification of the geogrid format is given in the WPS section of the
WRF users guide. The process of this conversion is somewhat technical; however, work
is in progress to automate it.
Editing GEOGRID.TBL
In order to include your custom data into the WPS output, you must add a description of
it in the GEOGRID.TBL file, which is located, by default, in the geogrid subdirectory of
the main WPS distribution. In addition to the standard options described in the WPS
users guide, there is one additional option that is necessary for defining data for fire grid
variables. For them, there is a subgrid option, which is off by default. For fire grid data,
one should add the option subgrid=yes to indicate that the variable should be defined on a
refined subgrid with a refinement ratio defined by the subgrid_ratio_[xy] option in the
WPS namelist. For example, typical table entries would appear as follows:
===============================
name=NFUEL_CAT
priority=1
dest_type=categorical
dominant_only=NFUEL_CAT
z_dim_name=fuel_cat
halt_on_missing=yes
interp_option=default:nearest_neighbor+average_16pt+search
rel_path=default:landfire/
subgrid=yes
==============================
name = ZSF
priority = 1
dest_type = continuous
halt_on_missing=yes
interp_option = default:four_pt
rel_path=default:highres_elev/
subgrid=yes
This table assumes that the converted data resides as a subdirectory of the standard data
directory given in the namelist under the option geog_data_path. The NFUEL_CAT data
should reside in landfire/ and ZSF in highres_elev/. In general, the only options that
should be modified by the user are the rel_path or abs_path options.
Once the data has been obtained and converted and the geogrid table has been properly
set up, the user can run:
./geogrid.exe
which will create files such as geo_em.d01.nc that contain the interpolated static data
fields.
The ungrib executable performs initial processing on atmospheric data. There are many
different datasets that can be used as input to ungrib. One must obtain this data manually
for a given simulation. Because fire simulations will be at a much higher resolution than
most atmospheric simulations, it is advisable to get as high resolution data as possible.
The 32 km resolution data from the North American Regional Reanalysis (NARR) is
likely a good choice. This data is available freely from
https://dss.ucar.edu/datazone/dsszone/ds608.0/NARR/3HRLY_TAR/. For real data WRF
runs, three individual datasets from this website are required: 3d, flx, and sfc. To use
them, download the files for the appropriate date/time and extract them somewhere on
your file system. The files have the naming convention, NARR3D_200903_0103.tar.
NARR indicates it comes from the NARR model, 3D indicates that it is the atmospheric
data fields, and 200903_0103 indicates that it contains data from March 1st through 3rd of
2009. Once these files are extracted, they must be linked into the main WPS directory
with the command link_grib.csh. It takes as arguments all of the files extracted from the
dataset. For example, if you extracted these files to /home/joe/mydata, then you
would issue the command:
./link_grib.csh /home/joe/mydata/*
into the top level WPS directory. Each atmospheric dataset requires a descriptor table
known as a variable table to be present. WPS comes with several variable tables that
work with most major data sources. These files reside in
WPS/ungrib/Variable_Tables/. The appropriate file must be linked into the top
level WPS directory as the file Vtable. For NARR data, type:
Once this has been done, everything should be set up properly to run the ungrib
command:
./ungrib.exe
Finally, the program metgrid combines the output of ungrib and geogrid to create a series
of files, which can be read by WRF’s real.exe. This is accomplished by
./metgrid.exe
Assuming everything completed successfully, you should now have a number of files
named something like met_em.d01.2009-03-01_12:00:00.nc. These should
be copied or linked to your WRFV3/test/em_real directory. If any errors occur
during execution of ungrib or metgrid, then make sure you have downloaded all of the
necessary atmospheric data and that the variable table and namelist are configured
properly.
First copy or link the met_em files generated by metgrid into test/em_real. If the
simulation is being done locally, this can be accomplished by running in wrf-
fire/WRFV3/test/em_real
ln –sf ../../../WPS/met_em* .
The namelist for WRF in the file namelist.input must now be edited to reflect the
domain configured in WPS. In addition to the fire-specific settings listed in Section 4.3
regarding the ideal simulation, a number of other settings must be considered as listed
below. See Chapter 5 for more details on these settings.
Variable Description
&time_control
start_xxx/end_xxx These describe the starting and ending date and time
of the simulation. They must coincide with the
start_date/end_date given in namelist.wps.
run_xxx The amount of time to run the simulation.
interval_seconds Must coincide with interval seconds from
namelist.wps.
restart_interval A restart file will be generated every x minutes. The
simulation can begin from a restart file rather than
wrfinput. This is controlled by the namelist variable
‘restart’.
&domains All grid settings must match those given in the
geogrid section of namelist.wps.
num_metgrid_levels The number of vertical levels of the atmospheric data
being used. This can be determined from the met_em
files:
ncdump -h met_em* | grep
'num_metgrid_levels ='
sr_x/sr_y Fire grid refinement. This must match that given in
namelist.wps as subgrid_ratio_x/subgrid_ratio_y.
p_top_requested The default is 5000, but may need to be edited if there
is an error executing real. If so, just set this to
whatever it tells you in the error message.
./real.exe
./wrf.exe
A number of array variables were added to the registry to the WRF state in order to
support the fire model. They are available in the wrfout* files created when running
WRF. All fire array variables are based at the centers of the fire grid cells. Their values in
the strips at the upper end of width sr_x in the x direction and sr_y in the y direction
are unused and are set to zero by WRF.
The following variables can be used to interpret the fire model output.
WRF-Fire software
This section is intended for programmers who wish to modify or extend the fire module.
The fire module resides in WRF physics layer and conforms to WRF Coding
Conventions. The wildland fire-related subroutines maintain the conventions as they
apply to on atmospheric grids, adapts them to 2D surface-based computations, and
follows analogous conventions on the fire grid. In particular, these routines may not
maintain any variables or arrays that persist between calls, and may not use common
blocks, allocatable variables, or pointer variables. Work arrays with variable bounds may
be declared only as automatic; thus, they are freed between on exit from the subroutine
where they are declared. All grid-sized arrays that should persist between calls to the
wildland fire-related subroutines must be created in WRF through the registry
mechanism, and passed to these as arguments.
In addition, the wildland fire-related subroutines may not call any WRF routines directly
but only through a utility layer. This is so that routines can be easily run standalone or
coupled with another weather code. All variables in the wildland fire-related subroutines
are based at grid centers. Grid dimensions are passed in argument lists as
In loops that need to index more than one grid at the same time (such as computations on
a submesh, or interpolation between atmosphere and fire) the index variable names must
always begin with i j.
Parallel execution
In these routines, all computational subroutines are called from a thread that services a
single tile. There is no code running on a patch. Loops may update only array entries
within in the tile but they may read other array entries in adjacent tiles, for example for
interpolation or finite differences. The values of arrays that may be read between adjacent
tiles are synchronized outside of the computational routines. Consequently, the values of
a variable that was just updated may be used from an adjacent tile only in the next call to
the computational subroutines, after the required synchronization was done outside.
Synchronization within a patch is by exiting the OpenMP loop. Synchronization of the
values between patches is by explicit HALO calls on the required variables and with the
required width. HALOs are provided by the WRF infrastructure and specified in the
registry.
The overall structure of the parallelism is spread over multiple software layers,
subroutines and source files. The computation is organized in stages, controlled by the
value of ifun.
do ifun=ifun_start,ifun_end ! what to do
Software layers
associated initialization.
The initialization of model arrays in the idealized case is done in the file
dyn_em/module_initialize_fire.F
This file was adapted from other initialization files in the same directory and extended to
deal with wildland fire-related variables.
Because of the fine meshes used in fire modeling, the user may wish to search for the text
grid%znw(k) and modify the following loop to assure a desired refinement of the
vertical atmospheric grid near the Earth surface:
DO k=1, kde
grid%znw(k) = (exp(-(k-1)/float(kde-1)/z_scale) &
- exp(-1./z_scale))/(1.-exp(-1./z_scale)
ENDDO
b Topography
The terrain height needs to be set consistently in the atmosphere model in the array
grid%ht and in the fire model array grid%zsf at the finer resolution. In the supplied
It is possible, though not recommended, to set only grid%ht and have the fire module
interpolate the terrain height from the atmosphere mesh by specifying
fire_topo_from_atm=1 in namelist.input. This will result in blocky terrain with
discontinuous terrain gradients, which will affect fire spread patterns.
Note that in a real run, the user should leave fire_topo_from_atm=0 and both
terrain height arrays are set consistently at the best available resolution from the WPS.
The user should not modify the code immediately after the setting of the terrain height
arrays, which initializes a number of atmosphere variables consistently with the terrain
height.