Hello,
The following program does not compile but returns the following error:
error #6236: A specification statement cannot appear in the executable section.
All I would like to do is to be able to transfer the array r(i) from the subroutine to the main program without using the "contents"
statement. The actual program I am working on is much bigger but the issue is the same, i.e., getting the main program to be able to
use r(i) inside the subroutine.
Program Test
IMPLICIT NONE
real,dimension(1) :: r
CALL f(r)
write(*,*) r
subroutine f(r)
implicit none
integer :: i
real, intent(out) :: r(i)
do i = 1, 10
r = 2*i
enddo
end subroutine
END
Thank you,
Vahid
The following program does not compile but returns the following error:
error #6236: A specification statement cannot appear in the executable section.
All I would like to do is to be able to transfer the array r(i) from the subroutine to the main program without using the "contents"
statement. The actual program I am working on is much bigger but the issue is the same, i.e., getting the main program to be able to
use r(i) inside the subroutine.
Program Test
IMPLICIT NONE
real,dimension(1) :: r
CALL f(r)
write(*,*) r
subroutine f(r)
implicit none
integer :: i
real, intent(out) :: r(i)
do i = 1, 10
r = 2*i
enddo
end subroutine
END
Thank you,
Vahid