10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-27 06:43:48 +01:00
quantum_package/plugins/garniron/mrcepa0/save_mrcc_wavefunction.irp.f

59 lines
1.3 KiB
Fortran
Raw Normal View History

2018-07-24 17:59:14 +02:00
program save_mrcc_wf
implicit none
threshold_generators = 1.d0
threshold_selectors = 1.d0
2018-07-25 01:13:04 +02:00
PROVIDE N_int psi_det
2018-07-24 17:59:14 +02:00
TOUCH threshold_generators threshold_selectors
mrmode=5
read_wf = .True.
SOFT_TOUCH read_wf mrmode
call generate_all_alpha_beta_det_products
call run1
call run2
end
subroutine run1
implicit none
integer :: k
double precision :: c_alpha(N_states)
call set_generators_bitmasks_as_holes_and_particles
2018-07-25 01:13:04 +02:00
call get_cc_coef(psi_det(1,1,1), c_alpha)
!$OMP PARALLEL DO DEFAULT(SHARED) &
!$OMP PRIVATE(k,c_alpha) SCHEDULE(static,64)
2018-07-24 17:59:14 +02:00
do k=1,N_det
2018-07-30 19:17:27 +02:00
! if (maxval(abs(psi_coef(k,1:N_states))) == 0.d0) then
2018-07-25 01:13:04 +02:00
if (iand(k,1023) == 0) then
print *, k, '/', N_det
endif
2018-07-24 17:59:14 +02:00
call get_cc_coef(psi_det(1,1,k), c_alpha)
psi_coef(k,1:N_states) = c_alpha(1:N_states)
2018-07-30 19:17:27 +02:00
! endif
2018-07-24 17:59:14 +02:00
enddo
2018-07-25 01:13:04 +02:00
!$OMP END PARALLEL DO
2018-07-24 17:59:14 +02:00
SOFT_TOUCH psi_coef
end
subroutine run2
implicit none
integer :: k
double precision :: c_alpha(N_states)
psi_det(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det)
psi_coef(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states)
2018-07-30 19:17:27 +02:00
! do k=N_det,1,-1
! if (maxval(abs(psi_coef(k,1:N_states))) > 0.d0) then
! exit
! endif
! enddo
! N_det = k
2018-07-24 17:59:14 +02:00
SOFT_TOUCH N_det psi_coef psi_det
call save_wavefunction
end