- #1
sky01237
- 1
- 0
Hi, folks,
Here is the code:
SUBROUTINE CALCFG(N,X,F,G,ITER)
DOUBLE PRECISION X(N),G(N),F,A,d(5000),u(5000)
open (unit=2, file ="output.txt")
Do i = 1 , ITER - 1
Read( 2 , * )
End Do
Read( 2 , * ) d(ITER)
...
Do i = 1 , n - 1
Read( 2 , * )
End Do // it always starts from the next line of last iteration
How to make it start reading always from the first line for every iteration since in one iteration, maybe this subfunciton will be called several times and I want same data read in one iteration. Any help will be really appreciated. Thanks a lot.
Rui.
Here is the code:
SUBROUTINE CALCFG(N,X,F,G,ITER)
DOUBLE PRECISION X(N),G(N),F,A,d(5000),u(5000)
open (unit=2, file ="output.txt")
Do i = 1 , ITER - 1
Read( 2 , * )
End Do
Read( 2 , * ) d(ITER)
...
Do i = 1 , n - 1
Read( 2 , * )
End Do // it always starts from the next line of last iteration
How to make it start reading always from the first line for every iteration since in one iteration, maybe this subfunciton will be called several times and I want same data read in one iteration. Any help will be really appreciated. Thanks a lot.
Rui.