[ncl-talk] about shapefiles
Agud Pique, Enric
eagud.q at ccma.cat
Sun Jun 26 07:08:26 MDT 2016
Hello,
I have a problem with the following code. I can plot the variables Tc and the wind, but I get an error from the shapefile’s command. The error is...
[Enric at meteo4u em_real]$ ncl plot-shapefiles.ncl
Copyright (C) 1995-2015 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.3.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:Undefined identifier: (gsn_add_shapefile_polylines) is undefined, can't continue
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 49 in file plot-shapefiles.ncl
Any idea?
Best
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
a = addfile("./wrfout_d01_2016-06-26_18:00:00","r")
wks = gsn_open_wks("png","shapefiles")
T2 = wrf_user_getvar(a,"T2",0)
Tc = T2-273
u10 = wrf_user_getvar(a,"U10",0) ; u at 10 m, mass point
v10 = wrf_user_getvar(a,"V10",0) ; v at 10 m, mass point
u10 = u10*1.94386 ; Turn wind into knots
v10 = v10*1.94386
u10 at units = "kts"
v10 at units = "kts"
res = True
pltres = True
mpres = True
;opts = True
opts = res
opts at cnFillOn = True
opts at cnLevelSelectionMode = "ExplicitLevels"
opts at cnLevels =(/ -10, -5,0,5,10,15,20,25,30,35,40/)
opts at cnFillColors =(/"Blue","DarkOliveGreen1", \
"DarkOliveGreen3","Chartreuse", \
"Chartreuse3","Green","ForestGreen", \
"Yellow","Orange","Red","Violet"/)
contour_t2 = wrf_contour(a,wks,Tc,opts)
delete(opts)
; Plotting options for Wind Vectors
opts = res
opts at NumVectors = 47 ; density of wind barbs
vector = wrf_vector(a,wks,u10,v10,opts)
delete(opts)
plot = wrf_map_overlays(a,wks,(/contour_t2,vector/),pltres ,mpres)
shp_name = "/home/Enric/Fronteres/FEsp/ESP_adm2.shp"
lnres = True
lnres at gsLineColor = "gray25"
lnres at gsLineThicknessF = 0.5
spain_id = gsn_add_shapefile_polylines(wks,plot,shp_name,lnres)
draw(plot)
frame(wks)
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160626/8b371898/attachment.html
More information about the ncl-talk
mailing list