Commit bc9c3563 authored by Marco Govoni's avatar Marco Govoni
Browse files

Corrected bug affecting nspin=2

parent ca9cb630
......@@ -347,7 +347,7 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
IF( ecut_refreq<=0._DP) CALL errore('fetch_input','Err: ecut_imfreq<0.',1)
IF( ecut_spectralf(2)<ecut_spectralf(1)) CALL errore('fetch_input','Err: ecut_spectralf(2)<ecut_spectralf(1)',1)
IF( wfreq_eta<=0._DP) CALL errore('fetch_input','Err: wfreq_eta<0.',1)
IF( n_secant_maxiter < 1 ) CALL errore('fetch_input','Err: n_secant_maxiter<1',1)
IF( n_secant_maxiter < 0 ) CALL errore('fetch_input','Err: n_secant_maxiter<0',1)
IF( trev_secant<=0._DP) CALL errore('fetch_input','Err: trev_secant<0.',1)
SELECT CASE(macropol_calculation)
CASE('N','n','C','c')
......
......@@ -244,7 +244,7 @@ SUBROUTINE calc_corr_k( sigma_corr, energy, l_verbose)
!
! Workspace
!
INTEGER :: ik,ikk,iks,ikks,iq,ib,ifreq,glob_ifreq,il,im,glob_im,ip
INTEGER :: ik,ikk,iks,ikks,iq,ib,ifreq,glob_ifreq,il,im,glob_im,ip,is,iss
INTEGER :: nbndval
!
REAL(DP),EXTERNAL :: integrate_imfreq
......@@ -286,7 +286,7 @@ SUBROUTINE calc_corr_k( sigma_corr, energy, l_verbose)
DO iks = 1, k_grid%nps ! KPOINT-SPIN (MATRIX ELEMENT)
!
ik = k_grid%ip(iks)
! is = k_grid%is(iks)
is = k_grid%is(iks)
!
DO ib = qp_bandrange(1), qp_bandrange(2)
!
......@@ -297,6 +297,8 @@ SUBROUTINE calc_corr_k( sigma_corr, energy, l_verbose)
DO ikks = 1, k_grid%nps ! KPOINT-SPIN (INTEGRAL OVER K')
!
ikk = k_grid%ip(ikks)
iss = k_grid%is(ikks)
IF( is /= iss ) CYCLE
!
!CALL k_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 1, 'cart', iq, g0 ) !MATTEO
CALL k_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 'cart', iq, g0 ) !MARCO
......@@ -371,7 +373,7 @@ SUBROUTINE calc_corr_k( sigma_corr, energy, l_verbose)
DO iks = 1, k_grid%nps ! KPOINT-SPIN (MATRIX ELEMENT)
!
ik = k_grid%ip(iks)
! is = k_grid%is(iks)
is = k_grid%is(iks)
!
DO ib = qp_bandrange(1), qp_bandrange(2)
!
......@@ -384,6 +386,9 @@ SUBROUTINE calc_corr_k( sigma_corr, energy, l_verbose)
DO ikks = 1, k_grid%nps ! KPOINT-SPIN (INTEGRAL OVER K')
!
ikk = k_grid%ip(ikks)
iss = k_grid%is(ikks)
!
IF( is /= iss ) CYCLE
!
!CALL k_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 1, 'cart', iq, g0 ) !MATTEO
CALL k_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 'cart', iq, g0 ) !MARCO
......
......@@ -607,6 +607,7 @@ SUBROUTINE solve_qp_k(l_secant,l_generate_plot)
LOGICAL,ALLOCATABLE :: l_conv(:,:)
REAL(DP),PARAMETER :: eshift = 0.007349862_DP ! = 0.1 eV
INTEGER :: k, ib, iks, ik, ikks, ikk, iq, ifixed, ip, glob_ip, ifreq, il, im, glob_im, glob_jp, glob_ifreq
INTEGER :: is, iss
REAL(DP) :: q(3), g0(3)
REAL(DP),ALLOCATABLE :: out_tab(:,:)
CHARACTER(LEN=5) :: myglobk
......@@ -694,6 +695,7 @@ SUBROUTINE solve_qp_k(l_secant,l_generate_plot)
DO iks = 1, k_grid%nps ! KPOINT-SPIN (MATRIX ELEMENT)
!
ik = k_grid%ip(iks)
is = k_grid%is(iks)
!
nbndval = nbnd_occ(iks)
!
......@@ -702,6 +704,8 @@ SUBROUTINE solve_qp_k(l_secant,l_generate_plot)
DO ikks = 1, k_grid%nps ! KPOINT-SPIN (INTEGRAL OVER K')
!
ikk = k_grid%ip(ikks)
iss = k_grid%is(ikks)
IF( is /= iss ) CYCLE
!
!CALL q_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 1, 'cart', iq, g0 ) !MATTEO
CALL q_grid%find( k_grid%p_cart(:,ik) - k_grid%p_cart(:,ikk), 'cart', iq, g0 ) !MARCO
......@@ -767,7 +771,7 @@ SUBROUTINE solve_qp_k(l_secant,l_generate_plot)
!
ENDDO ! im
!
CALL mp_sum( ztemp, inter_image_comm )
CALL mp_sum( ztemp, inter_image_comm )
!
DO im = 1, aband%nloc
glob_im = aband%l2g(im)
......@@ -1173,6 +1177,7 @@ SUBROUTINE output_eqp_report(iteration,en1,en2,sc1)
WRITE( stdout, '(5x,"k(",i6.6,") = (",3f12.7,") cryst. coord.")') ik, k_grid%p_cryst(1:3,ik)
IF( lnospin ) THEN
WRITE(stdout,"(5X,a,1X,a,1X,a)") 'band ', ' QP en. [eV]', 'conv'
iks = k_grid%ipis2ips(ik,1)
DO ib = qp_bandrange(1), qp_bandrange(2)
symb(1)=' no'
IF( (iteration .NE. 0) .AND. (ABS(en2(ib,iks)-en1(ib,iks)) < trev_secant) ) symb(1)=' yes'
......
......@@ -39,7 +39,7 @@ SUBROUTINE solve_wfreq_gamma(l_read_restart,l_generate_plot)
& l_enable_lanczos,nbnd_occ,iuwfc,lrwfc,wfreq_eta,imfreq_list,refreq_list,tr2_dfpt,&
& z_head_rfr,d_head_ifr,o_restart_time,l_skip_nl_part_of_hcomr,npwqx,fftdriver, wstat_save_dir
USE mp_global, ONLY : my_image_id,nimage,inter_image_comm,intra_bgrp_comm
USE mp_world, ONLY : mpime
USE mp_world, ONLY : mpime,root
USE mp, ONLY : mp_bcast,mp_barrier,mp_sum
USE io_global, ONLY : stdout,ionode
USE gvect, ONLY : g,ngm,gstart
......@@ -588,7 +588,7 @@ SUBROUTINE solve_wfreq_k(l_read_restart,l_generate_plot)
& z_head_rfr,z_head_ifr,o_restart_time,l_skip_nl_part_of_hcomr,npwqx,fftdriver, wstat_save_dir,&
& ngq, igq_q
USE mp_global, ONLY : my_image_id,nimage,inter_image_comm,intra_bgrp_comm
USE mp_world, ONLY : mpime
USE mp_world, ONLY : mpime,root
USE mp, ONLY : mp_bcast,mp_barrier,mp_sum
USE io_global, ONLY : stdout,ionode
USE gvect, ONLY : g,ngm,gstart
......
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