; ; Note: This example will not run with Version 4.1 or earlier of NCL. ; If you are licensed for version 4.1 of NCAR Graphics and are ; interested in getting a *test* version of NCL that will work with ; this example, send email to ncargfx@ucar.edu. ; ; This example makes use of the GSUN functions and procedures for ; generating graphics. If you would like more information on GSUN, ; go to the URL: http://ngwww.ucar.edu/ngdoc/ng/ug/ncl/gsun/ ; load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" ; Load the NCL file ; that contains the gsn_* ; functions used below. begin ; ; Open a netCDF file to read from. ; cdf_file = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/contour.cdf","r") temp = cdf_file->T(0,0,:,:) -273.15 ; Read in temperature at first ; time and first level and ; convert from K to C. wks = gsn_open_wks("x11","example4") ; Open an X11 window. ; ; Change the color map. ; setvalues wks "wkColorMap" : (/"white", "black", "red","blue","green","yellow","orange",\ "gray5", "gray9","gray13","gray17","gray21","gray25",\ "gray29","gray33","gray37","gray41","gray45","gray49",\ "gray53","gray57","gray61","gray65","gray69"/) end setvalues cnres = True ; Variable to hold contour plot resources. ; ; Turn on fill for contour levels and define the colors for each level. ; cnres@cnFillOn = True cnres@cnFillColors = (/ "blue", "gray9","gray13","gray17","gray21",\ "gray25","gray29","gray33","gray37","gray41",\ "gray45","gray49","gray53","gray57","gray61",\ "gray65", "red"/) cnres@cnInfoLabelOn = False ; Turn off the info label. cnres@cnLineLabelsOn = False ; Turn off contour line labels. cnres@pmLabelBarDisplayMode = "Always" ; Turn on labelbar. cnres@lbPerimOn = False ; Turn off labelbar perimeter. cnres@tiMainString = ":F26:Temperature (:S:o:N:C)" ; Main title. map = gsn_contour(wks,temp,cnres) ; Draw contour plot. Frame is ; advanced by gsn_contour. end