fortranintel-fortran

Force ifort to ignore the error #6633: The type of the actual argument differs from the type of the dummy argument


I am trying to compile this Fortran code using ifort (version 2022.1.0). I am getting an error:

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

I already found that this error is serious - the code might be faulty, and it should be fixed, though nobody is maintaining this software anymore.

Anyway, I found that it is possible to compile such codes with Intel Visual Fortran by setting:

Properties -> Fortran -> Diagnostics -> Check Routine Interfaces -> [No]

Unfortunately, I cannot use this solution because I am using only the command-line version of ifort. Is it possible to set something in the ifort.cfg file to achieve the same result?

EDIT.

Probably, the code needs fixing and cannot be compiled as is. As requested in the comments below, I post the code fragment which produces an error:

subroutine aovec_aosph_nw2ac(ntot,natom,aoind,aostr,geoind,trmat,fileout)
   use mod_fun
   use mod_print
   implicit none
   integer ntot,natom,fileout
   integer aoind(ntot,5),geoind(natom,3)
   double precision trmat(ntot,ntot)
   character(4) aostr(ntot,2)
   integer aotmp(5)
   integer i,j,k,b1,b2,c1,c2,k1,k2,l1,l2,m1,m2

!  aoind(i,j,k,l,m) i:nw-order/j:atom/k:ang/l:ang(lz)/m:ang(lz,ind)
!  geoind(a,b,c)    a:atom/b:atom-group/c:group-ind
!  aces-ind         b->k->l->m->c
   do i = 1,ntot-1
   do j = i+1,ntot
      ! atom group
      b1=geoind(aoind(i,2),2)
      b2=geoind(aoind(j,2),2)
      if (b2.lt.b1) then
         call rot_aoind(ntot,aoind,i,j)
      elseif (b2.eq.b1) then
         ! angular momentum
         k1=aoind(i,3)
         k2=aoind(j,3)
         if (k2.lt.k1) then
            call rot_aoind(ntot,aoind,i,j)
         elseif (k2.eq.k1) then
            ! angular momentum (z-axis)
            l1=aoind(i,4)
            l2=aoind(j,4)
            if (l2.lt.l1) then
               call rot_aoind(ntot,aoind,i,j)
            elseif (l2.eq.l1) then
               ! angular momentum (z-axis,index)
               m1=aoind(i,5)
               m2=aoind(j,5)
               if (m2.lt.m1) then
                  call rot_aoind(ntot,aoind,i,j)
               elseif (m2.eq.m1) then
                  ! atom group index
                  c1=aoind(i,2)
                  c2=aoind(j,2)
                  if (c2.lt.c1) then
                     call rot_aoind(ntot,aoind,i,j)
                  endif
               endif
            endif
         endif
      endif
   enddo
   enddo

   write(fileout,'(/,a)') '* aolab (nwchem rotated)'
   do i = 1,ntot
      write(fileout,'(5i5,2a4)') (aoind(i,j),j=1,5), &
           (aostr(aoind(i,1),k),k=1,2)
   enddo

   trmat(1:ntot,1:ntot) = 0.0d0
   do i = 1,ntot
      trmat(aoind(i,1),i) = 1.0d0  
   enddo

   write(fileout,'(/,a)') '* trmat (nwchem rotated)'
   call print_rmat(trmat,ntot*ntot,ntot,ntot,fileout,2)
end subroutine aovec_aosph_nw2ac

When I try to compile it using the command:

ifort file.f90

I get the following:

file.f90(21): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
         call rot_aoind(ntot,aoind,i,j)
------------------------^
file.f90(21): error #6633: The type of the actual argument differs from the type of the dummy argument.   [AOIND]
         call rot_aoind(ntot,aoind,i,j)
-----------------------------^
file.f90(21): warning #6075: The data type of the actual argument does not match the definition.   [I]
         call rot_aoind(ntot,aoind,i,j)
-----------------------------------^
file.f90(21): warning #6075: The data type of the actual argument does not match the definition.   [J]
         call rot_aoind(ntot,aoind,i,j)
-------------------------------------^
file.f90(27): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
            call rot_aoind(ntot,aoind,i,j)
