2019-06-24 16:42:16 +02:00
|
|
|
program casscf
|
2019-06-24 15:32:26 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! TODO : Put the documentation of the program here
|
|
|
|
END_DOC
|
2019-10-24 18:53:02 +02:00
|
|
|
call reorder_orbitals_for_casscf
|
2019-06-24 15:32:26 +02:00
|
|
|
no_vvvv_integrals = .True.
|
2020-05-11 16:04:16 +02:00
|
|
|
touch no_vvvv_integrals
|
2019-10-21 19:35:08 +02:00
|
|
|
pt2_max = 0.02
|
|
|
|
SOFT_TOUCH no_vvvv_integrals pt2_max
|
2019-10-23 00:11:55 +02:00
|
|
|
call run_stochastic_cipsi
|
2019-10-21 19:35:08 +02:00
|
|
|
call run
|
2019-06-24 15:32:26 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
subroutine run
|
|
|
|
implicit none
|
2019-06-24 17:03:27 +02:00
|
|
|
double precision :: energy_old, energy
|
2019-10-23 00:11:55 +02:00
|
|
|
logical :: converged,state_following_casscf_save
|
2019-06-26 00:51:47 +02:00
|
|
|
integer :: iteration
|
2019-06-24 17:03:27 +02:00
|
|
|
converged = .False.
|
|
|
|
|
|
|
|
energy = 0.d0
|
2019-06-26 00:51:47 +02:00
|
|
|
mo_label = "MCSCF"
|
|
|
|
iteration = 1
|
2019-10-23 00:11:55 +02:00
|
|
|
state_following_casscf_save = state_following_casscf
|
|
|
|
state_following_casscf = .True.
|
|
|
|
touch state_following_casscf
|
2019-06-26 00:51:47 +02:00
|
|
|
do while (.not.converged)
|
2019-06-27 23:46:30 +02:00
|
|
|
call run_stochastic_cipsi
|
2019-06-24 17:03:27 +02:00
|
|
|
energy_old = energy
|
|
|
|
energy = eone+etwo+ecore
|
2019-06-26 00:51:47 +02:00
|
|
|
|
|
|
|
call write_time(6)
|
|
|
|
call write_int(6,iteration,'CAS-SCF iteration')
|
|
|
|
call write_double(6,energy,'CAS-SCF energy')
|
|
|
|
call write_double(6,energy_improvement, 'Predicted energy improvement')
|
|
|
|
|
|
|
|
converged = dabs(energy_improvement) < thresh_scf
|
2019-10-21 19:35:08 +02:00
|
|
|
pt2_max = dabs(energy_improvement / pt2_relative_error)
|
2019-06-26 00:51:47 +02:00
|
|
|
|
|
|
|
mo_coef = NewOrbs
|
2019-10-24 18:53:02 +02:00
|
|
|
mo_occ = occnum
|
2019-06-26 00:51:47 +02:00
|
|
|
call save_mos
|
|
|
|
iteration += 1
|
2019-10-25 17:31:09 +02:00
|
|
|
N_det = max(N_det/2 ,N_states)
|
2019-06-28 01:16:12 +02:00
|
|
|
psi_det = psi_det_sorted
|
|
|
|
psi_coef = psi_coef_sorted
|
|
|
|
read_wf = .True.
|
2019-07-05 23:53:05 +02:00
|
|
|
call clear_mo_map
|
2019-07-05 18:50:22 +02:00
|
|
|
SOFT_TOUCH mo_coef N_det pt2_max psi_det psi_coef
|
2019-10-23 00:11:55 +02:00
|
|
|
if(iteration .gt. 3)then
|
|
|
|
state_following_casscf = state_following_casscf_save
|
|
|
|
touch state_following_casscf
|
|
|
|
endif
|
2019-06-27 23:46:30 +02:00
|
|
|
|
2019-06-26 00:51:47 +02:00
|
|
|
enddo
|
2019-06-24 16:42:16 +02:00
|
|
|
|
2019-06-24 15:32:26 +02:00
|
|
|
end
|