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

Error #6633 when recompile a CVF library

tsingfeng
Beginner
692 Views
Codes can be compiled properly in CVF. Trying to move it to Intel VF, but got this error:
"Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [INTFILEDEST]"

Any suggestion about this?

The source codes as the following:


SUBROUTINE destroyInternal(intFile)

INCLUDE 'toolType.fi'

type(internalFile):: intFile

IF (intFile%maxLines .gt. 0) deallocate(intFile%fileLines)

intFile%usedLines = 0

END SUBROUTINE destroyInternal



SUBROUTINE copyInternal(intFileSource,intFileDest)

INCLUDE 'toolType.fi'

INTEGER line

type(internalFile) :: intFileSource,intFileDest

CALL destroyInternal(intFileDest)

CALL openInternal(intFileDest,intFileSource%maxLines)

DO line=1,intFileSource%usedLines

CALL writeInternal(intFileDest,intFileSource%fileLines(line));

ENDDO

END SUBROUTINE copyInternal


toolType.fi

TYPE internalFile

character,pointer :: fileLines(:)*maxLineWidth

integer maxLines

integer usedLines

integer lineWidth

integer curLine

END TYPE internalFile


Thanks,
Tsingfeng

0 Kudos
2 Replies
Steven_L_Intel1
Employee
692 Views
Even though you are INCLUDEing the same text for the type declaration for internalFile, the Fortran language says that these are different types and therefore there is a type mismatch. Intel Fortran is better at detecting such errors than CVF was.

The best solution is to turn toolType.fi into a module. You can do this with minimal source changes as follows.

Create a new source file internalFileMod.f90 with the contents:

[fortran]MODULE internalFileMod
TYPE internalFile
character,pointer :: fileLines(:)*maxLineWidth
integer maxLines
integer usedLines
integer lineWidth
integer curLine
END TYPE internalFile
END MODULE internalFileMod[/fortran]

Now replace toolType.fi with the single line:

USE internalFileMod

See how that works for you. This will work only if the INCLUDE of toolType.fi is the first thing after the SUBROUTINE or FUNCTION statement. If it isn't, then move the INCLUDE up until it is.
0 Kudos
tsingfeng
Beginner
692 Views
Thanks Steve for the quick reply!
This solution works. Knowing that Intel Fortran is more strict in type mismatch, will be careful about such type of problems in legacy codes.
0 Kudos
Reply