×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Does anyone recognize "fac"?

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"?

Sometimes, during calculation, the developer must be looking some factor which might be interested to him/her. Myself is using Fortran more than a decade, and I can assure there is special syntax which can be concatenated to existing variable
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"?

(OP)
The line of code looks something like this:
tk2 = tk2fac * xyz and it is not in a subroutine. It is in the main program.

RE: Does anyone recognize "fac"?

If this is the only occurence of the "tk2fac" in the main
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"?

Also, in addition as Nbucska suggested, Fortran doesnot initiate variable. You do one thing, check the following:

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"?

As already stated,  Fortran does not initialize variables.  If the code you have has worked in the past and the tk2fac variable was not specifically given a value prior to it's usage....  then the program likely has a bug that no one has noticed.

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close