1313c license: GNU GPL
1414
1515 subroutine propaespacelibreintadda (Rij ,k0a ,
16- $ gridspacex ,gridspacey ,gridspacez ,relreq ,result )
16+ $ gridspacex ,gridspacey ,gridspacez ,relreq ,result , IFAIL )
1717 implicit none
1818 integer i,j
1919c definition of the position of the dipole, observation, wavenumber
2020c ,wavelength, spacing lattice
2121 double precision result(12 )
2222 double precision k0a,gridspacexm,gridspaceym,gridspacezm
2323 double precision x,y,z,gridspacex,gridspacey,gridspacez
24- double precision k0,xx0,yy0,zz0
24+ double precision k0,xx0,yy0,zz0,RR
2525 double precision Rij(3 )
2626
2727c The structure of the result is the following:
@@ -43,23 +43,33 @@ subroutine propaespacelibreintadda(Rij,k0a,
4343 y= Rij(2 )
4444 z= Rij(3 )
4545 k0= k0a
46- gridspacexm= gridspacex* 0.1d0
47- gridspaceym= gridspacey* 0.1d0
48- gridspacezm= gridspacez* 0.1d0
46+ gridspacexm= gridspacex* 0.01d0
47+ gridspaceym= gridspacey* 0.01d0
48+ gridspacezm= gridspacez* 0.01d0
4949c We perform the integration of the tensor
5050c definition for the integration
5151 MINCLS = 1000
5252 MAXCLS = 1000000
5353 KEY = 0
54- ABSREQ = 0.d0
55-
54+
55+ c Based on the conservative estimate from below of the largest
56+ c component of the integral. For moderate and large distances the
57+ c integral will actually scale as k^2/R, for small distances R^-3
58+ c dependence will lead to larger values than based on its center
59+ RR= x* x+ y* y+ z* z
60+ ABSREQ = RELREQ* gridspacex* gridspacey* gridspacez/ (RR** 1.5d0 )
61+ c ABSREQ=0
62+
5663 A(1 )=- gridspacex/ 2.d0
5764 A(2 )=- gridspacey/ 2.d0
5865 A(3 )=- gridspacez/ 2.d0
5966 B(1 )=+ gridspacex/ 2.d0
6067 B(2 )=+ gridspacey/ 2.d0
6168 B(3 )=+ gridspacez/ 2.d0
6269
70+ c If some of the coordinates are small, the corresponding
71+ c non-diagonal terms of the Green's tensor are further considered
72+ c null (during each integrand evaluation)
6373 xx0= 1.d0
6474 yy0= 1.d0
6575 zz0= 1.d0
@@ -80,9 +90,12 @@ subroutine propaespacelibreintadda(Rij,k0a,
8090 result(N)= result(N)/ gridspacex/ gridspacey/ gridspacez
8191 enddo
8292
83- if (ifail.ne. 0 ) then
84- write (* ,* ) ' IFAIL in IGT routine' ,IFAIL
85- endif
93+ c We return IFAIL instead of testing it here to avoid output to
94+ c terminal directly from Fortran, which leads to dependence on
95+ c quadmath library
96+ c if (ifail.ne.0) then
97+ c write(*,*) 'IFAIL in IGT routine',IFAIL
98+ c endif
8699
87100 end
88101c *************************************************************
0 commit comments