checkdopall.f90 1.86 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
MODULE m_checkdopall

CONTAINS

SUBROUTINE checkDOPAll(input,dimension,sphhar,stars,atoms,sym,vacuum,oneD,&
                       cell,potden,ispin)

   USE m_sphpts
   USE m_checkdop
   USE m_types
   USE m_cylpts
   USE m_points

   IMPLICIT NONE

   TYPE(t_input),INTENT(IN)     :: input
   TYPE(t_dimension),INTENT(IN) :: dimension
   TYPE(t_sphhar),intent(in)    :: sphhar      
   TYPE(t_stars),INTENT(IN)     :: stars
   TYPE(t_atoms),INTENT(IN)     :: atoms
   TYPE(t_sym),INTENT(IN)       :: sym
   TYPE(t_vacuum),INTENT(IN)    :: vacuum
   TYPE(t_oneD),INTENT(IN)      :: oneD
   TYPE(t_cell),INTENT(IN)      :: cell
   TYPE(t_potden),INTENT(IN)    :: potden

   INTEGER, INTENT(IN)          :: ispin

   INTEGER                      :: npd, nat, n, ivac
   REAL                         :: signum

   REAL                         :: xp(3,dimension%nspd)

   IF ((input%film).AND.(.NOT.oneD%odi%d1)) THEN
      !--->             vacuum boundaries
      npd = min(dimension%nspd,25)
      CALL points(xp,npd)
      DO ivac = 1,vacuum%nvac
         signum = 3.0 - 2.0*ivac
         xp(3,:npd) = signum*cell%z1/cell%amat(3,3)
         CALL checkdop(xp,npd,0,0,ivac,1,ispin,dimension,atoms,&
                       sphhar,stars,sym,vacuum,cell,oneD,potden)
      END DO
   ELSE IF (oneD%odi%d1) THEN
      !-odim
      npd = min(dimension%nspd,25)
      CALL cylpts(xp,npd,cell%z1)
      CALL checkdop(xp,npd,0,0,ivac,1,ispin,dimension,atoms,&
                    sphhar,stars,sym,vacuum,cell,oneD,potden)
      !+odim
   END IF

   !--->          m.t. boundaries
   nat = 1
   DO n = 1, atoms%ntype
      CALL sphpts(xp,dimension%nspd,atoms%rmt(n),atoms%pos(1,atoms%nat))
      CALL checkdop(xp,dimension%nspd,n,nat,0,-1,ispin,&
                    dimension,atoms,sphhar,stars,sym,vacuum,cell,oneD,potden)
      nat = nat + atoms%neq(n)
   END DO

END SUBROUTINE checkDOPAll

END MODULE m_checkdopall