Problem with for-slope [message #48637] |
Wed, 03 May 2006 00:52 |
Nexia
Messages: 3 Registered: May 2006
|
Junior Member |
|
|
Hello,
i´m pretty new to this group and in programming, so please excuse
stupid questions of if something simliar has been asked yet.
My programm is getting input from different files
nfiles_LM=17
file[0]=...
....
file[16]=...
the input is working quite well and doing a selection of several part
of chosen values (for example, getting each fouth value in time for
each file k) is working, too.
My Problem: I want to make a choice of stations k (there is input from
observational stations in the files) to bee used. I only need the last
12 files (k=5 to k=16 if I start counting from 0)
FOR k=5, nfiles_LM-1 DO BEGIN ; take the last 12 files
l=0
FOR i=0,nline_LM-1, 4. DO BEGIN ; take only every 4th value
time_LM_1h_oV(k,l)= time_LM(k,i)
t2m_LM_1h_oV(k,l)= t2m_LM(k,i)
rh2m_LM_1h_oV(k,l) = rhum_LM(k,i)
td2m_LM_1h_oV(k,l) = td2m_LM(k,i)
q2m_LM_1h_oV(k,l) = QV_2M_LM(k,i)
pres_LM_1h_oV(k,l) = pres_LM(k,i)
wspeed_LM_1h_oV(k,l)=windspeed_10m_LM(k,i)
l=l+1
ENDFOR
ENDFOR
The declaration was made befor this slope....
(nfiles_LM-1 = 17, nfiles_LM_oV=12
time_LM_1h_oV=FLTARR(nfiles_LM_oV, 0.25*nline_LM+1) & t2m_LM_1h_oV =
time_LM_1h_oV & pres_LM_1h_oV = time_LM_1h_oV & rh2m_LM_1h_oV =
time_LM_1h_oV & td2m_LM_1h_oV = time_LM_1h_oV & q2m_LM_1h_oV =
time_LM_1h_oV &wspeed_LM_1h_oV =time_LM_1h_oV)
For this slope I get the error-code: Attempt to subscript TIME_LM_1H_OV
with K is out of range.
If I select the first 12 files (k=0, nfiles_LM-6) everything is working
fine like if I take all files (k=0, nfiles_LM-1).
Can anybody tell me, what´s the mistake if I start the slope at k=5?
Nexia
P.S.: Please excuse also my very poor english-skill
|
|
|