Open and read data in one row in fortran 90
问题 I did some dummy code to learn to open and read file. Let's say I have the following test.dat which reads 1 2 3 4 5 6 7 8 9 10 I wrote the following code to open and read the data file subroutine readdata implicit none integer :: j double precision :: test open(unit = 100, file = 'test.dat', status = 'old', action = 'read') do j = 1, 10 read(100,*) test print *, 'N1=', test end do end subroutine The output is shown below, as expected gfortran -g -I/usr/include -o main main.o subroutines.o -L