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

Compliation error

ferrad01
Beginner
496 Views
I am moving code from Digital to Intel 11.1 and get the following compilation error:

col_inf.for(15): error #6636: This actual argument must be the name of a user subroutine or the name of intrinsic subroutine. [%VAL]

Code below:

SUBROUTINE COL_INF (MESSAGE)
USE HYSCLB
C
C message - text output to trace window
C
C
!DLLEXPORT :: COL_INF
IMPLICIT REAL(8) (A-H,O-Z)
C
CHARACTER*(*) MESSAGE
C
CALL COL_TRACE(%VAL(pTRACE), MESSAGE, pObject)
C
RETURN
END

SUBROUTINE COL_TRACE(TRACEFUNC, MESSAGE, OBJECT)
INTERFACE
SUBROUTINE TRACEFUNC(MESSAGE, OBJECT)
CHARACTER*(*) :: MESSAGE
INTEGER :: OBJECT
END
END INTERFACE
INTEGER OBJECT
CHARACTER*(*) MESSAGE
CALL TRACEFUNC(MESSAGE, OBJECT)
END


HYSCLB contains:

MODULE HYSCLB
INTEGER pObject
INTEGER pTRACE
END MODULE HYSCLB

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
496 Views
Well, you're trying to cheat, and you get caught by the compiler :). You're trying to pass an integer-by-value actual argument to a subroutine dummy.

Since, apparently, you use pTrace as a procedure pointer, your options are:

  1. Turn off interface checking (which is on only in Debug configuration as far as I recall)
  2. Turn off argument checking only for TRACEFUNC:
    SUBROUTINE COL_TRACE(TRACEFUNC, MESSAGE, OBJECT)
    !DEC$ATTRIBUTES NO_ARG_CHECK:: TRACEFUNC
  3. Re-implement the whole thing using F2003 procedure pointers.
0 Kudos
Reply