|
[Sponsors] |
April 18, 2007, 14:52 |
Fortran Problem
|
#1 |
Guest
Posts: n/a
|
Hi everyone,
How can I assign a variable name to a character variable in fortran. I would like to make an output file for my program but the name of the file would be changed during running and I need to record all of them. I don't want to repeat whole commands for making the file. If someone knows how it could be happened in fortran, I appreciate to let me know. Thanks MM |
|
April 18, 2007, 15:08 |
Re: Fortran Problem
|
#2 |
Guest
Posts: n/a
|
Write the variable to a character string. For example, for an integer n:
write(filename,'(a5,i2.2)')'file-',n then open(1,file=filename,....) This will make files called "file-01","file-02", etc. Is this what you meant? |
|
April 18, 2007, 15:59 |
Re: Fortran Problem
|
#3 |
Guest
Posts: n/a
|
Thank you so much, it was exactly what I was looking for.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User fortran error when running CFX-10 in parallel | CFDworker | CFX | 3 | September 22, 2015 09:59 |
Fortran compiler problem | Luke | Siemens | 2 | September 18, 2008 04:43 |
Problem with Fortran installation. | skarp | CFX | 0 | August 4, 2007 08:09 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
'C' or FORTRAN or 'C++' | Yogesh Talekar | Main CFD Forum | 20 | October 21, 1999 05:00 |