- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a theory question: It's possible to pass a global variale (from a module) to a subroutine in x64 program?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page