-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathderivate.f90
141 lines (103 loc) · 3.57 KB
/
derivate.f90
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
! ========================================================================
! find the derivate of A and spatial orbital
! ========================================================================
subroutine derivate(time,i)
use global
use auxiliary
use density
use operator_spatial_space
use solver
implicit none
real(kind=k1),intent(in) :: time
integer, intent(in) :: i
integer :: idicp,jdicp,kdicp,ldicp,method
!--------------------------------------------------------------
! calc. the rho1 and rho2
!--------------------------------------------------------------
call rho1()
call rho2()
! if(system%io_fcore/=1) then
call inverse_rho1()
call rho3()
! else
! call invers_rho1_fc()
! endif
!--------------------------------------------------------------
! calc. the matrix expression of ham. and v(r1,r2) in time-depe
! ndent spatial orbitals
! one electron operator and two electron operator
!--------------------------------------------------------------
if(laser%tdornot) then !! Real time propagation
if (laser%gauge.eq.'l') then !! Length gauge
call laserpara(time)
Else if (laser%gauge.eq.'v') then !! Velocity gauge
call laserpara_a(time)
Else
write(*,*) ''
write(*,*) '================================'
write(*,*) 'Select l or v for length or'
write(*,*) 'velocity gauge, respectively'
write(*,*) '================================'
write(*,*) ''
STOP
End if
endif
call update_ham_onebody()
!! If we store the matrix elements of the two body interactions
!! fedvr3d%store=1-> Using uncoupled basis
!! fedvr3d%store=2-> Using coupled representation
If (fedvr3d%store.eq.1.or.fedvr3d%store.eq.2) call update_vv_twobody()
!! commented by Wenliang
!
! if(laser%tdornot) then
! call update_zmat_spatial_space()
! endif
!
do idicp =1,system%nptot
do jdicp =1,idicp
ch_dummy(idicp,jdicp) = ham_onebody(ia(idicp)+jdicp)
if(idicp/=jdicp) then
ch_dummy(jdicp,idicp) = dconjg(ch_dummy(idicp,jdicp))
endif
enddo
enddo
!--------------------------------------------------------------
! two different way to solve Q_space equations
! Q_space equations
!--------------------------------------------------------------
! if(system%io_fcore/=1) then
select case (fedvr3d%store)
case(0)
!!$ call Qspace_opt() ! Juan: I did this to optimize
!!$ call Qspace_omp() ! Juan: I did this to parallelize
call Qspace_omp_select() ! Juan: I did this to optimize and parallelize
case(1)
call Qspace() ! usually
case(2)
!!
!! This subroutine is using the coupled representation technique.
call Qspace_coupled()
end select
! else
! call Qspace_fc() ! hf fcore
! endif
if((system%io_orb_eqs_p/=0).and.(system%io_fcore/=1)) then
!-----------------------------------------
if(system%io_sdtq/=0) then
call zet_mat1
call zet_mat2
call orb_eqs_p_zet
endif
!-----------------------------------------
! call Pspace_eqs(system%NP1,system%NP2,system%NP0,system%NP0+system%NP1) ! ch_dummy
call orb_eqs_p()
call acoff_eqs()
call combin_p_q()
else
!--------------------------------------------------------------
! find derivate of coff. A
!--------------------------------------------------------------
call acoff_eqs()
endif
return
end subroutine derivate