- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'
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'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You do not include the round.ffn file twice, by any chance?
Regards,
Arjen
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page