My IDE is: CodeBlocks 16.01
This is my code:
Program Array_To_Procedure
Implicit none
Integer, dimension (10) :: My_Array
Interface
Subroutine Fill_Array (a)
Integer :: i
Integer, intent ( inout ) :: a (*)
End subroutine Fill_Array
Subroutine Print_Array (a)
Integer :: i
Integer , intent ( in ) :: a (*)
End subroutine Print_Array
End interface
Call Fill_Array ( My_Array )
Call Print_Array ( My_Array )
End program Array_To_Procedure
Subroutine Fill_Array ( a )
Implicit none
Integer :: i
Integer, intent ( inout ) :: a (*)
Do i = 1 , size( a )
a(i) = i + 1
End Do
Return
End subroutine Fill_Array
Subroutine Print_Array ( a )
Implicit none
Integer :: i
Integer , intent ( in ) :: a (*)
Do i = 1 , size( a )
Write(*,*) a(i)
End Do
Return
End subroutine Print_Array
My intention is to use intrinsinc function size
for size determination of automatic array in subroutines. In my case, afther the compile process I got this message:
The upper bound in the last dimension must appear in the reference to the assumed size array 'a'
|
What is wrong with this code?