Commit a5d5a350 authored by ccavazzoni's avatar ccavazzoni

- use helper functions


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13736 c92efa57-630b-4861-b058-cf58834340f0
parent 472101ce
......@@ -526,7 +526,7 @@
!
IMPLICIT NONE
!
INTEGER :: from, i, eig_index, eig_offset, ii, right_nnr
INTEGER :: from, i, eig_index, eig_offset, ii, right_nnr, tg_nr3
!
#if defined(__INTEL_COMPILER)
#if __INTEL_COMPILER >= 1300
......@@ -539,7 +539,9 @@
ALLOCATE( psis( dffts%nnr_tg ) )
ALLOCATE( aux( dffts%nnr_tg ) )
!
ALLOCATE( tmp_rhos ( dffts%nr1x * dffts%nr2x * dffts%my_nr3p, nspin ) )
CALL tg_get_group_nr3( dffts, tg_nr3 )
!
ALLOCATE( tmp_rhos ( dffts%nr1x * dffts%nr2x * tg_nr3, nspin ) )
!
tmp_rhos = 0_DP
......@@ -663,11 +665,11 @@
!code this should be equal to the total number of planes
!
ir = dffts%nr1x*dffts%nr2x*dffts%my_nr3p
ir = dffts%nr1x*dffts%nr2x*tg_nr3
IF( ir > SIZE( psis ) ) &
CALL errore( ' rhoofr ', ' psis size too small ', ir )
do ir = 1, dffts%nr1x*dffts%nr2x*dffts%my_nr3p
do ir = 1, dffts%nr1x*dffts%nr2x*tg_nr3
tmp_rhos(ir,iss1) = tmp_rhos(ir,iss1) + sa1*( real(psis(ir)))**2
tmp_rhos(ir,iss2) = tmp_rhos(ir,iss2) + sa2*(aimag(psis(ir)))**2
end do
......
......@@ -57,7 +57,7 @@
!
INTEGER :: iv, jv, ia, is, isa, ism, ios, iss1, iss2, ir, ig, inl, jnl
INTEGER :: ivoff, jvoff, igoff, igno, igrp, ierr
INTEGER :: idx, eig_offset, nogrp_ , inc
INTEGER :: idx, eig_offset, nogrp_ , inc, tg_nr3
REAL(DP) :: fi, fip, dd, dv
COMPLEX(DP) :: fp, fm, ci
#if defined(__INTEL_COMPILER)
......@@ -154,11 +154,13 @@
!
IF( dffts%have_task_groups ) THEN
!
CALL tg_get_group_nr3( dffts, tg_nr3 )
!
!===============================================================================
!exx_wf related
IF(dft_is_hybrid().AND.exx_is_active()) THEN
!$omp parallel do private(tmp1,tmp2)
DO ir = 1, dffts%nr1x*dffts%nr2x*dffts%my_nr3p
DO ir = 1, dffts%nr1x*dffts%nr2x*tg_nr3
tmp1 = v(ir,iss1) * DBLE( psi(ir) )+exx_potential(ir,i/nogrp_+1)
tmp2 = v(ir,iss2) * AIMAG(psi(ir) )+exx_potential(ir,i/nogrp_+2)
psi(ir) = CMPLX( tmp1, tmp2, kind=DP)
......@@ -166,7 +168,7 @@
!$omp end parallel do
ELSE
!$omp parallel do
DO ir = 1, dffts%nr1x*dffts%nr2x*dffts%my_nr3p
DO ir = 1, dffts%nr1x*dffts%nr2x*tg_nr3
psi(ir) = CMPLX ( v(ir,iss1) * DBLE( psi(ir) ), &
v(ir,iss2) *AIMAG( psi(ir) ) ,kind=DP)
END DO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment