[ncl-talk] Error in shape file script

jagan TNAU jagan at tnau.ac.in
Wed Nov 12 18:04:50 MST 2014


Thanks Rick.

The entire script was provided to me by Mary. I have used it for producing
2x4 panel plot. Now I have planned to go for  3x4 panel plots and modified
it. The script reads a shape file and select a particular region
(districts) for plotting. I have not changed anything related to the shape
file reading.

On Wed, Nov 12, 2014 at 10:08 PM, Rick Brownrigg <brownrig at ucar.edu> wrote:

> Hi,
>
> I don't fully understand your script, but at line 249, you are looping
> over the number of lat/lon values in the shapefile:
>
>         do iltn=0,nlatlon_shp-1
>         ;---gc_inout returns True if point is inside lat/lon area.
>             if(ismissing(tmax1_mask(iltn))) then
>
> and indexing into tmax1_mask based upon "iltn".  But tmax1_mask was
> dimensioned as:
>
>   values = asciiread("tmax-had45.txt",-1,"float")
> ...
>   ncols = 15
> ...
>   tmax1 = values(2::ncols)
> ...
>   tmax1_mask = new(dimsizes(tmax1),typeof(tmax1),tmsg)
>
> So its dimensions would seem to be unrelated to the number of points in
> the shapefile (?)
>
> In any case, the error message means what it says -- an attempt to access
> an array outside its bounds.
>
> Hope that helps pinpoint your problem...
> Rick
>
>
> On Wed, Nov 12, 2014 at 8:22 AM, jagan TNAU <jagan at tnau.ac.in> wrote:
>
>> Hello,
>>
>> Please find attached a shape file script for which I am receiving the
>> error below. Kindly help me to correct it.
>> ---------------
>>  NCAR Command Language Version 6.0.0
>>  The use of this software is governed by a License Agreement.
>>  See http://www.ncl.ucar.edu/ for more details.
>> (0)
>> (0) numFeatures = 132
>> (0) numSegments = 202
>> (0) size of lat/lon arrays in shapefile = 192128
>> (0) minlat_reg = 12.2281
>> (0) maxlat_reg = 13.5628
>> (0) minlon_reg = 79.2832
>> (0) maxlon_reg = 80.3488
>> (0) Number of line segments to draw = 2
>> (0) Largest line segment length     = 8691
>> (0) Number of areas to mask         = 200
>> (0) Larkest mask segment length     = 10255
>> fatal:Subscript out of range, error in subscript #0
>> fatal:An error occurred reading tmax1_mask
>> fatal:Execute: Error occurred at or near line 249 in file tmax-tn-mask.ncl
>> --------------------
>>
>> --
>> With regards
>>
>> Dr.R.Jagannathan
>> Professor of Agronomy
>> Agro Climate Research Centre
>> Tamil Nadu Agricultural University
>> Coimbatore - 641 003 India
>>
>> PHONE:  Mob: +91 94438 89891
>>
>> DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE ENVIRONMENT CONCERNS US
>> ALL.
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
With regards

Dr.R.Jagannathan
Professor of Agronomy
Agro Climate Research Centre
Tamil Nadu Agricultural University
Coimbatore - 641 003 India

PHONE:  Mob: +91 94438 89891

DO NOT PRINT THIS E-MAIL UNLESS NECESSARY. THE ENVIRONMENT CONCERNS US ALL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141113/6262598f/attachment.html 


More information about the ncl-talk mailing list