[ncl-talk] generate_sample_indices generates index out of prescribed range

Lejeune Quentin Gaël Léo quentin.lejeune at env.ethz.ch
Mon Aug 31 09:08:23 MDT 2015


Hello,


I am facing a problem while using the function generate_sample_indices with NCL/6.3.0.

Here is an extract from my code:

newind_PI = generate_sample_indices(dims_PI(0),1)   ; line1
print(dims_PI(0))                                                       ; line2
printMinMax(newind_PI,True)                                     ; line3
printVarSummary(data_PI(:,j,i))                                  ; line4
rsdata_PI(:,j,i) = data_PI(newind_PI,j,i)                       ; line5


I get the following message:

Variable: dims_PI (subsection)
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates:
(0)     32850
(0)
(0)     min=1   max=32850

Variable: data_PI (subsection)
Type: float
Total Size: 131400 bytes
            32850 values
Number of Dimensions: 1
Dimensions and sizes:   [time | 32850]

fatal:Subscript out of range, error in subscript #0


So although I ask for the generation of indices within the [0:32849] range on line 1, it seems that I get an index equal to 32850, which causes the error on line 5. I precise that I got this error when repeating this operation for the 595th time in a row.

Have you already encountered this problem? Do you think there is a bug with this new function?

Here is what I get with uname -a:
Linux pilatus01 3.0.101-0.46-default #1 SMP Wed Dec 17 11:04:10 UTC 2014 (8356111) x86_64 x86_64 x86_64 GNU/Linux


Thanks for your help.
Best regards,


Quentin Lejeune




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150831/d3874445/attachment.html 


More information about the ncl-talk mailing list