linspace Subroutine

public subroutine linspace(start, finish, num, val, step)

Generates evenly spaced numbers over a specified interval. Both end points are included. If start < finish, the returned step size (if step is present) will be negative.

Arguments

Type IntentOptional Attributes Name
real(kind=rp), intent(in) :: start

Starting point

real(kind=rp), intent(in) :: finish

Ending point, finish /= start

integer, intent(in) :: num

Number of values to generate, num >= 2

real(kind=rp), intent(out), dimension(:) :: val

(num,) array; Generated values

real(kind=rp), intent(out), optional :: step

Step size