Graphics: NCL - Example

Below is a series of basic plots showing how to create a plot for WRF ARW data. The basic plotting techniques shown here can be used for any wrf data file.

       

    wrf_wps_ter1.ncl

    In this plot no special WRF functions are used.

    A single field is simply read from the file
    ter = a->HGT_M(0,:,:)

    and plotted
    plot = gsn_contour(wks,ter,True)

       

    wrf_wps_ter2.ncl

    Add shading to the plot
    res = True
    res@cnFillOn = True
    res@gsnSpreadColors = True
    plot = gsn_contour(wks,ter,res)

       

    wrf_wps_ter3.ncl

    Change the plot levels
    res@cnLevelSelectionMode = "ManualLevels"
    res@cnMinLevelValF = 0.
    res@cnMaxLevelValF = 1000.
    res@cnLevelSpacingF = 50.

       

    wrf_wps_ter4.ncl

    Up to now none of the plots had a map background. Adding a map over WRF ARW data is not trivial, so let's rather use some special WRF-NCL scripts to do this.

    Make sure to first load the special scripts:
    load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

    Create the color fill terrain plot (add a header at the same time):
    opts = True
    opts@MainTitle = "GEOGRID FIELDS"
    res = opts
    res@cnFillOn = True ; Create a color fill plot
    contour = wrf_contour(a,wks,ter,res)

    Overlay plot onto a map (using default plot and map setting):
    pltres = True
    mpres = True
    plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)


       

    wrf_wps_ter5.ncl

    Change the default plot levels before creating the plot:
    res = opts
    res@cnFillOn = True ; Create a color fill plot
    res@ContourParameters = (/ 0., 1000., 50. /)
    contour = wrf_contour(a,wks,ter,res)

       

    wrf_wps_ter6.ncl

    Remove initial time and footers from plots:
    opts = True
    opts@InitTime = False
    opts@Footer = False

    Change the default map and grid color to Black:
    mpres = True
    mpres@mpGeophysicalLineColor = "Black"
    mpres@mpGridLineColor = "Black"
    mpres@mpLimbLineColor = "Black"
    mpres@mpNationalLineColor = "Black"
    mpres@mpPerimLineColor = "Black"
    mpres@mpUSStateLineColor = "Black"