2005-10-16 07:27:47 +08:00
|
|
|
!
|
2005-12-18 05:21:54 +08:00
|
|
|
! Copyright (C) 2002-2005 Quantum-ESPRESSO group
|
2003-01-20 05:58:50 +08:00
|
|
|
! 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,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2004-06-26 01:25:37 +08:00
|
|
|
#include "f_defs.h"
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
SUBROUTINE iosys()
|
|
|
|
!-----------------------------------------------------------------------------
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
! ... this subroutine reads input data from standard input ( unit 5 )
|
2004-03-15 17:43:02 +08:00
|
|
|
! ... Use "-input filename" to read input from file "filename":
|
|
|
|
! ... may be useful if you have trouble reading from standard input
|
2003-12-10 22:57:07 +08:00
|
|
|
! ... ---------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! ... access the modules renaming the variables that have the same name
|
|
|
|
! ... as the input parameters, this is required in order to use a code
|
|
|
|
! ... independent input parser
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
!
|
2005-09-20 23:17:18 +08:00
|
|
|
USE kinds, ONLY : DP
|
2005-11-02 23:42:06 +08:00
|
|
|
USE funct, ONLY : enforce_input_dft
|
2005-10-23 06:37:48 +08:00
|
|
|
USE constants, ONLY : au, eV_to_kelvin, pi, rytoev, &
|
|
|
|
uakbar, amconv, bohr_radius_angs
|
2004-09-15 20:07:57 +08:00
|
|
|
USE mp_global, ONLY : npool, nproc_pool
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-06-09 15:35:50 +08:00
|
|
|
USE io_global, ONLY : stdout, ionode
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-10-23 06:37:48 +08:00
|
|
|
USE bp, ONLY : nppstr_ => nppstr, &
|
|
|
|
gdir_ => gdir, &
|
2005-12-18 01:40:37 +08:00
|
|
|
lberry_ => lberry, &
|
2005-10-23 06:37:48 +08:00
|
|
|
lelfield_ => lelfield, &
|
|
|
|
efield_ => efield, &
|
2005-10-26 07:17:05 +08:00
|
|
|
nberrycyc_ => nberrycyc
|
2005-08-16 20:04:34 +08:00
|
|
|
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
USE cell_base, ONLY : at, bg, alat, omega, &
|
2004-03-12 18:51:49 +08:00
|
|
|
celldm_ => celldm, &
|
|
|
|
ibrav_ => ibrav
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2004-06-12 00:53:16 +08:00
|
|
|
USE ions_base, ONLY : if_pos, &
|
2005-10-23 06:37:48 +08:00
|
|
|
ntyp_ => nsp, &
|
|
|
|
nat_ => nat, &
|
|
|
|
ityp, tau, atm
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2004-06-12 21:44:18 +08:00
|
|
|
USE basis, ONLY : atomic_positions, &
|
2003-10-17 00:30:12 +08:00
|
|
|
startingwfc_ => startingwfc, &
|
|
|
|
startingpot_ => startingpot, &
|
|
|
|
startingconfig
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE char, ONLY : title_ => title, &
|
|
|
|
crystal
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-01-21 23:06:22 +08:00
|
|
|
USE cellmd, ONLY : cmass, omega_old, at_old, ntcheck, &
|
2003-10-17 00:30:12 +08:00
|
|
|
cell_factor_ => cell_factor , &
|
|
|
|
press_ => press, &
|
|
|
|
calc, lmovecell
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2006-01-14 01:25:42 +08:00
|
|
|
USE dynamics_module, ONLY : temperature, amass, &
|
2006-03-28 05:40:10 +08:00
|
|
|
dt_ => dt, &
|
|
|
|
delta_t_ => delta_t, &
|
|
|
|
nraise_ => nraise, &
|
|
|
|
refold_pos_ => refold_pos
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE extfield, ONLY : tefield_ => tefield, &
|
|
|
|
dipfield_ => dipfield, &
|
|
|
|
edir_ => edir, &
|
|
|
|
emaxpos_ => emaxpos, &
|
|
|
|
eopreg_ => eopreg, &
|
|
|
|
eamp_ => eamp, &
|
|
|
|
forcefield
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-10-23 06:37:48 +08:00
|
|
|
USE io_files, ONLY : input_drho, output_drho, &
|
|
|
|
psfile, tmp_dir, wfc_dir, &
|
|
|
|
prefix_ => prefix, &
|
2006-02-02 01:56:16 +08:00
|
|
|
pseudo_dir_ => pseudo_dir, &
|
|
|
|
trimcheck
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE force_mod, ONLY : lforce, lstres, force
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE gvect, ONLY : dual, &
|
|
|
|
nr1_ => nr1, &
|
|
|
|
nr2_ => nr2, &
|
|
|
|
nr3_ => nr3, &
|
|
|
|
ecutwfc_ => ecutwfc, &
|
|
|
|
ecfixed_ => ecfixed, &
|
|
|
|
qcutz_ => qcutz, &
|
|
|
|
q2sigma_ => q2sigma
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE gsmooth, ONLY : nr1s_ => nr1s, &
|
|
|
|
nr2s_ => nr2s, &
|
|
|
|
nr3s_ => nr3s
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-03-17 22:47:46 +08:00
|
|
|
USE klist, ONLY : xk, wk, nks, ngauss, two_fermi_energies, &
|
2003-10-17 00:30:12 +08:00
|
|
|
xqq_ => xqq, &
|
|
|
|
degauss_ => degauss, &
|
2004-05-25 22:22:43 +08:00
|
|
|
nelec_ => nelec, &
|
2005-03-17 22:47:46 +08:00
|
|
|
nelup_ => nelup, &
|
|
|
|
neldw_ => neldw, &
|
2006-01-01 17:17:24 +08:00
|
|
|
tot_charge_ => tot_charge, &
|
|
|
|
tot_magnetization_ => tot_magnetization, &
|
|
|
|
multiplicity_ => multiplicity
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE ktetra, ONLY : nk1, nk2, nk3, k1, k2, k3, ltetra
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE ldaU, ONLY : Hubbard_U_ => hubbard_u, &
|
|
|
|
Hubbard_alpha_ => hubbard_alpha, &
|
2004-04-03 00:05:17 +08:00
|
|
|
niter_with_fixed_ns, starting_ns, U_projection, &
|
2003-10-17 00:30:12 +08:00
|
|
|
lda_plus_u_ => lda_plus_u
|
2005-12-28 18:49:03 +08:00
|
|
|
!
|
|
|
|
USE a2F, ONLY : la2F_ => la2F
|
|
|
|
!
|
2006-02-08 23:46:21 +08:00
|
|
|
USE exx, ONLY : x_gamma_extrapolation_ => x_gamma_extrapolation, &
|
|
|
|
nqx1_ => nq1, &
|
2005-10-23 06:37:48 +08:00
|
|
|
nqx2_ => nq2, &
|
2005-12-19 21:00:38 +08:00
|
|
|
nqx3_ => nq3
|
2006-03-28 05:40:10 +08:00
|
|
|
!
|
|
|
|
USE realus, ONLY : tqr_ => tqr
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
USE lsda_mod, ONLY : nspin_ => nspin, &
|
|
|
|
starting_magnetization_ => starting_magnetization, &
|
|
|
|
lsda
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2006-01-25 21:33:56 +08:00
|
|
|
USE relax, ONLY : epse, epsf, epsp, starting_scf_threshold
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2004-07-05 14:50:22 +08:00
|
|
|
USE control_flags, ONLY : diis_ndim, isolve, &
|
2003-10-17 00:30:12 +08:00
|
|
|
max_cg_iter, diis_buff, david, imix, nmix, &
|
2005-01-10 14:56:14 +08:00
|
|
|
iverbosity, tr2, niter, pot_order, wfc_order, &
|
2005-01-21 23:06:22 +08:00
|
|
|
tolp_ => tolp, &
|
2003-10-17 00:30:12 +08:00
|
|
|
upscale_ => upscale, &
|
|
|
|
mixing_beta_ => mixing_beta, &
|
|
|
|
nstep_ => nstep, &
|
|
|
|
iprint_ => iprint, &
|
|
|
|
nosym_ => nosym, &
|
|
|
|
modenum_ => modenum, &
|
2006-03-11 06:31:18 +08:00
|
|
|
reduce_io, langevin_rescaling, ethr, lscf, lbfgs, &
|
2006-03-21 06:44:35 +08:00
|
|
|
lmd, lpath, lneb, lsmd, lphonon, ldamped, lbands, &
|
2006-03-11 06:31:18 +08:00
|
|
|
lrescale_t, lmetadyn, lconstrain, lcoarsegrained, &
|
|
|
|
restart, twfcollect
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2004-09-28 00:02:17 +08:00
|
|
|
USE wvfct, ONLY : nbnd_ => nbnd
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2006-03-29 03:43:35 +08:00
|
|
|
USE fixed_occ, ONLY : tfixed_occ, f_inp
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-02-25 22:51:41 +08:00
|
|
|
USE path_variables, ONLY : nstep_path, lsteep_des, lquick_min, lbroyden, &
|
2006-03-02 03:57:03 +08:00
|
|
|
llangevin, &
|
2004-11-03 17:53:12 +08:00
|
|
|
ds_ => ds, &
|
|
|
|
write_save_ => write_save, &
|
2005-04-26 07:58:26 +08:00
|
|
|
use_masses_ => use_masses, &
|
2004-11-03 17:53:12 +08:00
|
|
|
init_num_of_images_ => init_num_of_images, &
|
2005-04-17 01:07:39 +08:00
|
|
|
use_fourier_ => use_fourier, &
|
2004-11-03 17:53:12 +08:00
|
|
|
use_multistep_ => use_multistep, &
|
|
|
|
CI_scheme_ => CI_scheme, &
|
2005-02-06 19:04:03 +08:00
|
|
|
fixed_tan_ => fixed_tan, &
|
2005-02-25 22:51:41 +08:00
|
|
|
free_energy_ => free_energy, &
|
2005-02-06 19:04:03 +08:00
|
|
|
use_freezing_ => use_freezing, &
|
2004-11-03 17:53:12 +08:00
|
|
|
k_max_ => k_max, &
|
|
|
|
k_min_ => k_min, &
|
|
|
|
num_of_images_ => num_of_images, &
|
|
|
|
first_last_opt_ => first_last_opt, &
|
|
|
|
temp_req_ => temp_req, &
|
|
|
|
path_thr_ => path_thr
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-10-23 06:37:48 +08:00
|
|
|
USE noncollin_module, ONLY : i_cons, mcons, &
|
|
|
|
noncolin_ => noncolin, &
|
2003-12-10 22:57:07 +08:00
|
|
|
lambda_ => lambda, &
|
|
|
|
angle1_ => angle1, &
|
|
|
|
angle2_ => angle2, &
|
|
|
|
report_ => report
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2004-08-25 16:23:30 +08:00
|
|
|
USE spin_orb, ONLY : lspinorb_ => lspinorb
|
2004-09-15 20:35:54 +08:00
|
|
|
!
|
2005-04-21 07:43:15 +08:00
|
|
|
USE bfgs_module, ONLY : bfgs_ndim_ => bfgs_ndim, &
|
2003-12-10 22:57:07 +08:00
|
|
|
trust_radius_max_ => trust_radius_max, &
|
|
|
|
trust_radius_min_ => trust_radius_min, &
|
|
|
|
trust_radius_ini_ => trust_radius_ini, &
|
|
|
|
w_1_ => w_1, &
|
2004-09-28 00:02:17 +08:00
|
|
|
w_2_ => w_2
|
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... CONTROL namelist
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-12-18 01:40:37 +08:00
|
|
|
USE input_parameters, ONLY : title, calculation, verbosity, restart_mode, &
|
|
|
|
nstep, iprint, tstress, tprnfor, dt, outdir, &
|
|
|
|
wfcdir, prefix, etot_conv_thr, forc_conv_thr, &
|
|
|
|
pseudo_dir, disk_io, tefield, dipfield, lberry, &
|
|
|
|
gdir, nppstr, wf_collect,lelfield, efield, tqr, &
|
|
|
|
nberrycyc
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... SYSTEM namelist
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
USE input_parameters, ONLY : ibrav, celldm, a, b, c, cosab, cosac, cosbc, &
|
2005-03-17 22:47:46 +08:00
|
|
|
nat, ntyp, nbnd, nelec, nelup, neldw, &
|
2006-01-01 17:17:24 +08:00
|
|
|
tot_charge, tot_magnetization, multiplicity, &
|
2005-03-17 22:47:46 +08:00
|
|
|
ecutwfc, ecutrho, &
|
2003-10-17 00:30:12 +08:00
|
|
|
nr1, nr2, nr3, nr1s, nr2s, nr3s, &
|
|
|
|
nosym, starting_magnetization, &
|
|
|
|
occupations, degauss, smearing, &
|
|
|
|
nspin, ecfixed, qcutz, q2sigma, &
|
|
|
|
lda_plus_U, Hubbard_U, Hubbard_alpha, &
|
2004-04-03 00:05:17 +08:00
|
|
|
starting_ns_eigenvalue, U_projection_type, &
|
2005-12-28 18:49:03 +08:00
|
|
|
input_dft, la2F, &
|
2005-06-27 21:11:33 +08:00
|
|
|
#if defined (EXX)
|
2006-02-08 23:46:21 +08:00
|
|
|
x_gamma_extrapolation, nqx1, nqx2, nqx3, &
|
2005-06-27 21:11:33 +08:00
|
|
|
#endif
|
2004-04-03 00:05:17 +08:00
|
|
|
edir, emaxpos, eopreg, eamp, &
|
2005-03-24 01:20:26 +08:00
|
|
|
noncolin, lambda, angle1, angle2, &
|
|
|
|
constrained_magnetization, B_field, &
|
|
|
|
fixed_magnetization, report, lspinorb
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... ELECTRONS namelist
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
USE input_parameters, ONLY : electron_maxstep, mixing_mode, mixing_beta, &
|
|
|
|
mixing_ndim, mixing_fixed_ns, conv_thr, &
|
|
|
|
diago_thr_init, diago_cg_maxiter, &
|
|
|
|
diago_david_ndim, diago_diis_ndim, &
|
|
|
|
diagonalization, startingwfc, startingpot
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... IONS namelist
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
USE input_parameters, ONLY : phase_space, ion_dynamics, ion_positions, tolp, &
|
|
|
|
tempw, delta_t, nraise, ion_temperature, &
|
2006-03-28 05:40:10 +08:00
|
|
|
refold_pos, upscale, pot_extrapolation, &
|
|
|
|
wfc_extrapolation, &
|
2004-10-13 16:18:15 +08:00
|
|
|
num_of_images, path_thr, CI_scheme, opt_scheme, &
|
2005-05-27 06:42:05 +08:00
|
|
|
use_masses, use_multistep, first_last_opt, &
|
2006-03-02 03:57:03 +08:00
|
|
|
init_num_of_images, temp_req, k_max, k_min, &
|
|
|
|
ds, use_fourier, use_freezing, fixed_tan, &
|
|
|
|
free_energy, write_save, &
|
|
|
|
w_1, w_2, trust_radius_max, trust_radius_min, &
|
|
|
|
trust_radius_ini, bfgs_ndim
|
|
|
|
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... CELL namelist
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
USE input_parameters, ONLY : cell_parameters, cell_dynamics, press, &
|
2006-01-25 21:33:56 +08:00
|
|
|
wmass, cell_temperature, cell_factor, &
|
|
|
|
press_conv_thr
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... PHONON namelist
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-07-01 01:56:05 +08:00
|
|
|
USE input_parameters, ONLY : phonon, modenum, xqq
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
! ... "path" specific
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
USE input_parameters, ONLY : pos, full_phs_path_flag
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2006-01-29 06:35:48 +08:00
|
|
|
USE input_parameters, ONLY : nconstr_inp
|
2005-10-20 23:22:12 +08:00
|
|
|
!
|
|
|
|
USE constraints_module, ONLY : init_constraint
|
2005-12-07 12:22:30 +08:00
|
|
|
USE metadyn_vars, ONLY : init_metadyn_vars
|
2005-09-17 10:14:39 +08:00
|
|
|
USE read_namelists_module, ONLY : read_namelists, sm_not_set
|
2005-03-24 01:20:26 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IMPLICIT NONE
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... local variables
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2005-10-23 06:37:48 +08:00
|
|
|
INTEGER :: i, ia, ios, is, image, nt
|
2005-09-20 23:17:18 +08:00
|
|
|
LOGICAL :: ltest
|
|
|
|
REAL(DP) :: theta, phi
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
!
|
|
|
|
CALL getenv( 'HOME', pseudo_dir )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
pseudo_dir = TRIM( pseudo_dir ) // '/pw/pseudo/'
|
2003-04-03 23:35:36 +08:00
|
|
|
!
|
2005-10-20 23:22:12 +08:00
|
|
|
IF ( ionode ) CALL input_from_file()
|
2003-12-16 23:43:57 +08:00
|
|
|
!
|
2004-03-15 17:43:02 +08:00
|
|
|
! ... all namelists are read
|
|
|
|
!
|
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
2003-07-31 21:24:20 +08:00
|
|
|
CALL read_namelists( 'PW' )
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... translate from input to internals of PWscf, various checks
|
|
|
|
!
|
2005-11-02 23:42:06 +08:00
|
|
|
if (input_dft /='none') call enforce_input_dft (input_dft)
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( tefield .AND. ( .NOT. nosym ) ) THEN
|
|
|
|
nosym = .TRUE.
|
2003-12-10 22:57:07 +08:00
|
|
|
WRITE( stdout, &
|
|
|
|
'(5x,"Presently no symmetry can be used with electric field",/)' )
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( tefield .AND. tstress ) THEN
|
2003-10-17 00:30:12 +08:00
|
|
|
tstress = .FALSE.
|
2003-12-10 22:57:07 +08:00
|
|
|
WRITE( stdout, &
|
|
|
|
'(5x,"Presently stress not available with electric field",/)' )
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2005-03-24 01:20:26 +08:00
|
|
|
IF ( tefield .AND. ( nspin > 2 ) ) THEN
|
2004-02-18 22:28:27 +08:00
|
|
|
CALL errore( 'iosys', 'LSDA not available with electric field' , 1 )
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
2003-09-02 17:16:09 +08:00
|
|
|
twfcollect = wf_collect
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... Set Values for electron and bands
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
tfixed_occ = .FALSE.
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( occupations ) )
|
|
|
|
CASE( 'fixed' )
|
|
|
|
!
|
|
|
|
ngauss = 0
|
|
|
|
ltetra = .FALSE.
|
|
|
|
IF ( degauss /= 0.D0 ) THEN
|
|
|
|
CALL errore( ' iosys ', &
|
|
|
|
& ' fixed occupations, gauss. broadening ignored', -1 )
|
|
|
|
degauss = 0.D0
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
CASE( 'smearing' )
|
|
|
|
!
|
|
|
|
ltetra = .FALSE.
|
|
|
|
IF ( degauss == 0.D0 ) THEN
|
|
|
|
CALL errore( ' iosys ', &
|
|
|
|
& ' smearing requires gaussian broadening', 1 )
|
|
|
|
END IF
|
|
|
|
SELECT CASE ( TRIM( smearing ) )
|
|
|
|
CASE ( 'gaussian' , 'gauss' )
|
2003-01-20 05:58:50 +08:00
|
|
|
ngauss = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
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
|
|
|
|
ltetra = .FALSE.
|
|
|
|
tfixed_occ = .TRUE.
|
|
|
|
!
|
|
|
|
CASE DEFAULT
|
|
|
|
!
|
|
|
|
CALL errore( ' iosys ',' occupations ' // TRIM( occupations ) // &
|
|
|
|
& 'not implemented', 1 )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF( nbnd < 1 ) &
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL errore( ' iosys ', ' nbnd less than 1 ', nbnd )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF( nelec < 0 ) &
|
2005-03-17 22:47:46 +08:00
|
|
|
CALL errore( ' iosys ', ' nelec less than 0 ', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF ( nelup < 0 ) &
|
2005-03-17 22:47:46 +08:00
|
|
|
CALL errore( ' iosys ', ' nelup less than 0 ', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF ( neldw < 0 ) &
|
2005-03-17 22:47:46 +08:00
|
|
|
CALL errore( ' iosys ', ' neldw less than 0 ', 1 )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( nspin )
|
|
|
|
CASE( 1 )
|
|
|
|
!
|
|
|
|
IF ( noncolin ) nspin = 4
|
|
|
|
!
|
|
|
|
CASE( 2 )
|
|
|
|
!
|
|
|
|
lsda = .TRUE.
|
|
|
|
IF ( noncolin ) &
|
|
|
|
CALL errore( ' iosys ', &
|
|
|
|
' noncolin .and. nspin==2 are conflicting flags ', 1 )
|
|
|
|
!
|
|
|
|
CASE( 4 )
|
|
|
|
!
|
|
|
|
noncolin = .TRUE.
|
|
|
|
!
|
|
|
|
CASE DEFAULT
|
|
|
|
!
|
|
|
|
CALL errore( ' iosys ', 'wrong input value for nspin ', 1 )
|
|
|
|
!
|
2005-03-24 01:20:26 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
2006-01-01 17:17:24 +08:00
|
|
|
IF ( nelup == 0.D0 .AND. neldw == 0.D0 .AND. &
|
|
|
|
tot_magnetization < 0 .AND. multiplicity == 0) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
two_fermi_energies = .FALSE.
|
|
|
|
!
|
2005-03-17 22:47:46 +08:00
|
|
|
ELSE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
two_fermi_energies = .TRUE.
|
|
|
|
!
|
|
|
|
IF ( .NOT. lsda ) &
|
2005-03-24 01:20:26 +08:00
|
|
|
CALL errore( ' iosys ', ' fixed nelup/neldw requires nspin=2 ', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF ( ABS( nelup + neldw - nelec ) > 1.D-10 ) &
|
2005-03-17 22:47:46 +08:00
|
|
|
CALL errore( ' iosys ', ' nelup + neldw must be equal to nelec ', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
!
|
2005-03-17 22:47:46 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
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
|
|
|
|
!
|
|
|
|
DO nt = 1, ntyp
|
|
|
|
!
|
|
|
|
theta = pi * angle1(nt) / 180.D0
|
|
|
|
phi = pi * angle2(nt) / 180.D0
|
|
|
|
!
|
|
|
|
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
|
|
|
|
!
|
|
|
|
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 = pi * angle1(nt) / 180.D0
|
|
|
|
!
|
|
|
|
mcons(3,nt) = cos(theta)
|
|
|
|
!
|
|
|
|
END DO
|
|
|
|
!
|
|
|
|
CASE DEFAULT
|
|
|
|
!
|
|
|
|
CALL errore( 'iosys',' constrained magnetization ' // &
|
|
|
|
& TRIM( constrained_magnetization ) // 'not implemented', 1 )
|
|
|
|
!
|
2005-03-24 01:20:26 +08:00
|
|
|
END SELECT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
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 )
|
|
|
|
!
|
2005-03-24 01:20:26 +08:00
|
|
|
END IF
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
! ... starting_magnetization(ia) = sm_not_set means "not set" -- set it to 0
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2003-12-02 22:28:22 +08:00
|
|
|
DO ia = 1, ntyp
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
IF ( starting_magnetization(ia) == sm_not_set ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
starting_magnetization(ia) = 0.D0
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END DO
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
IF ( ecutrho <= 0.D0 ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
dual = 4.D0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
dual = ecutrho / ecutwfc
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF ( dual <= 1.D0 ) &
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL errore( ' iosys ', ' invalid dual? ', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( restart_mode ) )
|
|
|
|
CASE( 'from_scratch' )
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
restart = .FALSE.
|
2003-01-20 05:58:50 +08:00
|
|
|
startingconfig = 'input'
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'restart' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
IF ( calculation == 'neb' .OR. calculation == 'smd' ) THEN
|
2005-06-28 23:50:30 +08:00
|
|
|
!
|
|
|
|
! ... "path" specific
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-27 14:43:44 +08:00
|
|
|
restart = .FALSE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-27 14:43:44 +08:00
|
|
|
restart = .TRUE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( TRIM( ion_positions ) == 'from_input' ) THEN
|
2005-06-28 23:50:30 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
startingconfig = 'input'
|
2005-06-28 23:50:30 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
ELSE
|
2005-06-28 23:50:30 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
startingconfig = 'file'
|
2005-06-28 23:50:30 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( ' iosys ', &
|
|
|
|
& ' unknown restart_mode ' // TRIM( restart_mode ), 1 )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( disk_io ) )
|
|
|
|
CASE( 'high' )
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
reduce_io = .FALSE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
reduce_io = .TRUE.
|
|
|
|
restart = .FALSE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
Hubbard_U(:) = Hubbard_U(:) / rytoev
|
|
|
|
Hubbard_alpha(:)= Hubbard_alpha(:) / rytoev
|
|
|
|
!
|
2004-01-23 17:50:00 +08:00
|
|
|
ethr = diago_thr_init
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( phase_space ) )
|
|
|
|
CASE( 'full' )
|
|
|
|
!
|
|
|
|
lcoarsegrained = .FALSE.
|
|
|
|
!
|
|
|
|
CASE ( 'coarse-grained' )
|
|
|
|
!
|
|
|
|
lcoarsegrained = .TRUE.
|
|
|
|
!
|
|
|
|
END SELECT
|
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
! ... various initializations of control variables
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
|
|
|
lscf = .FALSE.
|
|
|
|
lmd = .FALSE.
|
2005-09-17 10:14:39 +08:00
|
|
|
lmetadyn = .FALSE.
|
2004-08-18 23:53:01 +08:00
|
|
|
lpath = .FALSE.
|
|
|
|
lneb = .FALSE.
|
|
|
|
lsmd = .FALSE.
|
2004-03-12 18:51:49 +08:00
|
|
|
lmovecell = .FALSE.
|
2004-05-25 22:22:43 +08:00
|
|
|
lphonon = .FALSE.
|
2006-03-21 06:44:35 +08:00
|
|
|
lbands = .FALSE.
|
2004-11-19 18:49:00 +08:00
|
|
|
lbfgs = .FALSE.
|
|
|
|
ldamped = .FALSE.
|
|
|
|
lforce = tprnfor
|
|
|
|
calc = ' '
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( calculation ) )
|
|
|
|
CASE( 'scf' )
|
|
|
|
!
|
|
|
|
lscf = .TRUE.
|
|
|
|
nstep = 1
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'nscf' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
lforce = .FALSE.
|
|
|
|
nstep = 1
|
|
|
|
!
|
2006-03-21 06:44:35 +08:00
|
|
|
CASE( 'bands' )
|
|
|
|
!
|
|
|
|
lforce = .FALSE.
|
|
|
|
lbands = .TRUE.
|
|
|
|
nstep = 1
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'phonon' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
lforce = .FALSE.
|
|
|
|
lphonon = .TRUE.
|
|
|
|
!
|
|
|
|
nstep = 1
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'relax' )
|
2004-11-19 18:49:00 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
lscf = .TRUE.
|
|
|
|
lforce = .TRUE.
|
|
|
|
!
|
|
|
|
epse = etot_conv_thr
|
|
|
|
epsf = forc_conv_thr
|
|
|
|
!
|
|
|
|
SELECT CASE( TRIM( ion_dynamics ) )
|
|
|
|
CASE( 'bfgs' )
|
2004-11-19 18:49:00 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
lbfgs = .TRUE.
|
2004-11-19 18:49:00 +08:00
|
|
|
!
|
|
|
|
IF ( epse <= 20.D0 * ( tr2 / upscale ) ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ', 'required etot_conv_thr is too small:' // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ' conv_thr must be reduced', 1 )
|
|
|
|
!
|
|
|
|
CASE ( 'damp' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
lmd = .TRUE.
|
|
|
|
ldamped = .TRUE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
ntcheck = nstep + 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'md' )
|
|
|
|
!
|
|
|
|
lscf = .TRUE.
|
|
|
|
lmd = .TRUE.
|
|
|
|
lforce = .TRUE.
|
|
|
|
!
|
|
|
|
SELECT CASE( TRIM( ion_dynamics ) )
|
|
|
|
CASE( 'verlet' )
|
|
|
|
!
|
|
|
|
CONTINUE
|
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
|
|
|
END SELECT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'vc-relax' )
|
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
lscf = .TRUE.
|
|
|
|
lmd = .TRUE.
|
|
|
|
lmovecell = .TRUE.
|
|
|
|
lforce = .TRUE.
|
|
|
|
ldamped = .TRUE.
|
|
|
|
!
|
2006-01-25 21:33:56 +08:00
|
|
|
epse = etot_conv_thr
|
|
|
|
epsf = forc_conv_thr
|
|
|
|
epsp = press_conv_thr
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
SELECT CASE( TRIM( cell_dynamics ) )
|
|
|
|
CASE( 'none' )
|
2004-11-19 18:49:00 +08:00
|
|
|
!
|
|
|
|
calc = 'mm'
|
|
|
|
ntcheck = nstep + 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'damp-pr' )
|
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
calc = 'cm'
|
|
|
|
ntcheck = nstep + 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'damp-w' )
|
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
calc = 'nm'
|
|
|
|
ntcheck = nstep + 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ': cell_dynamics=' // TRIM( cell_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF ( TRIM( ion_dynamics ) /= 'damp' ) &
|
2004-11-19 18:49:00 +08:00
|
|
|
CALL errore( ' iosys ', 'calculation=' // TRIM( calculation ) // &
|
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'vc-md' )
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
lscf = .TRUE.
|
2003-12-10 22:57:07 +08:00
|
|
|
lmd = .TRUE.
|
2003-10-17 00:30:12 +08:00
|
|
|
lmovecell = .TRUE.
|
|
|
|
lforce = .TRUE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
ntcheck = nstep + 1
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( cell_dynamics ) )
|
|
|
|
CASE( 'none' )
|
|
|
|
!
|
|
|
|
calc = 'md'
|
|
|
|
!
|
|
|
|
CASE( 'pr' )
|
|
|
|
!
|
|
|
|
calc = 'cd'
|
|
|
|
!
|
|
|
|
CASE( 'w' )
|
|
|
|
!
|
|
|
|
calc = 'nd'
|
2004-11-19 18:49:00 +08:00
|
|
|
!
|
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-11-19 18:49:00 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF ( TRIM( ion_dynamics ) /= 'beeman' ) &
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2004-11-19 18:49:00 +08:00
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'neb' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
lscf = .TRUE.
|
|
|
|
lpath = .TRUE.
|
|
|
|
lneb = .TRUE.
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'smd' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
lscf = .TRUE.
|
|
|
|
lpath = .TRUE.
|
|
|
|
lsmd = .TRUE.
|
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CASE( 'metadyn' )
|
|
|
|
!
|
|
|
|
lscf = .TRUE.
|
|
|
|
lmetadyn = .TRUE.
|
|
|
|
lcoarsegrained = .TRUE.
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', ' calculation ' // &
|
2003-12-10 22:57:07 +08:00
|
|
|
& TRIM( calculation ) // ' not implemented', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
IF ( startingpot /= 'atomic' .AND. startingpot /= 'file' ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-08-31 00:27:58 +08:00
|
|
|
CALL infomsg( 'iosys', 'wrong startingpot: use default', -1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( lscf ) startingpot = 'atomic'
|
|
|
|
IF ( .NOT. lscf ) startingpot = 'file'
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
|
|
|
IF ( .NOT. lscf .AND. startingpot /= 'file' ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2006-03-23 02:58:38 +08:00
|
|
|
CALL infomsg( 'iosys', 'wrong startingpot: use default', -2 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
startingpot = 'file'
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF ( startingwfc /= 'atomic' .AND. &
|
|
|
|
startingwfc /= 'random' .AND. &
|
2003-10-17 00:30:12 +08:00
|
|
|
startingwfc /= 'file' ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-08-31 00:27:58 +08:00
|
|
|
CALL infomsg( 'iosys', 'wrong startingwfc: use default', -1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
startingwfc = 'atomic'
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( diagonalization ) )
|
2003-10-17 00:30:12 +08:00
|
|
|
CASE ( 'cg' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
isolve = 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
max_cg_iter = diago_cg_maxiter
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
CASE ( 'diis' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2006-03-03 22:19:17 +08:00
|
|
|
call errore ( ' input',' diis diagonalization disabled', 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
isolve = 2
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
max_cg_iter = diago_cg_maxiter
|
|
|
|
diis_ndim = diago_diis_ndim
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
CASE ( 'david' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
isolve = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
david = diago_david_ndim
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
isolve = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
david = diago_david_ndim
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
tr2 = conv_thr
|
|
|
|
niter = electron_maxstep
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( pot_extrapolation ) )
|
|
|
|
CASE( 'none' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
pot_order = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'atomic' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
pot_order = 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'first_order' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
pot_order = 2
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'second_order' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
pot_order = 3
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
pot_order = 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( wfc_extrapolation ) )
|
|
|
|
CASE( 'none' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
wfc_order = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'first_order' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
wfc_order = 2
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'second_order' )
|
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
wfc_order = 3
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
wfc_order = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-01-10 14:56:14 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
|
|
|
IF ( wfc_order > 0 .AND. noncolin ) THEN
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ', &
|
|
|
|
& 'wfc extrapolation not implemented in the ' // &
|
2006-02-16 21:38:28 +08:00
|
|
|
& 'noncollinear case', 1 )
|
2005-01-10 14:56:14 +08:00
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
IF ( occupations == 'fixed' .AND. nspin == 2 .AND. lscf ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
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 )
|
|
|
|
!
|
2005-03-17 22:47:46 +08:00
|
|
|
ELSE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', &
|
|
|
|
& 'fixed occupations and lsda need nelup and neldw ', 1 )
|
|
|
|
!
|
2005-03-17 22:47:46 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END IF
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
IF ( lcoarsegrained ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2006-01-29 06:35:48 +08:00
|
|
|
lmd = .TRUE.
|
2004-03-15 08:08:26 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
SELECT CASE( TRIM( ion_dynamics ) )
|
2006-01-29 06:35:48 +08:00
|
|
|
CASE( 'verlet' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
CONTINUE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2006-01-29 06:35:48 +08:00
|
|
|
CASE( 'damp' )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-17 10:14:39 +08:00
|
|
|
ldamped = .TRUE.
|
|
|
|
!
|
|
|
|
epse = etot_conv_thr
|
|
|
|
epsf = forc_conv_thr
|
|
|
|
!
|
|
|
|
CASE DEFAULT
|
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
|
|
|
& ': ion_dynamics=' // TRIM( ion_dynamics ) // &
|
|
|
|
& ' not supported', 1 )
|
|
|
|
!
|
|
|
|
END SELECT
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
! ... "path" specific initialization of control variables
|
|
|
|
!
|
|
|
|
IF ( lpath ) THEN
|
|
|
|
!
|
|
|
|
nstep_path = nstep
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF ( num_of_images < 2 ) &
|
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
|
|
|
& ': num_of_images must be at least 2', 1 )
|
|
|
|
!
|
2006-03-02 03:57:03 +08:00
|
|
|
IF ( ( CI_scheme /= "no-CI" ) .AND. &
|
|
|
|
( CI_scheme /= "auto" ) .AND. &
|
|
|
|
( CI_scheme /= "manual" ) ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ', 'calculation=' // TRIM( calculation ) // &
|
2003-12-10 22:57:07 +08:00
|
|
|
& ': unknown CI_scheme', 1 )
|
|
|
|
!
|
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-03-15 17:43:02 +08:00
|
|
|
! ... initialization of logical variables
|
2004-02-26 19:50:36 +08:00
|
|
|
!
|
|
|
|
lsteep_des = .FALSE.
|
|
|
|
lquick_min = .FALSE.
|
2005-02-25 22:51:41 +08:00
|
|
|
lbroyden = .FALSE.
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( opt_scheme )
|
2004-10-13 16:18:15 +08:00
|
|
|
CASE( "sd" )
|
|
|
|
!
|
|
|
|
lsteep_des = .TRUE.
|
|
|
|
!
|
|
|
|
CASE( "quick-min" )
|
|
|
|
!
|
|
|
|
lquick_min = .TRUE.
|
|
|
|
!
|
2005-02-25 22:51:41 +08:00
|
|
|
CASE( "broyden" )
|
|
|
|
!
|
|
|
|
lbroyden = .TRUE.
|
|
|
|
!
|
2004-10-13 16:18:15 +08:00
|
|
|
CASE( "langevin" )
|
|
|
|
!
|
|
|
|
llangevin = .TRUE.
|
|
|
|
!
|
|
|
|
IF ( lneb ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ','calculation=' // TRIM( calculation ) // &
|
|
|
|
& ': langevin dynamics not implemented', 1 )
|
2004-10-13 16:18:15 +08:00
|
|
|
!
|
|
|
|
temp_req = temp_req / ( eV_to_kelvin * au )
|
|
|
|
!
|
|
|
|
IF ( temp_req <= 0.D0 ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ','calculation=' // TRIM( calculation ) // &
|
|
|
|
& ': tepm_req has not been set', 1 )
|
2004-10-13 16:18:15 +08:00
|
|
|
!
|
2005-02-06 19:04:03 +08:00
|
|
|
IF ( use_freezing ) &
|
|
|
|
WRITE( UNIT = stdout, &
|
|
|
|
FMT = '(5X,"warning: freezing cannot be used in langevin")' )
|
|
|
|
!
|
2004-10-13 16:18:15 +08:00
|
|
|
IF ( use_multistep ) &
|
|
|
|
WRITE( UNIT = stdout, &
|
|
|
|
FMT = '(5X,"warning: multistep cannot be used in langevin")' )
|
|
|
|
!
|
2005-02-06 19:04:03 +08:00
|
|
|
use_freezing = .FALSE.
|
2004-10-13 16:18:15 +08:00
|
|
|
use_multistep = .FALSE.
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CASE default
|
2004-10-13 16:18:15 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ','calculation=' // TRIM( calculation ) // &
|
2004-10-13 16:18:15 +08:00
|
|
|
& ': unknown opt_scheme', 1 )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( ion_temperature ) )
|
|
|
|
CASE( 'not_controlled' )
|
2005-04-21 02:46:24 +08:00
|
|
|
!
|
|
|
|
lrescale_t = .FALSE.
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'rescaling' )
|
2005-04-21 02:46:24 +08:00
|
|
|
!
|
2006-03-11 06:31:18 +08:00
|
|
|
lrescale_t = .TRUE.
|
|
|
|
langevin_rescaling = .FALSE.
|
|
|
|
temperature = tempw
|
|
|
|
tolp_ = tolp
|
|
|
|
!
|
|
|
|
CASE( 'langevin' )
|
|
|
|
!
|
|
|
|
lrescale_t = .TRUE.
|
|
|
|
langevin_rescaling = .TRUE.
|
|
|
|
temperature = tempw
|
|
|
|
tolp_ = tolp
|
2005-04-21 02:46:24 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-04-21 02:46:24 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( ' iosys ', 'unknown ion_temperature ' // &
|
2003-12-10 22:57:07 +08:00
|
|
|
& TRIM( ion_temperature ), 1 )
|
2005-04-21 02:46:24 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( mixing_mode ) )
|
|
|
|
CASE( 'plain' )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
imix = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'TF' )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
imix = 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'local-TF' )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
imix = 2
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CASE( 'potential' )
|
|
|
|
!
|
2005-05-31 21:15:38 +08:00
|
|
|
CALL errore( 'iosys ', 'potential mixing no longer implemented', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
CALL errore( 'iosys ', 'unknown mixing ' // TRIM( mixing_mode ), 1 )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-31 21:15:38 +08:00
|
|
|
starting_scf_threshold = tr2
|
2003-01-20 05:58:50 +08:00
|
|
|
nmix = mixing_ndim
|
|
|
|
niter_with_fixed_ns = mixing_fixed_ns
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
SELECT CASE( TRIM( verbosity ) )
|
|
|
|
CASE( 'high' )
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
iverbosity = 1
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
CASE DEFAULT
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
iverbosity = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
END SELECT
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2006-02-01 01:22:28 +08:00
|
|
|
tmp_dir = trimcheck ( outdir )
|
2003-10-17 00:30:12 +08:00
|
|
|
lstres = ( tstress .AND. lscf )
|
|
|
|
!
|
2004-12-17 00:58:48 +08:00
|
|
|
IF ( lberry .AND. npool > 1 ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ', 'Berry Phase not implemented with pools ', 1 )
|
|
|
|
!
|
2004-12-17 00:58:48 +08:00
|
|
|
IF ( lberry .AND. nproc_pool > 1 .AND. gdir /= 3 ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ', 'Berry Phase in parallel only for gdir=3', 1 )
|
2004-03-13 00:30:12 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... Copy values from input module to PW internals
|
|
|
|
!
|
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
2003-07-31 21:24:20 +08:00
|
|
|
nppstr_ = nppstr
|
|
|
|
gdir_ = gdir
|
|
|
|
lberry_ = lberry
|
2005-08-16 20:04:34 +08:00
|
|
|
lelfield_ = lelfield
|
|
|
|
efield_ = efield
|
2005-10-26 07:17:05 +08:00
|
|
|
nberrycyc_ = nberrycyc
|
2005-11-30 23:49:59 +08:00
|
|
|
tqr_ = tqr
|
2006-01-25 21:33:56 +08:00
|
|
|
!
|
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
2003-07-31 21:24:20 +08:00
|
|
|
title_ = title
|
|
|
|
dt_ = dt
|
|
|
|
tefield_ = tefield
|
|
|
|
dipfield_ = dipfield
|
2003-10-17 00:30:12 +08:00
|
|
|
prefix_ = TRIM( prefix )
|
|
|
|
pseudo_dir_ = TRIM( pseudo_dir )
|
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
2003-07-31 21:24:20 +08:00
|
|
|
nstep_ = nstep
|
|
|
|
iprint_ = iprint
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
|
|
|
celldm_ = celldm
|
|
|
|
ibrav_ = ibrav
|
|
|
|
nat_ = nat
|
|
|
|
ntyp_ = ntyp
|
2003-10-17 00:30:12 +08:00
|
|
|
edir_ = edir
|
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
2003-07-31 21:24:20 +08:00
|
|
|
emaxpos_ = emaxpos
|
2003-10-17 00:30:12 +08:00
|
|
|
eopreg_ = eopreg
|
|
|
|
eamp_ = eamp
|
|
|
|
nr1_ = nr1
|
|
|
|
nr2_ = nr2
|
|
|
|
nr3_ = nr3
|
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
2003-07-31 21:24:20 +08:00
|
|
|
ecutwfc_ = ecutwfc
|
|
|
|
ecfixed_ = ecfixed
|
2004-05-08 01:21:24 +08:00
|
|
|
qcutz_ = qcutz
|
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
2003-07-31 21:24:20 +08:00
|
|
|
q2sigma_ = q2sigma
|
2003-10-17 00:30:12 +08:00
|
|
|
nr1s_ = nr1s
|
|
|
|
nr2s_ = nr2s
|
|
|
|
nr3s_ = nr3s
|
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
2003-07-31 21:24:20 +08:00
|
|
|
degauss_ = degauss
|
2003-10-17 00:30:12 +08:00
|
|
|
nelec_ = nelec
|
2005-03-17 22:47:46 +08:00
|
|
|
nelup_ = nelup
|
|
|
|
neldw_ = neldw
|
2006-01-01 17:17:24 +08:00
|
|
|
tot_charge_ = tot_charge
|
|
|
|
tot_magnetization_ = tot_magnetization
|
|
|
|
multiplicity_ = multiplicity
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2004-05-10 18:37:31 +08:00
|
|
|
lspinorb_ = lspinorb
|
2003-10-30 21:56:34 +08:00
|
|
|
noncolin_ = noncolin
|
2003-12-10 22:57:07 +08:00
|
|
|
angle1_ = angle1
|
|
|
|
angle2_ = angle2
|
|
|
|
report_ = report
|
|
|
|
lambda_ = lambda
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2005-09-20 23:17:18 +08:00
|
|
|
Hubbard_U_(1:ntyp) = hubbard_u(1:ntyp)
|
|
|
|
Hubbard_alpha_(1:ntyp) = hubbard_alpha(1:ntyp)
|
|
|
|
lda_plus_u_ = lda_plus_u
|
2005-12-28 18:49:03 +08:00
|
|
|
la2F_ = la2F
|
2005-09-20 23:17:18 +08:00
|
|
|
nspin_ = nspin
|
|
|
|
starting_magnetization_ = starting_magnetization
|
|
|
|
starting_ns = starting_ns_eigenvalue
|
|
|
|
U_projection = U_projection_type
|
|
|
|
nosym_ = nosym
|
2005-12-19 21:00:38 +08:00
|
|
|
nbnd_ = nbnd
|
2005-09-20 23:17:18 +08:00
|
|
|
!
|
2005-06-27 21:11:33 +08:00
|
|
|
#if defined (EXX)
|
|
|
|
!
|
2006-02-08 23:46:21 +08:00
|
|
|
x_gamma_extrapolation_ = x_gamma_extrapolation
|
2005-06-27 21:11:33 +08:00
|
|
|
nqx1_ = nqx1
|
|
|
|
nqx2_ = nqx2
|
|
|
|
nqx3_ = nqx3
|
2005-09-20 23:17:18 +08:00
|
|
|
!
|
2005-06-27 21:11:33 +08:00
|
|
|
#endif
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
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
2003-07-31 21:24:20 +08:00
|
|
|
startingwfc_ = startingwfc
|
|
|
|
startingpot_ = startingpot
|
|
|
|
mixing_beta_ = mixing_beta
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
upscale_ = upscale
|
2004-11-27 00:49:02 +08:00
|
|
|
delta_t_ = delta_t
|
|
|
|
nraise_ = nraise
|
2006-03-28 05:40:10 +08:00
|
|
|
refold_pos_ = refold_pos
|
2003-10-17 00:30:12 +08:00
|
|
|
press_ = press
|
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
2003-07-31 21:24:20 +08:00
|
|
|
cell_factor_ = cell_factor
|
2003-10-17 00:30:12 +08:00
|
|
|
modenum_ = modenum
|
|
|
|
xqq_ = xqq
|
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
! ... general "path" variables
|
|
|
|
!
|
2004-11-03 17:53:12 +08:00
|
|
|
ds_ = ds
|
2004-08-18 23:53:01 +08:00
|
|
|
num_of_images_ = num_of_images
|
|
|
|
first_last_opt_ = first_last_opt
|
2005-04-26 07:58:26 +08:00
|
|
|
use_masses_ = use_masses
|
2004-09-15 20:35:54 +08:00
|
|
|
write_save_ = write_save
|
2005-05-27 06:42:05 +08:00
|
|
|
free_energy_ = free_energy
|
2005-04-17 01:07:39 +08:00
|
|
|
use_fourier_ = use_fourier
|
2005-02-06 19:04:03 +08:00
|
|
|
use_freezing_ = use_freezing
|
2004-08-18 23:53:01 +08:00
|
|
|
temp_req_ = temp_req
|
2005-05-27 06:42:05 +08:00
|
|
|
path_thr_ = path_thr
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
! ... NEB specific
|
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
CI_scheme_ = CI_scheme
|
|
|
|
k_max_ = k_max
|
|
|
|
k_min_ = k_min
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
! ... SMD specific
|
2004-10-13 16:18:15 +08:00
|
|
|
!
|
2004-11-03 17:53:12 +08:00
|
|
|
init_num_of_images_ = init_num_of_images
|
|
|
|
use_multistep_ = use_multistep
|
2005-05-27 06:42:05 +08:00
|
|
|
fixed_tan_ = fixed_tan
|
2004-10-13 16:18:15 +08:00
|
|
|
!
|
2005-04-21 07:43:15 +08:00
|
|
|
! ... BFGS specific
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-04-21 07:43:15 +08:00
|
|
|
bfgs_ndim_ = bfgs_ndim
|
2003-12-10 22:57:07 +08:00
|
|
|
trust_radius_max_ = trust_radius_max
|
|
|
|
trust_radius_min_ = trust_radius_min
|
|
|
|
trust_radius_ini_ = trust_radius_ini
|
|
|
|
w_1_ = w_1
|
2005-10-20 23:22:12 +08:00
|
|
|
w_2_ = w_2
|
2005-09-20 23:17:18 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... read following cards
|
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
ALLOCATE( ityp( nat_ ) )
|
2005-05-27 06:42:05 +08:00
|
|
|
ALLOCATE( tau( 3, nat_ ) )
|
2006-03-29 03:43:35 +08:00
|
|
|
ALLOCATE( force( 3, nat_ ) )
|
2004-03-12 18:51:49 +08:00
|
|
|
ALLOCATE( if_pos( 3, nat_ ) )
|
2006-03-29 03:43:35 +08:00
|
|
|
IF ( tfixed_occ ) THEN
|
|
|
|
IF ( nspin_ == 4 ) THEN
|
|
|
|
ALLOCATE( f_inp( nbnd_, 1 ) )
|
|
|
|
ELSE
|
|
|
|
ALLOCATE( f_inp( nbnd_, nspin_ ) )
|
|
|
|
END IF
|
|
|
|
END IF
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
IF ( tefield ) ALLOCATE( forcefield( 3, nat_ ) )
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
CALL read_cards( psfile, atomic_positions )
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
! ... set up atomic positions and crystal lattice
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
IF ( celldm_(1) == 0.D0 .AND. a /= 0.D0 ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
IF ( ibrav_ == 0 ) ibrav = 14
|
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
celldm_(1) = a / bohr_radius_angs
|
|
|
|
celldm_(2) = b / a
|
|
|
|
celldm_(3) = c / a
|
|
|
|
celldm_(4) = cosab
|
|
|
|
celldm_(5) = cosac
|
2005-05-27 06:42:05 +08:00
|
|
|
celldm_(6) = cosbc
|
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
ELSE IF ( celldm_(1) /= 0.D0 .AND. a /= 0.D0 ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
CALL errore( 'input', ' do not specify both celldm and a,b,c!', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
END IF
|
|
|
|
!
|
2005-12-02 22:51:57 +08:00
|
|
|
! ... generate at (in atomic units) from ibrav and celldm
|
|
|
|
!
|
|
|
|
CALL latgen( ibrav_, celldm_, at(1,1), at(1,2), at(1,3), omega )
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
2005-12-18 01:40:37 +08:00
|
|
|
! ... define alat
|
|
|
|
!
|
|
|
|
alat = celldm_(1)
|
|
|
|
!
|
|
|
|
! ... convert at to unit of alat
|
|
|
|
!
|
|
|
|
at = at / alat
|
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
2003-07-31 21:24:20 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
! ... Generate the reciprocal lattice vectors
|
|
|
|
!
|
|
|
|
CALL recips( at(1,1), at(1,2), at(1,3), bg(1,1), bg(1,2), bg(1,3) )
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
IF ( full_phs_path_flag ) THEN
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
! ... "path" optimizations specific
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
DO image = 1, num_of_images_
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
tau = RESHAPE( pos(1:3*nat_,image), (/ 3 , nat_ /) )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
! ... convert input atomic positions to internally used format:
|
|
|
|
! ... tau in a0 units
|
|
|
|
!
|
|
|
|
SELECT CASE( atomic_positions )
|
|
|
|
CASE( 'alat' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are divided by a0: do nothing
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'bohr' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are in a.u.: divide by alat
|
|
|
|
!
|
|
|
|
tau = tau / alat
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'crystal' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are in crystal axis
|
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
CALL cryst_to_cart( nat_, tau, at, 1 )
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'angstrom' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... atomic positions in A: convert to a.u. and divide by alat
|
|
|
|
!
|
|
|
|
tau = tau / bohr_radius_angs / alat
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CASE DEFAULT
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ','atomic_positions=' // &
|
2003-12-10 22:57:07 +08:00
|
|
|
& TRIM( atomic_positions ) // ' not implemented ', 1 )
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END SELECT
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
pos(1:3*nat_,image) = RESHAPE( tau, (/ 3 * nat_ /) )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
END DO
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
ELSE
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
! ... convert input atomic positions to internally used format:
|
|
|
|
! ... tau in a0 units
|
|
|
|
!
|
|
|
|
SELECT CASE( atomic_positions )
|
|
|
|
CASE( 'alat' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are divided by a0: do nothing
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'bohr' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are in a.u.: divide by alat
|
|
|
|
!
|
|
|
|
tau = tau / alat
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'crystal' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input atomic positions are in crystal axis
|
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
CALL cryst_to_cart( nat_, tau, at, 1 )
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CASE( 'angstrom' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... atomic positions in A: convert to a.u. and divide by alat
|
|
|
|
!
|
|
|
|
tau = tau / bohr_radius_angs / alat
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CASE DEFAULT
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'iosys ','atomic_positions=' // &
|
2003-12-10 22:57:07 +08:00
|
|
|
& TRIM( atomic_positions ) // ' not implemented ', 1 )
|
2004-08-18 23:53:01 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END SELECT
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-08-25 16:23:30 +08:00
|
|
|
END IF
|
|
|
|
!
|
2005-09-28 00:34:11 +08:00
|
|
|
! ... Renata's dynamics uses masses in atomic units
|
|
|
|
!
|
|
|
|
IF ( calc /= ' ' ) amass = amass * amconv
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... set default value of wmass
|
2003-01-29 22:29:11 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( wmass == 0.D0 ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( calc == 'nd' .OR. calc == 'nm' ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
wmass = SUM( amass(ityp(:)) )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
wmass = 0.75D0 * wmass / pi / pi / omega**( 2.D0 / 3.D0 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( calc == 'cd' .OR. calc == 'cm' ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
wmass = SUM( amass(ityp(:)) )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
wmass = 0.75D0 * wmass / pi / pi
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2005-09-28 00:40:57 +08:00
|
|
|
cmass = wmass
|
|
|
|
!
|
|
|
|
ELSE
|
|
|
|
!
|
|
|
|
cmass = wmass * amconv
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
2003-01-29 22:29:11 +08:00
|
|
|
!
|
2005-09-28 00:34:11 +08:00
|
|
|
! ... unit conversion for pressure
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
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
2003-07-31 21:24:20 +08:00
|
|
|
press_ = press_ / uakbar
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... read pseudopotentials
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL readpp()
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
! ... In the case of variable cell dynamics save old cell variables
|
|
|
|
! ... and initialize a few other variables
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( lmovecell ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
at_old = at
|
2003-01-20 05:58:50 +08:00
|
|
|
omega_old = omega
|
2003-10-17 00:30:12 +08:00
|
|
|
lstres = .TRUE.
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( cell_factor_ <= 0.D0 ) cell_factor_ = 1.2D0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( cmass <= 0.D0 ) &
|
2004-05-08 01:21:24 +08:00
|
|
|
CALL errore( 'readin', &
|
2003-12-10 22:57:07 +08:00
|
|
|
& 'vcsmd: a positive value for cell mass is required', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
cell_factor_ = 1.D0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
2006-01-29 06:35:48 +08:00
|
|
|
! ... variables for constrained dynamics are set here
|
|
|
|
!
|
|
|
|
lconstrain = ( nconstr_inp > 0 )
|
2005-10-16 07:27:47 +08:00
|
|
|
!
|
2006-01-29 06:35:48 +08:00
|
|
|
IF ( lconstrain ) CALL init_constraint( nat, tau, ityp, alat )
|
2005-10-16 07:27:47 +08:00
|
|
|
!
|
2005-10-20 23:22:12 +08:00
|
|
|
! ... set variables for metadynamics
|
|
|
|
!
|
2005-12-07 12:22:30 +08:00
|
|
|
IF ( lcoarsegrained ) CALL init_metadyn_vars()
|
2005-10-20 23:22:12 +08:00
|
|
|
!
|
2005-12-18 01:40:37 +08:00
|
|
|
CALL verify_tmpdir( tmp_dir )
|
2005-10-19 08:54:48 +08:00
|
|
|
!
|
2005-12-18 01:40:37 +08:00
|
|
|
IF ( .NOT. TRIM( wfcdir ) == 'undefined' ) THEN
|
|
|
|
!
|
2006-02-01 01:22:28 +08:00
|
|
|
wfc_dir = trimcheck ( wfcdir )
|
2005-10-19 08:54:48 +08:00
|
|
|
!
|
2005-12-18 01:40:37 +08:00
|
|
|
CALL verify_tmpdir( wfc_dir )
|
2005-10-19 08:54:48 +08:00
|
|
|
!
|
|
|
|
ENDIF
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
CALL restart_from_file()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( startingconfig == 'file' ) CALL read_config_from_file()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
! ... Files
|
|
|
|
!
|
|
|
|
input_drho = ' '
|
|
|
|
output_drho = ' '
|
|
|
|
crystal = ' '
|
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE iosys
|
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
!----------------------------------------------------------------------------
|
2003-12-10 22:57:07 +08:00
|
|
|
SUBROUTINE read_cards( psfile, atomic_positions_ )
|
2005-10-16 07:27:47 +08:00
|
|
|
!----------------------------------------------------------------------------
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
USE input_parameters, ONLY : atom_label, atom_pfile, atom_mass, taspc, &
|
|
|
|
tapos, rd_pos, atomic_positions, if_pos, &
|
|
|
|
sp_pos, k_points, xk, wk, nk1, nk2, nk3, &
|
|
|
|
k1, k2, k3, nkstot, cell_symmetry, rd_ht, &
|
|
|
|
trd_ht, f_inp, calculation
|
2004-02-26 23:24:50 +08:00
|
|
|
USE wvfct, ONLY : gamma_only
|
2004-04-02 17:45:55 +08:00
|
|
|
USE cell_base, ONLY : at, ibrav, symm_type, celldm
|
2004-06-12 21:44:18 +08:00
|
|
|
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, atm
|
2004-02-26 23:24:50 +08:00
|
|
|
USE klist, ONLY : nks
|
|
|
|
USE ktetra, ONLY : nk1_ => nk1, &
|
|
|
|
nk2_ => nk2, &
|
|
|
|
nk3_ => nk3, &
|
|
|
|
k1_ => k1, &
|
|
|
|
k2_ => k2, &
|
|
|
|
k3_ => k3
|
|
|
|
USE klist, ONLY : lxkcry, &
|
|
|
|
xk_ => xk, &
|
|
|
|
wk_ => wk
|
|
|
|
USE fixed_occ, ONLY : tfixed_occ, &
|
|
|
|
f_inp_ => f_inp
|
2004-06-12 00:53:16 +08:00
|
|
|
USE ions_base, ONLY : fixatom, &
|
2004-02-26 23:24:50 +08:00
|
|
|
if_pos_ => if_pos
|
2006-01-14 01:25:42 +08:00
|
|
|
USE ions_base, ONLY : amass
|
2005-04-29 07:30:51 +08:00
|
|
|
USE control_flags, ONLY : lfixatom
|
2004-02-26 23:24:50 +08:00
|
|
|
USE read_cards_module, ONLY : read_cards_base => read_cards
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
2004-10-26 17:32:48 +08:00
|
|
|
CHARACTER (LEN=256) :: psfile(ntyp)
|
2005-04-26 07:58:26 +08:00
|
|
|
CHARACTER (LEN=30) :: atomic_positions_
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
LOGICAL :: tcell = .FALSE.
|
|
|
|
INTEGER :: i, is, ns, ia, ik
|
|
|
|
!
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
amass = 0
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
CALL read_cards_base( 'PW' )
|
|
|
|
!
|
|
|
|
IF ( .NOT. taspc ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'cards ', 'atomic species info missing', 1 )
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( .NOT. tapos ) &
|
2005-05-27 06:42:05 +08:00
|
|
|
CALL errore( 'cards ', 'atomic position info missing', 1 )
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
DO is = 1, ntyp
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
amass(is) = atom_mass(is)
|
|
|
|
psfile(is) = atom_pfile(is)
|
|
|
|
atm(is) = atom_label(is)
|
|
|
|
!
|
|
|
|
IF ( amass(is) <= 0.D0 ) &
|
|
|
|
CALL errore( ' iosys ', ' invalid mass ', is )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
END DO
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
|
|
|
DO ia = 1, nat
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
tau(:,ia) = rd_pos(:,ia)
|
|
|
|
ityp(ia) = sp_pos(ia)
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
END DO
|
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
! ... calculate fixatom
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
|
|
|
fixatom = 0
|
2004-06-12 00:53:16 +08:00
|
|
|
!
|
|
|
|
IF ( ANY( if_pos(:,1:nat) == 0 ) ) lfixatom = .TRUE.
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
DO ia = 1, nat
|
|
|
|
!
|
|
|
|
IF ( if_pos(1,ia) /= 0 .OR. &
|
|
|
|
if_pos(2,ia) /= 0 .OR. &
|
|
|
|
if_pos(3,ia) /= 0 ) CYCLE
|
|
|
|
!
|
|
|
|
fixatom = fixatom + 1
|
|
|
|
!
|
|
|
|
END DO
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
|
|
|
! ... The constrain on fixed coordinates is implemented using the array
|
|
|
|
! ... if_pos whose value is 0 when the coordinate is to be kept fixed, 1
|
|
|
|
! ... otherwise. fixatom is maintained for compatibility. ( C.S. 15/10/2003 )
|
|
|
|
!
|
|
|
|
if_pos_(:,:) = if_pos(:,1:nat)
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
atomic_positions_ = TRIM( atomic_positions )
|
|
|
|
!
|
|
|
|
IF ( k_points == 'automatic' ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... automatic generation of k-points
|
|
|
|
!
|
|
|
|
gamma_only = .FALSE.
|
|
|
|
lxkcry = .FALSE.
|
|
|
|
nks = 0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
! ... nk1,nk2,nk3 and k1,k2,k3 are initialized even when not used
|
|
|
|
!
|
|
|
|
nk1_ = nk1
|
|
|
|
nk2_ = nk2
|
|
|
|
nk3_ = nk3
|
|
|
|
k1_ = k1
|
|
|
|
k2_ = k2
|
|
|
|
k3_ = k3
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE IF ( k_points == 'tpiba' ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input k-points are in 2pi/a units
|
|
|
|
!
|
|
|
|
gamma_only = .FALSE.
|
|
|
|
lxkcry = .FALSE.
|
|
|
|
nks = nkstot
|
2003-10-17 00:30:12 +08:00
|
|
|
xk_(:,1:nks) = xk(:,1:nks)
|
|
|
|
wk_(1:nks) = wk(1:nks)
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
nk1_ = 0
|
|
|
|
nk2_ = 0
|
|
|
|
nk3_ = 0
|
|
|
|
k1_ = 0
|
|
|
|
k2_ = 0
|
|
|
|
k3_ = 0
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE IF ( k_points == 'crystal' ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... input k-points are in crystal (reciprocal lattice) axis
|
|
|
|
!
|
|
|
|
gamma_only = .FALSE.
|
|
|
|
lxkcry = .TRUE.
|
|
|
|
nks = nkstot
|
2003-10-17 00:30:12 +08:00
|
|
|
xk_(:,1:nks) = xk(:,1:nks)
|
|
|
|
wk_(1:nks) = wk(1:nks)
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
nk1_ = 0
|
|
|
|
nk2_ = 0
|
|
|
|
nk3_ = 0
|
|
|
|
k1_ = 0
|
|
|
|
k2_ = 0
|
|
|
|
k3_ = 0
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE IF ( k_points == 'gamma' ) THEN
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... Only Gamma (k=0) is used
|
|
|
|
! ... specialized routines are used
|
|
|
|
!
|
|
|
|
gamma_only = .TRUE.
|
|
|
|
lxkcry = .FALSE.
|
|
|
|
nks = 1
|
|
|
|
xk_(:,1) = 0.0
|
|
|
|
wk_(1) = 1.0
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
nk1_ = 0
|
|
|
|
nk2_ = 0
|
|
|
|
nk3_ = 0
|
|
|
|
k1_ = 0
|
|
|
|
k2_ = 0
|
|
|
|
k3_ = 0
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
ELSE
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... default: input k-points are in 2pi/a units
|
|
|
|
!
|
|
|
|
gamma_only = .FALSE.
|
|
|
|
lxkcry = .FALSE.
|
|
|
|
nks = nkstot
|
2003-10-17 00:30:12 +08:00
|
|
|
xk_(:,1:nks) = xk(:,1:nks)
|
|
|
|
wk_(1:nks) = wk(1:nks)
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
|
|
|
nk1_ = 0
|
|
|
|
nk2_ = 0
|
|
|
|
nk3_ = 0
|
|
|
|
k1_ = 0
|
|
|
|
k2_ = 0
|
|
|
|
k3_ = 0
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
END IF
|
|
|
|
!
|
|
|
|
IF ( tfixed_occ ) THEN
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IF ( nks > 1 .OR. ( nk1 * nk2 * nk3 ) > 1 ) &
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL errore( 'read_cards', &
|
|
|
|
& 'only one k point with fixed occupations', 1 )
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
f_inp_ = f_inp
|
2005-05-27 06:42:05 +08:00
|
|
|
!
|
2006-03-29 03:43:35 +08:00
|
|
|
DEALLOCATE ( f_inp )
|
|
|
|
!
|
2005-05-27 06:42:05 +08:00
|
|
|
END IF
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
IF ( trd_ht ) THEN
|
2005-04-26 07:58:26 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
symm_type = cell_symmetry
|
|
|
|
at = TRANSPOSE( rd_ht )
|
|
|
|
tcell = .TRUE.
|
2005-04-26 07:58:26 +08:00
|
|
|
!
|
2004-03-12 18:51:49 +08:00
|
|
|
END IF
|
|
|
|
!
|
|
|
|
IF ( ibrav == 0 .AND. .NOT. tcell ) &
|
2006-01-29 06:35:48 +08:00
|
|
|
CALL errore( 'cards', 'ibrav=0: must read cell parameters', 1 )
|
2004-03-12 18:51:49 +08:00
|
|
|
IF ( ibrav /= 0 .AND. tcell ) &
|
2006-01-29 06:35:48 +08:00
|
|
|
CALL errore( 'cards', 'redundant data for cell parameters', 2 )
|
2004-03-12 18:51:49 +08:00
|
|
|
!
|
2005-10-16 07:27:47 +08:00
|
|
|
RETURN
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
END SUBROUTINE read_cards
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
2005-12-18 05:21:54 +08:00
|
|
|
SUBROUTINE verify_tmpdir( tmp_dir )
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
USE input_parameters, ONLY : restart_mode
|
2004-08-18 23:53:01 +08:00
|
|
|
USE control_flags, ONLY : lpath
|
2006-02-02 01:56:16 +08:00
|
|
|
USE io_files, ONLY : prefix, nd_nmbr, delete_if_present
|
2004-08-18 23:53:01 +08:00
|
|
|
USE path_variables, ONLY : num_of_images
|
2005-03-09 21:50:01 +08:00
|
|
|
USE mp_global, ONLY : mpime, nproc
|
2004-03-24 17:36:50 +08:00
|
|
|
USE io_global, ONLY : ionode
|
2003-12-10 22:57:07 +08:00
|
|
|
USE mp, ONLY : mp_barrier
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
2005-10-19 08:54:48 +08:00
|
|
|
CHARACTER(LEN=*), INTENT(INOUT) :: tmp_dir
|
2005-12-18 05:21:54 +08:00
|
|
|
!
|
|
|
|
INTEGER :: l, ios, image, proc
|
2005-08-04 00:58:33 +08:00
|
|
|
CHARACTER (LEN=256) :: file_path, tmp_dir_saved
|
2006-04-03 22:39:29 +08:00
|
|
|
!
|
2006-02-02 01:56:16 +08:00
|
|
|
CHARACTER(LEN=6), EXTERNAL :: int_to_char
|
2006-04-03 22:39:29 +08:00
|
|
|
INTEGER, EXTERNAL :: c_mkdir
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
ios = 0
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
file_path = TRIM( tmp_dir ) // 'pwscf'
|
|
|
|
!
|
|
|
|
OPEN( UNIT = 4, FILE = TRIM( file_path ) // TRIM( int_to_char( mpime ) ), &
|
|
|
|
& STATUS = 'UNKNOWN', FORM = 'UNFORMATTED', IOSTAT = ios )
|
2003-10-17 00:30:12 +08:00
|
|
|
CLOSE( UNIT = 4, STATUS = 'DELETE' )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( ios /= 0 ) CALL errore( 'outdir: ', TRIM( tmp_dir ) // &
|
|
|
|
& ' non existent or non writable', 1 )
|
|
|
|
!
|
|
|
|
! ... if starting from scratch all temporary files are removed
|
|
|
|
! ... from tmp_dir ( only by the master node )
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
file_path = TRIM( tmp_dir ) // TRIM( prefix )
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
IF ( restart_mode == 'from_scratch' ) THEN
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
IF ( ionode ) THEN
|
2006-04-03 22:39:29 +08:00
|
|
|
!
|
|
|
|
! ... save directory is removed
|
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.save' )
|
2004-02-26 19:50:36 +08:00
|
|
|
!
|
2005-12-18 05:21:54 +08:00
|
|
|
! ... extrapolation file is removed
|
2004-02-26 19:50:36 +08:00
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.update' )
|
2004-02-26 19:50:36 +08:00
|
|
|
!
|
|
|
|
! ... MD restart file is removed
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.md' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-10-07 10:37:11 +08:00
|
|
|
! ... BFGS restart file is removed
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.bfgs' )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2006-04-03 22:39:29 +08:00
|
|
|
! ... "path" optimisation specific : in the scratch directory the tree of
|
|
|
|
! ... subdirectories needed by "path" calculations are created
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2004-08-18 23:53:01 +08:00
|
|
|
IF ( lpath ) THEN
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
|
|
|
IF ( ionode ) THEN
|
|
|
|
!
|
|
|
|
! ... files needed by parallelization among images are removed
|
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.BLOCK' )
|
2004-03-29 16:42:37 +08:00
|
|
|
CALL delete_if_present( TRIM( file_path ) // '.newimage' )
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2005-03-02 20:46:52 +08:00
|
|
|
! ... file containing the broyden's history
|
|
|
|
!
|
|
|
|
IF ( restart_mode == 'from_scratch' ) THEN
|
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( tmp_dir ) // &
|
|
|
|
& TRIM( prefix ) // '.broyden' )
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2004-03-24 17:36:50 +08:00
|
|
|
END IF
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
tmp_dir_saved = tmp_dir
|
|
|
|
!
|
|
|
|
DO image = 1, num_of_images
|
|
|
|
!
|
|
|
|
tmp_dir = TRIM( tmp_dir_saved ) // TRIM( prefix ) //"_" // &
|
|
|
|
TRIM( int_to_char( image ) ) // '/'
|
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
DO proc = 0, nproc - 1
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
! ... a scratch directory for this image is created sequentially
|
|
|
|
! ... by all the cpus
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
IF ( proc == mpime ) &
|
|
|
|
ios = c_mkdir( TRIM( tmp_dir ), LEN_TRIM( tmp_dir ) )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
CALL mp_barrier()
|
|
|
|
!
|
|
|
|
END DO
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
! ... each job checks whether the scratch directory is accessible
|
|
|
|
! ... or not
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
|
|
|
OPEN( UNIT = 4, FILE = TRIM( tmp_dir ) // TRIM( prefix ) // &
|
|
|
|
& TRIM( int_to_char( mpime ) ), &
|
|
|
|
& STATUS = 'UNKNOWN', FORM = 'UNFORMATTED', IOSTAT = ios )
|
2003-12-10 22:57:07 +08:00
|
|
|
CLOSE( UNIT = 4, STATUS = 'DELETE' )
|
|
|
|
!
|
|
|
|
IF ( ios /= 0 ) &
|
|
|
|
CALL errore( 'outdir: ', TRIM( tmp_dir ) // &
|
|
|
|
& ' non existent or non writable', 1 )
|
|
|
|
!
|
|
|
|
! ... if starting from scratch all temporary files are removed
|
2005-03-09 21:50:01 +08:00
|
|
|
! ... from tmp_dir ( by all the cpus in sequence )
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
IF ( restart_mode == 'from_scratch' ) THEN
|
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
DO proc = 0, nproc - 1
|
2004-03-24 17:36:50 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
IF ( proc == mpime ) THEN
|
|
|
|
!
|
2005-10-07 10:37:11 +08:00
|
|
|
! ... BFGS restart file is removed
|
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( tmp_dir ) // &
|
|
|
|
& TRIM( prefix ) // '.bfgs' )
|
|
|
|
!
|
2005-12-18 05:21:54 +08:00
|
|
|
! ... extrapolation file is removed
|
2005-03-09 21:50:01 +08:00
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( tmp_dir ) // &
|
|
|
|
& TRIM( prefix ) // '.update' )
|
|
|
|
!
|
|
|
|
! ... standard output of the self-consistency is removed
|
|
|
|
!
|
|
|
|
CALL delete_if_present( TRIM( tmp_dir ) // 'PW.out' )
|
|
|
|
!
|
|
|
|
END IF
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
CALL mp_barrier()
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
2005-03-09 21:50:01 +08:00
|
|
|
END DO
|
2003-12-10 22:57:07 +08:00
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
END DO
|
|
|
|
!
|
|
|
|
tmp_dir = tmp_dir_saved
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE verify_tmpdir
|