Out of range subscript encountered: [message #69937] |
Tue, 23 February 2010 09:51 |
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
|
|
|