From c0a6f5810aee74ca052f3bd1fa99c17899489b2d Mon Sep 17 00:00:00 2001 From: Otto Kohulak Date: Thu, 25 Jan 2024 15:18:54 +0100 Subject: [PATCH] Fix all minor ususe with QMCkl CPU --- src/c_adjoint_forward/compute_fast.f90 | 34 +++++++++++++++++++------- test/CMakeLists.txt | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/c_adjoint_forward/compute_fast.f90 b/src/c_adjoint_forward/compute_fast.f90 index c8c5742..533175d 100644 --- a/src/c_adjoint_forward/compute_fast.f90 +++ b/src/c_adjoint_forward/compute_fast.f90 @@ -1307,22 +1307,22 @@ subroutine task2(kelind, rion, dist, kel, vpseudolocal, prefactor, ivic, tmu) end subroutine task2 subroutine task4(kel, rion, dd, vju, winv, winvj) - + use qmckl - + implicit none - + real*8, intent(in) :: kel(3, nel, 0:indt), rion(3, nion) - real*8, intent(inout) :: winv(ipc * nelorbh, 0:indt4, nel) & + real*8, intent(inout) :: winv(ipc * nelorbh, 0:indt4, nel)& &, winvj(nelorbjmax, 0:indt4j, nel), dd(*), vju(*) -#ifdef _QMCKL +#ifdef _QMCKL integer*4 :: ii, l integer(qmckl_exit_code) :: rc integer*8, save :: ao_num=0, npoints_qmckl=0 - real*8, allocatable :: ao_vgl_qmckl(:,:,:)& - &, ao_value_qmckl(:,:)& - &, kel_tmp(:,:) + real*8, allocatable :: ao_vgl_qmckl(:,:,:) & + &, ao_value_qmckl(:,:) & + &, kel_tmp(:,:) #endif if(.not.yesupwf.and..not.yesupwfj) return @@ -1429,7 +1429,23 @@ subroutine task4(kel, rion, dd, vju, winv, winvj) #endif end if end if - + + if(nelorbj.ne.0.and.yesupwfj) then + ! TODO: These loops can be merged + do j = 1, nelup + call upnewwf(indt, 0, indtm(j), 0, nshelljh, ioptorbj, ioccj, kel(1, j, 0)& + &, nel, r, rmu, vju, zeta, rion, psip, winvj(1, 0, j), nelorbj& + &, nion, kionj, iflagnorm, cnorm(nshell + 1), LBox, rmucos, rmusin, 1d-9& + &, indparj_tab, indorbj_tab, indshellj_tab, .true.) + end do + do j = nelup + 1, nel + call upnewwf(indt, 0, indtm(j), 0, nshelljh, ioptorbj, ioccj, kel(1, j, 0)& + &, nel, r, rmu, vju, zeta, rion, psip, winvj(1, 0, j), nelorbj& + &, nion, kionj, iflagnorm, cnorm(nshell + 1), LBox, rmucos, rmusin, 1d-9& + &, indparj_tab, indorbj_tab, indshellj_tab, .false.) + end do + end if + do j = nelup + 1, nel if(yesupwf) then call upnewwf(indt, 0, indtm(j), 0, nshelldoh, ioptorb, ioccdo, kel(1, j, 0)& diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c1e8b44..88ccaa3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -203,7 +203,7 @@ if(EXT_TOOLS AND EXT_QMC) add_subdirectory(test_MD_classical_vmc) add_subdirectory(test_MD_quantum_vmc) - #add_subdirectory(test_setup_qmckl) + add_subdirectory(test_setup_qmckl) ######################################################################