The following code gives:

t.f90:41.12:

  call sub ( shape_line_P1 )
           1
Error: Type/rank mismatch in argument 'sub1' at (1)

I tested ifort, lahey, g95 without any problem.


module int_m
  interface shape_line_P1
    module procedure shape_line_P1, shape_line_P1_2
  end interface
contains
  subroutine shape_line_P1 ( xr, phi, dphi )
    real, intent(in), dimension(:) :: xr
    real, intent(out), dimension(:,:) :: phi
    real, intent(out), dimension(:,:), optional :: dphi
    phi = 0
    dphi = 0
  end subroutine shape_line_P1
  subroutine shape_line_P1_2 ( xr, phi, dphi )
    real, intent(in), dimension(:,:) :: xr
    real, intent(out), dimension(:,:) :: phi
    real, intent(out), dimension(:,:,:), optional :: dphi
    phi = 0
    dphi = 0
  end subroutine shape_line_P1_2
end module int_m
module tt
  use int_m
contains
   subroutine sub ( sub1 )
    interface
      subroutine sub1 ( xr, phi, dphi )
        real, intent(in), dimension(:,:) :: xr
        real, intent(out), dimension(:,:) :: phi
        real, intent(out), dimension(:,:,:), optional :: dphi
      end subroutine sub1
    end interface
    real, dimension(2,1) :: xr
    real, dimension(2,2) :: phi
    real, dimension(2,2,1) :: dphi
    xr = 0
   call sub1 ( xr, phi, dphi )
   end subroutine sub
end module tt
program z
  use tt
  call sub ( shape_line_P1 )
end program z


-- 
           Summary: Interface statement not detected: generate Error:
                    Type/rank mismatch
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: m dot a dot hulsen at tue dot nl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33847

Reply via email to