TABLE OF CONTENTS


ABINIT/chkprimit [ Functions ]

[ Top ] [ Functions ]

FUNCTION

 Check whether the cell is primitive or not.
 If chkprim/=0 and the cell is non-primitive, stops.

COPYRIGHT

 Copyright (C) 2000-2018 ABINIT group (XG)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .
 For the initials of contributors, see ~abinit/doc/developers/contributors.txt .

INPUTS

 chkprim= if non-zero, check that the unit cell is primitive.
 nsym=actual number of symmetries
 symafm(nsym)= (anti)ferromagnetic part of symmetry operations
 symrel(3,3,nsym)= nsym symmetry operations in real space in terms
   of primitive translations

OUTPUT

  multi=multiplicity of the unit cell

PARENTS

      symanal

CHILDREN

SOURCE

 35 #if defined HAVE_CONFIG_H
 36 #include "config.h"
 37 #endif
 38 
 39 #include "abi_common.h"
 40 
 41 
 42 subroutine chkprimit(chkprim,multi,nsym,symafm,symrel)
 43 
 44  use defs_basis
 45  use m_profiling_abi
 46  use m_errors
 47 
 48 !This section has been created automatically by the script Abilint (TD).
 49 !Do not modify the following lines by hand.
 50 #undef ABI_FUNC
 51 #define ABI_FUNC 'chkprimit'
 52 !End of the abilint section
 53 
 54  implicit none
 55 
 56 !Arguments ------------------------------------
 57 !scalars
 58  integer,intent(in) :: chkprim,nsym
 59  integer,intent(out) :: multi
 60 !arrays
 61  integer,intent(in) :: symafm(nsym),symrel(3,3,nsym)
 62 
 63 !Local variables-------------------------------
 64 !scalars
 65  integer :: isym
 66  character(len=500) :: message
 67 
 68 !**************************************************************************
 69 
 70 !Loop over each symmetry operation of the Bravais lattice
 71 !Find whether it is the identity, or a pure translation,
 72 !without change of sign of the spin
 73  multi=0
 74  do isym=1,nsym
 75    if( abs(symrel(1,1,isym)-1)+&
 76 &   abs(symrel(2,2,isym)-1)+&
 77 &   abs(symrel(3,3,isym)-1)+&
 78 &   abs(symrel(1,2,isym))+abs(symrel(2,1,isym))+&
 79 &   abs(symrel(2,3,isym))+abs(symrel(3,2,isym))+&
 80 &   abs(symrel(3,1,isym))+abs(symrel(1,3,isym))+&
 81 &   abs(symafm(isym)-1) == 0 )then
 82      multi=multi+1
 83    end if
 84  end do
 85 
 86 !Check whether the cell is primitive
 87  if(multi>1)then
 88    if(chkprim/=0)then
 89      write(message,'(a,a,a,i0,a,a,a,a,a,a,a,a,a)')&
 90 &     'According to the symmetry finder, the unit cell is',ch10,&
 91 &     'NOT primitive. The multiplicity is ',multi,' .',ch10,&
 92 &     'The use of non-primitive unit cells is allowed',ch10,&
 93 &     'only when the input variable chkprim is 0.',ch10,&
 94 &     'Action : either change your unit cell (rprim or angdeg),',ch10,&
 95 &     'or set chkprim to 0.'
 96      MSG_ERROR(message)
 97    else
 98      write(message,'(3a,i0,a,a,a)')&
 99 &     'According to the symmetry finder, the unit cell is',ch10,&
100 &     'not primitive, with multiplicity=',multi,'.',ch10,&
101 &     'This is allowed, as the input variable chkprim is 0.'
102      MSG_COMMENT(message)
103    end if
104  end if
105 
106 end subroutine chkprimit