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

compile error: REFERENCE/VALUE attributes for dummy args

pavel_sorokin
Beginner
787 Views
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
0 Kudos
3 Replies
Steven_L_Intel1
Employee
787 Views
I can't quite figure out that SUBROUTINE line with "GER 10 * GERROR". Something doesn't look right...

Steve
0 Kudos
pavel_sorokin
Beginner
787 Views
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
0 Kudos
Steven_L_Intel1
Employee
787 Views
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/
0 Kudos
Reply