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

DEC Fortran Module ERROR

barbados
Beginner
1,116 Views
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???
0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,116 Views
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?
0 Kudos
barbados
Beginner
1,116 Views
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.
0 Kudos
Steven_L_Intel1
Employee
1,116 Views
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?
0 Kudos
barbados
Beginner
1,116 Views
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
------------^
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.
0 Kudos
Steven_L_Intel1
Employee
1,116 Views
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.
0 Kudos
barbados
Beginner
1,116 Views
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!!
0 Kudos
Steven_L_Intel1
Employee
1,116 Views
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.
0 Kudos
Reply