The Elk Code
batchdv.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2022 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine batchdv
7 use modmain
8 use moddftu
9 use modvars
10 use modmpi
11 implicit none
12 ! no increment for first task
13 if (itask <= 1) return
14 ! only increment for ground-state tasks
15 if (all(task /= [0,1,2,3])) return
16 ! increment selected variables
17 if (any(dngridk(:) /= 0)) then
18  ngridk(:)=ngridk(:)+dngridk(:)
19  if (mp_mpi) write(*,'("Info(batchdv): incremented ngridk")')
20 end if
21 if (dlmaxapw /= 0) then
23  if (mp_mpi) write(*,'("Info(batchdv): incremented lmaxapw")')
24 end if
25 if (dlmaxo /= 0) then
27  if (mp_mpi) write(*,'("Info(batchdv): incremented lmaxo")')
28 end if
29 if (any(davec(:,:) /= 0.d0)) then
30  avec(:,:)=avec(:,:)+davec(:,:)
31  if (mp_mpi) write(*,'("Info(batchdv): incremented avec")')
32 end if
33 if (any(datposl(:,:,:) /= 0.d0)) then
34  atposl(:,:,:)=atposl(:,:,:)+datposl(:,:,:)
35  if (mp_mpi) write(*,'("Info(batchdv): incremented atposl")')
36 end if
37 if (drgkmax /= 0.d0) then
39  if (mp_mpi) write(*,'("Info(batchdv): incremented rgkmax")')
40 end if
41 if (dgmaxvr /= 0.d0) then
43  if (mp_mpi) write(*,'("Info(batchdv): incremented gmaxvr")')
44 end if
45 if (dnempty0 /= 0.d0) then
47  if (mp_mpi) write(*,'("Info(batchdv): incremented nempty")')
48 end if
49 if (dchgexs /= 0.d0) then
51  if (mp_mpi) write(*,'("Info(batchdv): incremented chgexs")')
52 end if
53 if (dsxcscf /= 0.d0) then
55  if (mp_mpi) write(*,'("Info(batchdv): incremented sxcscf")')
56 end if
57 if (dnrmtscf /= 0.d0) then
59  if (mp_mpi) write(*,'("Info(batchdv): incremented nrmtscf")')
60 end if
61 if (any(dudufix(:) /= 0.d0)) then
62  udufix(:)=udufix(:)+dudufix(:)
63  if (mp_mpi) write(*,'("Info(batchdv): incremented udufix")')
64 end if
65 if (any(dmomfix(:) /= 0.d0)) then
66  momfix(:)=momfix(:)+dmomfix(:)
67  if (mp_mpi) write(*,'("Info(batchdv): incremented momfix")')
68 end if
69 if (any(dbfieldc0(:) /= 0.d0)) then
70  bfieldc0(:)=bfieldc0(:)+dbfieldc0(:)
71  if (mp_mpi) write(*,'("Info(batchdv): incremented bfieldc0")')
72 end if
73 if (any(dvqlss(:) /= 0.d0)) then
74  vqlss(:)=vqlss(:)+dvqlss(:)
75  if (mp_mpi) write(*,'("Info(batchdv): incremented vqlss")')
76 end if
77 if (any(dafieldc(:) /= 0.d0)) then
78  afieldc(:)=afieldc(:)+dafieldc(:)
79  if (mp_mpi) write(*,'("Info(batchdv): incremented afieldc")')
80 end if
81 if (any(dafspc(:,:) /= 0.d0)) then
82  afspc(:,:)=afspc(:,:)+dafspc(:,:)
83  if (mp_mpi) write(*,'("Info(batchdv): incremented afspc")')
84 end if
85 end subroutine
86 
real(8), dimension(3, 3) dafspc
Definition: modmain.f90:331
real(8) dchgexs
Definition: modmain.f90:724
real(8), dimension(3, 3) afspc
Definition: modmain.f90:331
real(8), dimension(3, 3) davec
Definition: modmain.f90:12
integer task
Definition: modmain.f90:1299
logical mp_mpi
Definition: modmpi.f90:17
real(8), dimension(3, maxatoms, maxspecies) datposl
Definition: modmain.f90:52
real(8) dnrmtscf
Definition: modmain.f90:148
real(8) sxcscf
Definition: modmain.f90:668
real(8), dimension(maxdftu) dudufix
Definition: moddftu.f90:60
real(8) dnempty0
Definition: modmain.f90:883
integer lmaxo
Definition: modmain.f90:201
real(8), dimension(3) vqlss
Definition: modmain.f90:293
real(8) nempty0
Definition: modmain.f90:883
integer dlmaxo
Definition: modmain.f90:201
integer lmaxapw
Definition: modmain.f90:197
real(8) nrmtscf
Definition: modmain.f90:148
subroutine batchdv
Definition: batchdv.f90:7
real(8), dimension(3) momfix
Definition: modmain.f90:253
integer itask
Definition: modmain.f90:1295
real(8), dimension(3, maxatoms, maxspecies) atposl
Definition: modmain.f90:51
real(8), dimension(3) dbfieldc0
Definition: modmain.f90:271
real(8), dimension(3, 3) avec
Definition: modmain.f90:12
real(8) rgkmax
Definition: modmain.f90:493
integer, dimension(3) ngridk
Definition: modmain.f90:448
real(8), dimension(3) dafieldc
Definition: modmain.f90:325
real(8), dimension(3) dvqlss
Definition: modmain.f90:293
real(8), dimension(3) afieldc
Definition: modmain.f90:325
real(8) drgkmax
Definition: modmain.f90:493
real(8), dimension(maxdftu) udufix
Definition: moddftu.f90:60
Definition: modmpi.f90:6
real(8) dsxcscf
Definition: modmain.f90:668
real(8), dimension(3) bfieldc0
Definition: modmain.f90:271
integer, dimension(3) dngridk
Definition: modmain.f90:448
real(8), dimension(3) dmomfix
Definition: modmain.f90:253
real(8) chgexs
Definition: modmain.f90:724
integer dlmaxapw
Definition: modmain.f90:197
real(8) dgmaxvr
Definition: modmain.f90:384
real(8) gmaxvr
Definition: modmain.f90:384