User’s Guide for Advanced Research WRF (ARW) Modeling System Version 2
Chapter 8: Post-Processing Utilities
· NCL
· RIP4
· ARWpost
· WPP
· Tools
There are a number of visualization tools available to display WRF-ARW (http://wrf-model.org/) model data. Model data in netCDF format, can essentially be displayed using any tool capable of displaying this data format.
Currently the following post-processing utilities are supported, NCL, RIP4, ARWpost (converter to GrADS and Vis5D), and WPP.
NCL and RIP4 can currently only read data in netCDF format, while ARWpost can read data in netCDF and GRIB1 format, and 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.
Additional libraries required by each of the supported post-processing packages:
- NCL (http://www.ncl.ucar.edu/)
- GrADS (http://grads.iges.org/home.html)
- Vis5D (http://www.ssec.wisc.edu/~billh/vis5d.html)
-
GEMPAK (http://my.unidata.ucar.edu/content/software/gempak/index.html)
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.
Some example scripts are provided, but in order to fully utilize the functionality of the NCL Libraries, users should adapt these for their own needs, or write their own scripts.
NCL can process WRF ARW static/input and output files, as well as WRF-Var output data. Both single and double precision data can be processed.
What is NEW?
Up to July 2007, one
needed to install the NCL Libraries
(http://www.ncl.ucar.edu), AND the WRF_NCL package. (details’
regarding the old WRF_NCL package is available in Appendix B of this
User’s Guide).
In July 2007, the WRF_NCL package has been incorporated
into the NCL Libraries, thus only
the NCL Libraries, are now needed. NCL version 4.3.1 or higher is
required. (NOTE: some of the
built-in functions have been available since NCL version 4.3.0, but the
complete WRF-ARW package is only
available since version 4.3.1).
What has changed?
- The basic functions / procedures used in WRF_NCL has been moved in under the NCL libraries and are now located in "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/".
- 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 a user no longer need to compile these.
What is NCL
The NCAR Command Language (NCL) is a free interpreted language designed specifically for scientific data processing and visualization. NCL has robust file input and output. It can read in netCDF, HDF4, HDF4-EOS, GRIB, binary and ASCII data. The graphics are world class and highly customizable.
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/
To read more about NCL, please visit: http://www.ncl.ucar.edu/overview.shtml
Necessary software
NCL libraries (version 4.3.1 or higher).
.hlureasfile
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/users/graphics/NCL/.hluresfile)
*wkColorMap
: WhViBlGrYeOrReWh
*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.
Create NCL scripts
The basic outline of any NCL
script will look as follows:
|
load external functions and
procedures 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 Temperature and Wind as shown in the picture below.

|
; load functions and
procedures load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load
"$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" begin ; WRF ARW input file a
= addfile("../wrfout_d01_2000-01-24_12:00:00.nc","r") ; Output on screen. Output
will be called "plt_Surface1" type
= "x11" wks
= gsn_open_wks(type,"plt_Surface1") ; Set basic options ; Give our plot a main
title ; Set Footers off ARWres
= True ARWres@MainTitle
= "REAL-TIME WRF" ARWres@Footer
= False ;---------------------------------------------------------------
; Lets find out how many
times are in the datasets. times
= wrf_user_list_times(a) ; get times in the file ntimes
= dimsizes(times) ; number of times in the file it
= ntimes-1 ; we are only interested in the last time ARWres@TimeLabel
= times(it) ; keep some time information
; Create a MAP background mpres
= True map
= wrf_map(wks,a,mpres) ;--------------------------------------------------------------- ; Get variables tc2
= wrf_user_getvar(a,"T2",it) ; Get T2 (deg K) tc2
= tc2-273.16 ; Convert to deg C tf2
= 1.8*tc2+32. ; Turn temperature into Fahrenheit
tf2@description = "Surface Temperature"
tf2@units = "F" td_f = 1.8*td2+32. u10
= wrf_user_getvar(a,"U10",it) ; Get U10 v10
= wrf_user_getvar(a,"V10",it) ; get V10 u10
= u10*1.94386 ; Turn wind into knots v10
= v10*1.94386
u10@units = "kts"
v10@units = "kts" ;-------------------------------------------- |