Yet another problem with nk1 nk2 nk3 etc: example07 wasn't working any

longer. Not a big deal, but it must be fixed. Tentative solution: 
keep track whether new values are read in yet another logical variable,
copy new values into internal variables if so, do not if not so. I hope
this is the good time...


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@7797 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2011-05-17 15:04:29 +00:00
parent 6608bcc2c6
commit 6c92d606a7
10 changed files with 51 additions and 33 deletions

View File

@ -37,12 +37,11 @@ SUBROUTINE check_initial_status(auxdyn)
USE control_ph, ONLY : ldisp, recover, done_bands, &
start_q, last_q, current_iq, tmp_dir_ph, lgamma, &
ext_recover, ext_restart, tmp_dir_phq, lqdir, &
start_irr, last_irr
start_irr, last_irr, newgrid
USE save_ph, ONLY : tmp_dir_save
USE ph_restart, ONLY : ph_readfile, check_status_run, init_status_run, &
ph_writefile
USE start_k, ONLY : nks_start
USE input_parameters,ONLY : nk1, nk2, nk3
USE save_ph, ONLY : save_ph_input_variables
USE io_rho_xml, ONLY : write_rho
USE mp_global, ONLY : nimage, my_image_id, intra_image_comm
@ -120,9 +119,8 @@ SUBROUTINE check_initial_status(auxdyn)
ENDIF
ELSE
! this is the standard treatment
IF (((ldisp.OR..NOT.lgamma.OR.modenum/=0).AND.(.NOT.lqdir)).OR.nk1*nk2*nk3.ne.0) &
CALL write_rho( rho, nspin )
IF ( ( ( ldisp .OR. .NOT.lgamma .OR. modenum/=0 ) .AND. (.NOT.lqdir) ) &
.OR. newgrid ) CALL write_rho( rho, nspin )
ENDIF
!!!!!!!!!!!!!!!!!!!!!!!! END OF ACFDT TEST !!!!!!!!!!!!!!!!
!
@ -186,7 +184,7 @@ SUBROUTINE check_initial_status(auxdyn)
! ... each q /= gamma works on a different directory. We create them
! here and copy the charge density inside
!
IF ((.NOT.lgamma.OR.nk1*nk2*nk3 .ne. 0).AND.lqdir) THEN
IF ((.NOT.lgamma.OR. newgrid).AND.lqdir) THEN
tmp_dir_phq= TRIM (tmp_dir_ph) //TRIM(prefix)//&
& '_q' // TRIM(int_to_char(iq))//'/'
filename=TRIM(tmp_dir_phq)//TRIM(prefix)//'.save/charge-density.dat'

View File

@ -307,7 +307,7 @@ SUBROUTINE elphsum ( )
USE cell_base, ONLY : at, bg
USE lsda_mod, ONLY: isk, nspin
USE klist, ONLY: nks, nkstot, xk, wk, nelec
USE input_parameters, ONLY: nk1, nk2, nk3
USE start_k, ONLY: nk1, nk2, nk3
USE symm_base, ONLY: s, irt, nsym, invs
USE noncollin_module, ONLY: nspin_lsda, nspin_mag
USE wvfct, ONLY: nbnd, et

View File

@ -187,7 +187,6 @@ ch_psi_all.o : ../PW/noncol.o
ch_psi_all.o : ../PW/pwcom.o
ch_psi_all.o : phcom.o
check_initial_status.o : ../Modules/control_flags.o
check_initial_status.o : ../Modules/input_parameters.o
check_initial_status.o : ../Modules/io_files.o
check_initial_status.o : ../Modules/io_global.o
check_initial_status.o : ../Modules/ions_base.o
@ -594,7 +593,6 @@ elph.o : ../Modules/kind.o
elphon.o : ../Modules/cell_base.o
elphon.o : ../Modules/constants.o
elphon.o : ../Modules/fft_base.o
elphon.o : ../Modules/input_parameters.o
elphon.o : ../Modules/io_files.o
elphon.o : ../Modules/io_global.o
elphon.o : ../Modules/ions_base.o
@ -607,6 +605,7 @@ elphon.o : ../Modules/uspp.o
elphon.o : ../Modules/wavefunctions.o
elphon.o : ../PW/noncol.o
elphon.o : ../PW/pwcom.o
elphon.o : ../PW/start_k.o
elphon.o : ../PW/symm_base.o
elphon.o : elph.o
elphon.o : phcom.o
@ -865,6 +864,7 @@ phq_readin.o : ../Modules/uspp.o
phq_readin.o : ../Modules/xml_io_base.o
phq_readin.o : ../PW/noncol.o
phq_readin.o : ../PW/pwcom.o
phq_readin.o : ../PW/start_k.o
phq_readin.o : ph_restart.o
phq_readin.o : phcom.o
phq_readin.o : ramanm.o
@ -932,7 +932,6 @@ polariz.o : ../PW/pwcom.o
polariz.o : ../PW/symme.o
polariz.o : phcom.o
prepare_q.o : ../Modules/control_flags.o
prepare_q.o : ../Modules/input_parameters.o
prepare_q.o : ../Modules/io_files.o
prepare_q.o : ../Modules/io_global.o
prepare_q.o : ../PW/pwcom.o
@ -1066,7 +1065,6 @@ set_defaults_pw.o : ../Modules/cell_base.o
set_defaults_pw.o : ../Modules/constants.o
set_defaults_pw.o : ../Modules/control_flags.o
set_defaults_pw.o : ../Modules/griddim.o
set_defaults_pw.o : ../Modules/input_parameters.o
set_defaults_pw.o : ../Modules/io_global.o
set_defaults_pw.o : ../Modules/ions_base.o
set_defaults_pw.o : ../Modules/kind.o

