I am trying to get the script to zoom in on Mississippi, but I keep getting
the following error:
fatal:(gridlat_221) is not a named dimension in variable (u_wind).
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 41 in file
narr_ncl_template.ncl
This is my code:
;***************************************************************************
; narr_ncl_template.ncl
;
; Read NARR NCDC-NOMADS data
;
; Brittany Hailey 02/11/2013
; - Plotting NARR data
;
; Executea: ncl narr_ncl_template.ncl
;***************************************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
;*******************************************
; Open file and read in data
;*******************************************
dir = "/narrr-data/data/" ; input
directory
f = addfile (dir + "narr-a_221_20011231_0000_000.grb", "r")
;print(f)
;*******************************************
; Read variables and assign names
;*******************************************
level = f->lv_ISBL2
;latitude = f->gridlat_221
;longitude = f->gridlon_221
; dimlc = dimsizes(latitude)
; nlat = dimlc(0)
; mlon = dimlc(1)
;*******************************************
; Remove ";" for required variable
;*******************************************
u_wind = f->U_GRD_221_ISBL ; (lev,lat,lon)
u-wind_component
u_wind&gridlat_221@units = "degrees_north"
u_wind&gridlon_221@units = "degrees_east"
printVarSummary(u_wind)
printVarSummary(latitude)
printVarSummary(longitude)
;*************create plots*******************
wks = gsn_open_wks ("ps", "narr_dft") ; Create output filename
and type
gsn_define_colormap (wks,"gui_default") ; choose color map
res = True ; plot mods desired for
original grid
;************************************************************
; Define NARR Map
;
res@mpLimitMode = "Corners" ; choose range of map
res@mpLeftCornerLatF = 30
res@mpLeftCornerLonF = -92
res@mpRightCornerLatF = 35
res@mpRightCornerLonF = -86
res@tfDoNDCOverlay = False
res@mpProjection = "LambertConformal"
res@mpLambertParallel1F = 50
res@mpLambertParallel2F = 50
res@mpLambertMeridianF = 253
; Define how map is to be displayed [gridlines, boundaries]
res@pmTickMarkDisplayMode = "Always"
res@mpFillOn = False ; turn off map fill
res@mpDataBaseVersion = "MediumRes" ; Allow plotting of counties
res@mpOutlineDrawOrder = "PostDraw" ; draw continental outline
last
res@mpProvincialLineColor = "Blue" ; Border color
res@mpProvincialLineThicknessF = 5 ; Border line thickness
; res@mpOutlineBoundarySets = "AllBoundaries" ; state/county boundaries
res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; state boundaries
; END NARR MAP
;**********************************************************************
res@cnFillOn = True ; color fill
res@cnLinesOn = False ; no contour lines
res@gsnSpreadColors = True ; use total colormap
res@gsnSpreadColorStart = 4
res@gsnSpreadColorEnd = -1
res@mpGridAndLimbOn = True
res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks
res@tmXTOn = False
res@gsnAddCyclic = False ; regional data
res@gsnCenterString = "U-wind@"+u_wind&lv_ISBL2(8) + " hPa"
; draw center subtitle
res@gsnLeftString = "U Component Wind" ; draw
left subtitle
plot = gsn_csm_contour_map(wks,u_wind(5,:,:),res) ; Draw
original grid on map
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 18 11:12:29 2013
This archive was generated by hypermail 2.1.8 : Tue Mar 19 2013 - 16:31:18 MDT