ncl 製圖

msl

原始碼:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
	filename = "http://motherlode.ucar.edu:8080/thredds/dodsC/fmrc/NCEP/GFS/Global_0p5deg/runs/NCEP-GFS-Global_0p5deg_RUN_2011-04-18T06:00:00Z"
	f1 = addfile(filename,"r")
	fsd=f1->Pressure_reduced_to_MSL(time|2,{lat|8:42},{lon|90:146})
	lat  = fsd&lat
	lon  = fsd&lon
	fsd = fsd/100
	fsd@units     = "hPa"
	;**************************************
	;   Create plot
	;***************************************
	wks_type = "png"
	wks_type@wkWidth = 1000
	wks_type@wkHeight = 800
	wks  = gsn_open_wks(wks_type, "msl")

	gsn_define_colormap(wks,"BlGrYeOrReVi200")         ; choose color map
	i = NhlNewColor(wks,0.8,0.8,0.8)                   ; add gray to colormap

	res				= True             ; plot mods desired
	res@gsnMaximize			= True
	res@cnFillOn                    = False
	res@cnLinesOn                   = True
	res@cnLevelSpacingF             = 1             ; contour spacing
        res@cnSmoothingOn		= True
	res@gsnSpreadColors             = True             ; use full color map
	res@gsnSpreadColorEnd           = -3               ; don't use added gray
	res@mpDataBaseVersion           = "Ncarg4_1"       ; use finer database
	res@pmTickMarkDisplayMode       = "Always"         ; turn on tickmarks
	res@gsnAddCyclic                = False            ; regional data, don't add pt
	res@mpProjection                = "mercator"       ; projection
	res@mpLimitMode                 = "Corners"        ; method to zoom
	res@mpLeftCornerLatF            = min(lat)
	res@mpLeftCornerLonF            = min(lon)
	res@mpRightCornerLatF           = max(lat)
	res@mpRightCornerLonF           = max(lon)
	res@tfDoNDCOverlay              = True

	plot = gsn_csm_contour_map (wks,fsd,res)    ; create plot

end


本文連結