Type | Intent | Optional | Attributes | Name | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
function f(x)Arguments
Return Value real(kind=8) |
||||||||||||||||||||
real(kind=8), | dimension(:) | :: | x |
function d_trapz_nonlin_func(f,x) result(int) interface function f(x) real(8) :: x real(8) :: f end function f end interface real(8),dimension(:) :: x real(8) :: dh integer :: L,i real(8) :: int L = size(x) ! int=0.d0 do i=1,L-1 dh = (x(i+1)-x(i))/2d0 int = int + ( f(x(i+1)) + f(x(i)) )*dh enddo end function d_trapz_nonlin_func