I had this code. The original code, however, did not have that interface part that follows the comment: ! THIS IS THE RIGHT WAY.
integer*4 :: N, counter
real (kind = 8), dimension(:), allocatable :: work
! THIS IS THE RIGHT WAY
subroutine test00_1 ( N, work )
real*8, dimension(:) :: work
end subroutine test00_1
open (unit=1,file="triangleWindow.dat",status = "old")
N = 2310
call triangularWindow ( N, work )
10 format (E10.5)
counter = 0
do while (counter .le. N )
counter = counter + 1
write (1,10) work (counter)
call test00_1 ( N, work )
end program main
Without the Interface I was getting this compilation error:
Error: Dummy argument 'work' of procedure 'test00_1' at (1) has an attribute that requires an explicit interface for this procedure
Of, course I don't understand what it all means. So, I did some googling and found this webpage
which turned out to be very useful.
The error disappeared. Fine, but I still do not understand why it worked. Any help will be appreciated. Thanks, A.