[ncl-talk] Problems Plotting NARR data

Kerwyn Texeira ktish86 at gmail.com
Sat Jul 30 22:13:35 MDT 2016


Hi ncl-talk,

I'm trying to plot and overlay of (NARR) North American Regional Reanalysis
temperature, geopotential height contours, and wind barbs at 600mb but I'm
running into some problems.

1.  Where on the script should I mention the pressure level eg 600hpa so
that both the temperature, wind barbs and geopotential heights can be
plotted at this level that level?

2. How do I zoom into an area?  I specified the min lat, lon and max lat,
lon but it seems not to zoom into the area of interest?

3. I do not understand why I'm getting the following error:

 (0)     gsn_csm_contour_map_ce: Fatal: the input data array must be 1D or
2D
fatal:Illegal right-hand side type for assignment
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 113 in
file narr_temp.ncl

My script:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
a = addfile("./narr-a_221_20140128_0000_000.grb", "r")

wks_type = "png"
wks_type at wkWidth = 2500
wks_type at wkHeight = 2500

wks= gsn_open_wks(wks_type, "temp_narr")
gsn_define_colormap(wks,"matlab_jet")

lat2d = a->gridlat_221
lon2d = a->gridlon_221
hgt = a->HGT_221_ISBL
temp = a->TMP_221_ISBL
pres = a->PRES_221_HYBL
u_wind = a->U_GRD_221_ISBL
v_wind = a->V_GRD_221_ISBL
lev    = a->lv_ISBL3            ; 29 levels

spd = (u_wind*u_wind + v_wind*v_wind)^(0.5) ; m/s

pres = pres*0.01  ; converts to hpa

u_wind = u_wind*1.94384449
v_wind = v_wind*1.94384449

temp = temp - 273

temp at lat2d = lat2d
temp at lon2d = lon2d

hgt at lat2d = lat2d
hgt at lon2d = lon2d

pres at lon2d = lon2d
pres at lat2d = lat2d

u_wind at lon2d = lon2d
u_wind at lat2d = lat2d

spd = spd*1.94384449

spd at lon2d = lon2d
spd at lat2d = lat2d

v_wind at lat2d = lat2d
v_wind at lon2d = lon2d


res = True
res at gsnDraw = False
res at gsnFrame = False
res at cnLineLabelsOn = False
res at cnFillOn = True
res at tiMainString = "Temperature (C) at 700hpa on Jan 28 at 00:00UTC"
res at tiMainFont = "helvetica"
res at tiMainFontHeightF = 0.02
res at pmTickMarkDisplayMode = "Always"
res at mpProjection = "CylindricalEquidistant"
res at mpOutlineOn = "True"
res at lbOrientation = "Vertical"
res at tiMainOffsetYF = -0.03
res at mpFillOn  = False
res at tfDoNDCOverlay = True
res at mpMinLatF = 37.85
res at mpMaxLatF = 38.50
res at mpMinLonF = -120.0
res at mpMaxLonF = -119.0
res at gsnLeftString = "Geopotential Height (m) and Winds (kts)"
res at gsnStringFontHeightF = 0.020
res at gsnRightString = ""
res at gsnMaximize = True
res at mpShapeMode = "FreeAspect"
res at lbTitleString = "Temperature (C)"
res at lbTitlePosition = "Right"
res at lbTitleFontHeightF = 0.020
res at gsnAddCyclic = False
;res at cnLevelSelectionMode = "ManualLevels"
;res at cnMinLevelValF =
;res at cnMaxLevelValF =
;res at cnLevelSpacingF =

res1 = True
res1 at gsnDraw = False
res1 at gsnFrame = False
res1 at vcWindBarbLineThicknessF = 7.0
res1 at vcRefLengthF = 0.018
res1 at vcRefMagnitudeF = 10
res1 at vcMinDistanceF = 0.05
res1 at vcGLyphStyle = "WindBarb"
res1 at gsnRightString =""
res1 at vcRefAnnoOn = False
res1 at gsnAddCyclic = False

res2 = True
res2 at gsnDraw = False
res2 at gsnFrame = False
res2 at cnLineColor = "Black"
res2 at gsnContourLineThicknessesScale = 5.0
res2 at gsnAddCyclic = False
res2 at tfDoNDCOverlay = True
res2 at gsnLeftString = ""
res2 at gsnRightString = ""
res2 at cnInfoLabelOn = False
;res2 at cnLevelSpacingF = 2
res2 at cnLineLabelBackgroundColor = "white"
res2 at cnLineLabelDensityF = 1

geo = gsn_csm_contour(wks, hgt, res2)

temp = gsn_csm_contour_map(wks, temp, res)

vector = gsn_csm_vector(wks, u_wind, v_wind, res1)

overlay(temp, geo)
overlay(temp, vector)

draw(temp)
frame(wks)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

end

Whatever help anyone can give to me will be greatly appreciated. I thank
you very much in advance!!!.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160730/64244a21/attachment.html 


More information about the ncl-talk mailing list