Article ID: 62215 - View products that this article applies to.
This article was previously published under Q62215
This article has been archived. It is offered "as is" and will no longer be updated.
If a compiled Basic program is linked with a large or huge memory model FORTRAN routine that uses either CHARACTER data or the FORTRAN READ or WRITE statements, the Basic program will not be able to access the far heap.
To avoid this problem, link only to FORTRAN routines compiled in the medium memory model.
FORTRAN routines placed in a Quick library will work correctly, even if the FORTRAN is compiled in the large or huge memory model.
A number of symptoms can indicate the problem above. Here are two:
NOTE: The Basic program does not even have to call the FORTRAN subprogram; it is the allocation of the FORTRAN data space that causes the error.
To compile the FORTRAN.OBJ, use the following commands:
To compile the Basic.OBJ, use the following command:
Then, link the files together as follows:
To run the programs, type either PROG1 or PROG2.
FORTRAN Program 1
FORTRAN Program 2
In Basic...memory = 416968
Back in Basic. memory = 416968
In Basic...memory = 53992
Back in Basic memory = 53992
If the above example is used, but the FORTRAN compiler is instructed to use the medium memory model (/AM instead of /AL) and the library MLIBFORE is linked instead of LLIBFORE, the program will work correctly.
Article ID: 62215 - Last Review: August 23, 2013 - Revision: 2.1
Contact us for more help
Connect with Answer Desk for expert help.