Luka Djigas
2008-10-13 18:32:12 UTC
Hello everyone,
please, I need your help with something:
1 2 3 4 5 6
----------------
1 | 1 2 3 4 5 6
2 | 7 8 9 10
3 | 11 12 13 14 15 16
4 | 17 18
5 | 19 20 21 22 23 24
I have a table like the one above (only bigger and uglier :-) in which
I don't know the number of elements in each row.
I'm reading it into an array of (nrows,ncolumns; in this case (5,6)),
but since I don't know the number of elements, I was wondering is
there a way to read all the elements in one row, something like
dimension a(5,6)
open(unit=1, ...)
do 10 i=1,nrows
read(1,*,eor=10)(a(i,j),j=1,999)
10 continue
and then determine the number of elements in each row of an array ?
Also, since I will need to interpolate in 2 directions between the
given values (for example for x=5.5 and y=4.5) is there a way in such
an array to determine the difference between the loaded value from a
file, and default value (zero) from just declaring an array ?
In other words, how to determine whether both values for interpolation
exists ? In the above example, if x are horizontal values, value of
x=5.5 and y=4.5 would not exist because row "17 18" doesn't have 6
elements?
I would appreciate all your suggestions and input on this topic.
Best regards
Luka Djigas
please, I need your help with something:
1 2 3 4 5 6
----------------
1 | 1 2 3 4 5 6
2 | 7 8 9 10
3 | 11 12 13 14 15 16
4 | 17 18
5 | 19 20 21 22 23 24
I have a table like the one above (only bigger and uglier :-) in which
I don't know the number of elements in each row.
I'm reading it into an array of (nrows,ncolumns; in this case (5,6)),
but since I don't know the number of elements, I was wondering is
there a way to read all the elements in one row, something like
dimension a(5,6)
open(unit=1, ...)
do 10 i=1,nrows
read(1,*,eor=10)(a(i,j),j=1,999)
10 continue
and then determine the number of elements in each row of an array ?
Also, since I will need to interpolate in 2 directions between the
given values (for example for x=5.5 and y=4.5) is there a way in such
an array to determine the difference between the loaded value from a
file, and default value (zero) from just declaring an array ?
In other words, how to determine whether both values for interpolation
exists ? In the above example, if x are horizontal values, value of
x=5.5 and y=4.5 would not exist because row "17 18" doesn't have 6
elements?
I would appreciate all your suggestions and input on this topic.
Best regards
Luka Djigas