View File

@ -1,5 +1,5 @@
!
! Copyright (C) 2001-2004 PWSCF group
! Copyright (C) 2001-2011 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
@ -334,7 +334,8 @@ MODULE control_ph
lqdir=.FALSE., & ! if true each q writes in its directory
xmldyn=.FALSE., & ! if true the dynamical matrix is in xml form
all_done, & ! if .TRUE. all representations have been done
dvscf_star ! if .TRUE. obtain dvscf_q' for q' belonging by star{q} (in cart. coord.)
dvscf_star,& ! if .TRUE. obtain dvscf_q' for q' belonging by star{q} (in cart. coord.)
newgrid=.FALSE. ! if .TRUE. use new k-point grid nk1,nk2,nk3
!
END MODULE control_ph
!

View File

@ -1,5 +1,5 @@
!
! Copyright (C) 2001-2004 PWSCF group
! Copyright (C) 2001-2011 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
@ -23,8 +23,8 @@ SUBROUTINE phq_readin()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
USE ions_base, ONLY : amass, pmass, atm
USE input_parameters, ONLY : max_seconds
USE input_parameters, ONLY : nk1, nk2, nk3, k1, k2, k3
USE input_parameters, ONLY : max_seconds, nk1, nk2, nk3, k1, k2, k3
USE start_k, ONLY : init_start_grid
USE klist, ONLY : xk, nks, nkstot, lgauss, two_fermi_energies, lgauss
USE ktetra, ONLY : ltetra
USE control_flags, ONLY : gamma_only, tqr, restart, lkpoint_dir
@ -35,7 +35,7 @@ SUBROUTINE phq_readin()
USE cellmd, ONLY : lmovecell
USE printout_base, ONLY : title
USE control_ph, ONLY : maxter, alpha_mix, lgamma, lgamma_gamma, epsil, &
zue, zeu, xmldyn, &
zue, zeu, xmldyn, newgrid, &
trans, reduce_io, elph, tr2_ph, niter_ph, &
nmix_ph, ldisp, recover, lrpa, lnoloc, start_irr, &
last_irr, start_q, last_q, current_iq, tmp_dir_ph, &
@ -357,6 +357,13 @@ SUBROUTINE phq_readin()
1001 CONTINUE
CALL read_file ( )
!
! init_start_grid returns .true. if a new k-point grid is set from values
! read from input (this happens if nk1*nk2*nk3, else it returns .false.,
! leaves the current values, as read in read_file, unchanged)
!
newgrid = init_start_grid (nk1, nk2, nk3, k1, k2, k3)
!
tmp_dir=tmp_dir_save
!
IF (modenum > 3*nat) CALL errore ('phq_readin', ' Wrong modenum ', 2)

View File

@ -28,14 +28,13 @@ SUBROUTINE prepare_q(auxdyn, do_band, do_iq, setup_pw, iq)
USE qpoint, ONLY : xq
USE disp, ONLY : x_q, done_iq, rep_iq, done_rep_iq, comp_iq
USE control_ph, ONLY : ldisp, lgamma, epsil, trans, zue, zeu, &
start_irr, last_irr, current_iq, &
start_irr, last_irr, current_iq, newgrid, &
done_bands, tmp_dir_ph, tmp_dir_phq, lqdir
USE io_files, ONLY : prefix
USE ramanm, ONLY : lraman, elop
USE freq_ph, ONLY : fpol
USE output, ONLY : fildyn
USE ph_restart, ONLY : ph_writefile
USE input_parameters,ONLY : nk1, nk2, nk3
!
IMPLICIT NONE
!
@ -138,14 +137,13 @@ SUBROUTINE prepare_q(auxdyn, do_band, do_iq, setup_pw, iq)
CALL ph_writefile('init',0)
!
! ... In the case:
! of q = 0 and one of nk1, nk2 or nk3 = 0 we do not make a
! non selfconsistent run
! of q = 0 and nk1*nk2*nk3 \=0 we do make first a nscf run
! of q = 0 and one of nk1, nk2 or nk3 = 0 (newgrid=.false.)
! we do not make a non selfconsistent run
! of q = 0 and nk1*nk2*nk3 \=0 (newgrid = .true.)
! we do make first a nscf run
! of q \= 0 we do make first a nscf run
!
! setup_pw = (.NOT.lgamma.OR.modenum /= 0).AND..NOT. done_bands
setup_pw = (.NOT.lgamma.OR.modenum /= 0.OR.nk1*nk2*nk3 .ne. 0).AND..NOT. done_bands
setup_pw = (.NOT.lgamma.OR.modenum /= 0 .OR. newgrid).AND..NOT. done_bands
do_band=.FALSE.
DO irr=start_irr, MIN(ABS(last_irr),rep_iq(iq))
IF (done_rep_iq(irr,iq) /= 1) THEN

