;**************************************************** ; plotext.ncl ;***************************************************** load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ;*************************************** begin grib_file="fnl_20030416_00_00" fin = addfile(grib_file,"r") names = getfilevarnames(fin) print(names) atts = getfilevaratts(fin,names(0)) dims = getfilevardims(fin,names(0)) ; print(atts) ; print(dims) ; get vars var= fin->HGT_25_ISBL_10 lon= fin->lon_25 lat= fin->lat_25 ; lon2d= fin->lon_37 ; lat2d= fin->lat_37 ; print(var) printVarSummary(var) ; printVarSummary(lon) ; printVarSummary(lat) ; create plot wks = gsn_open_wks("ps","ext") ; open wk station gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap res = True ; plot mods desired res@cnFillOn = True ; turn on color fill res@cnLinesOn = False ; turn of contour lines ; res@cnLevelSpacingF = 0.5 ; contour spacing res@gsnSpreadColors = True ; use full range of color map ; res@lbLabelStride = 4 ; res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels res@gsnAddCyclic = True ; data already has cyclic point ; this must also be set for any zoom ; note that the gsn_csm_*map_ce templates automatically set ; res@mpLimitMode="LatLon" for you. If you are plotting a different projection, ; you may have to set this resource. res@mpMinLatF = min(lat) ; range to zoom in on res@mpMaxLatF = max(lat) res@mpMinLonF = min(lon) res@mpMaxLonF = max(lon) ; plot = gsn_csm_contour_map_ce(wks,var(0,{-60:30},{30:120})/100, res) plot = gsn_csm_contour_map_ce(wks,var(0,:,:)/10, res) ;************************************************ end