Commit ca226893 authored by Matteo Gerosa's avatar Matteo Gerosa
Browse files

Removed commented lines, old implementations of sqvc.

parent cbe386bb
......@@ -22,11 +22,10 @@ MODULE class_coulomb
!
TYPE, PUBLIC :: coulomb
!
REAL(DP) :: div ! divergece
REAL(DP) :: div ! divergence
CHARACTER(LEN=7) :: singularity_removal_mode ! singularity_removal_mode
INTEGER :: iq ! q-point
REAL(DP),ALLOCATABLE :: sqvc(:) ! square root of Coulomb potential in PW
INTEGER :: numg, numgx
!
CONTAINS
!
......@@ -68,24 +67,24 @@ MODULE class_coulomb
REAL(DP) :: qgnorm2,qg(3),x
INTEGER :: numg, numgx
INTEGER :: ig, ipol
LOGICAL :: on_double_grid, l_print
LOGICAL :: on_double_grid
REAL(DP) :: grid_factor
!
CALL start_clock('sqvc_init')
!
SELECT CASE ( cdriver )
CASE ( 'Wave' )
this%numg = npwq
this%numgx = npwqx
numg = npwq
numgx = npwqx
CASE ( 'Smooth' )
this%numg = ngms
this%numgx = ngms
numg = ngms
numgx = ngms
CASE DEFAULT
CALL errore("sqvc_init", "cdriver value not supported, supported only Wave and Smooth",1)
END SELECT
!
IF( ALLOCATED(this%sqvc) ) DEALLOCATE( this%sqvc )
ALLOCATE( this%sqvc( this%numgx ) )
ALLOCATE( this%sqvc( numgx ) )
!
IF ( PRESENT(iq) ) THEN
this%iq = iq
......@@ -93,12 +92,12 @@ MODULE class_coulomb
this%iq = 1 ! gamma-only
ENDIF
!
this%singularity_removal_mode = TRIM(singularity_removal_mode)
this%singularity_removal_mode = singularity_removal_mode
IF (this%singularity_removal_mode /= "gb" .AND. this%singularity_removal_mode /= "default") &
& CALL errore( 'sqvc_init', 'singularity removal mode not supported, supported only default and gb', 1 )
!
this%sqvc = 0._DP
DO ig = 1,this%numg
DO ig = 1,numg
!
IF ( gamma_only ) THEN
qg(:) = g(:,ig)
......
......@@ -19,7 +19,6 @@ MODULE scratch_area
SAVE
!
! COULOMB
! REAL(DP),ALLOCATABLE :: sqvc(:)
INTEGER :: npwq,npwqx,npwq_g
CHARACTER(LEN=6) :: fftdriver
INTEGER,ALLOCATABLE :: iks_l2g(:)
......@@ -70,7 +69,6 @@ MODULE scratch_area
! I/O
!INTEGER :: io_comm ! communicator for head of images (me_bgrp==0)
!
! REAL(DP) :: isz
!
END MODULE
!
......
......@@ -48,9 +48,7 @@ SUBROUTINE do_sxx ( )
!
INTEGER :: ir, ip, ig, iks, ib, iv, ip_glob
COMPLEX(DP),ALLOCATABLE :: pertg(:),pertr(:),pertr_nc(:,:)
! REAL(DP),ALLOCATABLE :: mysqvc(:)
TYPE(bar_type) :: barra
! REAL(DP) :: mydiv
REAL(DP),ALLOCATABLE :: sigma_exx( :, : )
REAL(DP),ALLOCATABLE :: sigma_sxx( :, : )
REAL(DP) :: peso
......@@ -62,11 +60,6 @@ SUBROUTINE do_sxx ( )
TYPE(json_file) :: json
INTEGER :: iunit
!
CALL pot3d%init('Wave','gb')
! ALLOCATE( mysqvc(npwq) )
! CALL store_sqvc(mysqvc,npwq,'spherical',1,.FALSE.,mydiv)
!CALL store_sqvc(mysqvc,npwq,1,mydiv)
!
CALL io_push_title("(S)creened eXact eXchange")
!
ALLOCATE( sigma_exx( westpp_range(1):westpp_range(2), nks) )
......@@ -82,6 +75,8 @@ SUBROUTINE do_sxx ( )
ALLOCATE( pertr( dffts%nnr ) )
ENDIF
!
CALL pot3d%init('Wave','gb')
!
IF( gamma_only ) THEN
peso = 2._DP
ALLOCATE( dproj( 1, pert%nloc ) )
......@@ -200,7 +195,6 @@ SUBROUTINE do_sxx ( )
sigma_sxx = sigma_exx + sigma_sxx
!
DEALLOCATE( pertg )
! DEALLOCATE( mysqvc )
IF( noncolin ) THEN
DEALLOCATE( pertr_nc )
ELSE
......
......@@ -42,12 +42,8 @@ SUBROUTINE westpp_setup
!
CALL set_npwq()
!
! ALLOCATE(sqvc(npwq))
!
CALL pot3D%init('Wave','default')
CALL pot3D%print_divergence()
! CALL store_sqvc(sqvc,npwq,'spherical',1,.FALSE.,isz,l_printout_div)
!CALL store_sqvc(sqvc,npwq,1,isz)
!
CALL set_nbndocc()
!
......
......@@ -65,8 +65,6 @@ SUBROUTINE calc_exx2_gamma( sigma_exx, nb1, nb2 )
TYPE(idistribute) :: vband
TYPE(bar_type) :: barra
INTEGER :: barra_load
! REAL(DP),ALLOCATABLE :: mysqvc(:)
! REAL(DP) :: mydiv
!
WRITE(stdout,'(5x,a)') ' '
CALL io_push_bar()
......@@ -74,7 +72,6 @@ SUBROUTINE calc_exx2_gamma( sigma_exx, nb1, nb2 )
CALL io_push_bar()
!
ALLOCATE( pertg( ngms ) )
! ALLOCATE( mysqvc(ngms) )
IF(noncolin) THEN
ALLOCATE( pertr_nc( dffts%nnr, npol ) )
ELSE
......@@ -82,8 +79,6 @@ SUBROUTINE calc_exx2_gamma( sigma_exx, nb1, nb2 )
ENDIF
!
CALL pot3D%init('Smooth','gb')
! CALL store_sqvc( mysqvc, ngms, 'gb', 1, .FALSE., mydiv )
!CALL store_sqvc(mysqvc,ngms,div_kind_hf,mydiv)
!
! Set to zero
!
......@@ -267,9 +262,7 @@ SUBROUTINE calc_exx2_k( sigma_exx, nb1, nb2 )
TYPE(idistribute) :: vband
TYPE(bar_type) :: barra
INTEGER :: barra_load
! REAL(DP),ALLOCATABLE :: mysqvc(:)
LOGICAL :: l_gammaq
! REAL(DP) :: mydiv
REAL(DP) :: g0(3)
!
WRITE(stdout,'(5x,a)') ' '
......@@ -278,7 +271,6 @@ SUBROUTINE calc_exx2_k( sigma_exx, nb1, nb2 )
CALL io_push_bar()
!
ALLOCATE( pertg( ngms ) )
! ALLOCATE( mysqvc( ngms ) )
ALLOCATE( phase(dffts%nnr) )
ALLOCATE( evckmq(npwx*npol,nbnd) )
IF(noncolin) THEN
......@@ -364,21 +356,10 @@ SUBROUTINE calc_exx2_k( sigma_exx, nb1, nb2 )
l_gammaq = q_grid%l_pIsGamma(iq)
!
CALL k_grid%find( k_grid%p_cart(:,ik) - q_grid%p_cart(:,iq), is, 'cart', ikqs, g0 )
!CALL k_grid%add( k_grid%p_cart(:,ik), -q_grid%p_cart(:,iq), kmq, g0, 'cart' )
!ikqs = k_grid%find( kmq, 'cart' )
!!ikqs = kmq_grid%index_kq(iks,iq)
!
CALL pot3D%init('Smooth', 'gb', iq)
! CALL store_sqvc( mysqvc, ngms, 'gb', iq, .FALSE., mydiv )
!IF ( l_gammaq ) THEN
! CALL store_sqvc(mysqvc,ngms,div_kind_hf,mydiv)
!ELSE
! CALL store_sqvc_q(mysqvc,ngms,div_kind_hf,iq,.FALSE.)
!ENDIF
!
CALL compute_phase( g0, 'cart', phase )
!CALL kmq_grid%get_phase(iks,iq)
!phase = kmq_grid%phase
!
npwkq = ngk(ikqs)
!
......@@ -428,7 +409,6 @@ SUBROUTINE calc_exx2_k( sigma_exx, nb1, nb2 )
CALL mp_sum( sigma_exx, inter_image_comm )
!
DEALLOCATE( pertg )
! DEALLOCATE( mysqvc )
IF( noncolin ) THEN
DEALLOCATE( pertr_nc )
ELSE
......
......@@ -99,8 +99,6 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
CALL allocate_bec_type ( nkb, pert%nloc, becp ) ! I just need 2 becp at a time
!
CALL pot3D%init('Wave','default')
! CALL store_sqvc( sqvc, npwq, 'spherical', 1, .FALSE., isz )
!CALL store_sqvc(sqvc,npwq,1,isz,.FALSE.)
!
IF(l_read_restart) THEN
CALL solvegfreq_restart_read( bks )
......@@ -332,7 +330,6 @@ SUBROUTINE solve_gfreq_gamma(l_read_restart)
!
ENDDO ! KPOINT-SPIN
!
! DEALLOCATE( sqvc )
!
CALL stop_bar_type( barra, 'glanczos' )
!
......@@ -357,13 +354,11 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
USE pwcom, ONLY : npw,npwx,et,nks,current_spin,isk,xk,nbnd,lsda,igk_k,g2kin,nkstot,current_k,ngk
USE wavefunctions_module, ONLY : evc,psic,psic_nc
USE io_files, ONLY : tmp_dir,nwordwfc,iunwfc
! USE fft_at_gamma, ONLY : DOUBLEBAND_INVFFT,SINGLEBAND_INVFFT,DOUBLEBAND_FWFFT,SINGLEBAND_FWFFT
USE fft_at_k, ONLY : single_invfft_k,single_fwfft_k
USE becmod, ONLY : becp,allocate_bec_type,deallocate_bec_type
USE uspp, ONLY : vkb,nkb
USE pdep_io, ONLY : pdep_read_G_and_distribute
USE io_push, ONLY : io_push_title
! USE control_flags, ONLY : gamma_only
USE noncollin_module, ONLY : noncolin,npol
USE buffers, ONLY : get_buffer
USE bar, ONLY : bar_type,start_bar_type,update_bar_type,stop_bar_type
......@@ -407,7 +402,6 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
REAL(DP) :: time_spent(2)
REAL(DP),EXTERNAL :: get_clock
TYPE(bks_type) :: bks
!TYPE(bz_grid) :: k1_grid, q_grid_aux
!
CALL io_push_title("(G)-Lanczos")
!
......@@ -500,9 +494,6 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
time_spent(1) = get_clock( 'glanczos' )
!
CALL q_grid%find( k_grid%p_cart(:,ikk) - k_grid%p_cart(:,ik), 1, 'cart', iq, g0 )
!CALL k_grid%add( k_grid%p_cart(:,ikk), -k_grid%p_cart(:,ik), q, g0, 'cart' )
!iq = q_grid%find( q, 'cart' )
!!iq = q_grid_aux%index_q(ikks,iks)
!
CALL preallocate_solvegfreq_q( iks_l2g(ikks), iks_l2g(iks), qp_bandrange(1), qp_bandrange(2), pert)
!
......@@ -511,12 +502,6 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
! compute Coulomb potential
!
CALL pot3D%init('Wave', 'default', iq)
!CALL store_sqvc( sqvc, npwq, 'spherical', iq, .TRUE., isz )
!IF ( q_grid%l_pIsGamma(iq) ) THEN
! CALL store_sqvc(sqvc,npwq,1,isz,.FALSE.)
!ELSE
! CALL store_sqvc_q(sqvc,npwq,1,iq,.TRUE.)
!ENDIF
!
! The Hamiltonian is evaluated at k'
!
......@@ -550,8 +535,6 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
! CALL init_us_2 (npw, igk, xk (1, iks), vkb)
!
CALL compute_phase( g0, 'cart', phase )
!CALL q_grid_aux%get_phase(ikks,iks)
!phase = q_grid_aux%phase
!
IF ( my_image_id == 0 ) CALL get_buffer( evc, lrwfc, iuwfc, iks )
CALL mp_bcast( evc, 0, inter_image_comm )
......@@ -688,7 +671,6 @@ SUBROUTINE solve_gfreq_k(l_read_restart)
!
ENDDO ! KPOINT-SPIN (MATRIX ELEMENT)
!
! DEALLOCATE( sqvc )
DEALLOCATE( phase )
DEALLOCATE( psick )
DEALLOCATE( evck )
......
......@@ -136,8 +136,6 @@ SUBROUTINE solve_wfreq_gamma(l_read_restart,l_generate_plot)
dmati = 0._DP
zmatr = 0._DP
!
! ALLOCATE( sqvc(npwqx) )
!
IF(l_read_restart) THEN
CALL solvewfreq_restart_read( bks, dmati, zmatr, mypara%nglob, mypara%nloc )
ELSE
......@@ -166,8 +164,6 @@ SUBROUTINE solve_wfreq_gamma(l_read_restart,l_generate_plot)
ENDIF
!
CALL pot3D%init('Wave','default')
! CALL store_sqvc( sqvc, npwq, 'spherical', 1, .FALSE., isz )
!CALL store_sqvc(sqvc,npwq,1,isz,.FALSE.)
!
! LOOP
!
......@@ -724,8 +720,6 @@ SUBROUTINE solve_wfreq_k(l_read_restart,l_generate_plot)
zmati_q = 0._DP
zmatr_q = 0._DP
!
! ALLOCATE( sqvc(npwqx) )
!
ALLOCATE( evckpq(npwx*npol,nbnd) )
IF (noncolin) THEN
ALLOCATE( psick_nc(dffts%nnr,npol) )
......@@ -775,12 +769,6 @@ SUBROUTINE solve_wfreq_k(l_read_restart,l_generate_plot)
l_gammaq = q_grid%l_pIsGamma(iq)
!
CALL pot3D%init('Wave','default',iq)
! CALL store_sqvc( sqvc, npwq, 'spherical', iq, .TRUE., isz )
!IF (l_gammaq) THEN
! CALL store_sqvc(sqvc,npwq,1,isz,.FALSE.)
!ELSE
! CALL store_sqvc_q(sqvc,npwq,1,iq,.TRUE.)
!ENDIF
!
DO iks = 1, k_grid%nps ! KPOINT-SPIN
!
......@@ -832,18 +820,10 @@ SUBROUTINE solve_wfreq_k(l_read_restart,l_generate_plot)
!npwkq = ngk(ikqs)
!
CALL k_grid%find( k_grid%p_cart(:,ik) + q_grid%p_cart(:,iq), is, 'cart', ikqs, g0 )
!CALL k_grid%add( k_grid%p_cart(:,ik), q_grid%p_cart(:,iq), kpq, g0, 'cart' )
!ikqs = k_grid%find( kpq, 'cart' )
!
npwkq = ngk(ikqs)
!
CALL compute_phase( g0, 'cart', phase )
!!
!! computes the phase needed to bring the wavefunction at k+q
!! to the equivalent [k+q] point in the first BZ
!!
!CALL kpq_grid%get_phase(iks,iq)
!phase = kpq_grid%phase
!
! Set wavefunctions at [k+q] in G space, for all bands,
! and store them in evckpq
......
......@@ -116,10 +116,6 @@ SUBROUTINE davidson_diago_gamma ( )
IF( ierr /= 0 ) &
CALL errore( 'chidiago',' cannot allocate dng ', ABS(ierr) )
!
! ALLOCATE( sqvc( npwqx ), STAT=ierr )
! IF( ierr /= 0 ) &
! CALL errore( 'chidiago',' cannot allocate sqvc ', ABS(ierr) )
!
ALLOCATE( hr_distr( nvecx, pert%nlocx ), STAT=ierr )
IF( ierr /= 0 ) &
CALL errore( 'chidiago',' cannot allocate hr_distr ', ABS(ierr) )
......@@ -153,8 +149,6 @@ SUBROUTINE davidson_diago_gamma ( )
!
CALL pot3D%init('Wave','default')
CALL pot3d%print_divergence()
! CALL store_sqvc( sqvc, npwq, 'spherical', 1, .FALSE., isz, .TRUE. )
!CALL store_sqvc(sqvc,npwq,1,isz,.TRUE.)
!
! KIND OF CALCULATION
!
......@@ -569,10 +563,6 @@ SUBROUTINE davidson_diago_k ( )
IF( ierr /= 0 ) &
CALL errore( 'chidiago',' cannot allocate conv ', ABS(ierr) )
!
! ALLOCATE(sqvc(npwqx), STAT=ierr)
! CALL errore( 'chidiago',' cannot allocate sqvc ', ABS(ierr) )
!
!
QPOINTS_LOOP: &
DO iq = 1, q_grid%np
!
......@@ -595,12 +585,6 @@ SUBROUTINE davidson_diago_k ( )
!
CALL pot3D%init('Wave','default',iq)
CALL pot3d%print_divergence()
! CALL store_sqvc( sqvc, npwq, 'spherical', iq, .TRUE., isz, .TRUE. )
!IF ( q_grid%l_pIsGamma(iq) ) THEN
! CALL store_sqvc(sqvc,npwq,1,isz,.TRUE.)
!ELSE
! CALL store_sqvc_q(sqvc,npwq,1,iq,.TRUE.)
!ENDIF
!
IF ( q_grid%np > 1 ) THEN
!
......@@ -923,7 +907,6 @@ SUBROUTINE davidson_diago_k ( )
DEALLOCATE( ev )
DEALLOCATE( hr_distr )
DEALLOCATE( vr_distr )
! DEALLOCATE( sqvc )
!
!
DEALLOCATE( dng )
......
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