- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am writing a Fortran code for fluid flow in porous media. I am in the debugging stage. The code solves fluid flow equations using LAPCAK.
I have several modules that have specific tasks. for example, INDEXING MODULE is finding the coordinates and node number for every node in the domain.
I started debugging but I have the following error.
program main
use INDEXING
end program main
module INDEXING
contains
module procedure
end module INDEXING
error #7002: Error in opening the compiled module file. Check INCLUDE paths. [INDEXING]
Could you please, explain how to fix this issue?
Regards
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to rearrange the source so the module source appears ahead of the main program source if those are contained in the same physical Fortran source file. As shown and assuming the code resides in the same source file, the USE INDEXING statement is parsed before the module source is; thus, the compiler throws the error noted since the module has not been compiled to create the needed .mod file that the compiler seeks related to the USE INDEXING statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin,
Thanks for your reply. What if put every module in a separate sources file? How should I compile it in this case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using visual studio it will work out the correct build order automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Elsayed A. wrote:
What if put every module in a separate sources file? How should I compile it in this case?
Whether you do so or not, the dependency rule remains the same. Before a program unit that contains a USE <xyz> statement can be compiled, the source code for <xyz> should have been compiled successfully. It follows that if the USE <xyz> and MODULE <xyz> are in the same file, the MODULE part should occur earlier in the file. If they are in separate files, the file containing the module should be compiled first.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page