for instance I'm running my CFD code with different mesh sizes. I want the name of my output file to be changed automatically with my variable for number of nodes; let's say "imax" that is equal to number “50”. it should be something like this :
open(44, file='Temperature-imax50.txt')
I want to use use both “variable name” and “value assigned to it” in my file name. Is there way to fix this? one way for other command's strings is to use <> marks, but it won't work here.
I am not sure I completely understand your question. So, depending on what you actually ask:
There is no way to convert variable name to a string in Frotran. You have to do it manually. (Read about reflexions).
"imax"
into the file name.That is easy, just concatenate the strings "Temperature-"//imax
.
imax
contains a number and you want that number in a file nameThat was discussed many many times here already: Convert integers to strings to create output filenames at run time