[ncl-talk] error in shapefile_mask_data.ncl

Rick Brownrigg brownrig at ucar.edu
Wed Jul 6 13:37:26 MDT 2016


Hi Xiao,

Its complaining about the reassignment operator  :=    I don't recall
exactly when it was introduced in NCL, but it was relatively recently, and
I strongly suspect it was after ver. 6.1.0.  You can work around it by
adding these lines at the end of the inner do-loop in that section of code3:

  delete(lat_sub)
  delete(lon_sub)

Hope that helps...
Rick

On Wed, Jul 6, 2016 at 12:43 PM, Zhang, Xiao <xiao.zhang at pnnl.gov> wrote:

>
>
> Hi
>
>
>
> I use ncl 6.1.0 and would like to use function shapefile_mask_data. Since
> it has not been built in, I use the code provided from the website but got
> error message. Could you please help with this? Thank you!
>
> “fatal:syntax error: line 158 in file ./shapefile_mask_data.ncl before or
> near :
>
>           lat_sub :
>
> ------------------^
>
>
>
> fatal:error in statement
>
> fatal:syntax error: line 159 in file ./shapefile_mask_data.ncl before or
> near :
>
>           lon_sub :
>
> ------------------^
>
>
>
> fatal:error in statement
>
> fatal:Syntax Error in block, block not executed”
>
>
>
> Here are the codes I used.
>
>
>
>
> https://www.ncl.ucar.edu/Support/talk_archives/2014/att-0432/shapefile_mask_data.ncl
>
> part of my code
>
>
>
>                 shpfile   = "USA_adm_shp/USA_adm0.shp"
>
>                 opt             = True
>
>                 opt at return_mask = True
>
>
>
>                  ;load self-define function
>
>                 load "./shapefile_mask_data.ncl"
>
>
>
>                  land_mask_a1 =
> shapefile_mask_data(dif_a1(0,:,:),shpfile,opt)
>
>
>
> Best,
>
> Xiao
>
>
>
> _______________________________________________
> 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/20160706/32181873/attachment.html 


More information about the ncl-talk mailing list