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.

x64 code and module variable

felotti
Beginner
552 Views

I have a theory question: It's possible to pass a global variale (from a module) to a subroutine in x64 program?

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
552 Views
I fail to see the relevance of "x64 program". According to the Bible Fortran Standard, you are allowed do it, and that supposedly has nothing to do with the compiler or architecture.

The only constraint is that the subroutine may not simultaneously refer to both the dumy argument and the said global variable in a non-read-only fashion. For example, this is a no-no in general:
MODULE Mod
INTEGER I
END MODULE Mod

PROGRAM
Use Mod
CALL FOO(I)
PRINT *, I
END PROGRAM

SUBROUTINE FOO(J)
Use Mod, ONLY: I
J = J + I
I = J * I
PRINT *, J, I
END SUBROUTINE

0 Kudos
Reply