2
C zfock_cs_core_scalarzora.F
4
C Calculates 1 electron scalar ZORA part (Hcore) of a closed shell
5
C complex Fock matrix. Note that input is the real part of the
6
C density matrix, and output is real part of the Fock matrix.
10
subroutine zfock_cs_core_scalarzora (params, g_densre, g_fcore)
16
#include "mafdecls.fh"
21
#include "rt_tddft.fh"
25
type(rt_params_t), intent(in) :: params
26
integer, intent(in) :: g_densre
30
integer, intent(in) :: g_fcore
34
character(*), parameter :: pname = "zfock_cs_core_scalarzora: "
38
double precision elapsed
42
$ call errquit (pname//"called without ZORA active",0,0)
44
call rt_tddft_cs_confirm (params)
46
if (params%prof) call prof_start (elapsed)
49
call ga_zero (g_fcore)
50
call ga_add (1d0, g_fcore, 1d0, params%g_zora_sf(1), g_fcore)
59
subroutine zfock_cs_core_scalarzora (params, g_densre, g_fcore)
65
#include "mafdecls.fh"
70
#include "rt_tddft.fh"
74
type(rt_params_t), intent(in) :: params
75
integer, intent(in) :: g_densre
79
integer, intent(in) :: g_fcore
83
character(*), parameter :: pname = "zfock_cs_core_scalarzora: "
87
double precision elapsed
88
integer g_sf(2) ! ZORA scalar arrays; real nbf_ao x nbf_ao
89
integer g_scale_sf(2) ! ZORA scalar energy scaling arrays; real nbf_ao x nbf_ao
94
logical, external :: dft_zora_read
98
$ call errquit (pname//"called without ZORA active",0,0)
100
call rt_tddft_cs_confirm (params)
102
if (params%prof) call prof_start (elapsed)
107
if (.not. ga_create(mt_dbl, params%nbf_ao, params%nbf_ao,
108
$ "sf(1)", 0, 0, g_sf(1)))
109
$ call errquit (pname//"couldnt make g_sf(1)", 0, GA_ERR)
110
if (.not. ga_create(mt_dbl, params%nbf_ao, params%nbf_ao,
111
$ "sf(2)", 0, 0, g_sf(2)))
112
$ call errquit (pname//"couldnt make g_sf(2)", 0, GA_ERR)
114
if (.not. ga_create(mt_dbl, params%nbf_ao, params%nbf_ao,
115
$ "scale sf(1)", 0, 0, g_scale_sf(1)))
116
$ call errquit (pname//"couldnt make g_sf(1)", 0, GA_ERR)
117
if (.not. ga_create(mt_dbl, params%nbf_ao, params%nbf_ao,
118
$ "scale sf(2)", 0, 0, g_scale_sf(2)))
119
$ call errquit (pname//"couldnt make g_sf(2)", 0, GA_ERR)
123
C Get ZORA data from file. If we can't read it, quit--rebuilding it
124
C on the fly is far too slow. We only use g_so and g_sf, as the
125
C scaling arrays are only applied to the eigenvalues in the SCF.
127
call util_file_name ("zora_sf", .false., .false., fname)
130
call ga_zero (g_scale_sf)
132
if (ga_nodeid().eq.0)
133
$ write (luout, *) pname//"todo: read in once only"
137
if (.not.dft_zora_read(fname, params%nbf_ao, 1,
138
$ params%nbf_ao, mult, g_sf, g_scale_sf))
139
$ call errquit (pname//
140
$ "failed to read scalar ZORA data from: "//trim(fname), 0, 0)
142
C call ga_print (g_sf(1))
144
call ga_zero (g_fcore)
145
call ga_add (1d0, g_fcore, 1d0, g_sf(1), g_fcore)
147
if (.not. ga_destroy (g_sf(1)))
148
$ call errquit (pname//"failed to destroy g_sf(1)", 0, 0)
149
if (.not. ga_destroy (g_sf(2)))
150
$ call errquit (pname//"failed to destroy g_sf(1)", 0, 0)
152
if (.not. ga_destroy (g_scale_sf(1)))
153
$ call errquit (pname//"failed to destroy g_scale_sf(1)", 0, 0)
154
if (.not. ga_destroy (g_scale_sf(2)))
155
$ call errquit (pname//"failed to destroy g_scale_sf(1)", 0, 0)
158
$ call prof_end (elapsed, "Fock CS core scalar ZORA")