2020-03-15 08:23:01 +01:00
|
|
|
subroutine read_options(method,x_rung,x_DFA,c_rung,c_DFA,SGn,nEns,wEns,maxSCF,thresh,DIIS,max_diis,guess_type,ortho_type)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
! Read DFT options
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: I
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
2020-03-15 08:23:01 +01:00
|
|
|
character(len=7),intent(out) :: method
|
2019-03-13 11:07:31 +01:00
|
|
|
integer,intent(out) :: x_rung,c_rung
|
2020-03-15 14:33:53 +01:00
|
|
|
character(len=12),intent(out) :: x_DFA, c_DFA
|
2019-03-13 11:07:31 +01:00
|
|
|
integer,intent(out) :: SGn
|
|
|
|
integer,intent(out) :: nEns
|
|
|
|
double precision,intent(out) :: wEns(maxEns)
|
|
|
|
|
|
|
|
integer,intent(out) :: maxSCF
|
|
|
|
double precision,intent(out) :: thresh
|
|
|
|
logical,intent(out) :: DIIS
|
|
|
|
integer,intent(out) :: max_diis
|
|
|
|
integer,intent(out) :: guess_type
|
|
|
|
integer,intent(out) :: ortho_type
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
character(len=1) :: answer
|
|
|
|
|
|
|
|
! Open file with method specification
|
|
|
|
|
2020-03-15 14:33:53 +01:00
|
|
|
open(unit=1,file='input/dft')
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
! Default values
|
|
|
|
|
2020-03-15 08:23:01 +01:00
|
|
|
method = 'GOK-RKS'
|
2019-03-13 11:07:31 +01:00
|
|
|
x_rung = 1
|
|
|
|
c_rung = 1
|
2020-03-16 23:28:56 +01:00
|
|
|
x_DFA = 'RS51'
|
|
|
|
c_DFA = 'RVWN5'
|
2019-03-13 11:07:31 +01:00
|
|
|
SGn = 0
|
|
|
|
wEns(:) = 0d0
|
|
|
|
|
2020-03-15 08:23:01 +01:00
|
|
|
! Restricted or unrestricted calculation
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) method
|
|
|
|
|
2019-03-13 11:07:31 +01:00
|
|
|
! EXCHANGE: read rung of Jacob's ladder
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) x_rung,x_DFA
|
|
|
|
|
|
|
|
! CORRELATION: read rung of Jacob's ladder
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) c_rung,c_DFA
|
|
|
|
|
|
|
|
! Read SG-n grid
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) SGn
|
|
|
|
|
|
|
|
! Read number of states in ensemble
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) nEns
|
|
|
|
|
|
|
|
if(nEns.gt.maxEns) then
|
|
|
|
write(*,*) ' Number of states in ensemble too big!! '
|
|
|
|
stop
|
|
|
|
endif
|
|
|
|
|
|
|
|
write(*,*)'----------------------------------------------------------'
|
|
|
|
write(*,'(A33,I3)')' Number of states in ensemble = ',nEns
|
|
|
|
write(*,*)'----------------------------------------------------------'
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! Read ensemble weights
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) (wEns(I),I=2,nEns)
|
|
|
|
wEns(1) = 1d0 - sum(wEns)
|
|
|
|
|
|
|
|
write(*,*)'----------------------------------------------------------'
|
|
|
|
write(*,*)' Ensemble weights '
|
|
|
|
write(*,*)'----------------------------------------------------------'
|
|
|
|
call matout(nEns,1,wEns)
|
|
|
|
write(*,*)
|
|
|
|
|
|
|
|
! Read KS options
|
|
|
|
|
|
|
|
maxSCF = 64
|
|
|
|
thresh = 1d-6
|
|
|
|
DIIS = .false.
|
|
|
|
max_diis = 5
|
|
|
|
guess_type = 1
|
|
|
|
ortho_type = 1
|
|
|
|
|
|
|
|
read(1,*)
|
|
|
|
read(1,*) maxSCF,thresh,answer,max_diis,guess_type,ortho_type
|
|
|
|
|
|
|
|
if(answer == 'T') DIIS = .true.
|
|
|
|
|
|
|
|
if(.not.DIIS) max_diis = 1
|
|
|
|
|
|
|
|
! Close file with options
|
|
|
|
|
2020-03-15 14:33:53 +01:00
|
|
|
close(unit=1)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
end subroutine read_options
|