Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop and external file writing

Status
Not open for further replies.

didiwidi

Technical User
Apr 17, 2008
1
BE
I need to make an external file within a DO loop, where I change the parameters of a model. In an external file I write my parameters and statistics. In the way I do it, I also write the answers on each other, in stead of becoming a nice overview of all my results. How do I have to do this, so that every loop has a row in my external file ?

Thanks in advance!
(Fortran77)
DO
%change parameters
%RMSE
u=20
open (u, FILE='uit.txt')
write(u,33) parameters, RMSE
33 format (F6.3, F6.3, F6.3)
close (u)

continue
 
At a guess, something like this
Code:
character*16 filename
integer iteration

iteration = 0
DO
%change parameters
%RMSE
    u=20
    iteration = iteration + 1
    write (filename, '(A,I0,A)') 'uit', iteration, '.txt'
    open (u, FILE=filename)
        write(u,33) parameters, RMSE
33    format (F6.3, F6.3, F6.3)
    close (u)

end do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top