4
1
mirror of https://github.com/pfloos/quack synced 2024-06-02 11:25:28 +02:00
quack/src/QuAcK/read_options.f90

210 lines
5.5 KiB
Fortran
Raw Permalink Normal View History

2023-11-03 19:48:12 +01:00
subroutine read_options(maxSCF_HF,thresh_HF,max_diis_HF,guess_type,mix,level_shift,dostab,dosearch, &
reg_MP, &
maxSCF_CC,thresh_CC,max_diis_CC, &
TDA,spin_conserved,spin_flip, &
maxSCF_GF,thresh_GF,max_diis_GF,lin_GF,eta_GF,renorm_GF,reg_GF, &
maxSCF_GW,thresh_GW,max_diis_GW,lin_GW,eta_GW,reg_GW,TDA_W, &
maxSCF_GT,thresh_GT,max_diis_GT,lin_GT,eta_GT,reg_GT,TDA_T, &
doACFDT,exchange_kernel,doXBS, &
2023-07-21 10:21:54 +02:00
dophBSE,dophBSE2,doppBSE,dBSE,dTDA)
2019-03-19 10:13:33 +01:00
! Read desired methods
implicit none
! Input variables
integer,intent(out) :: maxSCF_HF
double precision,intent(out) :: thresh_HF
integer,intent(out) :: max_diis_HF
2019-03-19 10:13:33 +01:00
integer,intent(out) :: guess_type
double precision,intent(out) :: mix
2022-02-03 10:05:58 +01:00
double precision,intent(out) :: level_shift
2021-03-03 11:37:46 +01:00
logical,intent(out) :: dostab
2023-11-03 19:48:12 +01:00
logical,intent(out) :: dosearch
2019-03-19 10:13:33 +01:00
logical,intent(out) :: reg_MP
2019-03-19 10:13:33 +01:00
integer,intent(out) :: maxSCF_CC
double precision,intent(out) :: thresh_CC
integer,intent(out) :: max_diis_CC
2019-03-19 10:13:33 +01:00
2020-10-05 23:00:56 +02:00
logical,intent(out) :: TDA
2020-09-22 23:08:47 +02:00
logical,intent(out) :: spin_conserved
logical,intent(out) :: spin_flip
2019-03-19 10:13:33 +01:00
integer,intent(out) :: maxSCF_GF
double precision,intent(out) :: thresh_GF
integer,intent(out) :: max_diis_GF
logical,intent(out) :: lin_GF
integer,intent(out) :: renorm_GF
2020-06-03 12:06:16 +02:00
double precision,intent(out) :: eta_GF
logical,intent(out) :: reg_GF
2019-03-19 10:13:33 +01:00
integer,intent(out) :: maxSCF_GW
double precision,intent(out) :: thresh_GW
integer,intent(out) :: max_diis_GW
2020-06-09 21:24:37 +02:00
logical,intent(out) :: TDA_W
logical,intent(out) :: lin_GW
2020-06-03 12:06:16 +02:00
double precision,intent(out) :: eta_GW
logical,intent(out) :: reg_GW
2021-12-17 11:41:40 +01:00
integer,intent(out) :: maxSCF_GT
double precision,intent(out) :: thresh_GT
integer,intent(out) :: max_diis_GT
2021-12-17 11:41:40 +01:00
logical,intent(out) :: TDA_T
logical,intent(out) :: lin_GT
2021-12-17 11:41:40 +01:00
double precision,intent(out) :: eta_GT
logical,intent(out) :: reg_GT
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
2023-07-12 23:16:37 +02:00
logical,intent(out) :: dophBSE
logical,intent(out) :: dophBSE2
logical,intent(out) :: doppBSE
2020-06-14 21:20:01 +02:00
logical,intent(out) :: dBSE
logical,intent(out) :: dTDA
2019-03-19 10:13:33 +01:00
! Local variables
2023-07-30 22:14:28 +02:00
character(len=1) :: ans1,ans2,ans3,ans4,ans5
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
max_diis_HF = 1
2019-03-19 10:13:33 +01:00
guess_type = 1
mix = 0d0
2022-02-03 10:05:58 +01:00
level_shift = 0d0
2021-03-03 11:37:46 +01:00
dostab = .false.
2023-11-03 19:48:12 +01:00
dosearch = .false.
2019-03-19 10:13:33 +01:00
read(1,*)
2023-11-03 19:48:12 +01:00
read(1,*) maxSCF_HF,thresh_HF,max_diis_HF,guess_type,mix,level_shift,ans1,ans2
2019-03-19 10:13:33 +01:00
2023-11-03 19:48:12 +01:00
if(ans1 == 'T') dostab = .true.
if(ans2 == 'T') dosearch = .true.
2019-03-19 10:13:33 +01:00
! Read MPn options
reg_MP = .false.
2019-03-19 10:13:33 +01:00
read(1,*)
2023-07-30 22:14:28 +02:00
read(1,*) ans1
if(ans1 == 'T') reg_MP = .true.
2019-03-19 10:13:33 +01:00
! Read CC options
maxSCF_CC = 64
thresh_CC = 1d-5
max_diis_CC = 1
2019-03-19 10:13:33 +01:00
read(1,*)
read(1,*) maxSCF_CC,thresh_CC,max_diis_CC
2019-03-19 10:13:33 +01:00
! Read excited state options
2020-10-05 23:00:56 +02:00
TDA = .false.
2020-09-22 23:08:47 +02:00
spin_conserved = .false.
spin_flip = .false.
2019-03-19 10:13:33 +01:00
read(1,*)
read(1,*) ans1,ans2,ans3
2019-03-19 10:13:33 +01:00
2023-07-30 22:14:28 +02:00
if(ans1 == 'T') TDA = .true.
if(ans2 == 'T') spin_conserved = .true.
if(ans3 == 'T') spin_flip = .true.
2019-03-19 10:13:33 +01:00
2021-12-17 11:41:40 +01:00
! Read GF options
2019-03-19 10:13:33 +01:00
maxSCF_GF = 64
thresh_GF = 1d-5
max_diis_GF = 1
lin_GF = .false.
eta_GF = 0d0
renorm_GF = 0
reg_GF = .false.
2019-03-19 10:13:33 +01:00
read(1,*)
read(1,*) maxSCF_GF,thresh_GF,max_diis_GF,ans1,eta_GF,renorm_GF,ans2
2019-03-19 10:13:33 +01:00
if(ans1 == 'T') lin_GF = .true.
if(ans2 == 'T') reg_GF = .true.
2019-03-19 10:13:33 +01:00
! Read GW options
maxSCF_GW = 64
thresh_GW = 1d-5
max_diis_GW = 1
lin_GW = .false.
eta_GW = 0d0
reg_GW = .false.
TDA_W = .false.
2019-03-19 10:13:33 +01:00
read(1,*)
read(1,*) maxSCF_GW,thresh_GW,max_diis_GW,ans1,eta_GW,ans2,ans3
2020-06-14 21:20:01 +02:00
if(ans1 == 'T') lin_GW = .true.
if(ans2 == 'T') TDA_W = .true.
if(ans3 == 'T') reg_GW = .true.
2019-03-19 10:13:33 +01:00
2022-01-17 15:15:27 +01:00
! Read GT options
2021-12-17 11:41:40 +01:00
maxSCF_GT = 64
thresh_GT = 1d-5
max_diis_GT = 1
lin_GT = .false.
eta_GT = 0d0
reg_GT = .false.
TDA_T = .false.
2021-12-17 11:41:40 +01:00
read(1,*)
read(1,*) maxSCF_GT,thresh_GT,max_diis_GT,ans1,eta_GT,ans2,ans3
2021-12-17 11:41:40 +01:00
if(ans1 == 'T') lin_GT = .true.
if(ans2 == 'T') TDA_T = .true.
if(ans3 == 'T') reg_GT = .true.
2021-12-17 11:41:40 +01:00
2020-01-14 21:27:34 +01:00
! Options for adiabatic connection
2020-06-15 23:04:07 +02:00
doACFDT = .false.
2020-01-16 21:39:00 +01:00
exchange_kernel = .false.
2020-06-15 23:04:07 +02:00
doXBS = .false.
2020-01-14 21:27:34 +01:00
read(1,*)
2023-07-30 22:14:28 +02:00
read(1,*) ans1,ans2,ans3
2020-01-14 21:27:34 +01:00
2023-07-30 22:14:28 +02:00
if(ans1 == 'T') doACFDT = .true.
if(ans2 == 'T') exchange_kernel = .true.
if(ans3 == 'T') doXBS = .true.
2020-01-14 21:27:34 +01:00
2020-06-14 21:20:01 +02:00
! Options for dynamical BSE calculations
2023-07-12 23:16:37 +02:00
dophBSE = .false.
dophBSE2 = .false.
doppBSE = .false.
dBSE = .false.
dTDA = .true.
2020-06-14 21:20:01 +02:00
read(1,*)
2023-07-30 22:14:28 +02:00
read(1,*) ans1,ans2,ans3,ans4,ans5
2020-06-14 21:20:01 +02:00
2023-07-30 22:14:28 +02:00
if(ans1 == 'T') dophBSE = .true.
if(ans2 == 'T') dophBSE2 = .true.
if(ans3 == 'T') doppBSE = .true.
if(ans4 == 'T') dBSE = .true.
if(ans5 == 'F') dTDA = .false.
2020-06-14 21:20:01 +02:00
2019-03-19 10:13:33 +01:00
! Close file with options
close(unit=1)
end subroutine