Skip to content

Commit

Permalink
Finished adding SCFRAMP card.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Kas committed Jun 6, 2023
1 parent ea8c6ce commit e2f7b2c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/POT/potsub.f90
Expand Up @@ -100,10 +100,10 @@ subroutine pot !KJ put everything in modules 7-09
real*8 sh_rmt, sh_dx, sh_p2f, sh_edge, sh_ri(nrptx), &
sh_dgcn(nrptx,41), sh_dpcn(nrptx,41), &
sh_adgc(10,41), sh_adpc(10,41), &
sh_eorb(41)
sh_eorb(41), rfms1_end
complex*16 sh_vxc(nrptx)
! correorb output
integer sh_neg(41), sh_norbp
integer sh_neg(41), sh_norbp, iramp
real*8 sh_eng(nex,41), sh_rhoj(nex,41)

! Added by FDV
Expand All @@ -121,7 +121,13 @@ subroutine pot !KJ put everything in modules 7-09

! Allocate some more arrays:


! Set final scf radius if ramping requested.
IF(ramp_scf) THEN
rfms1_end = rfms1
rfms1 = rfms1_start
iramp = 1
END IF

! Josh - for now if nohole=2 reset to 0 so that regular nohole potential is used
nhtmp = nohole
if (nohole.eq.2) nohole = 0
Expand Down Expand Up @@ -353,6 +359,7 @@ subroutine pot !KJ put everything in modules 7-09
& rnrmav, qtotel, inters, totvol)
xmunew = xmu
endif
195 CONTINUE
if(master) then
write(slog,131) ecv*hart
call wlog(slog)
Expand Down Expand Up @@ -547,7 +554,18 @@ subroutine pot !KJ put everything in modules 7-09
write(slog,'(a,i4,a)') 'Convergence reached in ',iscmt,' iterations.'
call wlog(slog)
endif
211 if (master) close(28) ! convergence.scf file
211 CONTINUE

IF(ramp_scf) THEN
! increase rfms1 and restart scf loop
rfms1 = rfms1_start + (rfms1_end - rfms1_start)*DBLE(iramp)/DBLE(nramp)
iramp = iramp + 1
IF(rfms1.LE.rfms1_end) THEN
IF(master) PRINT*, 'Restarting SCF with rscf = ', rfms1, iramp, nramp
GOTO 195
END IF
END IF
if (master) close(28) ! convergence.scf file


if (track_dos_convergence) then
Expand Down
1 change: 1 addition & 0 deletions src/POT/reapot.f90
Expand Up @@ -89,6 +89,7 @@ subroutine reapot(run_kpreppot) !KJ put everything in modules 7-09

! transform to code units (bohrs and hartrees - atomic units)
rfms1 = rfms1 / bohr
rfms1_start = rfms1_start/bohr
gamach = gamach / hart
ecv = ecv / hart
totvol = totvol / bohr**3
Expand Down

0 comments on commit e2f7b2c

Please sign in to comment.