CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   fortran77 help (https://www.cfd-online.com/Forums/main/13613-fortran77-help.html)

khan June 11, 2007 08:05

fortran77 help
 
I am using fortran 77 and looking for a function/subroutine which help me to generate many data files automatically to be used for animation. Now I am doing it manully but make me tired.

e.g i need to rename p.out as p1.out,.. p1.out ->p2.out ....pn-1 ->pn.out after every 5o iteration.

any one can help me.

thanks


MM June 11, 2007 11:18

Re: fortran77 help
 
Use the following command:

write(filename,'(a3,i4.2,a4)')'RES',NUM,'.OUT'

OPEN(2,FILE=filename)

Write(2,*)...

.

.

.

Close(2)

Just put the above in a loop while NUM is changed for each output file. You should make files such as: RES 1.OUT, RES 2.OUT and ...

Lost in CFD June 11, 2007 14:24

Re: fortran77 help
 
Can this syntax be applied to Fortran 90??

I've been opening several files, then

open(50,.) open(51 open(52 ...

do i=50,whatever asdfasdf

write(i,*)

end do

this would make things much easier if I could use it in 90.

Markus Lummer June 12, 2007 00:24

Re: fortran77 help
 
It works also in Fortran 90.


All times are GMT -4. The time now is 06:29.