TABLE OF CONTENTS


ABINIT/work_var_lotf [ Modules ]

[ Top ] [ Modules ]

NAME

 work_var_lotf

FUNCTION

COPYRIGHT

 Copyright (C) 2005-2024 ABINIT group (MMancini)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

14 #if defined HAVE_CONFIG_H
15 #include "config.h"
16 #endif
17 
18 #include "abi_common.h"
19 
20 module work_var_lotf
21 
22  use defs_basis
23  use defs_param_lotf
24  use m_errors
25  use m_abicore
26 
27  implicit none
28 
29  public ::             &
30    work_var_set,       &
31    work_var_dealloc,   &
32    cutoff_init,        &
33    smallfit
34 
35  public
36 
37  !--Control variables
38  ! !--Atomflags variables
39  integer,allocatable ::  ifixed(:) !--MMANCINI what is its utility
40 
41  !--Quantflags variables
42  integer,allocatable :: iq(:)
43 
44  !--Cutoff variables
45  real(dp) :: rcut,rcut_nbl
46  real(dp) :: rcrust
47 
48 contains

work_var_lotf/cutoff_init [ Functions ]

[ Top ] [ work_var_lotf ] [ Functions ]

NAME

  cutoff_init

FUNCTION

INPUTS

SOURCE

117  subroutine cutoff_init()
118   use pbc_lotf,only : pbc_bb_contract
119   !Local ---------------------------
120   real(dp)  :: bl(3),blmin
121   character(len=500) :: message
122 
123 ! *************************************************************************
124 
125    if (lotfvar%classic==5 .OR. lotfvar%classic==6) then
126      rcut = 4.0d0 / 0.529177 !--check consistency with glue parameters (mind d and its "limits"!)
127      rcut_nbl = rcut + rcrust
128    end if
129 
130    if (lotfvar%me==1.AND.lotfvar%classic==5) then
131      write(message,'(2(a,f12.6,a))')&
132 &     'GLUE radial cutoff used: ',rcut,ch10,&
133 &     'GLUE NEIGBOURS cutoff used: ',rcut_nbl,ch10
134      call wrtout(std_out,message,'COLL')
135    end if
136 
137   !--Cut-off check respect to cell size :
138    bl(:) = pbc_bb_contract()
139 
140    if (lotfvar%me==1) then
141      write(message,'(3a,3f12.6,a)')&
142 &     'LENGTH OF REC. CELL VECTORS : ',ch10,&
143 &     ' bl1, bl2, bl3 : ',   bl(:),ch10
144      call wrtout(std_out,message,'COLL')
145    end if
146    blmin = minval(bl)
147 
148    if (rcut_nbl*blmin  > half) then
149      write(message,'(2a,2(a,f12.6))')&
150 &     'LOTF: cut off too large : ',ch10,&
151 &     ' cut-off (A) is ', rcut_nbl ,  ' min. allowed : ',half/blmin
152      ABI_ERROR(message)
153    end if
154  end subroutine cutoff_init

work_var_lotf/smallfit [ Functions ]

[ Top ] [ work_var_lotf ] [ Functions ]

NAME

 smallfit

FUNCTION

INPUTS

SOURCE

167  subroutine smallfit(tau0,ndum)
168   use bond_lotf,only : tafit
169   USE pbc_lotf,only : dist_pbc,r2
170   implicit none
171 
172   !Arguments ------------------------
173   integer,intent(out) :: ndum
174   real(dp),intent(in):: tau0(3,lotfvar%natom)
175 
176   !Local ---------------------------
177   integer  ::  i, j, jat, nquant
178   real(dp) :: rag_fit
179 
180 ! *************************************************************************
181 
182    rag_fit = zero
183 
184    nquant = lotfvar%natom !--to remember old notation with nquant
185 
186    ndum = 0
187    do i = 1, lotfvar%natom
188      if(.not.tafit(i)) then
189        do j=1,nquant
190          jat = iq(j)
191          call dist_pbc(tau0(:,i),tau0(:,jat))
192          if (r2  <  rag_fit) then
193            tafit(i) = .true.
194            ndum = ndum + 1
195            cycle
196          end if
197        end do !nqtot
198      end if !tafit
199    end do
200 
201  end subroutine smallfit
202 
203 end module work_var_lotf

work_var_lotf/work_var_dealloc [ Functions ]

[ Top ] [ work_var_lotf ] [ Functions ]

NAME

 work_var_dealloc

FUNCTION

  deallocate variable

INPUTS

SOURCE

 99  subroutine work_var_dealloc()
100 
101 ! *************************************************************************
102    ABI_FREE(iq)
103    ABI_FREE(ifixed)
104  end subroutine work_var_dealloc

work_var_lotf/work_var_set [ Functions ]

[ Top ] [ work_var_lotf ] [ Functions ]

NAME

 work_var_set

FUNCTION

  set some internal variable of lotf

INPUTS

  natom=number of atoms

SOURCE

63  subroutine work_var_set()
64 
65   implicit none
66   !Local-----------------------------
67   integer :: iat
68 
69 ! *************************************************************************
70 
71   !--ifixed from ATOMFLAGS is initialized :
72    ABI_MALLOC(ifixed,(lotfvar%natom))
73    ifixed(:) = 1
74 
75   !--FINDS  FITTED ATOMS
76   ! ABI_MALLOC(tquant,(lotfvar%natom))
77   ! tquant(:) = .true.
78   !  nquant = lotfvar%natom
79   !nqxx   = lotfvar%natom
80 
81    ABI_MALLOC(iq,(lotfvar%natom))
82    iq(:)=(/(iat,iat=1,lotfvar%natom)/)
83 
84  end subroutine work_var_set