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

Defining Unit Number to a file as an environment variable

efengle
Novice
540 Views

I do not know if you can do this with Intel FORTRAN compiler or not, but I am trying to figure out how to link a unit number to a file for reading/writing outside of the source code, say in a shell script using environment varaibles.

I am sure this can be done. It can be done using IBM's XL FORTRAN Compiler. That is what I use at work, but I have Intel FORTRAN compiler on my Mac running 10.5 and using IFC 10.1.

Please help.

Thanks,
Eric

0 Kudos
2 Replies
Steven_L_Intel1
Employee
540 Views
Yes - the environment variable name is FORTn where n is the unit number with no leading zeroes. For example, FORT17 for unit 17. You can read about this and other run-time environment variables in the on-disk documentation.
0 Kudos
efengle
Novice
540 Views
It worked! Thank You.
0 Kudos
Reply