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

Error in opening the Library module file

h-faber
Beginner
686 Views
Hi,
first I must confess that I am not very familiar with Fortran > 77, so this might be a trivial problem.

I got some Fortran code from a BS2000 which seems to be Fortran > 77 using modules, free format etc. The problem I have is that the build fails with many error messages like

Error in opening the Library module file [somemodule]

This error is caused by

use somemodule

but makes me wonder because I see that module in the same file (all the sources are in one file):

module somemodule

use anothermodule
.
.
subroutine aplott ()
...
! some calculation code
.
end subroutine aplott
end module somemodule


Any idea what is wrong with that code? Does it have to do with the subroutine inside? If so, why does it work on the BS2000?

TIA
0 Kudos
4 Replies
Steven_L_Intel1
Employee
686 Views
The Fortran standard requires that a module be "available" at the time a USE of the module is seen. For a module in the same source file as the USE, the module must precede the USE in the source. I know some compilers allow the module to appear later in the source file, but ours does not.
0 Kudos
h-faber
Beginner
686 Views
Hi Steve,
thanks a bunch, that was indeed the reason for my trouble.
I have looked up for some module using in "Fortran 90 programming" (Addison Wesley) but this issue is not mentioned there. Most Google hits led me to the INCLUDE path, but the compiler still showed this error.

So again, thanks a lot!
0 Kudos
h-faber
Beginner
686 Views
Hi Steve,
one more question concerning modules:
Within Visual Studio 2003, the debugger is not able to resolve the variables defined in the modules but used in the main program. I only see "undefined variable". What can I do to make VS display the values for the variables?
0 Kudos
Steven_L_Intel1
Employee
686 Views
In a QuickWatch window, use the syntax modulename::variablename
0 Kudos
Reply