View File

@ -21,7 +21,7 @@ SUBROUTINE run_pwscf(do_band)
USE control_flags, ONLY : restart
USE qpoint, ONLY : xq
USE control_ph, ONLY : done_bands, reduce_io, recover, tmp_dir_phq, &
ext_restart, bands_computed
ext_restart, bands_computed, newgrid
USE save_ph, ONLY : tmp_dir_save
!
USE acfdtest, ONLY : acfdt_is_active, acfdt_num_der, ir_point, delta_vrs
@ -30,10 +30,9 @@ SUBROUTINE run_pwscf(do_band)
!
IMPLICIT NONE
!
CHARACTER(LEN=256) :: dirname, file_base_in, file_base_out
!
LOGICAL, INTENT(IN) :: do_band
!
CHARACTER(LEN=256) :: dirname, file_base_in, file_base_out
LOGICAL :: exst
!
CALL start_clock( 'PWSCF' )
@ -56,7 +55,7 @@ SUBROUTINE run_pwscf(do_band)
CALL restart_from_file()
conv_ions=.true.
!
CALL setup_nscf (xq)
CALL setup_nscf ( newgrid, xq )
CALL init_run()
!!!!!!!!!!!!!!!!!!!!!!!! ACFDT TEST !!!!!!!!!!!!!!!!
IF (acfdt_is_active) THEN

View File

@ -6,7 +6,7 @@
! or http://www.gnu.org/copyleft/gpl.txt .
!
!----------------------------------------------------------------------------
SUBROUTINE setup_nscf (xq)
SUBROUTINE setup_nscf ( newgrid, xq )
!----------------------------------------------------------------------------
!
! ... This routine initializes variables for the non-scf calculations at k
@ -45,8 +45,8 @@ SUBROUTINE setup_nscf (xq)
USE mp_global, ONLY : kunit
USE spin_orb, ONLY : domag
USE noncollin_module, ONLY : noncolin
USE start_k, ONLY : nks_start, xk_start, wk_start
USE input_parameters, ONLY : nk1, nk2, nk3, k1, k2, k3
USE start_k, ONLY : nks_start, xk_start, wk_start, &
nk1, nk2, nk3, k1, k2, k3
USE paw_variables, ONLY : okpaw
USE modes, ONLY : nsymq, invsymq !, gi, gimq, irgq, irotmq, minus_q
USE uspp_param, ONLY : n_atom_wfc
@ -54,6 +54,7 @@ SUBROUTINE setup_nscf (xq)
IMPLICIT NONE
!
REAL (DP), INTENT(IN) :: xq(3)
LOGICAL, INTENT (IN) :: newgrid
!
REAL (DP), ALLOCATABLE :: rtau (:,:,:)
LOGICAL :: minus_q, magnetic_sym, sym(48)
@ -124,7 +125,7 @@ SUBROUTINE setup_nscf (xq)
! ... Input k-points are assumed to be given in the IBZ of the Bravais
! ... lattice, with the full point symmetry of the lattice.
!
if(nk1.eq.0.OR.nk2.eq.0.OR.nk3.eq.0) then
if( .NOT. newgrid ) then
!
! In this case I keep the same points of the Charge density
! calculations

View File

@ -1410,6 +1410,7 @@ setlocal.o : ../Modules/mp_global.o
setlocal.o : ../Modules/recvec.o
setlocal.o : esm.o
setlocal.o : martyna_tuckerman.o
setlocal.o : ms2.o
setlocal.o : pwcom.o
setlocal.o : scf_mod.o
setqf.o : ../Modules/kind.o

View File

@ -29,5 +29,20 @@ MODULE start_k
! initial weight of k points
REAL(DP), ALLOCATABLE :: xk_start(:,:)
! initial coordinates of k points
CONTAINS
LOGICAL FUNCTION init_start_grid ( nk1_, nk2_, nk3_, k1_, k2_, k3_ )
INTEGER, INTENT (IN) :: nk1_, nk2_, nk3_, k1_, k2_, k3_
!
IF ( nk1_ > 0 ) nk1 = nk1_
IF ( nk2_ > 0 ) nk2 = nk2_
IF ( nk3_ > 0 ) nk3 = nk3_
IF ( k1_ > 0 ) k1 = nk1_
IF ( k2_ > 0 ) k2 = nk2_
IF ( k3_ > 0 ) k3 = nk3_
init_start_grid = (nk1*nk2*nk3 > 0)
!
END FUNCTION init_start_grid
END MODULE start_k