Does anyone recognize "fac"?
Does anyone recognize "fac"?
(OP)
Ok, I'm looking through some fortran code and there is a variable "tk2" in it. Then there is a "tk2fac" that is used in an equation computing "tk2". However, "tk2fac" is not being used or initialized anywhere else in the program. I just wanted to know if anyone knows if 'fac' after the tk2 is some sort of fortran syntax. Thanks for any input.





RE: Does anyone recognize "fac"?
a.) error
b.) incomplete source code
<nbucska@pcperipherals.com>
RE: Does anyone recognize "fac"?
and used it in the calculation. May be your variable is redefined as
TK2fac = TK2*xyz/pqr
One quick check you can do is the following:
If TK2fac is in a subroutine, at the end of the subroutine (where it says:
Return
End)
write TK2fac=0.0, and see how the program behaves. I am assuming there is no conditional "Return" in the subroutine.
RE: Does anyone recognize "fac"?
tk2 = tk2fac * xyz and it is not in a subroutine. It is in the main program.
RE: Does anyone recognize "fac"?
program and it is not in a common statement, it is an error
and undefined ( Fortran doesn't initiate variables )
<nbucska@pcperipherals.com>
RE: Does anyone recognize "fac"?
In COMMON statement
In EQUIVALENCE statement
If it is the Main program, it might be calling any Subroutine before that. Check the Argument list passing through all the LIST. Check all the COMMON statement, and finally do the following:
In the Fortran program, wirte the following statement:
(Exact syntax just copy from here, if old program then put it
leveaing first six column)
write(*,*)' Here is tk2,tk2fac, xyz ', tk2,tk2fac,xyz
Then compile the program, and use the same input file is was designed for. What you will see the value of each tk2, tk2fac, and xyz.
Hope you will find answer
Jbando@ureach.com
RE: Does anyone recognize "fac"?
However... a lot of compilers will initialize variables to 0.0. So... it may have a value of zero when it is first used. Of course.... Is that what was intended??? I certainly wouldn't count on it.
It's now up to you to decide what the program "should" be doing and what is correct.
Have fun,
Dan
www.dtware.com