Commit Graph

60 Commits

Author SHA1 Message Date
giannozz 3cd50d0257 More cleanup: spelling of Quantum ESPRESSO, CMPLX explicitly cast, f_defs.h
removed, a few REAL transformed into DBLE. Note that my previos statement
about REAL is overblown: REAl(C) is perfectly safe if C is a double precision
complex number. All changes should be safe.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@5793 c92efa57-630b-4861-b058-cf58834340f0
2009-08-01 17:48:59 +00:00
dalcorso 0375acce30 Variable so(nt) removed: so(nt) -> upf(nt)%has_so.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4929 c92efa57-630b-4861-b058-cf58834340f0
2008-05-15 12:58:11 +00:00
cavazzon 6e6630adbe - reduce replaced by mp_sum
- sub. reduce, removed from para!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4826 c92efa57-630b-4861-b058-cf58834340f0
2008-04-20 21:23:37 +00:00
paulatto ba4e005094 This is a quite complex check-in, but actually not very much is done. Changelog follows.
LP

UPF file format updated completely, UPFv2 introduced:
* ld1.x can still produce old format, with the switch upf_v1_format=.true. in inputp
  this is disabled by default, but we can discuss if it should be the opposite.
* pw.x cp.x and all utilities should notice no difference
* some utilities in upftools still need to be updated, anyway conversion UPFv1 to UPFv2
  is very easy, so this should be no big issue
* starting from now to produce an UPF file you need to fill the pseudo_upf derivedd type
  and feed it to write_upf woutine in upf_module (Modules/upf.f90)
* extensive use of iotk

I have tried to make the new format as self contained as possible, e.g. there should be
minimal need for post-processing after the data is read, no more reconstruction of known
quantities, and no more odd syntax to save negligible quantity of space. Also the human
readable section is a bit richer, all the rest is more machine readable.

I hope this will not cause any throuble, and tried really hard to, all examples and all
tests works as fine as before and gives (what really looks like) the same results.

Other changes that I needed to make:
* radial grids are now allocatable, they management is a bit less of a hack too
* paw and uspp augmentation are stored in the same place
* paw print total all-electron energy if all atoms are paw, not very useful, but nice
* most of the pseudopotential-writing reading files have been renamed to  some more
  logical name, I spare you the list. E.g. read_oldpseudo -> read_pseudo_rrkj3
* paw_t derived type was only used in atomic, so I have put it there (as the pseudo_type
  module take ages to recompile it was awkward to leave it there).

PAW tests inserted in test/ there are 6 of them, as a consequence I have also put 5 paw
pseudopotentials in the pseudo/ directory.

I will update the PAW scf examples soon, by deleting them (as running a pw with a PAW
pseudopotential requires no option at all). PAW generation examples should be updated.

A lot of small bugfixes here & there mostly uninitialized variables or unallocated
pointers used as subrotuine arguments.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4769 c92efa57-630b-4861-b058-cf58834340f0
2008-04-03 15:50:43 +00:00
paulatto 3f4cc01569 Trying to simplify paw self-consistency I have put becsum into the scf type, this requires a bit of a hack.
Symmetrization of becsum simplified a bit introducing mapping to "triangular" composite index.
Read upf now uses default (*) format for paw part.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4529 c92efa57-630b-4861-b058-cf58834340f0
2007-12-14 14:22:10 +00:00
degironc 0141bb6d0c update of several PAW routines.
global auxiliary variable saved%v removed and replace by a smaller local array.
ddd_PAW has now the same indexing structure as becsum.

