mirror of https://gitlab.com/QEF/q-e.git
1) Non scf calculations use atomic positions from the data filem no longer
those provided in input. I think that this is the correct behaviour and that the previous one was a source of trouble and of useless additional work. I cannot see any reason why one should perform a non scf calculation with one set of atomic positions and the scf potential relative to a different one. 2) After a reshuffling of input.f90 (which has become a mess beyond control), the check on starting_magnetization works again. input.f90 should be rewritten like the corresponding routine of CP. 3) Dependencies updated git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@5370 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
f1d1646946
commit
27c6cdf10e
|
@ -43,10 +43,6 @@ d2ion.o : ../Modules/io_global.o
|
|||
d2ion.o : ../Modules/kind.o
|
||||
d2ion.o : ../Modules/mp.o
|
||||
d2ion.o : ../Modules/mp_global.o
|
||||
dgcxc.o : ../Modules/functionals.o
|
||||
dgcxc.o : ../Modules/kind.o
|
||||
dgcxc_spin.o : ../Modules/functionals.o
|
||||
dgcxc_spin.o : ../Modules/kind.o
|
||||
dgradcorr.o : ../Modules/constants.o
|
||||
dgradcorr.o : ../Modules/kind.o
|
||||
dielec.o : ../Modules/ions_base.o
|
||||
|
|
|
@ -50,6 +50,7 @@ adddvscf.o : ../Modules/uspp.o
|
|||
adddvscf.o : ../PW/noncol.o
|
||||
adddvscf.o : ../PW/pwcom.o
|
||||
adddvscf.o : phcom.o
|
||||
addnlcc.o : ../Modules/cell_base.o
|
||||
addnlcc.o : ../Modules/functionals.o
|
||||
addnlcc.o : ../Modules/ions_base.o
|
||||
addnlcc.o : ../Modules/kind.o
|
||||
|
@ -58,6 +59,7 @@ addnlcc.o : ../Modules/mp_global.o
|
|||
addnlcc.o : ../PW/pwcom.o
|
||||
addnlcc.o : ../PW/scf_mod.o
|
||||
addnlcc.o : phcom.o
|
||||
addnlcc_zstar_eu_us.o : ../Modules/cell_base.o
|
||||
addnlcc_zstar_eu_us.o : ../Modules/functionals.o
|
||||
addnlcc_zstar_eu_us.o : ../Modules/kind.o
|
||||
addnlcc_zstar_eu_us.o : ../Modules/mp_global.o
|
||||
|
@ -100,12 +102,12 @@ addusdynmat.o : ../PW/noncol.o
|
|||
addusdynmat.o : ../PW/pwcom.o
|
||||
addusdynmat.o : phcom.o
|
||||
addusldos.o : ../Modules/ions_base.o
|
||||
addusldos.o : ../Modules/kind.o
|
||||
addusldos.o : ../Modules/uspp.o
|
||||
addusldos.o : ../Modules/wavefunctions.o
|
||||
addusldos.o : ../PW/pwcom.o
|
||||
allocate_part.o : ../Modules/ions_base.o
|
||||
allocate_part.o : ../Modules/kind.o
|
||||
allocate_part.o : ../PW/pwcom.o
|
||||
allocate_part.o : phcom.o
|
||||
allocate_phq.o : ../Modules/ions_base.o
|
||||
allocate_phq.o : ../Modules/kind.o
|
||||
|
@ -128,7 +130,6 @@ bcast_ph_input.o : ../Modules/io_global.o
|
|||
bcast_ph_input.o : ../Modules/ions_base.o
|
||||
bcast_ph_input.o : ../Modules/mp.o
|
||||
bcast_ph_input.o : ../Modules/printout_base.o
|
||||
bcast_ph_input.o : ../PW/pwcom.o
|
||||
bcast_ph_input.o : phcom.o
|
||||
bcast_ph_input.o : ramanm.o
|
||||
bcast_ph_input1.o : ../Modules/io_global.o
|
||||
|
@ -142,6 +143,7 @@ cch_psi_all.o : ../Modules/uspp.o
|
|||
cch_psi_all.o : ../PW/becmod.o
|
||||
cch_psi_all.o : ../PW/pwcom.o
|
||||
cch_psi_all.o : phcom.o
|
||||
cft_wave.o : ../Modules/kind.o
|
||||
cft_wave.o : ../PW/noncol.o
|
||||
cft_wave.o : ../PW/pwcom.o
|
||||
cft_wave.o : phcom.o
|
||||
|
@ -175,6 +177,7 @@ compute_alphasum.o : ../Modules/uspp.o
|
|||
compute_alphasum.o : ../PW/noncol.o
|
||||
compute_alphasum.o : ../PW/pwcom.o
|
||||
compute_alphasum.o : phcom.o
|
||||
compute_becalp.o : ../Modules/cell_base.o
|
||||
compute_becalp.o : ../Modules/io_files.o
|
||||
compute_becalp.o : ../Modules/kind.o
|
||||
compute_becalp.o : ../Modules/uspp.o
|
||||
|
@ -236,7 +239,6 @@ davcio_drho.o : ../Modules/io_global.o
|
|||
davcio_drho.o : ../Modules/kind.o
|
||||
davcio_drho.o : ../Modules/mp.o
|
||||
davcio_drho.o : ../Modules/mp_global.o
|
||||
davcio_drho.o : ../Modules/parallel_include.o
|
||||
davcio_drho.o : ../PW/pwcom.o
|
||||
deallocate_part.o : phcom.o
|
||||
deallocate_phq.o : ../Modules/wavefunctions.o
|
||||
|
@ -373,7 +375,6 @@ dvpsi_e2.o : ../Modules/kind.o
|
|||
dvpsi_e2.o : ../Modules/mp.o
|
||||
dvpsi_e2.o : ../Modules/mp_global.o
|
||||
dvpsi_e2.o : ../Modules/wavefunctions.o
|
||||
dvpsi_e2.o : ../PW/becmod.o
|
||||
dvpsi_e2.o : ../PW/pwcom.o
|
||||
dvpsi_e2.o : ../PW/scf_mod.o
|
||||
dvpsi_e2.o : phcom.o
|
||||
|
@ -675,6 +676,7 @@ phq_summary.o : ../Modules/control_flags.o
|
|||
phq_summary.o : ../Modules/functionals.o
|
||||
phq_summary.o : ../Modules/io_global.o
|
||||
phq_summary.o : ../Modules/ions_base.o
|
||||
phq_summary.o : ../Modules/kind.o
|
||||
phq_summary.o : ../Modules/printout_base.o
|
||||
phq_summary.o : ../PW/noncol.o
|
||||
phq_summary.o : ../PW/pwcom.o
|
||||
|
@ -719,7 +721,6 @@ psym_dmage.o : ../Modules/fft_base.o
|
|||
psym_dmage.o : ../Modules/kind.o
|
||||
psym_dmage.o : ../Modules/mp_global.o
|
||||
psym_dmage.o : ../PW/pwcom.o
|
||||
psym_dmage.o : phcom.o
|
||||
psymdvscf.o : ../Modules/fft_base.o
|
||||
psymdvscf.o : ../Modules/kind.o
|
||||
psymdvscf.o : ../Modules/mp_global.o
|
||||
|
@ -729,12 +730,10 @@ psyme.o : ../Modules/fft_base.o
|
|||
psyme.o : ../Modules/kind.o
|
||||
psyme.o : ../Modules/mp_global.o
|
||||
psyme.o : ../PW/pwcom.o
|
||||
psyme.o : phcom.o
|
||||
psyme2.o : ../Modules/fft_base.o
|
||||
psyme2.o : ../Modules/kind.o
|
||||
psyme2.o : ../Modules/mp_global.o
|
||||
psyme2.o : ../PW/pwcom.o
|
||||
psyme2.o : phcom.o
|
||||
punch_plot_e.o : ../Modules/cell_base.o
|
||||
punch_plot_e.o : ../Modules/fft_base.o
|
||||
punch_plot_e.o : ../Modules/io_global.o
|
||||
|
@ -888,7 +887,6 @@ solve_e_fpol.o : phcom.o
|
|||
solve_e_nscf.o : ../Modules/cell_base.o
|
||||
solve_e_nscf.o : ../Modules/kind.o
|
||||
solve_e_nscf.o : ../Modules/wavefunctions.o
|
||||
solve_e_nscf.o : ../PW/becmod.o
|
||||
solve_e_nscf.o : ../PW/pwcom.o
|
||||
solve_e_nscf.o : phcom.o
|
||||
solve_linter.o : ../Modules/cell_base.o
|
||||
|
@ -913,7 +911,6 @@ star_q.o : ../Modules/io_global.o
|
|||
star_q.o : ../Modules/kind.o
|
||||
stop_ph.o : ../Modules/kind.o
|
||||
stop_ph.o : ../Modules/mp.o
|
||||
stop_ph.o : ../Modules/parallel_include.o
|
||||
sym_and_write_zue.o : ../Modules/cell_base.o
|
||||
sym_and_write_zue.o : ../Modules/io_global.o
|
||||
sym_and_write_zue.o : ../Modules/ions_base.o
|
||||
|
@ -946,11 +943,9 @@ symdynph_gq.o : ../Modules/kind.o
|
|||
syme.o : ../Modules/kind.o
|
||||
syme.o : ../PW/pwcom.o
|
||||
syme.o : ../PW/symme.o
|
||||
syme.o : phcom.o
|
||||
syme2.o : ../Modules/kind.o
|
||||
syme2.o : ../PW/pwcom.o
|
||||
syme2.o : ../PW/symme.o
|
||||
syme2.o : phcom.o
|
||||
syme2.o : ramanm.o
|
||||
symm.o : ../Modules/constants.o
|
||||
symm.o : ../Modules/kind.o
|
||||
|
@ -1053,7 +1048,6 @@ addusddens.o : ../include/f_defs.h
|
|||
addusddense.o : ../include/f_defs.h
|
||||
addusdynmat.o : ../include/f_defs.h
|
||||
addusldos.o : ../include/f_defs.h
|
||||
allocate_part.o : ../include/f_defs.h
|
||||
allocate_phq.o : ../include/f_defs.h
|
||||
bcast_ph_input.o : ../include/f_defs.h
|
||||
bcast_ph_input1.o : ../include/f_defs.h
|
||||
|
|
761
PW/input.f90
761
PW/input.f90
|
@ -300,364 +300,6 @@ SUBROUTINE iosys()
|
|||
!
|
||||
CALL read_namelists( 'PW' )
|
||||
!
|
||||
! ... translate from input to internals of PWscf, various checks
|
||||
!
|
||||
if (input_dft /='none') call enforce_input_dft (input_dft)
|
||||
!
|
||||
IF ( tefield .AND. ( .NOT. nosym ) ) THEN
|
||||
nosym = .TRUE.
|
||||
WRITE( stdout, &
|
||||
'(5x,"Presently no symmetry can be used with electric field",/)' )
|
||||
END IF
|
||||
IF ( tefield .AND. tstress ) THEN
|
||||
tstress = .FALSE.
|
||||
WRITE( stdout, &
|
||||
'(5x,"Presently stress not available with electric field",/)' )
|
||||
END IF
|
||||
IF ( tefield .AND. ( nspin > 2 ) ) THEN
|
||||
CALL errore( 'iosys', 'LSDA not available with electric field' , 1 )
|
||||
END IF
|
||||
!
|
||||
twfcollect = wf_collect
|
||||
!
|
||||
! ... Set Values for electron and bands
|
||||
!
|
||||
tfixed_occ = .FALSE.
|
||||
ltetra = .FALSE.
|
||||
!
|
||||
IF (noncolin) THEN
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
angle1(nt) = pi * angle1(nt) / 180.D0
|
||||
angle2(nt) = pi * angle2(nt) / 180.D0
|
||||
!
|
||||
END DO
|
||||
ELSE
|
||||
angle1=0.d0
|
||||
angle2=0.d0
|
||||
ENDIF
|
||||
|
||||
SELECT CASE( TRIM( occupations ) )
|
||||
CASE( 'fixed' )
|
||||
!
|
||||
ngauss = 0
|
||||
!
|
||||
IF ( degauss /= 0.D0 ) THEN
|
||||
CALL errore( ' iosys ', &
|
||||
& ' fixed occupations, gauss. broadening ignored', -1 )
|
||||
degauss = 0.D0
|
||||
END IF
|
||||
!
|
||||
CASE( 'smearing' )
|
||||
!
|
||||
IF ( degauss == 0.D0 ) &
|
||||
CALL errore( ' iosys ', &
|
||||
& ' smearing requires gaussian broadening', 1 )
|
||||
!
|
||||
SELECT CASE ( TRIM( smearing ) )
|
||||
CASE ( 'gaussian', 'gauss' )
|
||||
ngauss = 0
|
||||
CASE ( 'methfessel-paxton', 'm-p', 'mp' )
|
||||
ngauss = 1
|
||||
CASE ( 'marzari-vanderbilt', 'cold', 'm-v', 'mv' )
|
||||
ngauss = -1
|
||||
CASE ( 'fermi-dirac', 'f-d', 'fd' )
|
||||
ngauss = -99
|
||||
END SELECT
|
||||
!
|
||||
CASE( 'tetrahedra' )
|
||||
!
|
||||
ngauss = 0
|
||||
ltetra = .TRUE.
|
||||
!
|
||||
CASE( 'from_input' )
|
||||
!
|
||||
ngauss = 0
|
||||
tfixed_occ = .TRUE.
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys','occupations ' // TRIM( occupations ) // &
|
||||
& 'not implemented', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
IF( nbnd < 1 ) &
|
||||
CALL errore( 'iosys', 'nbnd less than 1', nbnd )
|
||||
!
|
||||
IF( nelec < 0 ) &
|
||||
CALL errore( 'iosys', 'nelec less than 0', 1 )
|
||||
!
|
||||
IF ( nelup < 0 ) &
|
||||
CALL errore( 'iosys', 'nelup less than 0', 1 )
|
||||
!
|
||||
IF ( neldw < 0 ) &
|
||||
CALL errore( 'iosys', 'neldw less than 0', 1 )
|
||||
!
|
||||
SELECT CASE( nspin )
|
||||
CASE( 1 )
|
||||
!
|
||||
lsda = .FALSE.
|
||||
IF ( noncolin ) nspin = 4
|
||||
!
|
||||
CASE( 2 )
|
||||
!
|
||||
lsda = .TRUE.
|
||||
IF ( noncolin ) &
|
||||
CALL errore( 'iosys', &
|
||||
'noncolin .and. nspin==2 are conflicting flags', 1 )
|
||||
!
|
||||
CASE( 4 )
|
||||
!
|
||||
lsda = .FALSE.
|
||||
noncolin = .TRUE.
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys', 'wrong input value for nspin', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
IF ( nelup == 0.D0 .AND. neldw == 0.D0 .AND. &
|
||||
tot_magnetization < 0 .AND. multiplicity == 0) THEN
|
||||
!
|
||||
two_fermi_energies = .FALSE.
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
two_fermi_energies = .TRUE.
|
||||
!
|
||||
IF ( .NOT. lsda ) &
|
||||
CALL errore( 'iosys', 'fixed nelup/neldw requires nspin=2', 1 )
|
||||
!
|
||||
IF ( tot_magnetization < 0 .AND. multiplicity == 0 .AND. &
|
||||
ABS( nelup + neldw - nelec ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', 'nelup + neldw must be equal to nelec', 1 )
|
||||
!
|
||||
END IF
|
||||
|
||||
!
|
||||
! ... starting_magnetization(ia) = sm_not_set means "not set" -- set it to 0
|
||||
! ... stop if starting_magnetization is not set for all atomic types
|
||||
!
|
||||
IF ( lscf .AND. nspin == 2 .AND. &
|
||||
nelup == 0.d0 .AND. neldw == 0.d0 .AND. &
|
||||
multiplicity == 0 .AND. tot_magnetization == -1 .AND. &
|
||||
ALL(starting_magnetization == sm_not_set) ) THEN
|
||||
CALL errore('iosys','some starting_magnetization MUST be set', 1 )
|
||||
END IF
|
||||
!
|
||||
DO ia = 1, ntyp
|
||||
!
|
||||
IF ( starting_magnetization(ia) == sm_not_set ) &
|
||||
starting_magnetization(ia) = 0.D0
|
||||
!
|
||||
END DO
|
||||
!
|
||||
SELECT CASE( TRIM( constrained_magnetization ) )
|
||||
CASE( 'none' )
|
||||
!
|
||||
i_cons = 0
|
||||
!
|
||||
CASE( 'total' )
|
||||
!
|
||||
IF ( nspin == 4 ) THEN
|
||||
!
|
||||
i_cons = 3
|
||||
!
|
||||
mcons(1,1) = fixed_magnetization(1)
|
||||
mcons(2,1) = fixed_magnetization(2)
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
ELSE IF ( nspin == 2 ) THEN
|
||||
!
|
||||
i_cons = 5
|
||||
!
|
||||
two_fermi_energies = .TRUE.
|
||||
!
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
IF ( fixed_magnetization(1) /= 0.D0 .OR. &
|
||||
fixed_magnetization(2) /= 0.D0 ) &
|
||||
CALL errore( 'iosys', 'only fixed_magnetization(3)' // &
|
||||
& ' can be specified with nspin=2 ', 1 )
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
CALL errore( 'iosys','constrained total magnetization ' // &
|
||||
& 'requires nspin=2 or 4 ', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
CASE( 'atomic' )
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys','constrained atomic magnetizations ' // &
|
||||
& 'require nspin=2 or 4 ', 1 )
|
||||
!
|
||||
i_cons = 1
|
||||
!
|
||||
if (nspin == 4) then
|
||||
! non-collinear case
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
theta = angle1(nt)
|
||||
phi = angle2(nt)
|
||||
!
|
||||
mcons(1,nt) = starting_magnetization(nt) * SIN( theta ) * COS( phi )
|
||||
mcons(2,nt) = starting_magnetization(nt) * SIN( theta ) * SIN( phi )
|
||||
mcons(3,nt) = starting_magnetization(nt) * COS( theta )
|
||||
!
|
||||
END DO
|
||||
else
|
||||
! collinear case
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
mcons(1,nt) = starting_magnetization(nt)
|
||||
!
|
||||
END DO
|
||||
end if
|
||||
!
|
||||
CASE( 'total direction' )
|
||||
i_cons = 6
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
CASE( 'atomic direction' )
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys','constrained atomic magnetization ' // &
|
||||
& 'directions require nspin=2 or 4 ', 1 )
|
||||
!
|
||||
i_cons = 2
|
||||
!
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
theta = angle1(nt)
|
||||
!
|
||||
mcons(3,nt) = cos(theta)
|
||||
!
|
||||
END DO
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys','constrained magnetization ' // &
|
||||
& TRIM( constrained_magnetization ) // 'not implemented', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
|
||||
IF ( B_field(1) /= 0.D0 .OR. &
|
||||
B_field(2) /= 0.D0 .OR. &
|
||||
B_field(3) /= 0.D0 ) THEN
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'non-zero external B_field requires nspin=2 or 4', 1 )
|
||||
!
|
||||
IF ( TRIM( constrained_magnetization ) /= 'none' ) &
|
||||
CALL errore( 'iosys', 'constrained_magnetization and ' // &
|
||||
& 'non-zero external B_field are conflicting flags', 1 )
|
||||
!
|
||||
IF ( nspin == 2 .AND. &
|
||||
( B_field(1) /= 0.D0 .OR. B_field(2) /= 0.D0 ) ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'only B_field(3) can be specified with nspin=2', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
IF ( ecutrho <= 0.D0 ) THEN
|
||||
!
|
||||
dual = 4.D0
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
dual = ecutrho / ecutwfc
|
||||
!
|
||||
IF ( dual <= 1.D0 ) &
|
||||
CALL errore( 'iosys', 'invalid dual?', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
SELECT CASE( TRIM( restart_mode ) )
|
||||
CASE( 'from_scratch' )
|
||||
!
|
||||
restart = .FALSE.
|
||||
startingconfig = 'input'
|
||||
!
|
||||
CASE( 'restart' )
|
||||
!
|
||||
IF ( calculation == 'neb' .OR. calculation == 'smd' ) THEN
|
||||
!
|
||||
! ... "path" specific
|
||||
!
|
||||
restart = .FALSE.
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
restart = .TRUE.
|
||||
!
|
||||
IF ( TRIM( ion_positions ) == 'from_input' ) THEN
|
||||
!
|
||||
startingconfig = 'input'
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
startingconfig = 'file'
|
||||
!
|
||||
END IF
|
||||
!
|
||||
END IF
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys', &
|
||||
& 'unknown restart_mode ' // TRIM( restart_mode ), 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
SELECT CASE( TRIM( disk_io ) )
|
||||
CASE( 'high' )
|
||||
!
|
||||
io_level = 2
|
||||
!
|
||||
CASE ( 'low' )
|
||||
!
|
||||
io_level = 0
|
||||
restart = .FALSE.
|
||||
!
|
||||
CASE ( 'none' )
|
||||
!
|
||||
io_level = -1
|
||||
restart = .FALSE.
|
||||
IF ( twfcollect ) THEN
|
||||
CALL infomsg('iosys', 'minimal I/O required, wf_collect reset to FALSE')
|
||||
twfcollect= .FALSE.
|
||||
END IF
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
io_level = 1
|
||||
!
|
||||
IF ( lscf ) restart = .FALSE.
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
Hubbard_U(:) = Hubbard_U(:) / rytoev
|
||||
Hubbard_alpha(:)= Hubbard_alpha(:) / rytoev
|
||||
!
|
||||
ethr = diago_thr_init
|
||||
!
|
||||
SELECT CASE( TRIM( phase_space ) )
|
||||
CASE( 'full' )
|
||||
!
|
||||
lcoarsegrained = .FALSE.
|
||||
!
|
||||
CASE ( 'coarse-grained' )
|
||||
!
|
||||
lcoarsegrained = .TRUE.
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
! ... various initializations of control variables
|
||||
!
|
||||
lscf = .FALSE.
|
||||
|
@ -861,6 +503,389 @@ SUBROUTINE iosys()
|
|||
!
|
||||
END SELECT
|
||||
!
|
||||
! ... translate from input to internals of PWscf, various checks
|
||||
!
|
||||
if (input_dft /='none') call enforce_input_dft (input_dft)
|
||||
!
|
||||
IF ( tefield .AND. ( .NOT. nosym ) ) THEN
|
||||
nosym = .TRUE.
|
||||
WRITE( stdout, &
|
||||
'(5x,"Presently no symmetry can be used with electric field",/)' )
|
||||
END IF
|
||||
IF ( tefield .AND. tstress ) THEN
|
||||
tstress = .FALSE.
|
||||
WRITE( stdout, &
|
||||
'(5x,"Presently stress not available with electric field",/)' )
|
||||
END IF
|
||||
IF ( tefield .AND. ( nspin > 2 ) ) THEN
|
||||
CALL errore( 'iosys', 'LSDA not available with electric field' , 1 )
|
||||
END IF
|
||||
!
|
||||
twfcollect = wf_collect
|
||||
!
|
||||
! ... Set Values for electron and bands
|
||||
!
|
||||
tfixed_occ = .FALSE.
|
||||
ltetra = .FALSE.
|
||||
!
|
||||
SELECT CASE( TRIM( occupations ) )
|
||||
CASE( 'fixed' )
|
||||
!
|
||||
ngauss = 0
|
||||
!
|
||||
IF ( degauss /= 0.D0 ) THEN
|
||||
CALL errore( ' iosys ', &
|
||||
& ' fixed occupations, gauss. broadening ignored', -1 )
|
||||
degauss = 0.D0
|
||||
END IF
|
||||
!
|
||||
CASE( 'smearing' )
|
||||
!
|
||||
IF ( degauss == 0.D0 ) &
|
||||
CALL errore( ' iosys ', &
|
||||
& ' smearing requires gaussian broadening', 1 )
|
||||
!
|
||||
SELECT CASE ( TRIM( smearing ) )
|
||||
CASE ( 'gaussian', 'gauss' )
|
||||
ngauss = 0
|
||||
CASE ( 'methfessel-paxton', 'm-p', 'mp' )
|
||||
ngauss = 1
|
||||
CASE ( 'marzari-vanderbilt', 'cold', 'm-v', 'mv' )
|
||||
ngauss = -1
|
||||
CASE ( 'fermi-dirac', 'f-d', 'fd' )
|
||||
ngauss = -99
|
||||
END SELECT
|
||||
!
|
||||
CASE( 'tetrahedra' )
|
||||
!
|
||||
ngauss = 0
|
||||
ltetra = .TRUE.
|
||||
!
|
||||
CASE( 'from_input' )
|
||||
!
|
||||
ngauss = 0
|
||||
tfixed_occ = .TRUE.
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys','occupations ' // TRIM( occupations ) // &
|
||||
& 'not implemented', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
IF( nbnd < 1 ) &
|
||||
CALL errore( 'iosys', 'nbnd less than 1', nbnd )
|
||||
!
|
||||
IF( nelec < 0 ) &
|
||||
CALL errore( 'iosys', 'nelec less than 0', 1 )
|
||||
!
|
||||
IF ( nelup < 0 ) &
|
||||
CALL errore( 'iosys', 'nelup less than 0', 1 )
|
||||
!
|
||||
IF ( neldw < 0 ) &
|
||||
CALL errore( 'iosys', 'neldw less than 0', 1 )
|
||||
!
|
||||
SELECT CASE( nspin )
|
||||
CASE( 1 )
|
||||
!
|
||||
lsda = .FALSE.
|
||||
IF ( noncolin ) nspin = 4
|
||||
!
|
||||
CASE( 2 )
|
||||
!
|
||||
lsda = .TRUE.
|
||||
IF ( noncolin ) &
|
||||
CALL errore( 'iosys', &
|
||||
'noncolin .and. nspin==2 are conflicting flags', 1 )
|
||||
!
|
||||
CASE( 4 )
|
||||
!
|
||||
lsda = .FALSE.
|
||||
noncolin = .TRUE.
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys', 'wrong input value for nspin', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
IF ( nelup == 0.D0 .AND. neldw == 0.D0 .AND. &
|
||||
tot_magnetization < 0 .AND. multiplicity == 0) THEN
|
||||
!
|
||||
two_fermi_energies = .FALSE.
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
two_fermi_energies = .TRUE.
|
||||
!
|
||||
IF ( .NOT. lsda ) &
|
||||
CALL errore( 'iosys', 'fixed nelup/neldw requires nspin=2', 1 )
|
||||
!
|
||||
IF ( tot_magnetization < 0 .AND. multiplicity == 0 .AND. &
|
||||
ABS( nelup + neldw - nelec ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', 'nelup + neldw must be equal to nelec', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
! ... starting_magnetization(ia) = sm_not_set means "not set"
|
||||
! ... stop if starting_magnetization is not set for at least
|
||||
! ... one atomic type and occupations are not set in any other way
|
||||
!
|
||||
IF ( lscf .AND. nspin == 2 .AND. .NOT. tfixed_occ .AND. &
|
||||
nelup == 0.d0 .AND. neldw == 0.d0 .AND. &
|
||||
multiplicity == 0 .AND. tot_magnetization == -1 .AND. &
|
||||
ALL(starting_magnetization == sm_not_set) ) THEN
|
||||
CALL errore('iosys','some starting_magnetization MUST be set', 1 )
|
||||
END IF
|
||||
!
|
||||
DO ia = 1, ntyp
|
||||
!
|
||||
IF ( starting_magnetization(ia) == sm_not_set ) &
|
||||
starting_magnetization(ia) = 0.D0
|
||||
!
|
||||
END DO
|
||||
!
|
||||
IF (noncolin) THEN
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
angle1(nt) = pi * angle1(nt) / 180.D0
|
||||
angle2(nt) = pi * angle2(nt) / 180.D0
|
||||
!
|
||||
END DO
|
||||
ELSE
|
||||
angle1=0.d0
|
||||
angle2=0.d0
|
||||
ENDIF
|
||||
!
|
||||
SELECT CASE( TRIM( constrained_magnetization ) )
|
||||
CASE( 'none' )
|
||||
!
|
||||
i_cons = 0
|
||||
!
|
||||
CASE( 'total' )
|
||||
!
|
||||
IF ( nspin == 4 ) THEN
|
||||
!
|
||||
i_cons = 3
|
||||
!
|
||||
mcons(1,1) = fixed_magnetization(1)
|
||||
mcons(2,1) = fixed_magnetization(2)
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
ELSE IF ( nspin == 2 ) THEN
|
||||
!
|
||||
i_cons = 5
|
||||
!
|
||||
two_fermi_energies = .TRUE.
|
||||
!
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
IF ( fixed_magnetization(1) /= 0.D0 .OR. &
|
||||
fixed_magnetization(2) /= 0.D0 ) &
|
||||
CALL errore( 'iosys', 'only fixed_magnetization(3)' // &
|
||||
& ' can be specified with nspin=2 ', 1 )
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
CALL errore( 'iosys','constrained total magnetization ' // &
|
||||
& 'requires nspin=2 or 4 ', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
CASE( 'atomic' )
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys','constrained atomic magnetizations ' // &
|
||||
& 'require nspin=2 or 4 ', 1 )
|
||||
!
|
||||
i_cons = 1
|
||||
!
|
||||
if (nspin == 4) then
|
||||
! non-collinear case
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
theta = angle1(nt)
|
||||
phi = angle2(nt)
|
||||
!
|
||||
mcons(1,nt) = starting_magnetization(nt) * SIN( theta ) * COS( phi )
|
||||
mcons(2,nt) = starting_magnetization(nt) * SIN( theta ) * SIN( phi )
|
||||
mcons(3,nt) = starting_magnetization(nt) * COS( theta )
|
||||
!
|
||||
END DO
|
||||
else
|
||||
! collinear case
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
mcons(1,nt) = starting_magnetization(nt)
|
||||
!
|
||||
END DO
|
||||
end if
|
||||
!
|
||||
CASE( 'total direction' )
|
||||
i_cons = 6
|
||||
mcons(3,1) = fixed_magnetization(3)
|
||||
!
|
||||
CASE( 'atomic direction' )
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys','constrained atomic magnetization ' // &
|
||||
& 'directions require nspin=2 or 4 ', 1 )
|
||||
!
|
||||
i_cons = 2
|
||||
!
|
||||
DO nt = 1, ntyp
|
||||
!
|
||||
theta = angle1(nt)
|
||||
!
|
||||
mcons(3,nt) = cos(theta)
|
||||
!
|
||||
END DO
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys','constrained magnetization ' // &
|
||||
& TRIM( constrained_magnetization ) // 'not implemented', 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
|
||||
IF ( B_field(1) /= 0.D0 .OR. &
|
||||
B_field(2) /= 0.D0 .OR. &
|
||||
B_field(3) /= 0.D0 ) THEN
|
||||
!
|
||||
IF ( nspin == 1 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'non-zero external B_field requires nspin=2 or 4', 1 )
|
||||
!
|
||||
IF ( TRIM( constrained_magnetization ) /= 'none' ) &
|
||||
CALL errore( 'iosys', 'constrained_magnetization and ' // &
|
||||
& 'non-zero external B_field are conflicting flags', 1 )
|
||||
!
|
||||
IF ( nspin == 2 .AND. &
|
||||
( B_field(1) /= 0.D0 .OR. B_field(2) /= 0.D0 ) ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'only B_field(3) can be specified with nspin=2', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
IF ( occupations == 'fixed' .AND. nspin == 2 .AND. lscf ) THEN
|
||||
!
|
||||
IF ( two_fermi_energies ) THEN
|
||||
!
|
||||
IF ( ABS( NINT( nelup ) - nelup ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations requires integer nelup', 1 )
|
||||
IF ( ABS( NINT( neldw ) - neldw ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations requires integer neldw', 1 )
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations and lsda need nelup and neldw', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
END IF
|
||||
!
|
||||
IF ( ecutrho <= 0.D0 ) THEN
|
||||
!
|
||||
dual = 4.D0
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
dual = ecutrho / ecutwfc
|
||||
!
|
||||
IF ( dual <= 1.D0 ) &
|
||||
CALL errore( 'iosys', 'invalid dual?', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
SELECT CASE( TRIM( restart_mode ) )
|
||||
CASE( 'from_scratch' )
|
||||
!
|
||||
restart = .FALSE.
|
||||
IF ( lscf ) THEN
|
||||
startingconfig = 'input'
|
||||
ELSE
|
||||
startingconfig = 'file'
|
||||
END IF
|
||||
!
|
||||
CASE( 'restart' )
|
||||
!
|
||||
IF ( lneb .OR. lsmd ) THEN
|
||||
!
|
||||
! ... "path" specific
|
||||
!
|
||||
restart = .FALSE.
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
restart = .TRUE.
|
||||
!
|
||||
IF ( TRIM( ion_positions ) == 'from_input' ) THEN
|
||||
!
|
||||
startingconfig = 'input'
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
startingconfig = 'file'
|
||||
!
|
||||
END IF
|
||||
!
|
||||
END IF
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
CALL errore( 'iosys', &
|
||||
& 'unknown restart_mode ' // TRIM( restart_mode ), 1 )
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
SELECT CASE( TRIM( disk_io ) )
|
||||
CASE( 'high' )
|
||||
!
|
||||
io_level = 2
|
||||
!
|
||||
CASE ( 'low' )
|
||||
!
|
||||
io_level = 0
|
||||
restart = .FALSE.
|
||||
!
|
||||
CASE ( 'none' )
|
||||
!
|
||||
io_level = -1
|
||||
restart = .FALSE.
|
||||
IF ( twfcollect ) THEN
|
||||
CALL infomsg('iosys', 'minimal I/O required, wf_collect reset to FALSE')
|
||||
twfcollect= .FALSE.
|
||||
END IF
|
||||
!
|
||||
CASE DEFAULT
|
||||
!
|
||||
io_level = 1
|
||||
!
|
||||
IF ( lscf ) restart = .FALSE.
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
Hubbard_U(:) = Hubbard_U(:) / rytoev
|
||||
Hubbard_alpha(:)= Hubbard_alpha(:) / rytoev
|
||||
!
|
||||
ethr = diago_thr_init
|
||||
!
|
||||
SELECT CASE( TRIM( phase_space ) )
|
||||
CASE( 'full' )
|
||||
!
|
||||
lcoarsegrained = .FALSE.
|
||||
!
|
||||
CASE ( 'coarse-grained' )
|
||||
!
|
||||
lcoarsegrained = .TRUE.
|
||||
!
|
||||
END SELECT
|
||||
!
|
||||
!
|
||||
IF ( startingpot /= 'atomic' .AND. startingpot /= 'file' ) THEN
|
||||
!
|
||||
CALL infomsg( 'iosys', 'wrong startingpot: use default (1)' )
|
||||
|
@ -974,26 +999,6 @@ SUBROUTINE iosys()
|
|||
!
|
||||
END SELECT
|
||||
!
|
||||
IF ( occupations == 'fixed' .AND. nspin == 2 .AND. lscf ) THEN
|
||||
!
|
||||
IF ( two_fermi_energies ) THEN
|
||||
!
|
||||
IF ( ABS( NINT( nelup ) - nelup ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations requires integer nelup', 1 )
|
||||
IF ( ABS( NINT( neldw ) - neldw ) > 1.D-10 ) &
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations requires integer neldw', 1 )
|
||||
!
|
||||
ELSE
|
||||
!
|
||||
CALL errore( 'iosys', &
|
||||
& 'fixed occupations and lsda need nelup and neldw', 1 )
|
||||
!
|
||||
END IF
|
||||
!
|
||||
END IF
|
||||
!
|
||||
IF ( lcoarsegrained ) THEN
|
||||
!
|
||||
lmd = .TRUE.
|
||||
|
|
|
@ -143,7 +143,7 @@ subroutine symmetrize_at(nsym, s, nat, tau, ityp, at, bg, &
|
|||
!
|
||||
call cryst_to_cart(nat, tau, at, 1)
|
||||
|
||||
write (stdout,*) " SYMMETRIZED ATOMIC COORDINATES) "
|
||||
write (stdout,*) " SYMMETRIZED ATOMIC COORDINATES "
|
||||
|
||||
call output_tau(lmovecell)
|
||||
!
|
||||
|
|
Loading…
Reference in New Issue