vacp5_0.f 2.23 KB
Newer Older
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
      MODULE m_vacp5_0
      CONTAINS
      SUBROUTINE vacp5_0(
     >     nmzxyd,nmzxy,z1,tpi,rxy,m,delz,
     <     pvac,fact)     

c     calculates a part of a vacuum potential caused 
c     by the vacuum charge density for the g_z=0 component
c     based on the using of the Green function
c                      Y. Mokrousov
      
      USE m_qsf
      IMPLICIT NONE

      INTEGER, INTENT (IN) :: nmzxy,nmzxyd,m
      REAL,    INTENT (IN) :: z1,tpi,delz
      COMPLEX, INTENT (IN) :: rxy(nmzxyd)
      COMPLEX, INTENT (OUT):: pvac(nmzxyd)
      REAL,    INTENT (OUT):: fact(nmzxyd)

      INTEGER imz,imz1,l
      REAL    z,zp,vr(nmzxyd),vi(nmzxyd),fpi
      REAL    grfr(nmzxyd),grfi(nmzxyd)

      INTRINSIC real,aimag
      

      fpi = 2.*tpi

      DO 150 imz = 1,nmzxy
               
         z = z1 + delz*(imz-1)
         
c----------> goes to the interstitial contribution afterwards

         fact(imz) = tpi*z1/(m*((z/z1)**m))
         
c---------------------------------------------------------
         
         DO 250 imz1 = 1,nmzxy
            
c-----------------------------------> g(z,z') started
            
            zp = z1 + delz*(imz1-1)
            
            IF (imz1.LE.imz) THEN
               
c---------------------------------------> z'< z
          
               grfr(imz1) = tpi*zp*((zp/z)**m)*
     *              real(rxy(imz1))/m
               grfi(imz1) = tpi*zp*((zp/z)**m)*
     *              aimag(rxy(imz1))/m


c---------------------------------------->
            ELSE
c---------------------------------------> z'> z
            
               grfr(imz1) = tpi*zp*((z/zp)**m)*
     *              real(rxy(imz1))/m
               grfi(imz1) = tpi*zp*((z/zp)**m)*
     *              aimag(rxy(imz1))/m

c----------------------------------------> 
            END IF
            
 250     CONTINUE               ! imz1
               
c-----------------------------------> g(z,z') finished

c------>  obtaining the vacuum contribution for the potential
         
         CALL qsf(delz,grfr(1),vr,nmzxy,0)
         CALL qsf(delz,grfi(1),vi,nmzxy,0)
         
         pvac(imz) = cmplx(vr(1),vi(1))
               
 150  CONTINUE                  !  imz 
      
      END SUBROUTINE vacp5_0 
      END MODULE m_vacp5_0