- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
recently i wanna compile some old source files(F77), and many subroutines are like this:
!------------------------
subroutine func(x)
real,dimension(*):: x !dummy assumed-size array
end subroutine func
program main
real:: a
call func(a) !call with an actual scalar
end program main
!-----------------------
ivf2017u7 is ok for this code but ivf2018u1 throw out the error message #8284: if the actual argument is scalar, the dummy argument shall be scalar......
so is it a temporary compiler bug for ivf2018 or ivf decide to delete this rule?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your program is not standard F77. The 2017 compiler (and many older ones) can also detect this, but if the subroutine and call are in different source files, it requires "generated interface checking" to be enabled AND for the subroutine to be compiled first. That option has been the default for many years. It is not a compiler bug.
I wrote about this back in 2009 (see the section on Sequence Association). Does the subroutine try to change the value of the argument? If not, you can pass instead and satisfy the rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:
Your program is not standard F77. The 2017 compiler (and many older ones) can also detect this, but if the subroutine and call are in different source files, it requires "generated interface checking" to be enabled AND for the subroutine to be compiled first. That option has been the default for many years. It is not a compiler bug.
I wrote about this back in 2009 (see the section on Sequence Association). Does the subroutine try to change the value of the argument? If not, you can pass instead and satisfy the rule.
thank you for your advice
you said ivf2017 would detect this but i tried with disable/enable "check routine interface"(i didn't find the "generated interface checking") and split subroutine and call into two files, there is no warning and no error.
ok, this does't matter. i need to know what i should do with these code for ivf2018 and the later version
some subroutines in code really changed the value of the argument
so as your opinion, there is nothing i can do for the compiling with ivf2018 but modify the source file, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd be interested in seeing the actual source files involved and the buildlog.htm. You can turn off "Check Routine Interfaces" and this error will (probably) go away, but that's like running a power saw without a blade guard. My advice would be to correct the error in your code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:
I'd be interested in seeing the actual source files involved and the buildlog.htm. You can turn off "Check Routine Interfaces" and this error will (probably) go away, but that's like running a power saw without a blade guard. My advice would be to correct the error in your code.
sorry, i can't offer you the code because the my teacher does not allow this
i will try your advice because i think this code is stable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
linying l. wrote:
Quote:
i will try your advice because i think this code is stable
I've heard that many times before. More often than not, the code isn't in fact "stable" and has been producing wrong answers for years. But you do what you need to do. If it were me, I would not let incorrect code remain in my source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:thank you again. i will try.
Quote:
linying l. wrote:
Quote:
i will try your advice because i think this code is stable
I've heard that many times before. More often than not, the code isn't in fact "stable" and has been producing wrong answers for years. But you do what you need to do. If it were me, I would not let incorrect code remain in my source.

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