Data files for some examples
Example pages containing:
Using gsn_csm scripts to plot WRF-ARW data
The main purpose of this page is to show how to plot WRF-ARW data using
gsn_csm functions like gsn_csm_contour_map
For comparison purposes, some examples will also show how to plot the
same data using WRF-NCL functions
Here are some reasons you might want use gsn_csm_xxxx scripts over
- You want to have more control over customizing the plot.
- You want to use a different map projection than what is provided on the WRF-ARW
- You don't want all the extra titles that the wrf_xxxx functions give you.
Here are some reasons you might want use wrf_xxxx
scripts over gsn_csm_xxxx scripts:
- You will get some very nice titles.
- You get a labelbar title for color contour plots.
- The default vector plots created by
look nicer than those created by
Note that when you use the gsn_csm scripts for plotting WRF data, you
will need to set the necessary resources yourself for zooming in on
the map. For debug purposes, you can call the
wrf_map_resources routine and
then print out the resources that it set to see what kind of map
resources the wrf_map_overlays
would normally use.
For a whole suite of examples using NCL to plot WRF-ARW data, we
recommend that you visit the WRF-ARW
This example is similar to the previous one, except it shows how to
set some more plot resources to get a slightly nicer plot.
Just for informational purposes, this script calls
wrf_map_resources and prints
out the resultant resource list, so you can see what map resources
would normally be set by
wrf_map_overlays. Here's an example
of some of those resources:
pmTickMarkDisplayMode : "Always"
mpOutlineBoundarySets : "GeophysicalAndUSStates"
mpUSStateLineThicknessF : 0.5
mpUSStateLineColor : "Gray"
mpLimbLineThicknessF : 0.5
mpGridSpacingF : 5
mpGridLineThicknessF : 0.5
tmYLLabelFontHeightF : 0.01
This example shows how to plot WRF-ARW data using
, but using the
native map projection provided on the WRF output
file. The wrf_map_resources
function is used to set the correct map projection resources. This
can be useful if you want to use the native WRF map projection but you
need more control over plot elements, like the titles or labelbar.
The second image is of the same variable, but plotted with
The contour levels are slightly different because
increases the number of contour levels from the default
This example shows how to overlay line contours, vectors, and filled
contours on a map. The data and map projection are all read off a WRF
The first frame shows how to do this using gsn_csm_xxx
scripts, and the second frame shows how to do this using wrf_xxxx
Note that using the gsn_csm_xxxx method requires that you set
many more resources to customize the plot. This is because
the wrf_xxxx scripts set many of these resources for you.
The reason for using gsn_csm_xxxx scripts is to give
you more flexibility over setting plot options, and to use
a different map projection if desired.
This example is similar to the previous "wrf_gsn_5.ncl" one, except
it doesn't draw sea level pressure contours.
The point of this example is to show another way of drawing WRF
plots. This one uses gsnLeftString and
gsnRightString to title the plot,
and it changes more features of the WRF map to make the map outlines
more thick and prominent.
The second frame is plotting the same data, except using
Notice that with this plot, you get some very nice titling
without much effort.
The "HighRes" map database is used to get better coastal outlines.
If you want to use the "HighRes" map database, you will have to download the RANGS database.
This example regrids WRF output data to both a 0.25 and
0.125 degree grid, and compares them in a panel plot.
For the second image,
the gsn_coordinates procedure was
used to draw the lat/lon grid on all three plots.
This example shows how to generate streamlines of U10/V10, colored by
wind speed. It uses the
function, which was added in NCL Version 6.3.0.
The first plot shows the streamlines drawn in a basic lat/lon
projection, by reading the XLAT/XLONG data off the WRF output file and
attaching them as special "lat2d" and "lon2d" attributes to the data
The second plot shows the same streamlines drawn in the native WRF
map projection. It uses
wrf_map_resources to set the
correct map resources. Note that the special
resource tfDoNDCOverlay needs to be
set to True to tell NCL that the data is being plotted in a native
In the second plot, it's hard to see the map outlines. The
third plot shows how to set map resources to thicken the
map outlines and to make the streamlines less vivid.
This example shows two ways to create a 97-frame 4-panel animation
in NCL, with tips on how to speed things up.
The animation is filled contours of WRF reflectivity (across time and
four selected level indexes) overlaid on a WRF terrain plot. The
terrain plot is the same for each iteration, while the reflectivity
plots change for each time and level.
animate_4_1.ncl - this script
shows the traditional and "easy" way to do this, but also potentially
slower, by calling
and overlay each time in the loop.
animate_4_2.ncl - this script
shows how to speed this up a little by using "setvalues" on existing
reflectivity plots to simply change the data.
The timings on a Mac system were as follows:
"animate_4_1.ncl" - 163.0 seconds
"animate_4_2.ncl" - 129.8 seconds
Click on thumbnail image for an animation
The animation was created by generating a series of PNG images, and then
convert animate*.00*png animate_4.gif
: This example shows
how to overlay precipitation contours on a grayscale terrain map, using
transparency to control the colors for precipitation.
used to create the base terrain plot, and gsn_csm_contour
is used for the precipitation plot. wrf_map_resources
is used to get the correct map projection parameters as defined on the WRF file.
This script was contributed by Xiao-Ming Hu (email@example.com) at the
Center for Analysis and Prediction of Storms, University of Oklahoma.