Hi everybody,(adsbygoogle = window.adsbygoogle || []).push({});

I have 3 columns of data (3 different variables) and 400 rows. How would I set up a matrix/array sort of thing to read each row individually and store it in my fortran program to calculate equations at each step?

What I have basically tried and cant get to work, I think it tries to read past the file all the time....

-------------------------------------

read(99,*)N

allocate(x(N),y(N),z(N))

do i=1,N ! Read matrix row-by-row

read(99,*)x(i),y(i),z(i)

'Equations calculating from each line'

enddo

close(99)

---------------------------------------

Any help? or does someone have part of a working program i can use and modify?

Thanks.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Basic fortran help: reading columns of data from a text file

**Physics Forums | Science Articles, Homework Help, Discussion**