Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29306 Discussões

how to write multiple time step files

rcpoudel
Principiante
953 Visualizações
All,
I want to open mutiple time step file eg. q005.dat, q015.dat, ..................... q995.dat., and write formattted solution(CFD) data on it. There will be hundreds of them, each for one time steps.
I have been able to open a file and write a time step data on it. How can I extend to several files........?
Any help will be highly appreciated.
Regards,
0 Kudos
5 Respostas
TimP
Colaborador honorário III
953 Visualizações
Where are you seeing difficulty? Close the file, open the next one,...
Are you asking how to generated multiple file names? e.g.

character(len=9) fname

do nfile=1,995
write(fname,"('q',i3.3)")nfile
open(11,file=fname)
....
close(11)
enddo
rcpoudel
Principiante
953 Visualizações
Tim18,
Thanks! I am almost there; generated the mutiple files with your help.....thanks a lot.
How could Iappend extension '.dat' on files such generated? May this be a silly question, I am asking again as my usual method did not work out here .....and I am new......
Ram
TimP
Colaborador honorário III
953 Visualizações
write(fname,"('q',i3.3,'.dat')")nfile
or
open(11,file=fname//'.dat')

Message Edited by tim18 on 06-17-200604:42 AM

TimP
Colaborador honorário III
953 Visualizações
Actually, I did mean to include this:
write(fname,"('q',i3.3,'.dat')")nfile

Although many people would do
open(11, file=fname//'.dat')
rcpoudel
Principiante
953 Visualizações
Tim18,
Thnaks for help. great.
Ram
Responder