---------------------------^
file.f90(27): error #6633: The type of the actual argument differs from the type of the dummy argument.   [AOIND]
            call rot_aoind(ntot,aoind,i,j)
--------------------------------^
file.f90(27): warning #6075: The data type of the actual argument does not match the definition.   [I]
            call rot_aoind(ntot,aoind,i,j)
--------------------------------------^
file.f90(27): warning #6075: The data type of the actual argument does not match the definition.   [J]
            call rot_aoind(ntot,aoind,i,j)
----------------------------------------^
file.f90(33): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
               call rot_aoind(ntot,aoind,i,j)
------------------------------^
file.f90(33): error #6633: The type of the actual argument differs from the type of the dummy argument.   [AOIND]
               call rot_aoind(ntot,aoind,i,j)
-----------------------------------^
file.f90(33): warning #6075: The data type of the actual argument does not match the definition.   [I]
               call rot_aoind(ntot,aoind,i,j)
-----------------------------------------^
file.f90(33): warning #6075: The data type of the actual argument does not match the definition.   [J]
               call rot_aoind(ntot,aoind,i,j)
-------------------------------------------^
file.f90(39): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
                  call rot_aoind(ntot,aoind,i,j)
---------------------------------^
file.f90(39): error #6633: The type of the actual argument differs from the type of the dummy argument.   [AOIND]
                  call rot_aoind(ntot,aoind,i,j)
--------------------------------------^
file.f90(39): warning #6075: The data type of the actual argument does not match the definition.   [I]
                  call rot_aoind(ntot,aoind,i,j)
--------------------------------------------^
file.f90(39): warning #6075: The data type of the actual argument does not match the definition.   [J]
                  call rot_aoind(ntot,aoind,i,j)
----------------------------------------------^
file.f90(45): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
                     call rot_aoind(ntot,aoind,i,j)
------------------------------------^
file.f90(45): error #6633: The type of the actual argument differs from the type of the dummy argument.   [AOIND]
                     call rot_aoind(ntot,aoind,i,j)
-----------------------------------------^
file.f90(45): warning #6075: The data type of the actual argument does not match the definition.   [I]
                     call rot_aoind(ntot,aoind,i,j)
-----------------------------------------------^
file.f90(45): warning #6075: The data type of the actual argument does not match the definition.   [J]
                     call rot_aoind(ntot,aoind,i,j)
-------------------------------------------------^
file.f90(66): warning #6075: The data type of the actual argument does not match the definition.
   call print_rmat(trmat,ntot*ntot,ntot,ntot,fileout,2)
-----------------------------^
file.f90(66): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
   call print_rmat(trmat,ntot*ntot,ntot,ntot,fileout,2)
-----------------------------------^
file.f90(66): warning #6075: The data type of the actual argument does not match the definition.   [NTOT]
   call print_rmat(trmat,ntot*ntot,ntot,ntot,fileout,2)
----------------------------------------^
file.f90(66): warning #6075: The data type of the actual argument does not match the definition.   [FILEOUT]
   call print_rmat(trmat,ntot*ntot,ntot,ntot,fileout,2)
---------------------------------------------^
compilation aborted for file.f90 (code 1)

This is the subroutine for rot_aoind:

subroutine rot_aoind(ntot,aoind,ind1,ind2)                                                                                                       
   implicit none
   integer ntot,aoind(ntot,5),ind1,ind2
   integer k,aotmp(5)
   do k = 1, 5  
      aotmp(k)      = aoind(ind1,k) 
      aoind(ind1,k) = aoind(ind2,k)
      aoind(ind2,k) = aotmp(k)
   enddo
end subroutine rot_aoind

Solution

  • I found the solution on the Intel forum, exactly in this answer. Well, I would call it more a "workaround" than a "solution."

    For some reason, ifort is "confused when the type comes from the module currently being compiled". So what I did was:

    1. Move the troublesome file outside the directory (in this case, aovec.f90)
    2. Compile other files just using the make command.
    3. Move the file back and compile it again.

    Finally, it compiled successfully.

    Thank you, @IanBush and @francescalus, for your help and suggestions!