miscellaneous:
- defined undefined variable ze2=0 in ascheqps
- ibnd_up/dw initialized in print_ks_energies.f90


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4517 c92efa57-630b-4861-b058-cf58834340f0
2007-12-11 22:46:03 +00:00
paulatto c292822bde A few modification aiming at the solution of PAW convergence problems, not yet definitive.
Precision of dylmr2 increased a bit, maybe it's not necessary
mix_rho messed up a bit, included the possibility to normalize mixing matrix (disabled by default)
Added a currently unused function in paw_init to increase integration precision on the fly


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4498 c92efa57-630b-4861-b058-cf58834340f0
2007-12-04 14:20:36 +00:00
paulatto 68bd232899 A lot of little improvements and little new features have been added to PAW
routines, actually results should be the same, and execution time should be
a lot shorter.
 * each atom type now integrated to a different max(l)
 * max(l) tuned in order to exclude the non local channel of pseudo-
   potential, if it's empty
 * several implementation optimization
 * all occurences of ALLOCATABLE changed to POINTER inside derived types
 * added original Bloechl shape for augmentation charge, at the moment it
   is not useful but if someone wants to implement analylitical correction
   to overlaps...
 * PAW now uses UPF format, the format is still being tested: it will
   probably change a bit in the near future
 * as a consequence radial grids are now pointed from upf type and can be
   updated directly in read_upf, upf_to_internal don't have to set the grid
   anymore (at the moment only for pseudos read from upf files)
 * added a non-destructive check for abs(zeta)>1. in vxc_t
LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4449 c92efa57-630b-4861-b058-cf58834340f0
2007-11-19 16:20:26 +00:00
giannozz 28b4e9ba19 Minor cleanup; max number of species brought back to 10
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4447 c92efa57-630b-4861-b058-cf58834340f0
2007-11-19 14:51:15 +00:00
dalcorso e97a34174c The pseudization of the Q functions exported also to the US-PP.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4434 c92efa57-630b-4861-b058-cf58834340f0
2007-11-13 17:42:29 +00:00
paulatto 4e96b9de36 All pseudopotential data required for PAW is now dynamically allocated inside the upf structure. Parameters ndmx and nbrx are no more ne
cessary for PAW, the latter has been moved to GIPAW/gipaw_module.f90, as it is only used there.

Added a little trick to free some memory after the initialization is completed (only for parallel .and. PAW, but similar method could be
 used for US too; is it worth the hassle?)

Minor changes in paw_symmetrize (added parallel) and paw_newd.

LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4431 c92efa57-630b-4861-b058-cf58834340f0
2007-11-13 15:15:28 +00:00
paulatto 513379419b Step 1 of many: paw augmentation functions moved to upf structure
(I apologise for the many check-ins I'll do, but I have to keep track of changes.)
LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4424 c92efa57-630b-4861-b058-cf58834340f0
2007-11-12 16:20:55 +00:00
paulatto dce5f820da Paw code moved around and unused functions removed; old grid_paw code removed.
This is the first step of code cleanup. Actually nothing should change.

rad_paw_routines -> paw_onecenter (2 functions went to paw_init)
grid_paw_variables -> paw_variables (with some additions from rad_paw_routines)
grid_paw_routines -> paw_init (merged with 2 init functions from rad_paw)

Probably there are a few random fixes around.

Next step: remove ndmx and ntpx.

LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4422 c92efa57-630b-4861-b058-cf58834340f0
2007-11-12 14:49:09 +00:00
paulatto d858b4a51b New PAW version, now completely working on radial grid. Code on FFT grid can still be compiled using __GRID_PAW flag (but may not work a
nymore). Other things working: parallel, gamma-only.

Files vxc_t, exc_t and vxcgc moved from atomic to Modules (to prevent cyclic dependencies).

Other random fixes: a kind in init_vloc, a call to infomsg in ./PH/add_for_charges.f90.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4358 c92efa57-630b-4861-b058-cf58834340f0
2007-10-22 14:54:29 +00:00
giannozz 6d97829a14 Fixed stupid error in "read_file" that was causing crashes in all
phonon and postprocessing codes (Andrea please check the spin-orbit case)
Redundant variables in uspp_param (mostly) removed


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4313 c92efa57-630b-4861-b058-cf58834340f0
2007-10-06 08:23:39 +00:00
giannozz 216c32ccd3 The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
   nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 09:26:23 +00:00
dalcorso ed444efcfa Reintroduced some instructions related to the qq variables apparently
removed in the 18 Sep. commit.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4297 c92efa57-630b-4861-b058-cf58834340f0
2007-10-02 13:20:51 +00:00
paulatto 33bd36ef82 Now using sparse array for augmentation function (should) massively reduce
memory usage. A similar trick could be used for pfunc and ptfunc too (and
for ultrasoft's qfunc), but it requires a bit more time.

Minimal fix in run_example.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4258 c92efa57-630b-4861-b058-cf58834340f0
2007-09-18 13:35:48 +00:00
paulatto 08fedbe2f0 SCF with Projector-Augmented Wave Pseudopotential (PAW) routines added.
This means that a lot of routines have been modified and a few files have
been added. During the year several people have contributed to this code,
mainly Guido Fratesi, Ricardo Mazzarello, Stefano de Gironcoli, Andrea Dal
Corso and me (Lorenzo Paulatto).

A brief report of modified or added files follows, further down you will
find a loger report of modifications that was necessary to merge develop_PAW
branch with the current CVS version.

Current version is not 100% functional, but it doesn't brake anything else and
can be used to generate and test PAW pseudopotential.

      *************************************
      *** Brief report of modifications ***
      *************************************
Modified files:
PW/clean_pw.f90
PW/electrons.f90
PW/print_clock_pw.f90
PW/hinit0.f90
PW/potinit.f90
PW/newd.f90
PW/summary.f90
PW/setup.f90
PW/read_pseudo.f90
PW/init_us_1.f90
PW/init_run.f90
PW/mix_rho.f90
atomic/atomic_paw.f90
atomic/write_paw_recon.f90
atomic/ld1_writeout.f90
atomic/write_resultsps.f90
atomic/ld1inc.f90
atomic/ld1_readin.f90
atomic/gener_pseudo.f90
atomic/parameters.f900
atomic/run_pseudo.f900
atomic/set_rho_core.f90
atomic/pseudovloc.f90
Modules/read_upf.f90
Modules/uspp.f90
Modules/pseudo_types.f90
Modules/parameters.f90

Added files:
PW/grid_paw_routines.f90
PW/rad_paw_routines.f90
Modules/grid_paw_variables.f90
Modules/read_paw.f90

Added files that will be removed:
PW/rad_paw_trash.f90
PW/paw_xc.f90

Examples:
examples/PAWexample contains a full test of PAW pseudopotential
for Oxygen. The test consist in these tasks:
 - 2 norm conserving, 2 US and 4 PAW pseudopotentials are
   generated and tested in ld1
 - pw test for an isolated O atom at different cutoffs
 - pw test for an O2 molecule at different O-O distance
please read examples/PAWexample/README for (a few) details.

NOTES:
1. new modifications to atomic_paw (and related) from ADC have been rolled
   back, as they were breaking a lot of things, I will reintroduce them
   later when I am sure that everything works properly.
2. the files PW/paw_xc.f90 and Modules/rad_paw_trash.f90 will be removed in
   the next few weeks.

TODO:
1. use new ld1 XC code as much as possible, and remove legacy XC routines
   from rad_paw_routines
2. full self-consistency with radial energies
3. make new Harris-Foulkes estimate paw-aware
4. provide some kind error estimate
5. FORCES and stress!! (require symmetrization of becsums)
6. cleanup

    ************************
    *** merge of PW code ***
    ************************
Versions notation:
OLD=version from 2 years ago used as reference to generate the patches
NEW=CURRENT=current trunk version
PAW=current develop_PAW version

Note: pseudo-potential input and allocation routines changed
      a lot in the last years, this is a diagram:
OLD:PW/readin ~~> PAW:PW/read_pseudo --> disappears
pops out --> PAW:PW/readin ~~> NEW:PW/read_pseudo

added files:
Modules/read_paw.f90    (contains module read_paw_module with subroutines
                         paw_io nullify_pseudo_paw, allocate_pseudo_paw and
                         deallocate_pseudo_paw previously in removed file
                         Modules/readpseudo.f90. Also contains module
                         paw_to_internal with subroutine set_pseudo_paw,
                         previously in upf_to_internal.f90)
PW/paw_xc.f90           (contains OLD=PAW xc and gcxc routines as adapting paw
                         grid code to use new routines was very error prone and
                         quite worthless, as it has to be removed anyway)

Conflicts reported by CVS during merge:
DONE */Makefiles                    (all replaced with new, redone by hand)

DONE  flib/functionals.f90          (nothing to do)

DONE Modules/functionals.f90        (RNV == replaced with NEW version)
DONE Modules/atom.f90               (trivial: duped rgrid)
DONE Modules/autopilot.f90          (trivial)
DONE Modules/bfgs_module.f90        (RNV)
DONE Modules/cell_base.f90          (RNV)
DONE Modules/check_stop.f90         (RNV)
DONE Modules/constants.f90          (RNV)
DONE Modules/constraints_module.f90 (RNV)
DONE Modules/energies.f90           (RNV)
DONE Modules/input_parameters.f90   (RNV)
DONE Modules/ions_base.f90          (RNV, has 3 new subs)
DONE Modules/ions_nose.f90          (RNV)
DONE Modules/parameters.f90         (actually RNV)
DONE Modules/path_base.f90          (RNV)
DONE Modules/path_opt_routines.f90  (RNV)
DONE Modules/path_reparametrisation.f90 (RNV)
DONE Modules/path_variables.f90     (RNV)
DONE Modules/pseudo_types.f90       (cleaned double def of paw_t)
DONE Modules/read_cards.f90         (RNV)
DONE Modules/read_namelists.f90     (checked and RNV)
DONE Modules/uspp.f90               (trivial)
DONE Modules/xml_io_base.f90        (RNV)

DONE PW/read_pseudo.f90             (merged by hand with PAW PW/readin)

DONE PW/bp_calc_btq.f90             (trivial)
DONE PW/c_bands.f90                 (actually RNV)
DONE PW/ccgdiagg.f90                (RNV)
DONE PW/cegterg.f90                 (RNV)
DONE PW/cft3s.f90                   (RNV)
DONE PW/cinitcgg.f90                (RNV)
DONE PW/c_phase_field.f90           (RNV)
DONE PW/divide_et_impera.f90        (nothing to do?)
DONE PW/exx.f90                     (RNV)
DONE PW/hinit0.f90                  (easy)
DONE PW/h_psi.f90                   (RNV)
DONE PW/init_run.f90                (easy)
DONE PW/kpoint_grid.f90             (nothing to do?)
DONE PW/newd.f90                    (required mod in newd_paw_grid, CHECK!!)
DONE PW/openfil.f90                 (actually RNV)
DONE PW/paw.f90                     (actually RNV)
DONE PW/punch.f90                   (RNV)
DONE PW/pwscf.f90                   (quite RNV)
DONE PW/set_kup_and_kdw.f90         (RNV)
DONE PW/setup.f90                   (RNV + 2 line merged by hand)
DONE PW/sgama.f9                    (actually RNV)
DONE PW/sgam_at_mag.f90             (actually RNV)
DONE PW/stop_run.f90                (actually RNV)
DONE PW/stres_gradcorr.f90          (actually RNV)
DONE PW/symrho_mag.f90              (nothing to do)
DONE PW/v_of_rho.f90                (RNV)

DONE PW/compute_fes_grads.f90       (RNV)
DONE PW/gradcorr.f90                (RNV)
DONE PW/input.f90                   (RNV)
DONE PW/pw_restart.f90              (RNV)
DONE PW/read_ncpp.f90               (actually RNV)
DONE PW/summary.f90                 (RNV + inserted new PP type)
DONE PW/wfcinit.f90                 (RNV)

the hard ones:
DONE PW/electrons.f90   (adapted code to new syntaxes, a lot of cleanup, removed
                         some PAW junk that can be readded later, removed parts
                         that were applyed twice, or had been removed in trunk,
                         the rhog allocations and usage may need fixes)
DONE PW/mix_rho.f90     (merged tauk and paw additions, a bit of cleanup and smarter
                         variables names)
DONE PW/init_us_1.f90   (qtot redefined with "triangular" index nb,mb-->ijv)

modified for compiling:
Modules/io_files.f90    (depatched)
PW/pwcom.f90            (depatched)
Modules/parameters.f90  (temporary readded cp_lmax = lmaxx+1)
PW/newd.f90             (merge was wrong, redone mostly by hand)
PW/read_ncpp.f90        (depatched)
PW/read_pseudo          (small fixes)
PW/sgam_at_mag.f90      (depatched)
PW/sgama.f90            (depatched)
PW/stres_gradcorr.f90   (depatched)

modified for running:
PW/clean_pw.f90         (added call to deallocate_paw_internals)

Modifications to PAW routines:
1. compute_onecenter_charges and compute_onecenter_charges modified to
   comply with new structure of v_xc (in v_of_rho.f90), requiring new
   g-space densities to be saved and computed --> using old xc routines
   as this code will be removed.
2. qrad size has changed, prad and ptrad had to be changed accordingly.
3. several minor modifications to use new radial grid structure.
4. infomsg arguments changed, very funny bug followed.
5. added new routine deallocate_paw_internals, called by PW/clean_pw.f90
   required to run pp.x with more than one q-point(and good programming
   practice)


    *************************
    *** merge of LD1 code ***
    *************************
2nd try: atomic code replaced with current version, then merge by hand
the files that are used by paw subsystem:
* atomic_paw.f90        (replaced with most recent version from develop_PAW
                         routine us2paw and paw2us taken from newer trunk
                         version, a lot of minor changes.)
* gener_pseudo.f90      (fixes)
* ld1inc.f90            (PAW variables added)
* ld1_readin.f90        (PAW variables added, I am not sure if lpaw should go
                         in input or inputp namelist)
* ld1_writeout.f90      (it was only necessary to add a few lines)
* pseudovloc.f90        (nothing to do)
* run_pseudo.f90        (almost nothing to do)
* set_rho_core.f90      (readded a few lines for lnc2paw)
* write_paw_recon.f90   (nothing to do)
* write_resultsps.f90   (nothing to do: trunk version is more
                         PAW-aware than PAW version)

Main problems were found in subroutines run_pseudo and gen_pseudo,
a little code had to be rewritten to comply with new variable names
and fix with merge.

TODO: fix atomic_paw routines to use minimal allocated arrays insetad
of ndmx sized ones; try to use the pawet as much as possible. Remove
test lines and other garbage. Find a fix for PAW2.

The first week of september Andrea Dal Corso uploaded a few modifications to
the atomic_paw routines. I had to rollback them as the structure of atomic_paw
has changed a lot and reimplementing them is probably easier and definitely
safer than fixing everything. I will do it soon, I swear!

LP


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4257 c92efa57-630b-4861-b058-cf58834340f0
2007-09-18 10:05:46 +00:00
degironc 6da8252f73 a radial_grid_type is introduced in Modules and used in atomic-related part
many changes but results are identical before and after.
sdg


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4127 c92efa57-630b-4861-b058-cf58834340f0
2007-08-12 00:08:53 +00:00
ceresoli 25916130b0 Array out-of-bound fixed (this happened only if spline_ps=.true.). (D.C.)
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4025 c92efa57-630b-4861-b058-cf58834340f0
2007-07-13 09:43:45 +00:00
ceresoli 21f7d5ebca Splines are disabled by default, but now they are
compiled in. Set spline_ps = .true. in the &system namelist.
(D.C.)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@3717 c92efa57-630b-4861-b058-cf58834340f0
2007-01-25 11:42:52 +00:00
ceresoli a17f5cf04a Spline interpolation working in parallel. (D.C.)
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@3715 c92efa57-630b-4861-b058-cf58834340f0
2007-01-25 10:47:07 +00:00
giannozz 19b7ba4744 Symmetric indices of variable qfunc, holding the Q(r) functions in
Ultrasoft PPs, merged into a single index. The logic of the index
should be the same as for the other USPP_related variables. Tested
for UPF format, should work for old van and rrkjus formats as well,
but I haven't tested it (tests very welcome).

Why? with default static dimensions, qfunc took 40Mb. Some compilers
(e.g. g95) store a copy of statically dimensioned arrays in objects
and executables, so 'make all' produced *.x for 1Gb or so ...
Apart from this, wasting nonscalable memory should be avoided anyway
in massively parallel machines.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@3506 c92efa57-630b-4861-b058-cf58834340f0
2006-11-03 12:21:28 +00:00
ceresoli 8fe7fec7af Added spline interpolation of the pseudopotentials. Disabled by default,
unless you add -DUSE_SPLINES to DFLAGS in your make.sys. Magnetic response
slightly improved by splines. By D. Ceresoli


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@3394 c92efa57-630b-4861-b058-cf58834340f0
2006-09-15 09:06:15 +00:00
giannozz 86c64d934a Replaced several allocations with fixed dimensions with dimensions
calculated at run-time (should save some memory.
DIIS diagonalization disabled


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2865 c92efa57-630b-4861-b058-cf58834340f0
2006-03-03 14:19:17 +00:00
giannozz cbb7a98e56 Various fixes for the new file format. Now this is the default unless
__OLDPUNCH is defined. The norm-conserving phonon code should work, but
the USPP case doesn't, and likely many postprocessings as well.
Workaround for ifort crashes in gradcorr.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2710 c92efa57-630b-4861-b058-cf58834340f0
2006-01-18 17:20:40 +00:00
dalcorso 9d56f1c6c9 Added the possibility to mix scalar relativistic and fully relativistic
pseudopotentials with lspinorb=.true. (Still experimental)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2630 c92efa57-630b-4861-b058-cf58834340f0
2005-12-21 16:30:00 +00:00
dalcorso 33c97ffce1 Bands.x calculates the expectation value of the spin operator on each
spinor wave-function.
(A. Smogunov and ADC)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2427 c92efa57-630b-4861-b058-cf58834340f0
2005-11-07 11:07:36 +00:00
giannozz f533b052d5 dbl => DP (defined as previously dbl was)
syntax for declarations: real(DP), without "kind="


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2135 c92efa57-630b-4861-b058-cf58834340f0
2005-08-28 14:09:42 +00:00
giannozz bf4bfe222f General cleanup of intrinsic functions:
conversion to real    => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate     => CONJG
imaginary part        => AIMAG

All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b)  cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.

All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects

Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:

program test_intrinsic

  implicit none
  integer, parameter :: dp = selected_real_kind(14,200)
  real (kind=dp) :: a = 0.123456789012345_dp
  real (kind=dp) :: b = 0.987654321098765_dp
  complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)

  print *, '      A = ', a
  print *, ' DBLE(A)= ', DBLE(a)
  print *, '      C = ', c
  print *, 'CONJG(C)= ', CONJG(c)
  print *, 'DBLE(c),AIMAG(C)  = ', DBLE(c), AIMAG(c)
  print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)

