[ncl-talk] Overlaying shapefile to the wrf plot

Rick Brownrigg brownrig at ucar.edu
Mon Apr 8 15:14:51 MDT 2019


Hi,

Its a little bit confusing. I see you are trying to use wrf_map_overlays()
to overlay the shapefiles on your contour plot. This function is used to
overlay plots that have been created by the various wrf_ plotting routines
(wrf_contour, wrf_vector, etc). onto a map background.

Polylines, polygons, extra text, etc. are drawn onto an *existing* plot and
that's why you are getting the error message -- argument 1 should be the
name of that plot.  I think you need to rearrange things something like:

res = opts
res at gsnDraw = False    ;; these two lines are superfluous, as wrf_contour
doesn't draw immediately. They are required for gsn_xxx plotting routines
res at gsnFrame = False  ;; because those routines draw immediately, not
leaving a chance to draw polylines on top. These 2 prevent that auto draw.
.....
contour = wrf_contour(.....)
ind0_id = gsn_add_shapefile_polylines(wks,contour,ind0_shp_name,mpres,lnres)
ind1_id = gsn_add_shapefile_polylines(wks,contour,ind1_shp_name,mpres,lnres)
draw(contour)
frame(wks)

Rick

On Fri, Apr 5, 2019 at 6:17 AM Ganesan M <ganeshcuraj at gmail.com> wrote:

> I am new to ncl, I am trying to plot wrf model output wind speed over
> Indian region. now normally the plots are generated, at this point I am
> trying to overlay India shapefile to the generated plot to see the state
> boundaries. but I am getting errors as follows,
>
> fatal:Argument type mismatch on argument (1) of
> (gsn_add_shapefile_polylines) can not coerce
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 24 in
> file WRF_vector_contour.ncl
>
> I am not able to figure where I am going wrong here.
>
> I need to know, whether there is any pre-buit ncl script to load, as to
> show the India map with state boundaries. Is there any way to overlay the
> shapefile while the plotting the wrf variables?
> I am attaching the ncl script that I am working on, please help me with
> this issue.
>
> Thank you. Regards
> Ganesan M.
> _______________________________________________
> ncl-talk mailing list
> 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/20190408/632d0cb6/attachment.html>


More information about the ncl-talk mailing list