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

Intel Fortran says actual argument doesn't match dummy argument?

Bruce_E_
Beginner
2,054 Views

Apologies in advance for what seems to be a very basic question. I'm not a Fortran programmer, unfortunately, but I'm in a position of having to maintain some legacy FORTRAN77 code, and it is not compiling in Intel Visual Fortran Parallel XE 2013 (with VS2010) on Windows7.

The error I'm getting is 

> error #6633: The type of the actual argument differs from the type of the dummy argument.

It occurs in several calls to subroutines that are defined within the project. This code has the statement 

IMPLICIT REAL(8) (A-H,O-Z)

throughout, in both the calling function and the called subroutine. (It had been `REAL*8`, but I changed it.)

Doesn't that mean that the arguments, all of which have names that fall into the range (A-H,O-Z), will be two-byte reals? I don't know where they are being declared or otherwise converted to any other type. The only functions called within the subroutines are intrinsic math functions, such as cos, sin, atan2. 

Below is an example (I left out an INCLUDE statement that included a file with the IMPLICIT REAL statement above as its first line):

C    Transform from RS to RL
    call RS$RL(0,iobl,1,vrel,xlatgc,gam,az,vph,vth,vr,
*                 xlatgd,gaml,azl,vphl,vthl,vrl)

which calls

      SUBROUTINE RS$RL(ID,IOBL,IV,VREL,TH,GAM,AZ,VPH,VTH,VR,
     *                 THL,GAML,AZL,VPHL,VTHL,VRL)

C*  DECLARATIONS
      IMPLICIT REAL(8) (A-H,O-Z)
C     IMPLICIT REAL*8(A-H,O-Z)
      DEL = THL-TH
      IF(ID.EQ.0) THEN
C*  TRANSFORM FROM RS TO RL FRAME
        IF(IV.EQ.0) THEN
             VPH  = VREL*COS(GAM)*SIN(AZ)
             VTH  = VREL*COS(GAM)*COS(AZ)
             VR   = VREL*SIN(GAM)
        ENDIF
        IF(IOBL.EQ.0) THEN
             VPHL = VPH
             VTHL = VTH
             VRL  = VR
        ELSE
             VPHL = VPH
             VTHL = VTH*COS(DEL)-VR*SIN(DEL)
             VRL  = VTH*SIN(DEL)+VR*COS(DEL)
        ENDIF
        GAML = ATAN2(VRL,SQRT(VPHL**2+VTHL**2))
        AZL  = ATAN2(VPHL,VTHL)
      ELSE
C*  TRANSFORM FROM RL FRAME TO RS FRAME
        IF(IV.EQ.0) THEN
             VPHL = VREL*COS(GAML)*SIN(AZL)
             VTHL = VREL*COS(GAML)*COS(AZL)
             VRL  = VREL*SIN(GAML)
        ENDIF
        IF(IOBL.EQ.0) THEN
           VPH  = VPHL
           VTH  = VTHL
           VR   = VRL
        ELSE
           VPH  = VPHL
           VTH  = VTHL*COS(DEL)+VRL*SIN(DEL)
           VR   =-VTHL*SIN(DEL)+VRL*COS(DEL)
        ENDIF
        GAM  = ATAN2(VR,SQRT(VPH**2+VTH**2))
        AZ   = ATAN2(VPH,VTH)
      ENDIF
      RETURN
      END

The error messages complain about the arguments, vrel, xlatgc, gam, az.

Any suggestions or clues are much appreciated.

0 Kudos
26 Replies
Steven_L_Intel1
Employee
339 Views

Thanks. I don't get any errors building this, so what might have happened is that you have a "stale" generated interface module left behind. Do a Build > Clean and then rebuild the project and see what happens. If you still get the error, please provide me with the .vfproj file from your project.

0 Kudos
Bruce_E_
Beginner
339 Views

Steve Lionel (Intel) wrote:

Thanks. I don't get any errors building this, so what might have happened is that you have a "stale" generated interface module left behind. Do a Build > Clean and then rebuild the project and see what happens. If you still get the error, please provide me with the .vfproj file from your project.

Wow, that worked! I have to confess that I wasn't expecting that. I thought for sure that I had started from nothing but the source files, but I guess I must have carried along some leftover file from the old CVF project. Or maybe I did something wrong the first time and left some kind of bad interface module file (??).

Anyway, sure enough, Clean > Build worked, and now it compiles.

Thanks very much, and I'm sorry to have taken so much time looking for the wrong answer.

0 Kudos
FortranFan
Honored Contributor II
339 Views

All is well that ends well!

0 Kudos
Bruce_E_
Beginner
339 Views

FortranFan wrote:

All is well that ends well!

Indeed!

Thanks again to all who helped.

Bruce

0 Kudos
John_Campbell
New Contributor II
339 Views

Perhaps the error message could be more informative, although I'm not sure this is the full extent of the error message.

error #6633: The type of the actual argument differs from the type of the dummy argument.

Is the error that the variable type is wrong or just the variable kind ? Could a description of the two inconsistent types identified also be included in the report, especially if they are intrinsic data types.

Greater clarity in the message would help us ifort users and especially those learning the language to identify these problems.

John

0 Kudos
Steven_L_Intel1
Employee
339 Views

That's a good suggestion, John.
 

0 Kudos
Reply