[ncl-talk] about shapefiles

Agud Pique, Enric eagud.q at ccma.cat
Thu Jun 30 09:29:24 MDT 2016


Hello Rick

When I type grep shapefile or shapefile_polyline $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl,

I get nothing...an empty answer. The fle gsn_code.ncl exists but it doesn't contain "shapefile or shapefile_polyline"

Enric
________________________________
De: Rick Brownrigg [brownrig at ucar.edu]
Enviat el: diumenge, 26 / juny / 2016 16:02
Per a: Agud Pique, Enric
A/c: ncl-talk at ucar.edu
Tema: Re: [ncl-talk] about shapefiles

Hi,

That certainly looks correct, and I see you are running 6.3.0.  What do you get if you run:

   grep shapefile_polyline $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl

or just

   grep shapefile $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl



Rick



On Sun, Jun 26, 2016 at 7:08 AM, Agud Pique, Enric <eagud.q at ccma.cat<mailto:eagud.q at ccma.cat>> wrote:
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

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160630/b7bbf687/attachment.html 


More information about the ncl-talk mailing list