mirror of https://gitlab.com/QEF/q-e.git
All namelists and cards moved to Modules/input_parameters.f90 .
From now on, all new input variables should be added to this module, and then copied to the code internal variables in the input.f90 subroutine The namelists and cards parsers are in : Modules/read_namelists.f90 and Modules/read_cards.f90 files input_parameters.f90 read_namelists.f90 read_cards.f90 are shared by all codes, while each code has its own version of input.f90 ( used to copy input values into internals variables ). EXAMPLE: suppose you need to add a new input variable called "pippo" to the namelist control, then: 1) add pippo to the input_parameters.f90 file containing the namelist control INTEGER :: pippo = 0 NAMELIST / control / ....., pippo remember: always set an initialization value! 2) add pippo to the control_default subroutine ( cantained in module read_namelists.f90 ) subroutine control_default( prog ) ... IF( prog == 'PW' ) pippo = 10 ... end subroutine this routine set the default value for pippo, that could vary with the code 3) add pippo to the control_bcast subroutine ( cantained in module read_namelists.f90 ) subroutine control_bcast( ) ... call mp_bcast( pippo ) ... end subroutine 4) add pippo to the control_checkin subroutine ( cantained in module read_namelists.f90 ) subroutine control_checking( prog ) ... IF( pippo < 0 ) & CALL error(' control_checkin ',' variable pippo less than 0 ', 1 ) ... end subroutine 5) Copy the value of pippo in the code internal variables ( file input.f90 ) subroutine iosys() use input_parameters, only: ...., pippo use pwcom, only: ....., myvar ... call read_namelists( 'PW' ) ... myvar = pippo ... end subroutine git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@282 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
0deeeaba5b
commit
da47185a66
|
@ -88,6 +88,7 @@
|
|||
use parameters, only: nacx, natx, nsx, nbndxx
|
||||
use constants, only: pi, factem
|
||||
use psfiles, only: psfile, pseudo_dir
|
||||
use input_cp, only: iosys2
|
||||
!
|
||||
implicit none
|
||||
!
|
||||
|
@ -191,8 +192,10 @@
|
|||
real(kind=8) xnhh0(3,3),xnhhm(3,3),xnhhp(3,3),vnhh(3,3),temphh(3,3)
|
||||
!
|
||||
integer ibrav, k, ii, l, m
|
||||
real(kind=8) ekinh, alfar, temphc, alfap, twmass, frich, tolp, &
|
||||
real(kind=8) ekinh, alfar, temphc, alfap, frich, tolp, &
|
||||
& factp, temp1, temp2, temph, greash, qnh, randy, amprp(nsx)
|
||||
|
||||
logical :: twmass
|
||||
!
|
||||
! program starts here
|
||||
!
|
||||
|
|
1332
CPV/input.f90
1332
CPV/input.f90
File diff suppressed because it is too large
Load Diff
|
@ -100,8 +100,9 @@
|
|||
! 'vc-md' = variable-cell Car-Parrinello (-Rahman) dynamics
|
||||
|
||||
|
||||
CHARACTER(LEN=80) :: calculation_allowed(7)
|
||||
DATA calculation_allowed / 'scf', 'relax', 'md', 'cp', 'vc-relax', 'vc-md', 'vc-cp' /
|
||||
CHARACTER(LEN=80) :: calculation_allowed(9)
|
||||
DATA calculation_allowed / 'scf', 'nscf', 'relax', 'md', 'cp', &
|
||||
'vc-relax', 'vc-md', 'vc-cp', 'phonon' /
|
||||
! Allowed value for calculation parameters
|
||||
|
||||
|
||||
|
@ -199,10 +200,21 @@
|
|||
! disk_io = 'high', 'default', 'low', 'minimal'
|
||||
! Specify the amount of I/O activities ( not used in FPMD )
|
||||
|
||||
LOGICAL :: tefield = .FALSE.
|
||||
|
||||
LOGICAL :: dipfield = .FALSE.
|
||||
|
||||
LOGICAL :: lberry = .FALSE.
|
||||
|
||||
INTEGER :: gdir = 0
|
||||
|
||||
INTEGER :: nppstr = 0
|
||||
|
||||
NAMELIST / control / title, calculation, verbosity, restart_mode, &
|
||||
nstep, iprint, isave, tstress, tprnfor, dt, ndr, ndw, outdir, prefix, &
|
||||
max_seconds, ekin_conv_thr, etot_conv_thr, forc_conv_thr, &
|
||||
pseudo_dir, disk_io
|
||||
pseudo_dir, disk_io, tefield, dipfield, lberry, gdir, nppstr
|
||||
|
||||
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
@ -296,6 +308,8 @@
|
|||
! 'from_input' fixed occupations given in the input
|
||||
! ( see card 'OCCUPATIONS' )
|
||||
|
||||
CHARACTER(LEN=80) :: smearing = 'gaussian'
|
||||
|
||||
REAL(dbl) :: degauss = 0.0d0
|
||||
! parameter for the smearing functions
|
||||
! NOT used in FPMD-N
|
||||
|
@ -340,21 +354,41 @@
|
|||
REAL(dbl) :: starting_magnetization( nsx ) = 0.0d0
|
||||
! ONLY PWSCF
|
||||
|
||||
LOGICAL :: lda_plus_U = .FALSE.
|
||||
LOGICAL :: lda_plus_u = .FALSE.
|
||||
! ONLY PWSCF
|
||||
|
||||
REAL(dbl) :: Hubbard_U(nsx) = 0.0d0
|
||||
REAL(dbl) :: hubbard_u(nsx) = 0.0d0
|
||||
! ONLY PWSCF
|
||||
|
||||
REAL(dbl) :: Hubbard_alpha(nsx) = 0.0d0
|
||||
REAL(dbl) :: hubbard_alpha(nsx) = 0.0d0
|
||||
! ONLY PWSCF
|
||||
|
||||
NAMELIST / system / ibrav, celldm, nat, ntyp, nbnd, nelec, &
|
||||
REAL(dbl) :: a = 0.0d0
|
||||
|
||||
REAL(dbl) :: c = 0.0d0
|
||||
|
||||
REAL(dbl) :: b = 0.0d0
|
||||
|
||||
REAL(dbl) :: cosab = 0.0d0
|
||||
|
||||
REAL(dbl) :: cosac = 0.0d0
|
||||
|
||||
REAL(dbl) :: cosbc = 0.0d0
|
||||
|
||||
INTEGER :: edir = 0
|
||||
|
||||
REAL(dbl) :: emaxpos = 0.0d0
|
||||
|
||||
REAL(dbl) :: eopreg = 0.0d0
|
||||
|
||||
REAL(dbl) :: eamp = 0.0d0
|
||||
|
||||
NAMELIST / system / ibrav, celldm, a, b, c, cosab, cosac, cosbc, nat, ntyp, nbnd, nelec, &
|
||||
ecutwfc, ecutrho, nr1, nr2, nr3, nr1s, nr2s, nr3s, nr1b, nr2b, nr3b, &
|
||||
nosym, starting_magnetization, occupations, degauss, ngauss, &
|
||||
nelup, neldw, nspin, ecfixed, qcutz, q2sigma, xc_type, &
|
||||
lda_plus_U, Hubbard_U, Hubbard_alpha
|
||||
|
||||
lda_plus_U, Hubbard_U, Hubbard_alpha, &
|
||||
edir, emaxpos, eopreg, eamp, smearing
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
! ELECTRONS Namelist Input Parameters
|
||||
|
@ -392,18 +426,20 @@
|
|||
! This parameter apply only when using 'cg' electronic or
|
||||
! ionic dynamics
|
||||
|
||||
CHARACTER(LEN=80) :: electron_dynamics = 'sd'
|
||||
! electron_dynamics = 'sd'* | 'cg' | 'damp' | 'md' | 'none' | 'diis'
|
||||
CHARACTER(LEN=80) :: electron_dynamics = 'none'
|
||||
! electron_dynamics = 'default' | 'sd' | 'cg' | 'damp' | 'md' | 'none' | 'diis'
|
||||
! set how electrons shold be moved
|
||||
! 'none' electronic degrees of fredom (d.o.f.) are kept fixed
|
||||
! 'sd' steepest descent algorithm is used to minimize electronic d.o.f.
|
||||
! 'cg' conjugate gradient algorithm is used to minimize electronic d.o.f.
|
||||
! 'diis' DIIS algorithm is used to minimize electronic d.o.f.
|
||||
! 'damp' damped dynamics is used to propagate electronic d.o.f.
|
||||
! 'verlet' standard Verlet algorithm is used to propagate electronic d.o.f.
|
||||
! 'none' electronic degrees of fredom (d.o.f.) are kept fixed
|
||||
! 'sd' steepest descent algorithm is used to minimize electronic d.o.f.
|
||||
! 'cg' conjugate gradient algorithm is used to minimize electronic d.o.f.
|
||||
! 'diis' DIIS algorithm is used to minimize electronic d.o.f.
|
||||
! 'damp' damped dynamics is used to propagate electronic d.o.f.
|
||||
! 'verlet' standard Verlet algorithm is used to propagate electronic d.o.f.
|
||||
! 'default' the value depends on variable "calculation"
|
||||
|
||||
CHARACTER(LEN=80) :: electron_dynamics_allowed(6)
|
||||
DATA electron_dynamics_allowed / 'sd', 'cg', 'damp', 'verlet', 'none', 'diis' /
|
||||
CHARACTER(LEN=80) :: electron_dynamics_allowed(7)
|
||||
DATA electron_dynamics_allowed &
|
||||
/ 'default', 'sd', 'cg', 'damp', 'verlet', 'none', 'diis' /
|
||||
|
||||
REAL(dbl) :: electron_damping = 0.0d0
|
||||
! meaningful only if " electron_dynamics = 'damp' "
|
||||
|
@ -582,7 +618,7 @@
|
|||
! define how to mix wave functions
|
||||
! NOT used in FPMD
|
||||
|
||||
INTEGER :: mixing_beta = 0.0d0
|
||||
REAL(dbl) :: mixing_beta = 0.0d0
|
||||
! parameter for wave function mixing
|
||||
! NOT used in FPMD
|
||||
|
||||
|
@ -601,6 +637,9 @@
|
|||
INTEGER :: diago_david_ndim = 10
|
||||
! NOT used in FPMD
|
||||
|
||||
INTEGER :: diago_diis_ndim = 10
|
||||
! NOT used in FPMD
|
||||
|
||||
INTEGER :: diago_diis_buff = 10
|
||||
! buffer for diis diagonalization
|
||||
! NOT used in FPMD
|
||||
|
@ -635,7 +674,7 @@
|
|||
diis_rothr, diis_ethr, diis_chguess, mixing_mode, &
|
||||
mixing_beta, mixing_ndim, mixing_fixed_ns, diago_cg_maxiter, diago_david_ndim, &
|
||||
diago_diis_buff, diago_diis_start, diago_diis_keep, diagonalization, &
|
||||
startingpot, startingwfc , conv_thr
|
||||
startingpot, startingwfc , conv_thr, diago_diis_ndim
|
||||
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
@ -652,8 +691,9 @@
|
|||
! 'damp' damped dynamics is used to propagate ions
|
||||
! 'verlet' standard Verlet algorithm is used to propagate ions
|
||||
|
||||
CHARACTER(LEN=80) :: ion_dynamics_allowed(5)
|
||||
DATA ion_dynamics_allowed / 'sd', 'cg', 'damp', 'verlet', 'none' /
|
||||
CHARACTER(LEN=80) :: ion_dynamics_allowed(9)
|
||||
DATA ion_dynamics_allowed / 'sd', 'cg', 'damp', 'verlet', 'none', &
|
||||
'bfgs', 'constrained-bfgs', 'constrained-verlet', 'beeman' /
|
||||
|
||||
REAL(dbl) :: ion_radius(nsx) = 0.5d0
|
||||
! pseudo-atomic radius of the i-th atomic species
|
||||
|
@ -724,7 +764,7 @@
|
|||
INTEGER :: ion_maxstep = 1000
|
||||
! maximum number of step in ionic minimization
|
||||
|
||||
INTEGER :: upscale = 0
|
||||
REAL(dbl) :: upscale = 0.0d0
|
||||
! This variable is NOT used in FPMD
|
||||
|
||||
CHARACTER(LEN=80) :: potential_extrapolation = 'default'
|
||||
|
@ -755,8 +795,8 @@
|
|||
! 'sd' steepest descent algorithm is used to minimize the cell
|
||||
! 'pr' standard Verlet algorithm is used to propagate the cell
|
||||
|
||||
CHARACTER(LEN=80) :: cell_dynamics_allowed(3)
|
||||
DATA cell_dynamics_allowed / 'sd', 'pr', 'none' /
|
||||
CHARACTER(LEN=80) :: cell_dynamics_allowed(6)
|
||||
DATA cell_dynamics_allowed / 'sd', 'pr', 'none', 'w', 'damp-pr', 'damp-w' /
|
||||
|
||||
CHARACTER(LEN=80) :: cell_velocities = 'default'
|
||||
! cell_velocities = 'zero' | 'default'*
|
||||
|
@ -890,7 +930,7 @@
|
|||
! ... k-points inputs
|
||||
LOGICAL :: tk_inp = .FALSE.
|
||||
REAL(dbl) :: xk(3,npkx) = 0.0d0, wk(npkx) = 0.0d0
|
||||
INTEGER :: nks = 0, nk1 = 0, nk2 = 0, nk3 = 0, k1 = 0, k2 = 0, k3 = 0
|
||||
INTEGER :: nkstot = 0, nk1 = 0, nk2 = 0, nk3 = 0, k1 = 0, k2 = 0, k3 = 0
|
||||
CHARACTER(LEN=80) :: k_points = 'gamma'
|
||||
! k_points = 'automatic' | 'crystal' | 'tpiba' | 'gamma'*
|
||||
! select the k points mesh
|
||||
|
@ -960,6 +1000,7 @@
|
|||
! CELL_PARAMETERS
|
||||
!
|
||||
REAL(dbl) :: rd_ht(3,3) = 0.0d0
|
||||
CHARACTER(len=80) :: cell_symmetry = 'none'
|
||||
LOGICAL :: trd_ht = .FALSE.
|
||||
|
||||
!
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
IMPLICIT NONE
|
||||
SAVE
|
||||
|
||||
PRIVATE
|
||||
|
||||
PUBLIC :: read_cards
|
||||
|
||||
! end of module-scope declarations
|
||||
! ----------------------------------------------
|
||||
|
||||
|
@ -69,7 +73,7 @@
|
|||
! ... KPOINTS
|
||||
k_points = 'gamma'
|
||||
tk_inp = .FALSE.
|
||||
nks = 1
|
||||
nkstot = 1
|
||||
nk1 = 0
|
||||
nk2 = 0
|
||||
nk3 = 0
|
||||
|
@ -108,11 +112,14 @@
|
|||
|
||||
SUBROUTINE read_cards( prog )
|
||||
|
||||
USE parser, ONLY: capital
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! calling program ( FP, PW, CP )
|
||||
|
||||
CHARACTER(LEN=256) :: input_line
|
||||
CHARACTER(LEN=80) :: card
|
||||
LOGICAL :: tend
|
||||
INTEGER :: i
|
||||
|
||||
CALL card_default_values( prog )
|
||||
|
||||
|
@ -123,6 +130,11 @@
|
|||
|
||||
READ (input_line, *) card
|
||||
|
||||
DO i = 1, LEN_TRIM( input_line )
|
||||
input_line( i : i ) = capital( input_line( i : i ) )
|
||||
END DO
|
||||
|
||||
|
||||
IF ( TRIM(card) == 'ATOMIC_SPECIES' ) THEN
|
||||
|
||||
CALL card_atomic_species( input_line, prog )
|
||||
|
@ -134,46 +146,62 @@
|
|||
ELSE IF ( TRIM(card) == 'SETNFI' ) THEN
|
||||
|
||||
CALL card_setnfi( input_line )
|
||||
|
||||
ELSE IF( TRIM(card) == '2DPROCMESH' ) THEN
|
||||
|
||||
CALL card_2dprocmesh( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'OPTICAL' ) THEN
|
||||
|
||||
CALL card_optical( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'CONSTRAINTS' ) THEN
|
||||
|
||||
CALL card_constraints( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'VHMEAN' ) THEN
|
||||
|
||||
CALL card_vhmean( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'DIPOLE' ) THEN
|
||||
|
||||
CALL card_dipole( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'ESR' ) THEN
|
||||
|
||||
CALL card_esr( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'K_POINTS' ) THEN
|
||||
|
||||
CALL card_kpoints( input_line )
|
||||
IF( prog == 'CP' .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'NEIGHBOURS' ) THEN
|
||||
|
||||
CALL card_neighbours( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'OCCUPATIONS' ) THEN
|
||||
|
||||
CALL card_occupations( input_line )
|
||||
IF( prog == 'PW' .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'PSTAB' ) THEN
|
||||
|
||||
CALL card_pstab( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'CELL_PARAMETERS' ) THEN
|
||||
|
||||
|
@ -182,22 +210,32 @@
|
|||
ELSE IF( TRIM(card) == 'TURBO' ) THEN
|
||||
|
||||
CALL card_turbo( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'ION_VELOCITIES' ) THEN
|
||||
|
||||
CALL card_ion_velocities( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'KSOUT' ) THEN
|
||||
|
||||
CALL card_ksout( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'KSOUT_EMPTY' ) THEN
|
||||
|
||||
CALL card_ksout_empty( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE IF( TRIM(card) == 'RHOOUT' ) THEN
|
||||
|
||||
CALL card_rhoout( input_line )
|
||||
IF( ( prog == 'PW' .OR. prog == 'CP' ) .AND. ionode ) &
|
||||
write (6,'(a)') 'Warning: card '//trim(input_line)//' ignored'
|
||||
|
||||
ELSE
|
||||
|
||||
|
@ -354,20 +392,21 @@
|
|||
rd_pos = 0.d0
|
||||
na_inp = 0
|
||||
|
||||
IF( matches("crystal", input_line ) ) THEN
|
||||
IF( matches("CRYSTAL", input_line ) ) THEN
|
||||
atomic_positions = 'crystal'
|
||||
ELSE IF( matches("bohr", input_line ) ) THEN
|
||||
ELSE IF( matches("BOHR", input_line ) ) THEN
|
||||
atomic_positions = 'bohr'
|
||||
ELSE IF( matches("angstrom", input_line ) ) THEN
|
||||
ELSE IF( matches("ANGSTROM", input_line ) ) THEN
|
||||
atomic_positions = 'angstrom'
|
||||
ELSE IF( matches("alat", input_line ) ) THEN
|
||||
ELSE IF( matches("ALAT", input_line ) ) THEN
|
||||
atomic_positions = 'alat'
|
||||
ELSE
|
||||
IF( TRIM( ADJUSTL( input_line ) ) /= 'ATOMIC_POSITIONS' ) &
|
||||
CALL errore( ' read_cards ', ' unknow unit option for ATOMIC_POSITION: '&
|
||||
&//input_line, 1 )
|
||||
IF ( prog == 'FP' ) atomic_positions = 'crystal'
|
||||
IF ( prog == 'FP' ) atomic_positions = 'bohr'
|
||||
IF ( prog == 'CP' ) atomic_positions = 'bohr'
|
||||
IF ( prog == 'PW' ) atomic_positions = 'alat'
|
||||
END IF
|
||||
|
||||
DO ia = 1, nat
|
||||
|
@ -401,17 +440,19 @@
|
|||
na_inp( is ) = na_inp( is ) + 1
|
||||
END DO
|
||||
|
||||
tscal = .TRUE.
|
||||
IF ( atomic_positions == 'bohr' ) THEN
|
||||
tscal = .FALSE.
|
||||
ELSE IF( atomic_positions == 'angstrom' ) THEN
|
||||
rd_pos = rd_pos * angstrom_au
|
||||
tscal = .FALSE.
|
||||
ELSE IF( atomic_positions == 'alat' ) THEN
|
||||
rd_pos = rd_pos * celldm(1) ! Remember celldm(i) = alat
|
||||
tscal = .FALSE.
|
||||
ELSE
|
||||
IF( prog /= 'PW' ) THEN
|
||||
tscal = .TRUE.
|
||||
IF ( atomic_positions == 'bohr' ) THEN
|
||||
tscal = .FALSE.
|
||||
ELSE IF( atomic_positions == 'angstrom' ) THEN
|
||||
rd_pos = rd_pos * angstrom_au
|
||||
tscal = .FALSE.
|
||||
ELSE IF( atomic_positions == 'alat' ) THEN
|
||||
rd_pos = rd_pos * celldm(1) ! Remember celldm(i) = alat
|
||||
tscal = .FALSE.
|
||||
ELSE
|
||||
tscal = .TRUE.
|
||||
END IF
|
||||
END IF
|
||||
|
||||
tapos = .TRUE.
|
||||
|
@ -471,26 +512,60 @@
|
|||
CHARACTER(LEN=256) :: input_line
|
||||
INTEGER :: i
|
||||
LOGICAL, SAVE :: tread = .FALSE.
|
||||
|
||||
IF( tread ) THEN
|
||||
CALL errore(' card_kpoints ', ' two occurrence ', 2 )
|
||||
END IF
|
||||
IF( matches("automatic", input_line ) ) THEN
|
||||
|
||||
IF( matches("AUTOMATIC", input_line ) ) THEN
|
||||
! automatic generation of k-points
|
||||
k_points = 'automatic'
|
||||
ELSE IF( matches("crystal", input_line ) ) THEN
|
||||
ELSE IF( matches("CRYSTAL", input_line ) ) THEN
|
||||
! input k-points are in crystal (reciprocal lattice) axis
|
||||
k_points = 'crystal'
|
||||
ELSE IF( matches("tpiba", input_line ) ) THEN
|
||||
ELSE IF( matches("TPIBA", input_line ) ) THEN
|
||||
! input k-points are in 2pi/a units
|
||||
k_points = 'tpiba'
|
||||
ELSE IF( matches("gamma", input_line ) ) THEN
|
||||
ELSE IF( matches("GAMMA", input_line ) ) THEN
|
||||
! Only Gamma (k=0) is used
|
||||
k_points = 'gamma'
|
||||
ELSE
|
||||
! by default, input k-points are in 2pi/a units
|
||||
k_points = 'tpiba'
|
||||
END IF
|
||||
CALL read_line( input_line )
|
||||
READ(input_line,*) nks
|
||||
DO i = 1, nks
|
||||
CALL read_line( input_line )
|
||||
READ(input_line,*) xk(1,i), xk(2,i), xk(3,i), wk(i)
|
||||
END DO
|
||||
|
||||
IF( k_points == 'automatic' ) THEN
|
||||
|
||||
!
|
||||
! automatic generation of k-points
|
||||
!
|
||||
|
||||
nkstot = 0
|
||||
CALL read_line( input_line )
|
||||
READ (input_line, *) nk1, nk2, nk3, k1, k2 ,k3
|
||||
|
||||
ELSE IF( ( k_points == 'tpiba' ) .OR. ( k_points == 'crystal' ) ) THEN
|
||||
|
||||
!
|
||||
! input k-points are in 2pi/a units
|
||||
!
|
||||
|
||||
CALL read_line( input_line )
|
||||
READ (input_line, *) nkstot
|
||||
|
||||
DO i = 1, nkstot
|
||||
CALL read_line( input_line )
|
||||
READ(input_line,*) xk(1,i), xk(2,i), xk(3,i), wk(i)
|
||||
END DO
|
||||
|
||||
ELSE IF( k_points == 'gamma' ) THEN
|
||||
|
||||
nkstot = 1
|
||||
xk( :, 1 ) = 0.0d0
|
||||
wk( 1 ) = 1.0d0
|
||||
|
||||
END IF
|
||||
|
||||
tread = .TRUE.
|
||||
tk_inp = .TRUE.
|
||||
RETURN
|
||||
|
@ -555,17 +630,6 @@
|
|||
! END manual
|
||||
! ----------------------------------------------------------------
|
||||
|
||||
SUBROUTINE card_2dprocmesh( input_line )
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=256) :: input_line
|
||||
LOGICAL, SAVE :: tread = .FALSE.
|
||||
IF( tread ) THEN
|
||||
CALL errore(' card_2dprocmesh ', ' two occurrence ', 2 )
|
||||
END IF
|
||||
t2dpegrid_inp = .TRUE.
|
||||
tread = .TRUE.
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
! ----------------------------------------------------------------
|
||||
! BEGIN manual
|
||||
|
@ -903,19 +967,28 @@
|
|||
! ----------------------------------------------------------------
|
||||
|
||||
SUBROUTINE card_cell_parameters( input_line )
|
||||
USE parser, ONLY: matches
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=256) :: input_line
|
||||
INTEGER :: i, j
|
||||
LOGICAL, SAVE :: tread = .FALSE.
|
||||
|
||||
IF( tread ) THEN
|
||||
CALL errore(' card_cell_parameters ', ' two occurrence ', 2 )
|
||||
END IF
|
||||
DO i=1,3
|
||||
|
||||
if ( matches('HEXAGONAL',input_line) ) then
|
||||
cell_symmetry = 'hexagonal'
|
||||
else
|
||||
cell_symmetry = 'cubic'
|
||||
end if
|
||||
|
||||
DO i = 1, 3
|
||||
CALL read_line( input_line )
|
||||
READ (input_line,*) (rd_ht(i,j),j=1,3)
|
||||
READ (input_line,*) ( rd_ht( i, j ), j = 1, 3 )
|
||||
END DO
|
||||
trd_ht = .TRUE.
|
||||
tread = .TRUE.
|
||||
tread = .TRUE.
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
|
|
|
@ -6,76 +6,97 @@
|
|||
! or http://www.gnu.org/copyleft/gpl.txt .
|
||||
!
|
||||
|
||||
! AB INITIO COSTANT PRESSURE MOLECULAR DYNAMICS
|
||||
! ----------------------------------------------
|
||||
! Car-Parrinello Parallel Program
|
||||
! Carlo Cavazzoni
|
||||
! ----------------------------------------------
|
||||
! BEGIN manual
|
||||
MODULE read_namelists_module
|
||||
|
||||
MODULE read_namelists_module
|
||||
|
||||
! this module handles the reading of input data
|
||||
! ----------------------------------------------
|
||||
! list of routines in this module:
|
||||
! SUBROUTINE iosys
|
||||
! ----------------------------------------------
|
||||
!
|
||||
! END manual
|
||||
! ----------------------------------------------------------------------
|
||||
! this module handles the reading of input namelists
|
||||
! written by: Carlo Cavazzoni
|
||||
! --------------------------------------------------
|
||||
|
||||
USE kinds
|
||||
|
||||
USE parameters
|
||||
USE input_parameters
|
||||
|
||||
USE constants, ONLY: factem, kb_au, au_kb, K_BOLTZMAN_AU, angstrom_au, UMA_AU, pi
|
||||
USE constants, ONLY: factem, kb_au, au_kb, k_boltzman_au, angstrom_au, &
|
||||
uma_au, pi
|
||||
|
||||
IMPLICIT NONE
|
||||
SAVE
|
||||
|
||||
PRIVATE
|
||||
|
||||
PUBLIC :: read_namelists
|
||||
|
||||
! end of module-scope declarations
|
||||
! ----------------------------------------------
|
||||
|
||||
CONTAINS
|
||||
|
||||
! subroutines
|
||||
! ----------------------------------------------
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist CONTROL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE control_defaults( prog )
|
||||
! ... Variables initialization for CONTROL
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
title = 'MD Simulation'
|
||||
calculation = 'cp'
|
||||
! ( 'scf' | 'nscf' | 'phonon' | 'relax' | 'md' | 'cp' | 'vc-relax' | 'vc-md' | 'vc-cp' )
|
||||
IF( prog == 'PW' ) THEN
|
||||
title = ' '
|
||||
calculation = 'scf'
|
||||
ELSE
|
||||
title = 'MD Simulation'
|
||||
calculation = 'cp'
|
||||
END IF
|
||||
verbosity = 'default'
|
||||
restart_mode = 'restart'
|
||||
nstep = 10
|
||||
iprint = 10
|
||||
IF( prog == 'PW' ) restart_mode = 'from_scratch'
|
||||
IF( prog == 'CP' ) restart_mode = 'restart'
|
||||
IF( prog == 'FP' ) restart_mode = 'restart'
|
||||
nstep = 50
|
||||
IF( prog == 'PW' ) iprint = 100000
|
||||
IF( prog == 'CP' ) iprint = 10
|
||||
IF( prog == 'FP' ) iprint = 10
|
||||
isave = 100
|
||||
tstress = .FALSE.
|
||||
tprnfor = .FALSE.
|
||||
dt = 1.0d0
|
||||
dt = 1.0d0
|
||||
ndr = 50
|
||||
ndw = 50
|
||||
outdir = './' ! use the path specified as Outdir and the filename prefix to store the output
|
||||
prefix = 'cp' ! use the path specified as Outdir and the filename prefix to store the output
|
||||
pseudo_dir = './' ! directory containing the pseudopotentials
|
||||
max_seconds = 1.d+6
|
||||
IF( prog == 'PW' ) prefix = 'pwscf'
|
||||
IF( prog == 'CP' ) prefix = 'cp'
|
||||
IF( prog == 'FP' ) prefix = 'cp'
|
||||
IF( prog /= 'PW' ) pseudo_dir = './' ! directory containing the pseudopotentials
|
||||
max_seconds = 1.d+6
|
||||
ekin_conv_thr = 1.d-6
|
||||
etot_conv_thr = 1.d-5
|
||||
forc_conv_thr = 1.d-4
|
||||
etot_conv_thr = 1.d-4
|
||||
forc_conv_thr = 1.d-3
|
||||
disk_io = 'default'
|
||||
electron_maxstep = 100
|
||||
tefield = .FALSE.
|
||||
dipfield = .FALSE.
|
||||
lberry = .FALSE.
|
||||
gdir = 0
|
||||
nppstr = 0
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist SYSTEM
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE system_defaults( prog )
|
||||
! ... Variables initialization for SYSTEM
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
ibrav = -1
|
||||
celldm = (/ 0.d0, 0.d0, 0.d0, 0.d0, 0.d0, 0.d0 /)
|
||||
a = 0.0d0
|
||||
b = 0.0d0
|
||||
c = 0.0d0
|
||||
cosab = 0.0d0
|
||||
cosac = 0.0d0
|
||||
cosbc = 0.0d0
|
||||
nat = 0
|
||||
ntyp = 0
|
||||
nbnd = 0
|
||||
|
@ -92,26 +113,38 @@
|
|||
nr2b = 0
|
||||
nr3b = 0
|
||||
occupations = 'fixed'
|
||||
smearing = 'gaussan'
|
||||
degauss = 0.d0
|
||||
ngauss = 0
|
||||
nelup = 0
|
||||
neldw = 0
|
||||
nspin = 1
|
||||
nosym = .TRUE.
|
||||
IF( prog == 'PW' ) nosym = .FALSE.
|
||||
IF( prog == 'CP' ) nosym = .TRUE.
|
||||
IF( prog == 'FP' ) nosym = .TRUE.
|
||||
ecfixed = 0.d0
|
||||
qcutz = 0.d0
|
||||
q2sigma = 0.01d0
|
||||
xc_type = 'PZ'
|
||||
nosym = .FALSE.
|
||||
starting_magnetization = 0.0d0
|
||||
lda_plus_U = .FALSE.
|
||||
Hubbard_U = 0.0d0
|
||||
Hubbard_alpha = 0.0d0
|
||||
edir = 1
|
||||
emaxpos = 0.5d0
|
||||
eopreg = 0.1d0
|
||||
eamp = 1.0d-3
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist ELECTRONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE electrons_defaults( prog )
|
||||
! ... Variables initialization for ELECTRONS
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
emass = 400.d0
|
||||
emass_cutoff = 2.5d0
|
||||
|
@ -125,13 +158,18 @@
|
|||
electron_temperature = 'not_controlled' ! ( 'nose' | 'not_controlled' | 'rescaling')
|
||||
ekincw = 0.001d0
|
||||
fnosee = 1.0d0
|
||||
startingwfc = 'random'
|
||||
ampre = 0.0d0
|
||||
grease = 1.0d0
|
||||
IF( prog == 'FP' ) grease = 0.0d0
|
||||
twall = .FALSE.
|
||||
startingpot = ' '
|
||||
conv_thr = 0.00001
|
||||
IF( prog == 'PW' ) THEN
|
||||
startingwfc = 'atomic'
|
||||
startingpot = 'atomic'
|
||||
ELSE
|
||||
startingwfc = 'random'
|
||||
startingpot = ' '
|
||||
END IF
|
||||
conv_thr = 1.d-6
|
||||
empty_states_nbnd = 0
|
||||
empty_states_maxstep = 100
|
||||
empty_states_delt = 0.0d0
|
||||
|
@ -167,13 +205,22 @@
|
|||
IF( prog == 'FP' ) diago_david_ndim = 0
|
||||
diago_diis_buff = 200
|
||||
IF( prog == 'FP' ) diago_diis_buff = 0
|
||||
diago_diis_start = 0
|
||||
diago_diis_ndim = 3
|
||||
IF( prog == 'FP' ) diago_diis_ndim = 0
|
||||
diago_diis_start = 2
|
||||
IF( prog == 'FP' ) diago_diis_start = 2
|
||||
diago_diis_keep = .FALSE.
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist IONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE ions_defaults( prog )
|
||||
! ... Variables initialization for IONS
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
ion_dynamics = 'none'
|
||||
! ( 'sd' | 'cg' | 'damp' | 'verlet' | 'none' )
|
||||
|
@ -193,12 +240,19 @@
|
|||
ion_nstepe = 1
|
||||
ion_maxstep = 100
|
||||
upscale = 0
|
||||
IF( prog == 'PW' ) upscale = 10
|
||||
potential_extrapolation = 'default'
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist CELL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE cell_defaults( prog )
|
||||
! ... Variables initialization for CELL
|
||||
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
cell_parameters = 'default'
|
||||
cell_dynamics = 'none' ! ( 'sd' | 'pr' | 'none' | 'w' | 'damp-pr' | 'damp-w' )
|
||||
|
@ -218,19 +272,28 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Variables initialization for Namelist PHONON
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE phonon_defaults( prog )
|
||||
! ... Variables initialization for PHONON
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
modenum = 0
|
||||
xqq = 0.0d0
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist CONTROL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE control_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
! ... CONTROL Variables Broadcast
|
||||
CALL mp_bcast( title, ionode_id )
|
||||
CALL mp_bcast( calculation, ionode_id )
|
||||
CALL mp_bcast( verbosity, ionode_id )
|
||||
|
@ -251,15 +314,31 @@
|
|||
CALL mp_bcast( forc_conv_thr, ionode_id )
|
||||
CALL mp_bcast( pseudo_dir, ionode_id )
|
||||
CALL mp_bcast( disk_io, ionode_id )
|
||||
CALL mp_bcast( tefield, ionode_id )
|
||||
CALL mp_bcast( dipfield, ionode_id )
|
||||
CALL mp_bcast( lberry, ionode_id )
|
||||
CALL mp_bcast( gdir, ionode_id )
|
||||
CALL mp_bcast( nppstr, ionode_id )
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist SYSTEM
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE system_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
! ... SYSTEM Variables Broadcast
|
||||
CALL mp_bcast( ibrav, ionode_id )
|
||||
CALL mp_bcast( celldm, ionode_id )
|
||||
CALL mp_bcast( a, ionode_id )
|
||||
CALL mp_bcast( b, ionode_id )
|
||||
CALL mp_bcast( c, ionode_id )
|
||||
CALL mp_bcast( cosab, ionode_id )
|
||||
CALL mp_bcast( cosac, ionode_id )
|
||||
CALL mp_bcast( cosbc, ionode_id )
|
||||
CALL mp_bcast( nat, ionode_id )
|
||||
CALL mp_bcast( ntyp, ionode_id )
|
||||
CALL mp_bcast( nbnd, ionode_id )
|
||||
|
@ -276,6 +355,7 @@
|
|||
CALL mp_bcast( nr2b, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( nr3b, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( occupations, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( smearing, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( degauss, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( ngauss, ionode_id ) ! not used in fpmd
|
||||
CALL mp_bcast( nelup, ionode_id )
|
||||
|
@ -291,13 +371,22 @@
|
|||
CALL mp_bcast( lda_plus_U, ionode_id )
|
||||
CALL mp_bcast( Hubbard_U, ionode_id )
|
||||
CALL mp_bcast( Hubbard_alpha, ionode_id )
|
||||
CALL mp_bcast( edir, ionode_id )
|
||||
CALL mp_bcast( emaxpos, ionode_id )
|
||||
CALL mp_bcast( eopreg, ionode_id )
|
||||
CALL mp_bcast( eamp, ionode_id )
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist ELECTRONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE electrons_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
! ... ELECTRONS Variables Broadcast
|
||||
CALL mp_bcast( emass, ionode_id )
|
||||
CALL mp_bcast( emass_cutoff, ionode_id )
|
||||
CALL mp_bcast( orthogonalization, ionode_id )
|
||||
|
@ -346,15 +435,21 @@
|
|||
CALL mp_bcast( diago_cg_maxiter, ionode_id )
|
||||
CALL mp_bcast( diago_david_ndim, ionode_id )
|
||||
CALL mp_bcast( diago_diis_buff, ionode_id )
|
||||
CALL mp_bcast( diago_diis_ndim, ionode_id )
|
||||
CALL mp_bcast( diago_diis_start, ionode_id )
|
||||
CALL mp_bcast( diago_diis_keep, ionode_id )
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist IONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE ions_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
! ... IONS Variables Broadcast
|
||||
CALL mp_bcast( ion_dynamics, ionode_id )
|
||||
CALL mp_bcast( ion_radius, ionode_id )
|
||||
CALL mp_bcast( ion_damping, ionode_id )
|
||||
|
@ -374,10 +469,15 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist CELL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE cell_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
! ... CELL Variables Broadcast
|
||||
CALL mp_bcast( cell_parameters, ionode_id )
|
||||
CALL mp_bcast( cell_dynamics, ionode_id )
|
||||
CALL mp_bcast( cell_velocities, ionode_id )
|
||||
|
@ -393,6 +493,12 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Broadcast variables values for Namelist PHONON
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE phonon_bcast()
|
||||
USE io_global, ONLY: ionode_id
|
||||
USE mp, ONLY: mp_bcast
|
||||
|
@ -401,6 +507,12 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist CONTROL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE control_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
CHARACTER(LEN=80) :: msg
|
||||
|
@ -442,35 +554,51 @@
|
|||
IF( disk_io /= 'default' ) &
|
||||
CALL errore( sub_name,' disk_io not implemented yet ',-1)
|
||||
END IF
|
||||
IF( calculation /= 'cp' ) THEN
|
||||
! msg = ' could not execute '//TRIM(calculation)//' calculation'
|
||||
! CALL errore( sub_name, TRIM(msg), -1)
|
||||
END IF
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist SYSTEM
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE system_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
CHARACTER(LEN=80) :: msg
|
||||
CHARACTER(LEN=20) :: sub_name = ' system_checkin '
|
||||
IF( ibrav < -1 .OR. ibrav > 14 ) &
|
||||
|
||||
IF( ibrav < 0 .OR. ibrav > 14 ) &
|
||||
CALL errore( sub_name ,' ibrav out of range ', MAX( 1, ibrav) )
|
||||
IF( celldm(1) == 0.0d0 ) &
|
||||
CALL errore( sub_name ,' celldm invalid values ', 1)
|
||||
IF( nat < 1 .OR. nat > natx ) &
|
||||
CALL errore( sub_name ,' nat out of range ', MAX( nat, 1) )
|
||||
|
||||
IF( ( ibrav /= 0 ) .AND. ( celldm(1) == 0.d0 ) .AND. ( a == 0.d0 ) ) &
|
||||
CALL errore(' iosys ',' invalid lattice parameters ( celldm or a )', 1 )
|
||||
|
||||
IF( nat < 1 ) &
|
||||
CALL errore( sub_name ,' nat less than one ', MAX( nat, 1) )
|
||||
IF( nat > natx ) &
|
||||
CALL errore( sub_name ,' nat too large, increase NATX ', MAX( nat, 1) )
|
||||
|
||||
IF( ntyp < 1 ) &
|
||||
CALL errore( sub_name ,' ntyp less than one ', MAX( ntyp, 1) )
|
||||
IF( ntyp < 1 .OR. ntyp > nsx ) &
|
||||
CALL errore( sub_name ,' ntyp out of range ', MAX( ntyp, 1) )
|
||||
IF( nbnd < 1 .OR. nbnd > nbndxx ) &
|
||||
CALL errore( sub_name ,' nbnd out of range ', MAX(nbnd, 1) )
|
||||
IF( nelec < 1 .OR. nelec > 2*nbnd ) &
|
||||
CALL errore( sub_name ,' nelec out of range ', MAX(nelec, 1) )
|
||||
CALL errore( sub_name ,' ntyp too large, increase NSX ', MAX( ntyp, 1) )
|
||||
|
||||
IF( prog /= 'PW' ) THEN
|
||||
IF( nbnd < 1 .OR. nbnd > nbndxx ) &
|
||||
CALL errore( sub_name ,' nbnd out of range ', MAX(nbnd, 1) )
|
||||
IF( nelec < 1 .OR. nelec > 2*nbnd ) &
|
||||
CALL errore( sub_name ,' nelec out of range ', MAX(nelec, 1) )
|
||||
END IF
|
||||
|
||||
IF( nspin < 1 .OR. nspin > nspinx ) &
|
||||
CALL errore( sub_name ,' nelec out of range ', MAX(nspin, 1 ) )
|
||||
|
||||
IF( ecutwfc <= 0.0d0 ) &
|
||||
CALL errore( sub_name ,' ecutwfc out of range ',-1)
|
||||
CALL errore( sub_name ,' ecutwfc out of range ',1)
|
||||
IF( ecutrho < 0.0d0 ) &
|
||||
CALL errore( sub_name ,' ecutrho out of range ',-1)
|
||||
CALL errore( sub_name ,' ecutrho out of range ',1)
|
||||
|
||||
IF( prog == 'FP' ) THEN
|
||||
IF( nr1 /= 0 ) &
|
||||
CALL errore( sub_name ,' nr1 is not used in FPMD ',-1)
|
||||
|
@ -520,6 +648,12 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist ELECTRONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE electrons_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
CHARACTER(LEN=80) :: msg
|
||||
|
@ -574,6 +708,8 @@
|
|||
CALL errore( sub_name, ' diago_david_ndim not used in FPMD ',-1)
|
||||
IF( diago_diis_buff /= 0 ) &
|
||||
CALL errore( sub_name, ' diago_diis_buff not used in FPMD ',-1)
|
||||
IF( diago_diis_ndim /= 0 ) &
|
||||
CALL errore( sub_name, ' diago_diis_buff not used in FPMD ',-1)
|
||||
IF( diago_diis_start /= 0 ) &
|
||||
CALL errore( sub_name, ' diago_diis_start not used in FPMD ',-1)
|
||||
IF( diago_diis_keep ) &
|
||||
|
@ -586,6 +722,12 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist IONS
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE ions_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
CHARACTER(LEN=80) :: msg
|
||||
|
@ -616,6 +758,12 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist CELL
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE cell_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
CHARACTER(LEN=80) :: msg
|
||||
|
@ -644,13 +792,22 @@
|
|||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Check input values for Namelist PHONON
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE phonon_checkin( prog )
|
||||
CHARACTER(LEN=2) :: prog ! specify the calling program
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Set values according to the "calculation" variable
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
SUBROUTINE fixval( prog )
|
||||
|
||||
|
@ -659,65 +816,78 @@
|
|||
CHARACTER(LEN=80) :: msg
|
||||
CHARACTER(LEN=20) :: sub_name = ' fixval '
|
||||
|
||||
IF( prog == 'FP' ) THEN
|
||||
IF( electron_dynamics /= 'none' .OR. ion_dynamics /= 'none' .OR. cell_dynamics /= 'none' ) THEN
|
||||
WRITE(6,*)
|
||||
WRITE(6,fmt="(3X,'Dynamics parameters from input, ', /, 3X, &
|
||||
& 'one or more of electron_dynamics, ion_dynamics OR cell_dynamics ', /, 3X, &
|
||||
& 'parameters specified, calculation parameter ''',A,''' is ignored')") TRIM(calculation)
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
IF( prog == 'PW' ) startingpot = 'atomic'
|
||||
|
||||
SELECT CASE ( TRIM(calculation) )
|
||||
CASE ('scf')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'sd'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'damp'
|
||||
IF( prog == 'FP' ) THEN
|
||||
electron_dynamics = 'sd'
|
||||
ion_dynamics = 'none'
|
||||
cell_dynamics = 'none'
|
||||
END IF
|
||||
IF( prog == 'CP' ) THEN
|
||||
electron_dynamics = 'damp'
|
||||
ion_dynamics = 'none'
|
||||
cell_dynamics = 'none'
|
||||
END IF
|
||||
CASE ('nscf')
|
||||
IF( prog == 'FP' ) CALL errore( sub_name,' calculation '//calculation//' not implemented ',1)
|
||||
IF( prog == 'CP' ) occupations = 'bogus'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'damp'
|
||||
IF( prog == 'PW' ) startingpot = 'file'
|
||||
CASE ('phonon')
|
||||
IF( prog == 'FP' ) CALL errore( sub_name,' calculation '//calculation//' not implemented ',1)
|
||||
IF( prog == 'CP' ) CALL errore( sub_name,' calculation '//calculation//' not implemented ',1)
|
||||
IF( prog == 'PW' ) startingpot = 'file'
|
||||
CASE ('relax')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'sd'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'damp'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'damp'
|
||||
IF( prog == 'CP' ) ion_dynamics = 'damp'
|
||||
CASE ('md')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'verlet'
|
||||
CASE ('cp')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'verlet'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'CP' ) ion_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) THEN
|
||||
electron_dynamics = 'sd'
|
||||
ion_dynamics = 'damp'
|
||||
ELSE IF( prog == 'CP' ) THEN
|
||||
electron_dynamics = 'damp'
|
||||
ion_dynamics = 'damp'
|
||||
ELSE IF( prog == 'PW' ) THEN
|
||||
ion_dynamics = 'bfgs'
|
||||
END IF
|
||||
CASE ( 'md', 'cp' )
|
||||
IF( prog == 'FP' .OR. prog == 'CP' ) THEN
|
||||
electron_dynamics = 'verlet'
|
||||
ion_dynamics = 'verlet'
|
||||
ELSE IF( prog == 'PW' ) THEN
|
||||
ion_dynamics = 'verlet'
|
||||
END IF
|
||||
CASE ('vc-relax')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'sd'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'damp'
|
||||
IF( prog == 'FP' ) cell_dynamics = 'pr'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'damp'
|
||||
IF( prog == 'CP' ) ion_dynamics = 'damp'
|
||||
IF( prog == 'CP' ) cell_dynamics = 'damp-pr'
|
||||
CASE ('vc-md')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) cell_dynamics = 'pr'
|
||||
CASE ('vc-cp')
|
||||
IF( prog == 'FP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) ion_dynamics = 'verlet'
|
||||
IF( prog == 'FP' ) cell_dynamics = 'pr'
|
||||
IF( prog == 'CP' ) electron_dynamics = 'verlet'
|
||||
IF( prog == 'CP' ) ion_dynamics = 'verlet'
|
||||
IF( prog == 'CP' ) cell_dynamics = 'pr'
|
||||
IF( prog == 'FP' ) THEN
|
||||
electron_dynamics = 'sd'
|
||||
ion_dynamics = 'damp'
|
||||
cell_dynamics = 'pr'
|
||||
ELSE IF( prog == 'CP' ) THEN
|
||||
electron_dynamics = 'damp'
|
||||
ion_dynamics = 'damp'
|
||||
cell_dynamics = 'damp-pr'
|
||||
ELSE IF( prog == 'PW' ) THEN
|
||||
ion_dynamics = 'damp'
|
||||
END IF
|
||||
CASE ( 'vc-md', 'vc-cp' )
|
||||
IF( prog == 'FP' .OR. prog == 'CP' ) THEN
|
||||
electron_dynamics = 'verlet'
|
||||
ion_dynamics = 'verlet'
|
||||
cell_dynamics = 'pr'
|
||||
ELSE IF( prog == 'PW' ) THEN
|
||||
ion_dynamics = 'beeman'
|
||||
END IF
|
||||
CASE DEFAULT
|
||||
CALL errore( sub_name,' calculation '//calculation//' not implemented ',1)
|
||||
END SELECT
|
||||
RETURN
|
||||
END SUBROUTINE
|
||||
|
||||
!=----------------------------------------------------------------------------=!
|
||||
!
|
||||
! Namelist parsing main routine
|
||||
!
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
||||
! ----------------------------------------------
|
||||
SUBROUTINE read_namelists( prog )
|
||||
|
||||
! this routine reads data from standard input and puts them into
|
||||
|
@ -746,7 +916,11 @@
|
|||
! ... end of declarations
|
||||
! ----------------------------------------------
|
||||
|
||||
IF( prog /= 'PW' .AND. prog /= 'CP' .AND. prog /= 'FP' ) &
|
||||
CALL errore( ' read_namelists ', ' unknown calling program ', 1 )
|
||||
|
||||
! ... Here set default values for namelists
|
||||
|
||||
CALL control_defaults( prog )
|
||||
CALL system_defaults( prog )
|
||||
CALL electrons_defaults( prog )
|
||||
|
@ -755,12 +929,13 @@
|
|||
CALL phonon_defaults( prog )
|
||||
!
|
||||
! ... Here start reading standard input file
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
READ (5, control, iostat = ios )
|
||||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist control ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist control ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL control_bcast( )
|
||||
|
@ -769,56 +944,65 @@
|
|||
CALL fixval( prog )
|
||||
|
||||
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
READ (5, system, iostat = ios )
|
||||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist system ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist system ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL system_bcast( )
|
||||
CALL system_checkin( prog )
|
||||
|
||||
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
READ (5, electrons, iostat = ios )
|
||||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist electrons ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist electrons ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL electrons_bcast( )
|
||||
CALL electrons_checkin( prog )
|
||||
|
||||
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
READ (5, ions, iostat = ios )
|
||||
IF( TRIM(calculation) == 'relax' .or. TRIM(calculation) == 'md' .or.&
|
||||
TRIM(calculation) == 'vc-relax'.or. TRIM(calculation) == 'vc-md'.or.&
|
||||
TRIM(calculation) == 'cp' .or. TRIM(calculation) == 'vc-cp' ) THEN
|
||||
READ (5, ions, iostat = ios )
|
||||
END IF
|
||||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist ions ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist ions ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL ions_bcast( )
|
||||
CALL ions_checkin( prog )
|
||||
|
||||
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
IF( TRIM( calculation ) == 'vc-relax' .OR. TRIM( calculation ) == 'vc-cp' ) THEN
|
||||
IF( TRIM( calculation ) == 'vc-relax' .OR. TRIM( calculation ) == 'vc-cp' .OR. &
|
||||
TRIM(calculation) == 'vc-md' .OR. TRIM( calculation ) == 'vc-md' ) THEN
|
||||
READ (5, cell, iostat = ios )
|
||||
END IF
|
||||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist cell ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist cell ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL cell_bcast()
|
||||
CALL cell_checkin( prog )
|
||||
|
||||
|
||||
ios = 0
|
||||
IF( ionode ) THEN
|
||||
IF( TRIM( calculation ) == 'phonon' ) THEN
|
||||
READ (5, phonon, iostat = ios )
|
||||
|
@ -826,18 +1010,14 @@
|
|||
END IF
|
||||
CALL mp_bcast( ios, ionode_id )
|
||||
IF( ios /= 0 ) THEN
|
||||
CALL errore( ' code_input ', ' reading namelist cell ', ABS(ios) )
|
||||
CALL errore( ' read_namelists ', ' reading namelist cell ', ABS(ios) )
|
||||
END IF
|
||||
|
||||
CALL phonon_bcast()
|
||||
CALL phonon_checkin( prog )
|
||||
|
||||
|
||||
RETURN
|
||||
END SUBROUTINE read_namelists
|
||||
|
||||
! ----------------------------------------------------------------
|
||||
! END manual
|
||||
! ----------------------------------------------------------------
|
||||
|
||||
END MODULE read_namelists_module
|
||||
END MODULE read_namelists_module
|
||||
|
|
1027
PW/input.f90
1027
PW/input.f90
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue