<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello,<br>
<br>
<br>
I am facing a problem while using the function generate_sample_indices with NCL/6.3.0.<br>
<div><br>
Here is an extract from my code:<br>
<br>
newind_PI = generate_sample_indices(dims_PI(0),1)&nbsp;&nbsp; ; line1<br>
print(dims_PI(0))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; line2<br>
printMinMax(newind_PI,True)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; line3<br>
printVarSummary(data_PI(:,j,i))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; line4<br>
rsdata_PI(:,j,i) = data_PI(newind_PI,j,i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; line5<br>
<br>
<br>
I get the following message: <br>
<br>
Variable: dims_PI (subsection)<br>
Type: integer<br>
Total Size: 4 bytes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:&nbsp;&nbsp; [1]<br>
Coordinates: <br>
(0)&nbsp;&nbsp;&nbsp;&nbsp; 32850<br>
(0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
(0)&nbsp;&nbsp;&nbsp;&nbsp; min=1&nbsp;&nbsp; max=32850<br>
<br>
Variable: data_PI (subsection)<br>
Type: float<br>
Total Size: 131400 bytes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32850 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:&nbsp;&nbsp; [time | 32850]<br>
<br>
fatal:Subscript out of range, error in subscript #0<br>
<br>
<br>
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.<br>
<br>
Have you already encountered this problem? Do you think there is a bug with this new function?<br>
<br>
Here is what I get with uname -a:<br>
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<br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><br>
<br>
Thanks for your help.<br>
Best regards,<br>
<br>
<br>
Quentin Lejeune<font size="2"><span style="font-size:10pt"><br>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="2"><span style="font-size:10pt"><br>
</span></font><br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>