- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compile my code, I get an error:
Error 540 : Microsoft attributes REFERENCE and VALUE can only be applied to dummy arguments
The function is declared as follows:
SUBROUTINE GERK(F, NEQN, Y, T, TOUT, RELERR, ABSERR, IFLAG, GER 10
* GERROR, WORK, IWORK)
INTEGER*4 NEQN [VALUE]
INTEGER*4 IFLAG [REFERENCE]
INTEGER*4 IWORK [REFERENCE]
REAL*8 Y [REFERENCE]
REAL*8 T [REFERENCE]
REAL*8 TOUT [VALUE]
REAL*8 RELERR [VALUE]
REAL*8 ABSERR [VALUE]
REAL*8 GERROR [REFERENCE] <--- this line produces the error
REAL*8 WORK [REFERENCE]
This is the legacy code that I'm trying to compile, and AFAIK it used to compile fine with Visual Fortran 5. Doesn anyone have any ideas?
Thanks,
Pavel
Error 540 : Microsoft attributes REFERENCE and VALUE can only be applied to dummy arguments
The function is declared as follows:
SUBROUTINE GERK(F, NEQN, Y, T, TOUT, RELERR, ABSERR, IFLAG, GER 10
* GERROR, WORK, IWORK)
INTEGER*4 NEQN [VALUE]
INTEGER*4 IFLAG [REFERENCE]
INTEGER*4 IWORK [REFERENCE]
REAL*8 Y [REFERENCE]
REAL*8 T [REFERENCE]
REAL*8 TOUT [VALUE]
REAL*8 RELERR [VALUE]
REAL*8 ABSERR [VALUE]
REAL*8 GERROR [REFERENCE] <--- this line produces the error
REAL*8 WORK [REFERENCE]
This is the legacy code that I'm trying to compile, and AFAIK it used to compile fine with Visual Fortran 5. Doesn anyone have any ideas?
Thanks,
Pavel
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't quite figure out that SUBROUTINE line with "GER 10 * GERROR". Something doesn't look right...
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it's just a formatting thing (new line transition or something like that). When I removed the attribute, everything compiled fine.
In fact, the problem seems to boil down to the parameter mangling while calling across C++ and Fortran. I opened a new thread about it.
Best,
Pavel
In fact, the problem seems to boil down to the parameter mangling while calling across C++ and Fortran. I opened a new thread about it.
Best,
Pavel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the compiler is trying to tell you something with the compile error. My guess is that your subroutine statement is not formatted properly.
If you think there is a problem with the compiler, please report it through http://premier.intel.com/
If you think there is a problem with the compiler, please report it through http://premier.intel.com/

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