- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
While compiling my code I get the following: Error: This is not a DEC Fortran module file.
I have a main program like:
PROGRAM name
USE module_name
implicit none
..
..
END PRGRAM name
I have saved the module (module_name.mod) in my working directory. Iincluded this directory in Tools -> Options [Directories tab], but it didn't help.
Anyone a solution for this problem???
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you perhaps have another .mod file of the same name in the same directory as the source? Just a check - you're using CVF? (And no, this question is not as silly as it sounds.)
Are you sure that the error is for that specific module?
Are you sure that the error is for that specific module?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using Digital Visual Fortran Ver. 6 (but I think this is the same as Compaq).
In my directory I have 2 module files, named:
ModuleGeometry.mod
ModuleGrid.mod
These files are not in any subdirectory, just between all the other files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Version 6.0? Wow, that is old. Are you compiling these modules as part of the application build? Is it these modules the compiler is complaining about?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compile the main program (at the moment there no subroutines) it adds a map 'External Dependencies' to my workspace. In there the two module files are named.
But it also gives error:
C:Dirmain.f90(5) : Error: This is not a DEC Fortran module file. [MODULEGEOMETRY]
use ModuleGeometry
------------^
use ModuleGeometry
------------^
The module files are ok. When I rename them to .f90 files, and add them to my project everything works fine.
What is anyway the method to create a Fortran module?? I did it by opening a new Fortran Free Format file, writing the module, compiling the module (checking for errors) and after this I renamed them from .f90 to .mod file. I think this is not the right way to do it, but I'm not really familliar with modules and CVF.
BarBados.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OH! Yes, that would do it...
You should not rename anything. The .mod is created by compiling the .f90 module source. Just let the compiler find the .mod by itself. The best way is to add the .f90 sources to the project and everything will get built in the proper order (usually!)
What you did was supply a source file when the compiler was looking for a compiled module file. No wonder it was confused.
You should not rename anything. The .mod is created by compiling the .f90 module source. Just let the compiler find the .mod by itself. The best way is to add the .f90 sources to the project and everything will get built in the proper order (usually!)
What you did was supply a source file when the compiler was looking for a compiled module file. No wonder it was confused.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, this works!!
I have now the ModuleGeometry.f90 and ModuleGrid.f90 in the Source Files and after compiling it creates ModuleGeometry.mod and a ModuleGrid.mod in the External Dependencies. It is displayed in hexadecimal form. Is this correct? What is the use of this!!
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't recall that the .mod files show up under external dependencies, but they are not meant to be viewed in an editor, so just close the files.
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