comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Out of range subscript encountered:
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Out of range subscript encountered: [message #69937] Tue, 23 February 2010 09:51
Katie Burnett is currently offline  Katie Burnett
Messages: 2
Registered: February 2010
Junior Member
Hello,

I'm writing a bit of code and receiving the following error message:
Out of range subscript encountered: DU


I have tried everything I can think of to fix this, playing with the
values and such. Below is the code associated with this error, as the
program itself is quite long:

v_400 = FLTARR(84,56)
FOR k=0,26 DO BEGIN
FOR i=0,83 DO BEGIN
FOR j=0,55 DO BEGIN

IF Pres[k,i,j] GT 40000L AND Pres[k+1,i,j] LT
40000L THEN BEGIN
v_400[i,j] = ((vwind[k+1,i,j]-vwind[k,i,j])/
(pres[k+1,i,j]-pres[k,i,j]))*(40000-Pres[k,i,j]) + vwind[k,i,j]
ENDIF
ENDFOR
ENDFOR
ENDFOR

du = FLTARR(84,56)
FOR k=0,26 DO BEGIN
FOR i=0,82 DO BEGIN
FOR j=0,54 DO BEGIN
du[i,j] = (u_400[i+1,j]-u_400[i,j])/(2*dx)
ENDFOR
ENDFOR
ENDFOR


I wasn't able to bold the line that's causing the trouble, but it's
not liking the fourth line from the bottom (du[i,j] = (u_400[i+1,j]-
u_400[i,j])/(2*dx) )

I've used this exact same bit of code several other times in the
program for other variables and this is the one giving me a problem.
Help?!

Thanks,
Katie
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: wavelength calibration
Next Topic: Re: Out of range subscript encountered:

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:37:45 PDT 2025

Total time taken to generate the page: 0.00503 seconds