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

Declaration of routine 'DROUND' conflicts with a previous declaration

davidgraham
Beginner
1,991 Views
When I compiled I got "Declaration of routine 'ROUND' conflicts with a previous declaration". I had never got this error before when I compiled and had not changed the function.

I therefore renamed the function to 'dround' but get the above error. I've even deleted all the files in the debug directory and recompiled - I don't know what I'm doing wrong.

integer*4 function dround (d)
! -----------------------------------------
! round double precision value to integer*4
real*8 d
if (d.ge.0d0) then
d=d+5d-1
else
d=d-5d-1
endif
dround=d
return
end

interface
integer*4 function dround (d)
real*8 d
end function
end interface
0 Kudos
6 Replies
Arjen_Markus
Honored Contributor II
1,991 Views
Can you show us the exact source you are compiling? The fragment you show is not
valid Fortran and the cause of the error message is likely located in the code you
have not shown.

BTW, your rounding function is changing its argument, d. That may not be quite
what you want.

Regards,

Arjen
0 Kudos
davidgraham
Beginner
1,991 Views
Arjen,
It's a large project, here are the two bits of code that I think are important.

round.ffn is the function - I add that to may large project using an include statement in a file include.f90

! other includes
include 'rotlim.fsb'
include 'round.ffn'
include 'reqHts.ffn'
! etc

round.fif is the interface which is also added as using an include statement at the start of any routine that uses the function.

include 'round.fif'
0 Kudos
Arjen_Markus
Honored Contributor II
1,991 Views
You do not include the round.ffn file twice, by any chance?

Regards,

Arjen
0 Kudos
davidgraham
Beginner
1,991 Views
No, I've checked.

I edited a file I have never edited before, compiled and got this error. I wondered if that file contained its own function 'round' but it doesn't. Decided to change the name of my function to 'dround' but it still won't compile.
0 Kudos
Steven_L_Intel1
Employee
1,991 Views
Is all this code in a module or are contained procedures? It is an error to declare an explicit interface in a scope where the function itself is defined. Your use of include files makes me think you are doing this.
0 Kudos
davidgraham
Beginner
1,991 Views
I think I have solved it.
I think the error I listed was the second error in the error list.
Once I fixed the first error, the second disapeared.
Thanks,
David
0 Kudos
Reply