TABLE OF CONTENTS


ABINIT/macroin2 [ Functions ]

[ Top ] [ Functions ]

NAME

 macroin2

FUNCTION

 Treat "macro" input variables, that can :
 - initialize several other input variables for one given dataset
 - initialize several other input variables for a set of datasets.
 Note that the treatment of these different types of macro input variables is different.
 Documentation of such input variables is very important, including the
 proper echo, in the output file, of what such input variables have done. 

 Important information : all the "macro" input variables should be properly
 identifiable to be so, and it is proposed to make them start with the string "macro".

COPYRIGHT

 Copyright (C) 2009-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

  ndtset_alloc=number of datasets, corrected for allocation of at
               least one data set.

OUTPUT

  dtsets(0:ndtset_alloc)=<type datafiles_type>contains all input variables,
   some of which are given a value here.
   The dataset with number 0 should NOT be modified in the present routine.

PARENTS

      m_ab7_invars_f90

CHILDREN

SOURCE

40 #if defined HAVE_CONFIG_H
41 #include "config.h"
42 #endif
43 
44 #include "abi_common.h"
45 
46 
47 subroutine macroin2(dtsets,ndtset_alloc)
48 
49  use defs_basis
50  use defs_abitypes
51  use m_profiling_abi
52 
53 !This section has been created automatically by the script Abilint (TD).
54 !Do not modify the following lines by hand.
55 #undef ABI_FUNC
56 #define ABI_FUNC 'macroin2'
57 !End of the abilint section
58 
59  implicit none
60 
61 !Arguments ------------------------------------
62 !scalars
63  integer,intent(in) :: ndtset_alloc
64 !arrays
65  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc) !vz_i
66 
67 !Local variables -------------------------------
68 !scalars
69  integer :: idtset,pawujat              !,jdtset
70 
71 !******************************************************************
72 
73  do idtset=1,ndtset_alloc
74 !  Set first PAW+U atom to perform atomic level shift
75    if (dtsets(idtset)%typat(1)==0) cycle
76    pawujat=dtsets(idtset)%pawujat
77    pawujat=pawujat-count(dtsets(idtset)%lpawu( dtsets(idtset)%typat( 1:pawujat ))<0)
78 
79    if (dtsets(idtset)%macro_uj>0) then
80 !    Level shift atom with amplitude pawujv 
81      dtsets(idtset)%atvshift(:,:,pawujat)=dtsets(idtset)%pawujv
82 
83 !    Case level shift only on one spin channel
84      if ((dtsets(idtset)%macro_uj==2.or.dtsets(idtset)%macro_uj==3).and.dtsets(idtset)%nsppol==2) then 
85        dtsets(idtset)%atvshift(:,2,pawujat)=0_dp 
86      end if
87 
88    end if ! macro_uj
89 
90  end do
91 
92 end subroutine macroin2