Array parameter shape mismatch

The type of an actual argument does not match the corresponding formal parameter at a subroutine call.

Specifically, this error occurs when both the actual and formal parameter types are arrays, but the arrays have different shape.

This same kind of error can also happen when a FORTRAN dummy argument of type subroutine is invoked. That is, the subroutine that is invoked through a dummy argument might exhibit the same problem as can occur in a direct call. In this case, the problem may or may not occur, depending on what subroutine was passed to the dummy argument of subroutine type. There will be an additional observation in such cases that identifies the call site where the subroutine argument was passed in.

ID

Observation

Description

1

Call site

The actual argument that was passed

2

Definition

The definition of the called procedure and shows the declaration of the formal parameter

Example

          
subroutine mysub(m)
type mytype1
    integer f1
    real f2
end type mytype1
type (mytype1), dimension(2,3) :: m
print *, m
end

type mytype2
    integer g1
    real g2
end type mytype2
type (mytype2), dimension(3,2) :: n
n%g1 = 1
call mysub(n)
! shapes of dummy argument and actual argument are different.
print *, n%g1
end
        

Copyright © 2010, Intel Corporation. All rights reserved.