Commit 0b1a5c9f authored by giannozz's avatar giannozz

Extensive module cleanup: DP moved from wrong place (parameters) to the

correct place (kinds); module "varie" replaced by "control_flags" (not
yet in pwcom, though) - many many files changed.
64-bit cpus (Opteron, maybe Itanium) should now work if __LINUX64 is defined


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@513 c92efa57-630b-4861-b058-cf58834340f0
parent 38950d1d
......@@ -9,7 +9,7 @@
! Common for d3toten
!
module g0aux
use parameters, only: DP
USE kinds, only: DP
real(kind=DP), pointer:: vlocg0(:,:) ! local potential at q+G for q=0
complex(kind=DP), pointer:: vkb0 (:,:) ! contains beta functions at q=0
complex(kind=DP), pointer:: d0rc(:,:)! contain the rhoc for q=0
......@@ -32,7 +32,7 @@ end module d0rho
! the variable needed to describe the patterns when q=0
!
module modesg0
use parameters, only: DP
USE kinds, only: DP
integer :: nsymg0, &! the number of symmetries of the crystal
nirrg0 ! the number of irreducible representation
!
......@@ -45,7 +45,7 @@ end module modesg0
! third order dynamical matrices (auxiliary)
!
module d3aux
use parameters, only: DP
USE kinds, only: DP
complex(kind=DP), allocatable :: &
d3dyn_aux1(:,:,:), d3dyn_aux2(:,:,:), d3dyn_aux3(:,:,:), &
d3dyn_aux4(:,:,:), d3dyn_aux5(:,:,:), d3dyn_aux6(:,:,:), &
......@@ -55,7 +55,7 @@ end module d3aux
! third order dynamical matrix
!
module thirdorder
use parameters, only: DP
USE kinds, only: DP
complex(kind=DP), allocatable :: d3dyn(:,:,:)
! third order dynamical matrix
complex(kind=DP), allocatable :: psidqvpsi(:,:)
......@@ -69,7 +69,7 @@ end module thirdorder
! test variables
!
module testvar
use parameters, only: DP
USE kinds, only: DP
real(kind=DP) :: testreal(50)
integer :: testint(50)
logical :: testflag(50)
......
......@@ -18,7 +18,7 @@ subroutine davcio_drho2 (drho, lrec, iunit, nrec, isw)
!
#include "machine.h"
use pwcom
use parameters, only : DP
USE kinds, only : DP
use phcom
#ifdef __PARA
use para
......
......@@ -30,7 +30,7 @@ subroutine set_sym_irr (nat, at, bg, xq, s, invs, nsym, rtau, irt, &
! April 1997: parallel stuff added (SdG)
!
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
#ifdef __PARA
use para, only: me
use mp, only: mp_bcast
......
......@@ -10,7 +10,7 @@
subroutine A_h(e,h,ah)
!-----------------------------------------------------------------------
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use pwcom
USE wavefunctions_module, ONLY: evc, psic
USE constants, ONLY: degspin
......
......@@ -103,7 +103,7 @@ end subroutine cg_readin
subroutine cg_readmodes(iunit)
!-----------------------------------------------------------------------
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use pwcom
use cgcom
#ifdef __PARA
......
......@@ -11,7 +11,7 @@ subroutine cg_setup
!-----------------------------------------------------------------------
!
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use pwcom
USE wavefunctions_module, ONLY: evc
use io_files, only: prefix, iunpun, iunres
......
......@@ -11,7 +11,7 @@ subroutine cg_setupdgc
! Setup all arrays needed in the gradient correction case
! This version requires on input allocated array
!
use parameters, only: DP
USE kinds, only: DP
use pwcom
use cgcom
use funct
......
......@@ -47,7 +47,7 @@ END MODULE flags
!
!
MODULE dielectric
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -60,7 +60,7 @@ END MODULE dielectric
!
!
MODULE modes1
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -74,7 +74,7 @@ END MODULE modes1
!
!
MODULE cgconv
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -87,7 +87,7 @@ END MODULE cgconv
!
!
MODULE AA
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -101,7 +101,7 @@ END MODULE AA
!
!
MODULE dmu
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -117,7 +117,7 @@ END MODULE dmu
!
!
MODULE phon
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......@@ -145,7 +145,7 @@ END MODULE symmetry
!
!
MODULE diffs
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
SAVE
!
......
......@@ -18,7 +18,7 @@ subroutine cgsolve (operator,npw,evc,npwx,nbnd,overlap, &
!
#include "machine.h"
USE io_global, ONLY : stdout
use parameters, only : DP
USE kinds, only : DP
implicit none
integer npw, npwx, nbnd, nbndx, niter, iter
real(kind=DP) :: diagonal(npw), e(nbnd), overlap(nbndx,nbnd)
......
......@@ -15,7 +15,7 @@ subroutine d2ion (nat,ntyp,ityp,zv,tau,alat,omega, &
! (both real- and reciprocal-space contributions are present)
!
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
USE io_global, ONLY : stdout
implicit none
integer :: nat, ntyp, ngm, ityp(nat), nmodes, has_equivalent(nat)
......
......@@ -8,7 +8,7 @@
!-----------------------------------------------------------------------
subroutine dgcxc (r, s2, vrrx, vsrx, vssx, vrrc, vsrc, vssc)
!-----------------------------------------------------------------------
use parameters, only : DP
USE kinds, only : DP
implicit none
real(kind=DP) :: r, s2, vrrx, vsrx, vssx, vrrc, vsrc, vssc
real(kind=DP) :: dr, s, ds
......
......@@ -15,7 +15,7 @@ subroutine dgcxc_spin (rup, rdw, gup, gdw, vrrxup, vrrxdw, vrsxup, &
! This routine computes the derivative of the exchange and correlatio
! potentials with respect to the density, the gradient and zeta
!
use parameters, only : DP
USE kinds, only : DP
implicit none
real(kind=DP) :: rup, rdw, gup (3), gdw (3), vrrxup, vrrxdw, vrsxup, &
vrsxdw, vssxup, vssxdw, vrrcup, vrrcdw, vrscup, vrscdw, vssc, &
......
......@@ -14,7 +14,7 @@ subroutine dgradcor1 (rho, grho, dvxc_rr, dvxc_sr, dvxc_ss, dvxc_s, &
! ADD Gradient Correction contibution to screening potential
! phonon calculation, half G-vectors
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
implicit none
!
......@@ -158,7 +158,7 @@ subroutine gradient1(nrx1, nrx2, nrx3, nr1, nr2, nr3, nrxx, &
a, ngm, g, nl, nlm, alat, ga)
!--------------------------------------------------------------------
! Calculates ga = \grad a in R-space (a is G-space)
use parameters, only : DP
USE kinds, only : DP
implicit none
integer :: nrx1, nrx2, nrx3, nr1, nr2, nr3, nrxx, ngm, nl (ngm), &
nlm(ngm)
......@@ -219,7 +219,7 @@ subroutine grad_dot1 (nrx1, nrx2, nrx3, nr1, nr2, nr3, nrxx, &
a, ngm, g, nl, nlm, alat, da)
!--------------------------------------------------------------------
! Calculates da = \sum_i \grad_i a_i in R-space
use parameters, only : DP
USE kinds, only : DP
implicit none
integer :: nrx1, nrx2, nrx3, nr1, nr2, nr3, nrxx, ngm, nl (ngm), &
nlm(ngm)
......
......@@ -11,7 +11,7 @@ function dmxc (rho)
!
! derivative of the xc potential with respect to the local density
!
use parameters, only : DP
USE kinds, only : DP
use funct
implicit none
! I/O variables
......@@ -78,7 +78,7 @@ function dpz (rs, iflg)
! derivative of the correlation potential with respect to the local den
! Perdew and Zunger parameterization of the C.A. functional
!
use parameters, only : DP
USE kinds, only : DP
implicit none
real(kind=DP) :: rs, dpz
! input : the value of rs
......
......@@ -14,7 +14,7 @@ subroutine dvpsi_e(kpoint,ipol)
! Requires on input: vkb, evc, igk
!
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use pwcom
USE wavefunctions_module, ONLY: evc
USE rbecmod, ONLY: becp, becp_
......
......@@ -12,7 +12,7 @@ subroutine dvpsi_kb(kpoint,nu)
! calculates dVion/dtau * psi and stores it in dvpsi
!
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use pwcom
USE wavefunctions_module, ONLY: evc, psic
use cgcom
......
......@@ -14,7 +14,7 @@ subroutine dyndiar (dyn,nat3,nmodes,u,nat,ityp,amass,w2,dynout)
! and mode displacements in "dynout". dyn is unchanged on output.
!
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
USE io_global, ONLY : stdout
implicit none
integer :: nmodes, nat3, nat,ityp(nat), iudyn
......
......@@ -16,7 +16,7 @@ subroutine generate_dynamical_matrix &
! Input: dyn = irreducible dyn.mat. Output: dyn = complete dyn.mat.
!
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
implicit none
integer :: nat, nsym, n_diff_sites, irt(48,nat), &
equiv_atoms(nat,nat), s(3,3,48), has_equivalent(nat)
......
......@@ -14,7 +14,7 @@ subroutine generate_effective_charges &
! generate all effective charges
!
#include "machine.h"
use parameters, only : DP
USE kinds, only : DP
implicit none
integer :: nat, nsym, n_diff_sites, irt(48,nat), equiv_atoms(nat,nat),&
s(3,3,48), has_equivalent(nat)
......
......@@ -11,7 +11,7 @@ subroutine H_h(e,h,Ah)
!-----------------------------------------------------------------------
#include "machine.h"
!
use parameters, only: DP
USE kinds, only: DP
use pwcom
use rbecmod, only: becp
use cgcom
......
......@@ -13,7 +13,7 @@ subroutine pw_dot(sum_over_nodes,n,m,a,lda,b,ldb,c)
! using half G vectors or half PWs
!
#include "machine.h"
use parameters, only: DP
USE kinds, only: DP
use gvect, only: gstart
implicit none
! input
......
......@@ -29,7 +29,7 @@ MODULE basic_algebra_routines
! identity( N ) the identity matrix in dimension N
!
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
IMPLICIT NONE
!
......
......@@ -29,7 +29,7 @@ MODULE bfgs_module
! ... Landscapes and Rare Events.
!
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE io_files, ONLY : iunbfgs
!
USE basic_algebra_routines
......
......@@ -8,7 +8,7 @@
!
MODULE mytime
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
!
IMPLICIT NONE
......@@ -31,7 +31,7 @@ SUBROUTINE init_clocks( go )
! flag = .TRUE. : clocks will run
! flag = .FALSE. : only clock #1 will run
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE mytime
!
IMPLICIT NONE
......@@ -55,7 +55,7 @@ END SUBROUTINE init_clocks
!
SUBROUTINE start_clock( label )
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE mytime
!
IMPLICIT NONE
......@@ -101,7 +101,7 @@ END SUBROUTINE start_clock
!
SUBROUTINE stop_clock( label )
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE mytime
!
IMPLICIT NONE
......@@ -141,7 +141,7 @@ END SUBROUTINE stop_clock
!
SUBROUTINE print_clock( label )
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
use mytime
!
IMPLICIT NONE
......@@ -176,7 +176,7 @@ END SUBROUTINE print_clock
!
SUBROUTINE print_this_clock( n )
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE mytime
USE mp, ONLY : mp_max, mp_min
USE mp_global, ONLY : group, inter_pool_comm
......@@ -253,7 +253,7 @@ END SUBROUTINE print_this_clock
!
FUNCTION get_clock( label )
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
USE mytime
USE mp, ONLY : mp_max, mp_min
USE mp_global, ONLY : group, inter_pool_comm
......
......@@ -216,7 +216,6 @@
conv_elec, &! if .TRUE. electron convergence has been reached
conv_ions, &! if .TRUE. ionic convergence has been reached
nosym, &! if .TRUE. no symmetry is used
newpseudo(npsx), &! if .TRUE. done with the new pseudopotentials
noinv = .FALSE., &! if .TRUE. eliminates inversion symmetry
diis_wfc_keep, &! if .TRUE. keeps old wfc for starting
restart, &! if .TRUE. restart from results of a preceding run
......
......@@ -613,7 +613,7 @@ subroutine fft_scatter (f_in, nrx3, nxx_, f_aux, ncp_, npp_, sign)
!
#include "machine.h"
use mp_global, ONLY: nproc_pool, me_pool, intra_pool_comm, nproc
use parameters, only : DP
USE kinds, only : DP
implicit none
integer, intent(in) :: nrx3, nxx_, sign, ncp_ (:), npp_ (:)
......
......@@ -17,7 +17,7 @@
!----------------------------------------------------------------------!
! FFT scalar drivers Module.
! Written by Carlo Cavazzoni
! Last update April 2003
! Last update January 2004
!----------------------------------------------------------------------!
......@@ -63,24 +63,14 @@
#endif
#if defined __SGI64 || defined __ALPHA || defined __T3E
INTEGER, PARAMETER :: ipt = 8
#else
INTEGER, PARAMETER :: ipt = 4
#endif
! ipt Size of integer that store "C" pointers
! ipt = 4 for 32bit executables
! ipt = 8 for 64bit executables
! C_POINTER is defined in include/machine.h
! for 32bit executables, C_POINTER is integer(4)
! for 64bit executables, C_POINTER is integer(8)
#if defined __FFTW
INTEGER ( kind=ipt ) :: fw_plan( 3, ndims ) = 0
INTEGER ( kind=ipt ) :: bw_plan( 3, ndims ) = 0
C_POINTER :: fw_plan( 3, ndims ) = 0
C_POINTER :: bw_plan( 3, ndims ) = 0
! Pointers to the "C" structures containing FFT factors ( PLAN )
......@@ -518,8 +508,8 @@
#if defined __FFTW
integer(kind=ipt), save :: fw_plan(ndims) = 0
integer(kind=ipt), save :: bw_plan(ndims) = 0
C_POINTER, save :: fw_plan(ndims) = 0
C_POINTER, save :: bw_plan(ndims) = 0
#elif defined __AIX
......@@ -934,8 +924,8 @@ subroutine cfft3ds (f, nr1, nr2, nr3, nrx1, nrx2, nrx3, sign, do_fft_x, do_fft_y
#if defined __FFTW
integer(kind=ipt), save :: bw_planz( ndims ) = 0
integer(kind=ipt), save :: bw_planxy( ndims ) = 0
C_POINTER, save :: bw_planz( ndims ) = 0
C_POINTER, save :: bw_planxy( ndims ) = 0
#elif defined __AIX
......@@ -1088,7 +1078,7 @@ integer function good_fft_dimension (n)
! Determines the optimal maximum dimensions of fft arrays
! Useful on some machines to avoid memory conflicts
!
use parameters
USE kinds
implicit none
integer :: n, nx
! this is the default: max dimension = fft dimension
......@@ -1113,7 +1103,7 @@ function allowed (nr)
! a "bad one" is either not implemented (as on IBM with ESSL)
! or implemented but with awful performances (most other cases)
use parameters
USE kinds
implicit none
integer :: nr
......
......@@ -18,7 +18,7 @@ MODULE input_parameters
!=----------------------------------------------------------------------------=!
!
USE kinds
USE parameters, ONLY : DP, nsx, natx, npkx, nbndxx, nspinx
USE parameters, ONLY : nsx, natx, npkx, nbndxx, nspinx
!
IMPLICIT NONE
!
......
......@@ -51,7 +51,7 @@
USE io_global, ONLY : stdout
USE kinds
USE parameters
USE parameters, ONLY: nsx
IMPLICIT NONE
SAVE
......@@ -158,9 +158,9 @@
! neld = number of electrons with spin down
! nat = number of atoms
! ntyp = number of atomic species
! na(.) = numbero of atom for each species
! na(.) = number of atom for each species
! acc(.) = accomulators
! nacc = number of accomulators
! nacc = number of accumulators
! ecutwfc = wave function cutoff
! ecutrho = charge density cutoff cutoff
......
......@@ -12,7 +12,7 @@
INTEGER, PARAMETER :: i4b = selected_int_kind(9)
INTEGER, PARAMETER :: DP = kind(0.0d0) ! compatibility with PWSCF
PRIVATE
PUBLIC :: i4b, dbl, sgl, print_kind_info
PUBLIC :: i4b, dbl, sgl, DP, print_kind_info
!
!------------------------------------------------------------------------------!
!
......
......@@ -10,7 +10,7 @@
MODULE miscellany
!---------------------------------------------------------------------------
!
USE parameters, ONLY : DP
USE kinds, ONLY : DP
!
IMPLICIT NONE
!
......
......@@ -24,7 +24,6 @@ MODULE parameters
lmaxx = 3, &! max non local angular momentum
nchix = 6, &! max number of atomic wavefunctions per atom
ndm = 2000 ! max number of points in the atomic radial mesh
INTEGER, PARAMETER :: DP = kind(0.0d0)