-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput_class.f90
More file actions
96 lines (89 loc) · 3.89 KB
/
input_class.f90
File metadata and controls
96 lines (89 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module input_class
use para
implicit none
private
type, public :: input
! These are the input things for GEM method
integer :: l_i, l_f
integer :: nfancy, Vstat, BasisType, OSmeth, p_max, OVmeth
logical :: verbose, basisplots,wavefunplots, overlaps, expect_r, OScalc, time
real(kind=range) :: r1, rN, alpha, mu, lowtol, hightol, Rmax, stepsize
! And these are for the Laguerre basis
integer :: npwave, npdbl, ndouble, ltmax
real(kind=range) :: formcut, regcut, expcut
contains
procedure :: new => new_input
end type input
contains
! Read the read_in file and construct an input object
subroutine new_input(self, infile, iwrite)
class(input), intent(inout) :: self
integer, intent(in) :: infile, iwrite
logical :: ex
integer :: iostat_data
! infile checks for the existence of data.in
! iwrite =1 then we print the data to the terminal, =0 then not
if(infile .eq. 10) then
inquire(file='data.in',exist=ex)
if(.not. ex) STOP 'ERROR: File data.in does not exists'
open(infile,file='data.in',iostat=iostat_data)
if(iostat_data.ne.0) STOP 'ERROR: input_class cannot open file data.in'
endif
!------------------------------------------------------------------------!
! Here we read the values from data.in and assigns values to input object!
!------------------------------------------------------------------------!
read(infile,*) self%verbose, self%time
read(infile,*) self%npwave, self%npdbl, self%ndouble, self%ltmax
read(infile,*) self%formcut, self%regcut, self%expcut
read(infile,*) self%basisplots, self%wavefunplots
read(infile,*) self%overlaps, self%OVmeth
read(infile,*) self%expect_r, self%p_max
read(infile,*) self%OScalc, self%OSmeth
read(infile,*) self%Rmax, self%stepsize
read(infile,*) self%BasisType
read(infile,*) self%l_i, self%l_f
read(infile,*) self%r1, self%rN, self%nfancy
read(infile,*) self%alpha
read(infile,*) self%mu
read(infile,*) self%lowtol, self%hightol
read(infile,*) self%Vstat
!------------------------------------------------------------------------!
! For iwrite=1 print all of the input to terminal !
!------------------------------------------------------------------------!
if (iwrite==1) then
print*, 'Verbose mode ', self%verbose, 'Timing code?', self%time
print*, self%npwave, self%npdble, self%ndouble, self%ltmax, 'npwave, npdbl, ndouble, ltmax'
print*, self%formcut, self%regcut, self%expcut, 'formcut, regcut, expcut'
print*, 'Save plots? ', self%basisplots, self%wavefunplots
print*, 'Print calculated overlaps? (only for free H)', self%overlaps
if (self%OVmeth==0) then
print*, 'Using analytic overlap subroutine'
else if (self%OVmeth==1) then
print*, 'Using numerical overlap strength subroutine'
end if
print*, 'calculate expectation values? (only for H atom)', self%expect_r
print*, 'For <n|r^p|n> use abs val of p=', self%p_max
print*, 'Calculate oscillator strengths for 1s->np', self%OScalc
if (self%OSmeth==0) then
print*, 'Using analytic oscillator strength subroutine'
else if (self%OSmeth==1) then
print*, 'Using numerical oscillator strength subroutine'
else
print*, 'Using both analytic and numerical OS subroutines'
end if
print*, 'Rmax, stepsize:', self%Rmax, self%stepsize
if (self%BasisType==1) then
print*, 'Using the complex range Gaussian functions'
else
print*, 'Using the regular Gaussian functions'
end if
print*,'Angular momentum, calc from l=', self%l_i, 'to l=', self%l_f
print*, 'Parameters r1, rN, N: ',self%r1, self%rN, self%nfancy
print*, 'Parameters alpha: ', self%alpha,'*pi'
print*, 'Reduced mass mu = ', self%mu
print*, 'lowtol, hightol: ', self%lowtol, self%hightol
print*, 'Vstat = ', self%Vstat
end if
!------------------------------------------------------------------------!
end subroutine new_input
end module input_class