end program test_intrinsic

Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-26 17:44:42 +00:00
giannozz 3b250f78e6 Do not allow nqlc to be set to less than 0 if there are only local
pseudopotentials in the system (Andrea Ferretti)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1943 c92efa57-630b-4861-b058-cf58834340f0
2005-06-08 10:12:58 +00:00
giannozz 0bf090e4bc variable "okvan" moved to module "uspp" + minor cleanup
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1765 c92efa57-630b-4861-b058-cf58834340f0
2005-03-28 13:55:19 +00:00
giannozz 8362db17d9 Possible out-of-bound error with US PP fixed, hopefully for good this
time, both in CP and in PW: nqlc read from file is set to 2*lmax+1
but lmax may be larger than the max l in beta functions


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1652 c92efa57-630b-4861-b058-cf58834340f0
2005-02-21 14:52:12 +00:00
sbraccia 0caeadbd7b Machine-dependent definitions are now contained in two different files (both in /include):
1) f_defs.h  for definitions to be included in FORTRAN files ONLY
   2) c_defs.h  for definitions to be included in C       files ONLY

C.S.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1012 c92efa57-630b-4861-b058-cf58834340f0
2004-06-25 17:25:37 +00:00
giannozz 43b1b240b7 No need to have a spin index in dvan
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@988 c92efa57-630b-4861-b058-cf58834340f0
2004-06-22 08:03:59 +00:00
dalcorso 5b2fd8fbe3 Bug fix: the modified newd was wrong in the spin-orbit case.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@962 c92efa57-630b-4861-b058-cf58834340f0
2004-06-14 12:58:51 +00:00
sbraccia d1579c66ec Removed references (not yet everywhere) to module basis for those variables already in module ions_base.
C.S.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@953 c92efa57-630b-4861-b058-cf58834340f0
2004-06-12 13:44:18 +00:00
giannozz c821ed5236 Compilation fixes
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@949 c92efa57-630b-4861-b058-cf58834340f0
2004-06-10 17:19:58 +00:00
giannozz 25ff6785e3 More uspp variables rearrangement (beware undesired side effects!)
qq_spinorb moved into Modules/uspp.f90 as qq_so
dvan => dvan + dvan_so (for spin-orbit only)
PW/clean_pw.f90 replaces PWNC/clean_pw.f90 (PG)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@945 c92efa57-630b-4861-b058-cf58834340f0
2004-06-08 20:00:04 +00:00
giannozz 47c5de62f8 More USPP_related variables moved to Modules/uspp.f90
Note that lqx => lmaxq for consistency with other names
(those ending in x are static dimensioning)
Beware unexpected side effects (PG)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@933 c92efa57-630b-4861-b058-cf58834340f0
2004-05-31 17:55:33 +00:00
giannozz 4a5732790a Part of the variables for ultrasoft pseudopotentials have been moved to a
new module uspp_param, shared between PW and CP (in file Modules/uspp.f90)
The flag newpseudo is no longer used to decide whether states with oc=0 are
bound or not: for those states, and only for the old RRKJ format, oc is set
to a negative value, and this signals that they are not bound. Not elegant
but simpler than it used to be. The converter to UPF format did not include
those states anyway. Beware unexpected side effects!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@914 c92efa57-630b-4861-b058-cf58834340f0
2004-05-26 11:04:07 +00:00
giannozz 68b075c1ae Cleanup: pwcom no longer used in PP/
qgm is now a local variable as it should be


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@867 c92efa57-630b-4861-b058-cf58834340f0
2004-05-08 10:24:24 +00:00
dalcorso 958c86f3f7 Support for s.o.: changes to PW routines:
init_us_1 : dvan coefficients are recalculated
            qq_spinorb coefficients are defined
