The Elk Code
zfpole.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2017 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: zfpole
8 ! !INTERFACE:
9 pure complex(8) function zfpole(n,c,z)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! n : number of poles (in,integer)
12 ! c : constant, pole and residue data (in,complex(*))
13 ! z : point at which function is to be evaluated (in,complex)
14 ! !DESCRIPTION:
15 ! Returns the complex function
16 ! $$ f(z)=C+\sum_{i=1}^n \frac{a_i}{z_i-z}, $$
17 ! where $C={\tt c(1)}$, $z_1={\tt c(2)}$, $a_1={\tt c(3)}$, and so on.
18 !
19 ! !REVISION HISTORY:
20 ! Created October 2017 (JKD)
21 !EOP
22 !BOC
23 implicit none
24 ! arguments
25 integer, intent(in) :: n
26 complex(8), intent(in) :: c(*),z
27 ! local variables
28 integer i
29 complex(8) z1
30 zfpole=c(1)
31 do i=2,2*n,2
32  z1=c(i)+z
33  if (abs(z1%re)+abs(z1%im) > 1.d-8) then
34  zfpole=zfpole+c(i+1)/z1
35  end if
36 end do
37 end function
38 !EOC
39 
pure complex(8) function zfpole(n, c, z)
Definition: zfpole.f90:10