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

Problem with compile module files

paramont
Beginner
1,428 Views
I have a fortran project written in Fortran 77 originally by some old people. Now my boss has written some Fortran 90/95 routines and wanted me to combine them together. The new routines contain two modules that include global variables.

When I tried to compile this project, it always give me error message box said both two module files are configured to produce mod file with same name. Then the compilation was terminated.

I was using DVF 5.0 A.

Thank you all experts.
0 Kudos
7 Replies
Jugoslav_Dujic
Valued Contributor II
1,428 Views
For the start, upgrade to 5.0D -- this version is much more stable than 5.0A.

It's not clear what you're trying to do -- I suspect you're replacing COMMONs with MODULEs. If I'm right, these are similar but not identical and you cannot just replace COMMON with MODULE and expect it to work.

There may be only one MODULE with one name within one application, e.g.
MODULE something
REAL:: r  !a "global" variable
INTEGER:: ii(100)  !another "global" variable
CONTAINS
SUBROUTINE Foo()   !a routine
...
END SUBROUTINE Foo
END MODULE something
If you want to access r, ii, or Foo, you must put
USE something
as the very first line of the routine that uses it. But there may be only one definition of something.

Does it clear things up?

Jugoslav
0 Kudos
paramont
Beginner
1,428 Views
Well, simply speaking, this project was written in Fortran 77 before. Now we want to extend its function by writing some routine in Fortran 90/95. F77 use include files/COMMON to create global variables, while F90/95 uses MODULE. I was not trying to replace COMMON with MODULE. On the contrary, I want to keep the old part intact.

When I tried to update to 5.0D, I got an error message of: old file not found, DFORRT.DLL. However, this file is there, in winnt/system32. Anyway, it's nasty.

Thank you!
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,428 Views
Note that upgrade program asks you to confirm whether it got the three directories right (DevStudio, DevStudioSharedIDE and system32). It usually gets it right, but it's worth rechecking.

As Steve said in another thread, it expects to find exactly the same versions of files from the original DVF 5.0A installation.

If it doesn't solve your module problem (and I guess it won't), you could attach a zip file containting your .for, .f90 files, and ProjectName.dsp file to your reply [hint: "Attach Files" Forum feature is problematic. Keep the post text short (<1 screen) and attach zip file after you type it].

Jugoslav
0 Kudos
paramont
Beginner
1,428 Views
see attached files
0 Kudos
paramont
Beginner
1,428 Views
here are more
0 Kudos
paramont
Beginner
1,428 Views
Because the whole project is huge(~40MB), I only attached module file and .dsp file.

Thank you very much!
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,428 Views
Hmm, I don't get it -- flowdefs.f90 and leakoffdefs.f90 are not referenced at all in the .dsp file?

I have a hunch that you're trying to INCLUDE files which contain MODULEs. If that's the case, it's not a good idea -- you should add them to the project as source files.

Jugoslav
0 Kudos
Reply