Fortran Problem
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 |
Re: Fortran Problem
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? |
Re: Fortran Problem
Thank you so much, it was exactly what I was looking for.
|
All times are GMT -4. The time now is 05:38. |