Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

What does FORTRAN compiler do when a variable is in parentheses?

tclin
Beginner
1,879 Views
Good Afternoon all,

I have an old FORTRAN program which compiled just fine, but it does not make sense to me. Hope somebody out there can explain it to me. Thanks in advance.

The program declares three variables as

real*8 L, Bo, B0

and later there is the following line of code:

Bo = B0( L)

I am expecting a compiler error message, because B0 is not an array. But it compiled just fine. Can anyone explain to me how Intel compiler interpret the code? Thanks.

Tom Lin

0 Kudos
2 Replies
mecej4
Honored Contributor III
1,879 Views
The meaning and effect of parentheses vary significantly with context.

In the code fragment that you showed, B0(L) is taken as a reference to a function of type REAL*8 with integer argument L.

If there is no such function provided elsewhere, you will get a linker error.
0 Kudos
tclin
Beginner
1,879 Views
Thanks. That's my fault. Idofinea small function called B0 insde the program.

Tom Lin
0 Kudos
Reply