File: sdelta_sq.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (33 lines) | stat: -rw-r--r-- 756 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

! Copyright (C) 2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
! This file is distributed under the terms of the GNU Lesser General Public
! License. See the file COPYING for license details.

!BOP
! !ROUTINE: sdelta_sq
! !INTERFACE:
real(8) function sdelta_sq(x)
! !INPUT/OUTPUT PARAMETERS:
!   x : real argument (in,real)
! !DESCRIPTION:
!   Returns the square-wave pulse approximation to the Dirac delta function
!   $$ \tilde\delta(x)=\left\{\begin{array}{ll}
!    1 & \quad |x|\le 1/2 \\
!    0 & \quad |x|>1/2 \end{array}\right. $$
!
! !REVISION HISTORY:
!   Created July 2008 (JKD)
!EOP
!BOC
implicit none
! arguments
real(8), intent(in) :: x
if (abs(x).le.0.5d0) then
  sdelta_sq=1.d0
else
  sdelta_sq=0.d0
end if
return
end function
!EOC