\addtogroup SELF_SupportRoutines @{ \fn UniformPoints Generates a REAL(prec) array of N points evenly spaced between two points.
REAL(prec) :: a
REAL(prec) :: b
REAL(prec) :: xU(0:N)
INTEGER :: N
....
xU = UniformPoints( a, b, N )
in | a | REAL(prec) | Starting point of the interval |
---|---|---|---|
in | b | REAL(prec) | Ending point of the interval |
in | N | INTEGER | The number of points in the interval \f$[a,b]\f$ |
in | xU(0:N) | REAL(prec) | Array of evenly spaced points in the interval \f$[a,b]\f$ |
@}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=prec) | :: | a | ||||
real(kind=prec) | :: | b | ||||
integer | :: | firstInd | ||||
integer | :: | lastInd |
function UniformPoints(a,b,firstInd,lastInd) result(xU)
implicit none
real(prec) :: a,b
integer :: firstInd,lastInd
real(prec) :: xU(firstInd:lastInd)
! LOCAL
real(prec) :: dx
integer :: i
dx = (b-a)/real((lastInd-firstInd),prec)
do i = firstInd,lastInd
xU(i) = a+dx*real(i-firstInd,prec)
enddo
endfunction UniformPoints