Skip to content

Commit

Permalink
Changed mpi call to be consistent with others
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilshajan committed May 22, 2024
1 parent 3b6fc48 commit 5b95c3c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
43 changes: 38 additions & 5 deletions src/dnc/dnc_scf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ subroutine electdiisdc(jscf,ierr)
#endif
#endif

implicit double precision(a-h,o-z)

#ifdef MPIV
include "mpif.h"
use mpi
#endif

implicit double precision(a-h,o-z)

! variable inputed to return
integer :: jscf ! scf interation
integer, intent(inout) :: ierr

integer :: ierr1
logical :: diisdone = .false. ! flag to indicate if diis is done
logical :: deltaO = .false. ! delta Operator
integer :: idiis = 0 ! diis iteration
Expand All @@ -66,7 +66,7 @@ subroutine electdiisdc(jscf,ierr)
logical :: diisoff=.false.
integer elecs,itemp
double precision efermi(10),oneElecO(nbasis,nbasis)

character(len=80) :: FileName = ''

!---------------------------------------------------------------------------
! The purpose of this subroutine is to utilize Pulay's accelerated
Expand Down Expand Up @@ -218,6 +218,28 @@ subroutine electdiisdc(jscf,ierr)

call scf_operatordc(deltaO)

! if (quick_method%QCint) then
! if (jscf .eq. 2) then
! call Onedivided
! do itt=1, np
! write(filename,'(a,I0,a)')'1eint',itt,'.txt'
! call quick_open(iOneIntFile,filename,'U','F','R',.false.,ierr1)
! write(ioneintfile,'(" 1E INTEGRALS")')
! call PriSym(ioneintfile,nbasisdc(itt),Onedcsub(itt,:,:),'f14.8')
! enddo
! close(ioneintfile)
! call quick_open(iTwoIntFile,TwoIntFileName,'U','F','R',.false.,ierr1)
! write(itwointfile,'(" 2E INTEGRALS")')
! npair = (nbasis*(nbasis+1))/2
! ns8 = (npair*(npair+1))/2
! do ijkl=1,ns8
! write(itwointfile,*)quick_qm_struct%aoint2e(ijkl)
! enddo
! close(itwointfile)
! endif
! endif


quick_qm_struct%denseOld(:,:) = quick_qm_struct%dense(:,:)

if (quick_method%debug) call debug_SCF(jscf)
Expand Down Expand Up @@ -519,6 +541,7 @@ subroutine electdiisdc(jscf,ierr)

do itt = 1, np


! pass value for convience reason
nbasis=nbasisdc(itt) ! basis set for fragment

Expand Down Expand Up @@ -730,6 +753,16 @@ subroutine electdiisdc(jscf,ierr)
(quick_qm_struct%E((quick_molspec%nelec/2)+1) - quick_qm_struct%E(quick_molspec%nelec/2))*AU_TO_EV
diisdone=.true.
quick_method%scf_conv=.true.

! if (quick_method%QCint) then
! do itt=1, np
! write(filename,'(a,I0,a)')'coeff',itt,'.txt'
! call quick_open(iCoeffFile,filename,'U','F','R',.false.,ierr1)
! write(icoefffile,'(" MO COEFFECIENTS")')
! call PriSym(icoefffile,nbasisdc(itt),Codcsub(:,:,itt),'f14.8')
! enddo
! close(icoefffile)
! endif

endif
if (PRMS < 1.0d-4) then
Expand Down
6 changes: 3 additions & 3 deletions src/dnc/dnc_scf_operator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ subroutine scf_operatordc(deltaO)
use quick_cshell_eri_module, only: getCshellEriDC, getCshellEriEnergy
use quick_oei_module, only:get1eEnergy,get1e

implicit none

#ifdef MPIV
include "mpif.h"
use mpi
#endif

implicit none
! double precision oneElecO(nbasis,nbasis)
logical :: deltaO
integer II,JJ,KK,LL,NBI1,NBI2,NBJ1,NBJ2,NBK1,NBK2,NBL1,NBL2, I, J
Expand Down
7 changes: 3 additions & 4 deletions src/dnc/dnc_uscf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ subroutine uelectdiisdc(jscf,ierr)
#endif
#endif
#endif

implicit double precision(a-h,o-z)

#ifdef MPIV
include "mpif.h"
use mpi
#endif

implicit double precision(a-h,o-z)

! variable inputed to return
integer :: jscf ! scf interation
integer, intent(inout) :: ierr
Expand Down
11 changes: 6 additions & 5 deletions src/dnc/dnc_uscf_operator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ subroutine uscf_operatordc(deltaO)
use quick_oshell_eri_module, only: getOshellEriDC, getOshellEriEnergy
use quick_oei_module, only:get1eEnergy, get1e

implicit none

#ifdef MPIV
include "mpif.h"
use mpi
#endif

implicit none
! double precision oneElecO(nbasis,nbasis)
logical, intent(in) :: deltaO
integer II,JJ,KK,LL,NBI1,NBI2,NBJ1,NBJ2,NBK1,NBK2,NBL1,NBL2, I, J
Expand Down Expand Up @@ -267,11 +267,12 @@ subroutine get_oshell_xc(deltaO)
use quick_dft_module, only: b3lypf, b3lyp_e, becke, becke_e, lyp, lyp_e
use xc_f90_types_m
use xc_f90_lib_m
implicit none

#ifdef MPIV
include "mpif.h"
use mpi
#endif

implicit none

!integer II,JJ,KK,LL,NBI1,NBI2,NBJ1,NBJ2,NBK1,NBK2,NBL1,NBL2, I, J
!common /hrrstore/II,JJ,KK,LL,NBI1,NBI2,NBJ1,NBJ2,NBK1,NBK2,NBL1,NBL2
Expand Down

0 comments on commit 5b95c3c

Please sign in to comment.