Sie sind hier: Startseite / Services / Data Analysis and Visualization / Visualization / Software / NCL / examples / source_code / DKRZ NCL contour unstructured example
Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

DKRZ NCL contour unstructured example

NCL script to create a contour plot of unstructured data.

DKRZ NCL example script:

;-----------------------------------------------------------------
;  DKRZ NCL Example:  NCL_unstructured_grid.ncl
; 
;  30.10.14 kmf
;-----------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
;-- read the data and define
   diri = "$HOME/NCL/general/data/new_data/"
   fili  = "camse_unstructured_grid.nc"
   
   f     =  addfile(diri+fili, "r")
   var   =  f->T850
   lat1d =  f->lat
   lon1d =  f->lon
  
;-- define the workstation (plot type and name)
   wks = gsn_open_wks("png","plot_unstructured_grid")

;-- set resources
   res                       =  True
   res@gsnMaximize           =  True            ;-- maximize graphics output

   res@cnFillOn              =  True            ;-- turn on contour fill
   res@cnLinesOn             =  False           ;-- turn off contour lines
   res@cnLineLabelsOn        =  False           ;-- turn off line labels
   res@cnFillMode            = "RasterFill"     ;-- use CellFill method

   res@tiMainString          = "DKRZ NCL Example: unstructured grid (CAM-SE)"  ;-- title string
   res@tiMainFontHeightF     =  0.02            ;-- title font size

;-- lat/lon arrays of curvelinear frid for overlaying on map
   res@sfXArray              =  lon1d
   res@sfYArray              =  lat1d

;-- draw the contour map
   plot = gsn_csm_contour_map(wks,var,res)

end

Artikelaktionen