Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

interface, error when compiling

Status
Not open for further replies.

whatisthishmm

Technical User
Mar 17, 2009
2
NL
Hello everyone.

I'm writing a program which uses several subroutines. These subroutines are also defined in the module mod_interfaces. When i compile the program by using a makefile i get an error for the file defsystemrad.

error during compiling:
---------------------------------
In file defsystemrad.f90:4

USE mod_interfaces
1
Error: Module 'mod_interfaces' at (1) redefines the current program unit 'defsystemrad'
make: *** [defsystemrad.o] Error 1
---------------------------------


So my first thought was that the definition of defsystemrad in mod_interfaces does not exactly match the subroutine. After checking several times i made sure that the definitions do match.

part of mod_interfaces containing interface for defsystemrad
---------------
module mod_interfaces

interface defsystemrad
subroutine defsystemrad(dlower,dmain,dupper,smat_fp,rhsvector,idebug)
real dlower:)), dmain:)), dupper:))
real smat_fp
real rhsvector:))
integer idebug
end subroutine defsystemrad
end interface defsystemrad

!other interfaces further below in this file
--------------------------
header of defsystemrad
--------------------------
subroutine defsystemrad(dlower,dmain,dupper,smat_fp, &
rhsvector,idebug)
USE mod_interfaces
USE mod_mesh
USE mod_physpar
implicit none
real dlower:)), dmain:)), dupper:))
real smat_fp
real rhsvector:))
integer idebug

!* locals
integer i, idegfd, inodpoint
real conduct_left, conduct_right, heat_left, heat_right
real radmid_left, radmid_right, segment_left, segment_right
real zmid_left, zmid_right

!* init. r.h.s. vector
rhsvector = 0e0
------------------

does anyone see the cause of this error ? All help would be greatly appreciated! Thanks

Bram
 
Tou haven't specified any intent keywords on the parameters. don@t really know what the defaults are but they may be different for interfaces>

have you built the code several times before? if so< delete all the mod files before starting.
 
Hey xwb, thanks for the reply. I tried removing the .o and .mod files before recompiling, but it did not help. I never used intent in interfaces and it always worked out fine. I will look into it, but i'd be surprised if it is the cause. Btw, i tried compiling with g95. I heard people say installing gfortran might be better. Do you know something about this maybe?
 
I've always had problems with gfortran; I use g95 in preference.

Try removing the defsystemrad after interface.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top