alb
09-22-2006, 07:12 AM
Hello,
i need some help on the interface declaration of the function to be
integrated in qsimp.f90 and trapzd.f90.
It says:
INTERFACE
FUNCTION func(x)
USE nrtype
REAL(SP), DIMENSION(:), INTENT(IN) :: x
REAL(SP), DIMENSION(size(x)) :: func
END FUNCTION func
END INTERFACE
Now I tried to integrate the following function
FUNCTION test(m)
USE nrtype
IMPLICIT NONE
REAL(SP), DIMENSION(1) :: m
REAL(SP), DIMENSION(SIZE(m)) :: test
test = m**2
RETURN
END FUNCTION test
by calling
myres = QSIMP(test,-1.,1.)
The result however is NaN. Could anyone tell me what the function
has to look like to get the thing working?
Regards,
alb
i need some help on the interface declaration of the function to be
integrated in qsimp.f90 and trapzd.f90.
It says:
INTERFACE
FUNCTION func(x)
USE nrtype
REAL(SP), DIMENSION(:), INTENT(IN) :: x
REAL(SP), DIMENSION(size(x)) :: func
END FUNCTION func
END INTERFACE
Now I tried to integrate the following function
FUNCTION test(m)
USE nrtype
IMPLICIT NONE
REAL(SP), DIMENSION(1) :: m
REAL(SP), DIMENSION(SIZE(m)) :: test
test = m**2
RETURN
END FUNCTION test
by calling
myres = QSIMP(test,-1.,1.)
The result however is NaN. Could anyone tell me what the function
has to look like to get the thing working?
Regards,
alb