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

Using MODULE source files

magliola
Beginner
545 Views
In a single source file (source.for) I have the following structure. (I use one file because this is how I used to load the hopper with cards.)

module one
integer a, b, c, d
end module one

module two
integer e, f, g, h
end module two

program main
use one
use two
...
end

subroutine mysub
use one
use two
...
end

In Developer Studio how do I create MOD source files and where do they go? I see three locations - SOURCE files, HEADER files, RESOURCE files.

When I press Ctrl+N I have the choice to create the following files: Binary, Bitmap, ..., Fortran Fixed Format, Fortran Free Format, .... I don't see a choice to create a MOD file.

Any help will be appreciated.
0 Kudos
2 Replies
David_V_3
Beginner
545 Views
*.mod files are intermediate files created by the compiler. As I understand it a *.mod file is created for each module found in a source file. That is, in your example one.mod and two.mod will be created when you compile your single source file. You can control the location of the *.mod files with the /module: compiler switch.
0 Kudos
magliola
Beginner
545 Views
OK. I had it all wrong. I see what is going on now. The *.mod files were in the DEBUG subdirectory of the project along with the *.obj file.

I could put the source code for the modules in a *.for file and add that file to the project.

Thank you for your help.

0 Kudos
Reply