[ncl-talk] Subscript out of range error
Ipsita Putatunda
ipsita.putatunda at gmail.com
Tue Sep 9 12:51:15 MDT 2014
Hi,
With the suggestion by Dennis I have modified my script, and the output
is coming like:
(0) i=0 levels(i)=0 levels(i+1)=2
(0) i=0 nii=44
(0) i=1 levels(i)=2 levels(i+1)=4
(0) i=1 nii=5
(0) i=2 levels(i)=4 levels(i+1)=6
(0) i=2 nii=1
(0) i=3 levels(i)=6 levels(i+1)=8
(0) i=3 nii=2
(0) i=4 levels(i)=8 levels(i+1)=10
(0) ii has missing values: ii=-2147483647
(0) i=5 levels(i)=10 levels(i+1)=12
fatal:Number of dimensions on right hand side do not match number of
dimension in left hand side
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 25 in file
IN3_point.ncl
In my script at line 25,
ii = ind(apr.ge.levels(i).and.apr.lt.levels(i+1))
Please suggest any solution for this issue.
Thanks,
Ipsita
On Tue, Sep 9, 2014 at 11:45 PM, Dennis Shea <shea at ucar.edu> wrote:
> Hi Ipsita,
>
> offline
>
> Please do no include any salutation (Hi Dennis [, Adam, Mary, ...]) when
> you respond.
> When you do this, people ignore the question. In essence, your problem is
> now my or Mary or Adam's problem.
>
> We are not paid to answer ncl-talk questions. We do it to help people but
> our time is valuable too.
> We have our own jobs to do.
>
> Please look at the output. What does it say to you?
>
>
> ===
>
> THX
> Dennis
>
>
> On Tue, Sep 9, 2014 at 11:26 AM, Ipsita Putatunda <
> ipsita.putatunda at gmail.com> wrote:
>
>> Hi Dennis,
>> Thanks for your reply. But instead of my own script I have tried the
>> ncl script http://www.ncl.ucar.edu/Applications/Scripts/scatter_5.ncl,
>> where I didn't change anything except the npts from 300 to 56,and then
>> run the script which is also giving similar error message.Why is it so? I
>> didn't even change a single letter in the script scatter_5.ncl except the
>> array size. Though may be am wrong but this seems to me it is depending
>> upon the array size.
>>
>> In my own script if I am debugging as per your suggestion it is giving
>>
>> "warning:Argument 0 of the current function or procedure was coerced to
>> the appropriate type and thus will not change if the function or procedure
>> modifies its value
>> fatal:Dimension size mismatch on subscript #1, left-hand and right-hand
>> side dimensions do not match"
>> it is clear that data2d(i,ii) and apr(ii) have different dimensions, but
>> I need to make a two dimensional array data2d as per the scatter_5.ncl
>> script using apr(ii). Could you please suggest if there is some way to do
>> it.
>>
>> Thanks in advance,
>> Ipsita
>>
>>
>> On Tue, Sep 9, 2014 at 6:10 PM, Dennis Shea <shea at ucar.edu> wrote:
>>
>>> This is basic debugging. It is not the size of the arrays, rather the
>>> subscripts
>>> that are referencing some location out of range.
>>>
>>> The error message:
>>> fatal:Subscript out of range, error in subscript #1
>>> fatal:["Execute.c":7743]:
>>> Execute: Error occurred at or near line 28 in file
>>>
>>>
>>> 26 do i=0,nlevels-2
>>> 27 ii = ind(apr.ge.levels(i).and.apr.lt.levels(i+1))
>>> 28 data2d(i,ii) = apr(ii)
>>> 29 labels(i) = levels(i) + ":" + levels(i+1)
>>> 30 delete(ii)
>>> 31 end do
>>>
>>> Well ...... Put prints *before* line 28 printing the values of i and ii.
>>>
>>> ii = ind(apr.ge.levels(i).and.apr.lt.levels(i+1))
>>> print("i="+i+" ii="+ii) ; basic debug approach
>>> data2d(i,ii) = apr(ii)
>>>
>>> ii could even be missing ...
>>>
>>>
>>> On Tue, Sep 9, 2014 at 5:01 AM, Ipsita Putatunda <
>>> ipsita.putatunda at gmail.com> wrote:
>>>
>>>> In continuation of my previous mail, I have a little query.
>>>> http://www.ncl.ucar.edu/Applications/Scripts/scatter_5.ncl in the same
>>>> script I simply tried to see how does it works with npts=56 instead of 300
>>>> and the same script is giving the similar error (Subscript out of range,
>>>> error in subscript #1) as am getting in my script. It is working only with
>>>> some larger number like 200 and above. Why is it happening? can anyone give
>>>> me some idea?
>>>>
>>>> Thanks,
>>>> Ipsita
>>>>
>>>> On Tue, Sep 9, 2014 at 3:31 PM, Ipsita Putatunda <
>>>> ipsita.putatunda at gmail.com> wrote:
>>>>
>>>>> Hi all,
>>>>> Am doing something similar to
>>>>> http://www.ncl.ucar.edu/Applications/Scripts/scatter_5.ncl
>>>>> this scatter plot. While doing this am getting error:
>>>>>
>>>>> fatal:Subscript out of range, error in subscript #1
>>>>> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 28 in
>>>>> file
>>>>>
>>>>> I have checked the dimension and size of my array at line 28.
>>>>> Which gives :
>>>>>
>>>>> Variable: data2d
>>>>> Type: float
>>>>> Total Size: 1568 bytes
>>>>> 392 values
>>>>> Number of Dimensions: 2
>>>>> Dimensions and sizes: [7] x [56]
>>>>> Coordinates:
>>>>> Number Of Attributes: 1
>>>>> _FillValue : 9.96921e+36
>>>>>
>>>>> Variable: apr
>>>>> Type: float
>>>>> Total Size: 224 bytes
>>>>> 56 values
>>>>> Number of Dimensions: 1
>>>>> Dimensions and sizes: [56]
>>>>> Coordinates:
>>>>> Number Of Attributes: 1
>>>>> _FillValue : 9.96921e+36
>>>>>
>>>>> But still am getting the same error. Any help will be appreciated.
>>>>> My script is attached herewith.
>>>>>
>>>>> Thanks in advance,
>>>>> Ipsita
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> 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/20140910/cd0847b2/attachment.html
More information about the ncl-talk
mailing list