Hi,
The compiler HP-UX FORTRAN 90 gives me the following error:
program TEST
internal function HEVAL
Error 294 : Function HEVAL has not been given a result value
but in the definition of the function Heval I have the clause result
with the corresponding definition in the header of the function.
Can someone tell what I am doing wrong?
Thanks in advance,
David
-----------------------------------
program test
type Smatrix
integer :: ne
integer ,pointer :: i(:),j(:)
real(kind=8),pointer :: z(:)
end type Smatrix
integer,parameter :: n=10
real(kind=8),allocatable :: x(:)
type(Smatrix) :: H
allocate(H%i(n),H%j(n),H%z(n),x(n))
x=(/(real(i),i=1,n)/)
H=Heval(x)
deallocate(H%i,H%j,H%z,x)
stop 'end'
contains
function Heval(x) result(H)
type(Smatrix) :: H
real(kind=8) :: x(:)
integer :: i,n
n =Size(x)
H%i=(/(i,i=1,n)/)
H%j=(/(i,i=1,n)/)
H%z=x
return
end function Heval
end program test
--------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|