4
1
mirror of https://github.com/pfloos/quack synced 2024-06-19 19:52:17 +02:00
quack/src/QuAcK/read_options.f90

205 lines
5.6 KiB
Fortran
Raw Normal View History

2020-01-14 21:27:34 +01:00
subroutine read_options(maxSCF_HF,thresh_HF,DIIS_HF,n_diis_HF,guess_type,ortho_type, &
maxSCF_CC,thresh_CC,DIIS_CC,n_diis_CC, &
singlet_manifold,triplet_manifold, &
2020-03-19 10:33:56 +01:00
maxSCF_GF,thresh_GF,DIIS_GF,n_diis_GF,linGF,renormGF, &
2020-06-03 12:06:16 +02:00
BSE_GF,TDA_GF,eta_GF, &
2020-01-14 21:27:34 +01:00
maxSCF_GW,thresh_GW,DIIS_GW,n_diis_GW, &
2020-06-03 12:06:16 +02:00
COHSEX,SOSEX,BSE_GW,TDA_GW,G0W,GW0,linGW,eta_GW, &
2020-01-16 21:39:00 +01:00
doACFDT,exchange_kernel,doXBS, &
2019-03-19 10:13:33 +01:00
nMC,nEq,nWalk,dt,nPrint,iSeed,doDrift)
! Read desired methods
implicit none
! Input variables
integer,intent(out) :: maxSCF_HF
double precision,intent(out) :: thresh_HF
logical,intent(out) :: DIIS_HF
integer,intent(out) :: n_diis_HF
integer,intent(out) :: guess_type
integer,intent(out) :: ortho_type
integer,intent(out) :: maxSCF_CC
double precision,intent(out) :: thresh_CC
logical,intent(out) :: DIIS_CC
integer,intent(out) :: n_diis_CC
logical,intent(out) :: singlet_manifold
logical,intent(out) :: triplet_manifold
integer,intent(out) :: maxSCF_GF
double precision,intent(out) :: thresh_GF
logical,intent(out) :: DIIS_GF
integer,intent(out) :: n_diis_GF
2020-03-19 10:33:56 +01:00
logical,intent(out) :: linGF
integer,intent(out) :: renormGF
2020-06-03 12:06:16 +02:00
logical,intent(out) :: BSE_GF
logical,intent(out) :: TDA_GF
double precision,intent(out) :: eta_GF
2019-03-19 10:13:33 +01:00
integer,intent(out) :: maxSCF_GW
double precision,intent(out) :: thresh_GW
logical,intent(out) :: DIIS_GW
integer,intent(out) :: n_diis_GW
logical,intent(out) :: COHSEX
logical,intent(out) :: SOSEX
2020-06-03 12:06:16 +02:00
logical,intent(out) :: BSE_GW
logical,intent(out) :: TDA_GW
2019-03-19 10:13:33 +01:00
logical,intent(out) :: G0W
logical,intent(out) :: GW0
2020-03-19 10:33:56 +01:00
logical,intent(out) :: linGW
2020-06-03 12:06:16 +02:00
double precision,intent(out) :: eta_GW
2019-03-19 10:13:33 +01:00
2020-01-14 21:27:34 +01:00
logical,intent(out) :: doACFDT
2020-01-16 21:39:00 +01:00
logical,intent(out) :: exchange_kernel
2020-01-14 21:27:34 +01:00
logical,intent(out) :: doXBS
2019-03-19 10:13:33 +01:00
integer,intent(out) :: nMC
integer,intent(out) :: nEq
integer,intent(out) :: nWalk
double precision,intent(out) :: dt
integer,intent(out) :: nPrint
integer,intent(out) :: iSeed
logical,intent(out) :: doDrift
! Local variables
2020-01-14 21:27:34 +01:00
character(len=1) :: answer1,answer2,answer3,answer4,answer5,answer6,answer7,answer8,answer9
2019-03-19 10:13:33 +01:00
! Open file with method specification
open(unit=1,file='input/options')
! Read HF options
maxSCF_HF = 64
thresh_HF = 1d-6
DIIS_HF = .false.
n_diis_HF = 5
guess_type = 1
ortho_type = 1
read(1,*)
read(1,*) maxSCF_HF,thresh_HF,answer1,n_diis_HF,guess_type,ortho_type
if(answer1 == 'T') DIIS_HF = .true.
if(.not.DIIS_HF) n_diis_HF = 1
! Read MPn options
read(1,*)
read(1,*)
! Read CC options
maxSCF_CC = 64
thresh_CC = 1d-5
DIIS_CC = .false.
n_diis_CC = 5
read(1,*)
read(1,*) maxSCF_CC,thresh_CC,answer1,n_diis_CC
if(answer1 == 'T') DIIS_CC = .true.
if(.not.DIIS_CC) n_diis_CC = 1
! Read excited state options
singlet_manifold = .false.
triplet_manifold = .false.
read(1,*)
read(1,*) answer1,answer2
if(answer1 == 'T') singlet_manifold = .true.
if(answer2 == 'T') triplet_manifold = .true.
! Read Green function options
maxSCF_GF = 64
thresh_GF = 1d-5
DIIS_GF = .false.
n_diis_GF = 5
2020-06-03 12:06:16 +02:00
linGF = .false.
renormGF = 0
BSE_GF = .false.
TDA_GF = .false.
eta_GF = 0d0
2019-03-19 10:13:33 +01:00
read(1,*)
2020-06-03 12:06:16 +02:00
read(1,*) maxSCF_GF,thresh_GW,answer1,n_diis_GF,answer2,renormGF,answer3,answer4,eta_GF
2019-03-19 10:13:33 +01:00
if(answer1 == 'T') DIIS_GF = .true.
2020-03-19 10:33:56 +01:00
if(answer2 == 'T') linGF = .true.
2020-06-03 12:06:16 +02:00
if(answer3 == 'T') BSE_GF = .true.
if(answer4 == 'T') TDA_GF = .true.
2019-03-19 10:13:33 +01:00
if(.not.DIIS_GF) n_diis_GF = 1
! Read GW options
maxSCF_GW = 64
thresh_GW = 1d-5
DIIS_GW = .false.
n_diis_GW = 5
COHSEX = .false.
SOSEX = .false.
2020-06-03 12:06:16 +02:00
BSE_GW = .false.
TDA_GW = .false.
2019-03-19 10:13:33 +01:00
G0W = .false.
GW0 = .false.
2020-03-19 10:33:56 +01:00
linGW = .false.
2020-06-03 12:06:16 +02:00
eta_GW = 0d0
2019-03-19 10:13:33 +01:00
read(1,*)
read(1,*) maxSCF_GW,thresh_GW,answer1,n_diis_GW,answer2, &
2020-06-03 12:06:16 +02:00
answer3,answer4,answer5,answer6,answer7,answer8,eta_GW
2019-03-19 10:13:33 +01:00
if(answer1 == 'T') DIIS_GW = .true.
2020-06-03 12:06:16 +02:00
if(answer2 == 'T') COHSEX = .true.
if(answer3 == 'T') SOSEX = .true.
if(answer4 == 'T') BSE_GW = .true.
if(answer5 == 'T') TDA_GW = .true.
if(answer6 == 'T') G0W = .true.
if(answer7 == 'T') GW0 = .true.
if(answer8 == 'T') linGW = .true.
2019-03-19 10:13:33 +01:00
if(.not.DIIS_GW) n_diis_GW = 1
2020-01-14 21:27:34 +01:00
! Options for adiabatic connection
doACFDT = .false.
2020-01-16 21:39:00 +01:00
exchange_kernel = .false.
2020-01-14 21:27:34 +01:00
doXBS = .false.
read(1,*)
2020-01-16 21:39:00 +01:00
read(1,*) answer1,answer2,answer3
2020-01-14 21:27:34 +01:00
if(answer1 == 'T') doACFDT = .true.
2020-01-16 21:39:00 +01:00
if(answer2 == 'T') exchange_kernel = .true.
if(answer3 == 'T') doXBS = .true.
2020-01-14 21:27:34 +01:00
2019-03-19 10:13:33 +01:00
! Read options for MC-MP2: Monte Carlo steps, number of equilibration steps, number of walkers,
! Monte Carlo time step, frequency of output results, and seed for random number generator
nMC = 100000
nEq = 10000
nWalk = 10
dt = 0.3d0
nPrint = 1000
iSeed = 0
doDrift = .false.
read(1,*)
read(1,*) nMC,nEq,nWalk,dt,nPrint,iSeed,answer1
if(answer1 == 'T') doDrift = .true.
! Close file with options
close(unit=1)
end subroutine read_options