boxcar Function

public elemental function boxcar(x, a, b, height) result(res)

Boxcar function.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: x

argument

real(kind=rk), intent(in) :: a

interval limit

real(kind=rk), intent(in) :: b

interval limit

real(kind=rk), intent(in) :: height

pulse height

Return Value real(kind=rk)


Source Code

   elemental real(rk) function boxcar(x, a, b, height) result(res)
   !! Boxcar function.
      real(rk), intent(in) :: x
         !! argument
      real(rk), intent(in) :: a, b
         !! interval limit \( a < b \)
      real(rk), intent(in) :: height
         !! pulse height

      res = ZERO
      if (x > a .and. x < b) res = height

   end function boxcar