[ncl-talk] About shapefiles

Mary Haley haley at ucar.edu
Thu Jun 2 09:05:11 MDT 2016


The error messages are giving you useful information about what the problem
is.

The first error message:

warning:ContourPlotSetValues: Data values out of range of levels set by
EXPLICITLEVELS mode

is telling you that the contour levels you chose are not in the same range
of your data. You chose these levels:

  res at cnLevels              = (/ 5.4, 6.2, 6.9, 7.4, 7.8, 8.6 /)

So you should look at your data (VERY IMPORTANT) to see what the range is
and make sure that your data intersects with this range of values.
 "printMinMax" is useful for this:

printMinMax(maskedS(nt,:,:),0)

The second error message:

fatal:["Execute.c":5900]:variable (NAME_3) is not in file (citiesShapes)

is telling you that you are trying to reference a variable called "NAME_3"
from the "citiesShapes.shp" shapefile, but that the variable doesn't exist
on the file. You need to look at your shapefile to see what the variable
names are. You can either do this on the UNIX command line with:

   ncl_filedump citiesShapes.shp

or you can do it inside the NCL script by using the "getfilevarnames"
function:

  f = addfile("citiesShapes.shp", "r")

  print(getfilevarnames(f))

If you continue to have problems, please look at the error messages closely.

--Mary



On Thu, Jun 2, 2016 at 6:01 AM, isakhar sakhar isakhar <
isakhar.inside13 at gmail.com> wrote:

> Dear Mary,
>
> Now I am getting the error as shown below. I tried to change the name of
> NAME_3 according to name of the cities but still same.
>
>
> warning:ContourPlotSetValues: Data values out of range of levels set by
> EXPLICITLEVELS mode
> fatal:["Execute.c":5900]:variable (NAME_3) is not in file (citiesShapes)
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 269 in
> file shapefiles_5.ncl
>
>
> Appreciate for any help,
>
> Soares
>
> On Wed, Jun 1, 2016 at 11:36 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> Soares,
>>
>> The error is telling you that you have a undefined function or procedure.
>> If you have an older version of NCL, then you may need to include some
>> "load" command at the top of your script:
>>
>>  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>
>>
>> --Mary
>>
>>
>>
>> On Sat, May 28, 2016 at 3:59 AM, isakhar sakhar isakhar <
>> isakhar.inside13 at gmail.com> wrote:
>>
>>> Dear Mr.Rick
>>>
>>> I still face the error as shown below;
>>>
>>> fatal:syntax error: line 122 in file shapefiles_5.ncl before or near \n
>>>   gsn_define_colormap(wks, cmap)
>>> ---------------------------------^
>>>
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 329 in file shapefiles_5.ncl before or near \n
>>>   gsn_table(wks, (/ 1, 1 /), (/ ulX-.005, ulX+.255 /), (/ ulY-.21, ulY
>>> /), (/ " " /), tblRes)
>>>
>>> ---------------------------------------------------------------------------------------------^
>>>
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 337 in file shapefiles_5.ncl before or near \n
>>>   gsn_table(wks, hdr, hdrX, hdrY, hdrText, tblRes)
>>> --------------------------------------------------^
>>>
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 346 in file shapefiles_5.ncl before or near \n
>>>   gsn_table(wks, subHdr, hdrX, hdrY, subHdrText, tblRes)
>>> --------------------------------------------------------^
>>>
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 380 in file shapefiles_5.ncl before or near \n
>>>   gsn_table(wks, tblBdy, tblX, tblY, tblText, tblRes)
>>> -----------------------------------------------------^
>>>
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:Syntax Error in block, block not executed
>>> fatal:error at line 383 in file shapefiles_5.ncl
>>>
>>>
>>> Soares
>>>
>>> On Sat, May 28, 2016 at 12:56 AM, Rick Brownrigg <brownrig at ucar.edu>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> It looks there's a syntax error at line 258 that likely cascades to the
>>>> other errors. Lines 257-258 read:
>>>>
>>>>   majorCities = (/ (/ "Dili", "Dili"     /), \
>>>>                    (/ "Hera ","Hera"/), \ /)
>>>>
>>>>                                    ^^^^^^^^
>>>> That should be:
>>>>
>>>>   majorCities = (/ (/ "Dili", "Dili"     /), \
>>>>                    (/ "Hera ","Hera"/)  /)
>>>>
>>>> Rick
>>>>
>>>> On Fri, May 27, 2016 at 3:35 AM, isakhar sakhar isakhar <
>>>> isakhar.inside13 at gmail.com> wrote:
>>>>
>>>>> Dear NCL team
>>>>>
>>>>> I download the shapefiles for administrative boundaries from GIVA-DIS
>>>>> website (http://www.diva-gis.org/gdata) to run my wrfout. Here I got
>>>>> error as shown below;
>>>>>
>>>>>
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 258 in file shapefiles_5.ncl before or near
>>>>> \n
>>>>>
>>>>> ^
>>>>>
>>>>> fatal:syntax error: line 329 in file shapefiles_5.ncl before or near
>>>>> \n
>>>>>   gsn_table(wks, (/ 1, 1 /), (/ ulX-.005, ulX+.255 /), (/ ulY-.21, ulY
>>>>> /), (/ " " /), tblRes)
>>>>>
>>>>> ---------------------------------------------------------------------------------------------^
>>>>>
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 337 in file shapefiles_5.ncl before or near
>>>>> \n
>>>>>   gsn_table(wks, hdr, hdrX, hdrY, hdrText, tblRes)
>>>>> --------------------------------------------------^
>>>>>
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 346 in file shapefiles_5.ncl before or near
>>>>> \n
>>>>>   gsn_table(wks, subHdr, hdrX, hdrY, subHdrText, tblRes)
>>>>> --------------------------------------------------------^
>>>>>
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 380 in file shapefiles_5.ncl before or near
>>>>> \n
>>>>>   gsn_table(wks, tblBdy, tblX, tblY, tblText, tblRes)
>>>>> -----------------------------------------------------^
>>>>>
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:Syntax Error in block, block not executed
>>>>> fatal:error at line 383 in file shapefiles_5.ncl
>>>>>
>>>>>
>>>>> Here I attach my ncl script and ncdump file.
>>>>> Many thanks for your help.
>>>>>
>>>>> Regards,
>>>>> Soares
>>>>>
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> ncl-talk at ucar.edu
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> 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/20160602/395ef840/attachment.html 


More information about the ncl-talk mailing list