setup : added code to average a s.o. pseudopotential and use it as a
        standard pseudopotential. (Still not working with US)


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@845 c92efa57-630b-4861-b058-cf58834340f0
2004-05-03 08:08:59 +00:00
dalcorso aef6ec462c Introduced variables for spin-orbit support. Changes on these
routines are due to the fact that dvan becomes spin dependent and has
an additional index.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@839 c92efa57-630b-4861-b058-cf58834340f0
2004-04-30 08:51:31 +00:00
giannozz a6de70dfa6 *** empty log message ***
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@832 c92efa57-630b-4861-b058-cf58834340f0
2004-04-28 20:48:11 +00:00
giannozz d69e112706 More PP cleanup
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@828 c92efa57-630b-4861-b058-cf58834340f0
2004-04-28 10:25:36 +00:00
giannozz 6c76b02482 Pseudopotential cleanup: vnl => vloc_at
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@818 c92efa57-630b-4861-b058-cf58834340f0
2004-04-26 07:25:01 +00:00
giannozz c90e9062bd more 0:ndm => 1:ndm
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@816 c92efa57-630b-4861-b058-cf58834340f0
2004-04-24 11:58:24 +00:00
giannozz d198ebad0c ndm, mmaxx => ndmx ; 0:ndm => ndmx (starting from 0 no longer needed)
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@815 c92efa57-630b-4861-b058-cf58834340f0
2004-04-23 17:10:44 +00:00