101 COMPLEX(kind=dp),
INTENT(in) :: z
102 REAL(kind=
dp),
INTENT(in) :: err
104 INTEGER :: n, n3, n3_3
105 REAL(kind=
dp) :: a, a_pi, a_sqr, aux13, cos_2yx, del2_tmp, del3, del3_3_tmp, del3_tmp, del5, &
106 delta3, delta5, den1, erfcsy, exp1, exp2, exp3, exp3_3_den, exp3_den, exp_del1, &
107 exp_x_sqr, four_a_sqr, half_a, l_old, myerr, sigma1, sigma2, sigma3, sigma4, sigma4_5, &
108 sigma5, sin_2yx, two_a, two_a_pi, two_a_sqr, two_a_x, two_exp_x_sqr_ysqr, two_yx, v_old, &
109 x, x_sqr, xsign, y, y_sqr, ysign
117 IF (abs(x) .EQ.
zero)
THEN
122 myerr = max(err,
eps0)
123 a = sqrt(-
pi2/log(err/2.0_dp))
131 erfcsy = erfc_scaled(abs(y))
135 y = max(
rmin, abs(y))
140 exp_x_sqr = exp(-x_sqr)
141 cos_2yx = cos(two_yx)
142 sin_2yx = sin(two_yx)
144 (erfcsy*cos_2yx + two_a_pi*sin(two_yx/2)**2/y)
145 l_old = -erfcsy + a_pi/y
160 exp2 = exp(four_a_sqr*n3 - 2*two_a_x - two_a_sqr)
161 exp3 = exp(-(two_a_sqr*n3 - two_a_x - two_a_sqr))
163 del3_tmp = exp(-(a_sqr*n3**2 - two_a_x*n3 &
164 - two_a_sqr*n3 + x_sqr + two_a_x + a_sqr))
165 del3_3_tmp = exp(a_sqr - (two_a_sqr*n3 - two_a_x))
168 IF (delta3 .LT. myerr .AND. delta5 .LT. myerr .AND. &
169 n .GT. 50)
EXIT loop1
171 den1 = a_sqr*n**2 + y_sqr
172 exp_del1 = exp(-(a_sqr*n**2))/den1
173 del2_tmp = del2_tmp*exp1
175 minor:
IF (n3_3 .GE. 1)
THEN
176 del3_tmp = del3_tmp*exp3
177 exp3_den = del3_tmp*exp_del1* &
178 (den1/(a_sqr*n3**2 + y_sqr))
179 del3_3_tmp = del3_3_tmp*exp2
180 exp3_3_den = exp3_den*del3_3_tmp* &
181 ((a_sqr*n3**2 + y_sqr)/ &
182 (a_sqr*n3_3**2 + y_sqr))
183 del5 = n3_3*exp3_3_den + n3*exp3_den
184 del3 = exp3_3_den + exp3_den
186 del3_tmp = del3_tmp*exp3
187 del3 = del3_tmp*exp_del1* &
188 (den1/(a_sqr*n3**2 + y_sqr))
194 sigma1 = sigma1 + exp_del1
195 sigma2 = sigma2 + del2_tmp*exp_x_sqr*exp_del1
196 sigma3 = sigma3 + del3
197 sigma4 = sigma4 + n*del2_tmp*exp_x_sqr*exp_del1
198 sigma5 = sigma5 + del5
200 IF (x .GE. 5.0e-4_dp)
THEN
201 sigma4_5 = -sigma4 + sigma5
203 sigma4_5 = sigma4_5 + 2*n**2*two_a_x*exp_x_sqr &
204 *exp_del1*(
one + 1.666666666666667e-1_dp &
205 *(two_a_x*n)**2 + 8.333333333333333e-3_dp &
215 aux13 = y*two_a_pi* &
216 (-cos_2yx*exp_x_sqr*sigma1 +
half*(sigma2 + sigma3))
217 mumu:
IF (y .LE. 5.0_dp .AND. two_yx .GT.
rmin)
THEN
219 *(sin_2yx*exp_x_sqr*(l_old + two_a_pi*y*sigma1) &
220 + two_a_pi*half_a*sigma4_5)
221 ELSE IF (y .LE. 5.0_dp .AND. two_yx .LE.
rmin)
THEN
223 *(
two*y*exp_x_sqr*(x*l_old + x*two_a_pi*y &
224 *sigma1) + two_a_pi*half_a*sigma4_5)
227 *(sin_2yx*exp_x_sqr*min(
zero, abs(l_old &
228 + (two_a_pi*y*sigma1))) + two_a_pi*half_a &
234 exp2 = exp(four_a_sqr*n3 - 2*two_a_x - two_a_sqr)
235 del3_3_tmp = exp(a_sqr + two_a_x - two_a_sqr*n3)
238 IF (delta3 .LT. myerr .AND. delta5 .LT. myerr .AND. &
239 n .GT. 50)
EXIT loop2
241 IF (n3_3 .GE. 1)
THEN
242 exp3_den = exp(-(a*n3 - x)*(a*n3 - x)) &
243 /(a_sqr*n3**2 + y_sqr)
244 del3_3_tmp = del3_3_tmp*exp2
245 exp3_3_den = exp3_den*del3_3_tmp*((a_sqr*n3**2 + y_sqr) &
246 /(a_sqr*n3_3**2 + y_sqr))
247 del5 = n3_3*exp3_3_den + n3*exp3_den
248 del3 = exp3_3_den + exp3_den
250 del3 = exp(-(a*n3 - x)**2)/(a_sqr*n3**2 + y_sqr)
256 sigma3 = sigma3 + del3
257 sigma5 = sigma5 + del5
264 *exp_x_sqr*l_old + two_a_pi*half_a*sigma5)
270 IF (ysign .LT.
zero)
THEN
271 two_exp_x_sqr_ysqr =
two*exp(-x_sqr + y_sqr)
317 COMPLEX(kind=dp),
INTENT(in) :: z
319 REAL(kind=
dp),
PARAMETER :: factor = 1.12837916709551257388_dp
321 INTEGER :: i, j, kapn, n, np1, nu
323 REAL(kind=
dp) :: c, daux, h, h2, qlambda, qrho, rx, ry, &
324 sx, sy, tx, ty, u, u1, u2, v, v1, v2, &
325 w1, x, xabs, xabsq, xaux, xi, xquad, &
326 xsum, y, yabs, yi, yquad, ysum
341 xquad = xabsq - yabs**2
344 a = qrho .LT. 0.085264_dp
353 qrho = (
one - 0.85_dp*y)*sqrt(qrho)
354 n = nint(6.0_dp + 72.0_dp*qrho)
356 xsum =
one/real(j, kind=
dp)
361 xaux = (xsum*xquad - ysum*yquad)/real(i, kind=
dp)
362 ysum = (xsum*yquad + ysum*xquad)/real(i, kind=
dp)
363 xsum = xaux +
one/real(j, kind=
dp)
366 u1 = -factor*(xsum*yabs + ysum*xabs) +
one
367 v1 = factor*(xsum*xabs - ysum*yabs)
370 v2 = -daux*sin(yquad)
375 bran2:
IF (qrho .GT.
one)
THEN
384 nu = int(3.0_dp + (1442.0_dp/(26.0_dp*qrho &
397 qrho = (
one - y)*sqrt(
one - qrho)
400 kapn = nint(7.0_dp + 34.0_dp*qrho)
401 nu = nint(16.0_dp + 26.0_dp*qrho)
410 IF (b) qlambda = h2**kapn
419 tx = yabs + h + np1*rx
421 c =
half/(tx**2 + ty**2)
424 IF (b .AND. n .LE. kapn)
THEN
432 IF (h .EQ.
zero)
THEN
440 IF (yabs .EQ.
zero) u = exp(-xabs**2)
446 IF (yi .LT.
zero)
THEN
460 IF (xi .GT.
zero) v = -v
462 IF (xi .LT.
zero) v = -v