The Elk Code
 
Loading...
Searching...
No Matches
stheta_sq.f90
Go to the documentation of this file.
1
2! Copyright (C) 2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU Lesser General Public
4! License. See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: stheta_sq
8! !INTERFACE:
9elemental real(8) function stheta_sq(x)
10! !INPUT/OUTPUT PARAMETERS:
11! x : real argument (in,real)
12! !DESCRIPTION:
13! Returns the Heaviside step function corresponding to the square-wave pulse
14! approximation to the Dirac delta function
15! $$ \tilde\Theta(x)=\left\{\begin{array}{ll}
16! 0 & \quad x \le -1/2 \\
17! x+1/2 & \quad -1/2 < x < 1/2 \\
18! 1 & \quad x\ge 1 \end{array}\right. $$
19!
20! !REVISION HISTORY:
21! Created July 2008 (JKD)
22!EOP
23!BOC
24implicit none
25! arguments
26real(8), intent(in) :: x
27if (x <= -0.5d0) then
28 stheta_sq=0.d0
29 return
30end if
31if (x < 0.5d0) then
32 stheta_sq=x+0.5d0
33else
34 stheta_sq=1.d0
35end if
36end function
37!EOC
38
elemental real(8) function stheta_sq(x)
Definition stheta_sq.f90:10