Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29062 Discussions

How to Input Equations from External Files

mheibels
Beginner
358 Views
I haven't used FORTRAN in a very long time (Punch Cards) and I am trying to create a utility that finds the zeros of non-linear functions. I would like to generalize the method to the point that I don't have to recompile for each different equation. I want to pass the equation through my input file via some sort of read statement, but I'm unable to remember how this is done. Is anyone aware of a simple wat to do this ?
Thanks in advance for any assistance.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
358 Views
There's no "a simple way" -- since Fortran is compiled language, any expression entered at run-time must be re-parsed, i.e. interpreted.
There's free function parser by Stuart Midgley you can use. Note that the method, in principle, comes down to interpreting, thus it's necessarily slower than using pre-compiled code. Also, I've built a graphing tool around that parser which you can take a look at here.
Jugoslav
0 Kudos
Reply