- #1
_Andreas
- 144
- 1
Hello. I'm completely new to programming, and I'm having some troubles with a Fortran program I'm writing.
I have an input file containing three columns, where each column contains a couple of cartesian coordinates (column 1 contains various x coordinates, and so on). What I would like my program to do is to keep one (or two) coordinate constant, while varying the rest. The relevant part of my code looks like this:
open(11, file="filnamn")
do i=1,N
read(11, *) 1, 2, 3
...
Here all the columns are read. But if I want the program to read only column 2 and 3 I can't write
read(11,*) 2, 3
since this of course would make it read column 1 and 2. So my question is: How can I make the program read a specific column?
I have an input file containing three columns, where each column contains a couple of cartesian coordinates (column 1 contains various x coordinates, and so on). What I would like my program to do is to keep one (or two) coordinate constant, while varying the rest. The relevant part of my code looks like this:
open(11, file="filnamn")
do i=1,N
read(11, *) 1, 2, 3
...
Here all the columns are read. But if I want the program to read only column 2 and 3 I can't write
read(11,*) 2, 3
since this of course would make it read column 1 and 2. So my question is: How can I make the program read a specific column?