- many small changes ( comments and standartd output layout )

- some new pseudo
- some new cp_examples
- NEW shared module constants, this is the merge of FPMD and PW constants module
- NEW fpmd2upf pseudo converter (from fpmd format to upf )

carlo


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@22 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
cavazzon 2003-01-26 22:39:33 +00:00
parent c9436b394c
commit 15dd1c757c
14 changed files with 4844 additions and 49 deletions

View File

@ -1,4 +1,6 @@
CODEDIR=CPV
include ../make.sys include ../make.sys

View File

@ -32,10 +32,9 @@
use parms, only: nr1s,nr2s,nr3s use parms, only: nr1s,nr2s,nr3s
use pres_mod, only: agg, sgg, e0gg use pres_mod, only: agg, sgg, e0gg
use psfiles, only: psfile use psfiles, only: psfile
#ifdef __PARA use io_global, only: ionode
use para_mod, only: me use mp, only: mp_bcast
use mp
#endif
! !
implicit none implicit none
! !
@ -315,9 +314,7 @@
modenum = 0 modenum = 0
xqq = 0.d0 xqq = 0.d0
#ifdef __PARA if ( ionode ) then
if (me == 1) then
#endif
ios = 0 ios = 0
READ (unit, control, iostat = ios ) READ (unit, control, iostat = ios )
@ -362,7 +359,6 @@
if (ios /= 0) call error ('reading','namelist &cell',5) if (ios /= 0) call error ('reading','namelist &cell',5)
end if end if
#ifdef __PARA
end if end if
! !
! ... CONTROL Variables Broadcast ! ... CONTROL Variables Broadcast
@ -512,7 +508,6 @@
CALL mp_bcast( modenum, ionode_id ) CALL mp_bcast( modenum, ionode_id )
CALL mp_bcast( xqq, ionode_id ) CALL mp_bcast( xqq, ionode_id )
! !
#endif
! translate from input to internals of CP, various checks ! translate from input to internals of CP, various checks
@ -643,7 +638,6 @@
CASE DEFAULT CASE DEFAULT
CALL error(' iosys ',' unknown electron_dynamics '//& CALL error(' iosys ',' unknown electron_dynamics '//&
trim(electron_dynamics),1) trim(electron_dynamics),1)
END SELECT END SELECT
! Ion velocities ! Ion velocities
@ -653,6 +647,8 @@
tcap = .false. tcap = .false.
CASE ('random') CASE ('random')
tcap = .true. tcap = .true.
CASE ('zero')
print '("Warning: ion_velocities = zero not yet implemented")'
CASE DEFAULT CASE DEFAULT
CALL error(' iosys ',' unknown ion_velocities '//trim(ion_velocities),1) CALL error(' iosys ',' unknown ion_velocities '//trim(ion_velocities),1)
END SELECT END SELECT
@ -685,6 +681,8 @@
SELECT CASE ( cell_velocities ) SELECT CASE ( cell_velocities )
CASE ('default') CASE ('default')
continue continue
CASE ('zero')
print '("Warning: cell_velocities = zero not yet implemented")'
CASE DEFAULT CASE DEFAULT
CALL error(' iosys ',' unknown cell_velocities '//trim(cell_velocities),1) CALL error(' iosys ',' unknown cell_velocities '//trim(cell_velocities),1)
END SELECT END SELECT

View File

@ -92,6 +92,7 @@ CONTAINS
INTEGER, ALLOCATABLE :: ityp(:) INTEGER, ALLOCATABLE :: ityp(:)
INTEGER :: isk, tetra(4) INTEGER :: isk, tetra(4)
REAL(dbl) :: zmesh_, xmin_, dx_ REAL(dbl) :: zmesh_, xmin_, dx_
REAL(dbl) :: ainv(3,3), deth
! !
! Only the first node writes ! Only the first node writes
@ -302,7 +303,8 @@ CONTAINS
twm = .TRUE. twm = .TRUE.
twrite = .TRUE. twrite = .TRUE.
wfc_scal_cp90 = 1.0d0 call matinv(h,ainv,deth)
wfc_scal_cp90 = 1.0d0 / SQRT(ABS(deth))
DO j = 1, nspin DO j = 1, nspin
DO i = 1, nk DO i = 1, nk
nb_g = nx nb_g = nx

View File

@ -1,7 +1,8 @@
# #
# Makefile for Modules # Makefile for Modules
# #
MODULES= kind.o \ MODULES= constants.o \
kind.o \
parallel_include.o \ parallel_include.o \
shmem_include.o \ shmem_include.o \
parameters.o \ parameters.o \

84
Modules/constants.f90 Normal file
View File

@ -0,0 +1,84 @@
!
! Copyright (C) 2002 FPMD group
! 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 .
!
MODULE constants
USE kinds
!
! The constants needed everywhere
!
IMPLICIT NONE
SAVE
REAL(dbl) :: ALAT
REAL(dbl) :: PI, tpi, FPI, TPIBA, TPIBA2
REAL(dbl) :: SQRTPI, SQRTPM1, sqrt2
! ... Physical constants
REAL(dbl), PARAMETER :: K_BOLTZMAN_SI = 1.38066D-23 ! J K^-1
REAL(dbl), PARAMETER :: K_BOLTZMAN_AU = 3.1667D-6 ! Hartree K^-1
REAL(dbl), PARAMETER :: K_BOLTZMAN_M1_AU = 315795.26D0 ! Hartree^-1 K
REAL(dbl), PARAMETER :: FACTEM = 315795.26D0 ! Hartree^-1 K
! ... Physical constants defining the Atomic Units System
REAL(dbl), PARAMETER :: BOHR_RADIUS_SI = 0.529177D-10 ! m
REAL(dbl), PARAMETER :: BOHR_RADIUS_CM = 0.529177D-8 ! cm
REAL(dbl), PARAMETER :: BOHR_RADIUS_ANGS = 0.529177D0 ! angstrom
REAL(dbl), PARAMETER :: ELECTRONMASS_SI = 9.10953D-31 ! Kg
REAL(dbl), PARAMETER :: ELECTRONMASS_UMA = 5.4858D-4 ! uma
! ... Units conversion factors
REAL(dbl), PARAMETER :: ELECTRONVOLT_SI = 1.6021892D-19 ! J
REAL(dbl), PARAMETER :: UMA_SI = 1.66057D-27 ! Kg
REAL(dbl), PARAMETER :: ANGSTROM_AU = 1.889727D0 ! au
REAL(dbl), PARAMETER :: AU_TO_OHMCMM1 = 46000.0D0 ! (ohm cm)^-1
REAL(dbl), PARAMETER :: AU_KB = 294210.0D0 ! Kbar
REAL(dbl), PARAMETER :: KB_AU = 1.0D0/294210.0D0 ! au
REAL(dbl), PARAMETER :: AU = 27.212D0 ! eV
REAL(dbl), PARAMETER :: RY = 13.606D0 ! eV
REAL(dbl), PARAMETER :: SCMASS = 1822.89D0 ! uma to au
REAL(dbl), PARAMETER :: UMA_AU = 1822.89D0 ! au
REAL(dbl), PARAMETER :: AU_TERAHERTZ = 2.418D-5 ! THz
REAL(dbl), PARAMETER :: TERAHERTZ = 2.418D-5 ! from au to THz
REAL(dbl), PARAMETER :: AU_SEC = 2.4189D-17 ! sec
PARAMETER( pi = 3.14159265358979323846_dbl )
PARAMETER( tpi = 2.0_dbl * 3.14159265358979323846_dbl )
PARAMETER( fpi = 4.0_dbl * 3.14159265358979323846_dbl )
PARAMETER( sqrtpi = 1.77245385090551602729_dbl )
PARAMETER( sqrtpm1 = 1.0_dbl / sqrtpi )
PARAMETER( sqrt2 = 1.41421356237309504880 )
REAL(dbl), PARAMETER :: rhothr = 1.0e-5_dbl ! tolerance
REAL(dbl), PARAMETER :: gsmall = 1.0d-12
REAL(dbl), parameter :: e2 = 2.d0 ! the square of the electron charge
REAL(dbl), parameter :: degspin = 2.d0 ! the number of spins per level
REAL(dbl), parameter :: rytoev=13.6058d0 ! conversion from Ry to eV
! mass conversion: a.m.u to a.u. (Ry)
REAL(dbl), parameter :: amconv= 1.66042d-24/9.1095d-28*0.5d0
! pressure conversion from Ry/(a.u)^3 to K
REAL(dbl), parameter :: uakbar= 147105.d0
CONTAINS
SUBROUTINE constants_setup(CELLDM)
REAL(dbl), INTENT(IN) :: celldm
If(celldm.le.0.0d0) THEN
CALL error(' constants_setup ', ' zero or negative CELLDM ',0)
END IF
alat = celldm
tpiba = tpi / celldm ! scaling constant: 2*pi/alat
tpiba2 = tpiba ** 2
RETURN
END SUBROUTINE constants_setup
END MODULE constants

View File

@ -11,22 +11,6 @@
! statically allocated variables are dimensioned in commons ! statically allocated variables are dimensioned in commons
! dynamically allocated variables are dimensioned in type declaration ! dynamically allocated variables are dimensioned in type declaration
! !
module constants
use parameters
!
! The constants needed everywhere
!
real(kind=DP), parameter :: &
e2 =2.d0, &! the square of the electron charge
degspin=2.d0, &! the number of spins per level
rytoev=13.6058d0, &! conversion from Ry to eV
amconv= 1.66042d-24/9.1095d-28*0.5d0, &! mass conversion: a.m.u to a.u. (Ry)
uakbar= 147105.d0, &! pressure conversion from Ry/(a.u)^3 to K
pi=3.14159265358979d0, &! pi
tpi=2.d0*pi, &! 2 times pi
fpi=4.d0*pi ! 4 times pi
end module constants
! !
module brilz module brilz
use parameters use parameters
@ -602,7 +586,7 @@ module ldaU
end module ldaU end module ldaU
module pwcom module pwcom
use constants use constants, only: e2, degspin, rytoev, amconv, uakbar, pi, tpi, fpi
use brilz use brilz
use basis use basis
use dynam use dynam

View File

@ -65,7 +65,7 @@
WRITE (15,100) mpime, a, b, n WRITE (15,100) mpime, a, b, n
CLOSE(UNIT=15) CLOSE(UNIT=15)
ELSE IF ( n < 0 ) THEN ELSE IF ( n < 0 ) THEN
WRITE (6,200) mpime, a, b, n IF( mpime == 0 ) WRITE (6,200) a, b
END IF END IF
#if defined __MPI #if defined __MPI
CALL mpi_barrier(mpi_comm_world,ierr) CALL mpi_barrier(mpi_comm_world,ierr)
@ -91,11 +91,7 @@
/,' *** error code : ',I5, & /,' *** error code : ',I5, &
/,' *** aborting ***', /) /,' *** aborting ***', /)
200 FORMAT (/,' *** from PE : ',I5, & 200 FORMAT (/,' * warning (', A, ') : ', A, /)
/,' *** in routine : ',A, &
/,' *** warning msg. : ',A, &
/,' *** warning code : ',I5, &
/,' *** continuing ***', /)
IF( n > 0 ) THEN IF( n > 0 ) THEN
STOP 'CRASH' STOP 'CRASH'

View File

@ -1,5 +1,5 @@
###################################################################### ######################################################################
# IBM SP2, SP3 and SP4 # IBM SP systems
# #
# Architecture # Architecture
ARCH=ibmsp ARCH=ibmsp
@ -9,9 +9,12 @@
# --- Change Variables according to your system --- # # --- Change Variables according to your system --- #
# ** Preprocessor Macro ** # ** Preprocessor Macro **
# Add -D__LIBMASS to use IBM mass
# Add -D__FFTDRW to use fftw
CPMACRO=-D__AIX,-D__MPI,-D__PARA,-D__LIBMASS,-D__ESSL,-DSWAP=dswap,-DAXPY=daxpy,-DSCAL=dscal,-DCOPY=dcopy,-DGEMM=dgemm CPMACRO=-D__AIX,-D__MPI,-D__PARA,-D__LIBMASS,-D__ESSL,-DSWAP=dswap,-DAXPY=daxpy,-DSCAL=dscal,-DCOPY=dcopy,-DGEMM=dgemm
# #
# Uncomment to Use IBM mass # ** Uncomment to Use IBM mass **
# Substitute -lmassvp4 with -lmassvp3 or -lmassvp2 depending on your arch
MASS= -L /cineca/lib/mass -lmassvp4 -lmass MASS= -L /cineca/lib/mass -lmassvp4 -lmass
# #
# ** Scientific Libraries ** # ** Scientific Libraries **
@ -35,7 +38,7 @@
LNKFLAGS = $(ARCHFLAGS) -bmaxdata:0x70000000 LNKFLAGS = $(ARCHFLAGS) -bmaxdata:0x70000000
# #
# Flag for the compilation of the c source files # Flag for the compilation of the c source files
CFLAGS = -Wp,$(CPMACRO) -O2 CCFLAGS = $(INCLUDEPATH) -Wp,$(CPMACRO) -O2
# #
# Name of the fortran compiler # Name of the fortran compiler
FC= mpxlf FC= mpxlf
@ -45,7 +48,7 @@
# Libraries # Libraries
LIB= $(ESSL) $(LAPACK) $(MASS) -lm -lc LIB= $(ESSL) $(LAPACK) $(MASS) -lm -lc
MODULEFLAG=-I $(OSHOME)/CPV -I$(OSHOME)/Modules MODULEFLAG=-I $(OSHOME)/Modules/ -I $(OSHOME)/$(CODEDIR)/
# #
# OTHER settings # OTHER settings
RANLIB=echo RANLIB=echo

View File

@ -1,10 +1,8 @@
###################################################################### ######################################################################
# IBM SP # IBM SP systems
# #
# Architecture (choose yours) # Architecture
# ARCH=sp2 ARCH=ibmsp
# ARCH=sp3
ARCH=sp4
# #
###################################################################### ######################################################################
@ -13,7 +11,8 @@
# ** Preprocessor Macro ** # ** Preprocessor Macro **
# Add -D__LIBMASS to use IBM mass # Add -D__LIBMASS to use IBM mass
# Add -D__FFTDRW to use fftw # Add -D__FFTDRW to use fftw
CPMACRO=-D__AIX,-D__MPI,-D__PARA,-D__LIBMASS CPMACRO=-D__AIX,-D__MPI,-D__PARA,-D__LIBMASS,-D__ESSL
CPMACRO=-D__AIX,-D__MPI,-D__PARA,-D__LIBMASS,-D__ESSL,-DSWAP=dswap,-DAXPY=daxpy,-DSCAL=dscal,-DCOPY=dcopy,-DGEMM=dgemm
# #
# ** Uncomment to Use IBM mass ** # ** Uncomment to Use IBM mass **
# Substitute -lmassvp4 with -lmassvp3 or -lmassvp2 depending on your arch # Substitute -lmassvp4 with -lmassvp3 or -lmassvp2 depending on your arch
@ -22,10 +21,9 @@
# ** Scientific Libraries ** # ** Scientific Libraries **
# Uncomment to use system Lapack and IBM ESSL # Uncomment to use system Lapack and IBM ESSL
# LAPACK= -L /cineca/lib -llapack # LAPACK= -L /cineca/lib -llapack
# MYLIB=
# ESSL= -lpessl -lessl
# Uncomment to compile Lapack subset from the source code and use IBM ESSL # Uncomment to compile Lapack subset from the source code and use IBM ESSL
MYLIB=lapack MYLIB=lapack
FFT=ibmfft.o
ESSL= -lpessl -lessl ESSL= -lpessl -lessl
# Uncomment to use blas and lapack subset from the source code # Uncomment to use blas and lapack subset from the source code
# MYLIB=blas_and_lapack # MYLIB=blas_and_lapack
@ -56,7 +54,7 @@
# Libraries # Libraries
LIB= $(ESSL) $(LAPACK) $(MASS) -lm -lc LIB= $(ESSL) $(LAPACK) $(MASS) -lm -lc
MODULEFLAG=-I $(OSHOME)/Modules/ -I $(OSHOME)/FPMD/ MODULEFLAG=-I $(OSHOME)/Modules -I $(OSHOME)/$(CODEDIR)
# #
# OTHER settings # OTHER settings
RANLIB=echo RANLIB=echo

1069
pseudo/H.fpmd.UPF Normal file

File diff suppressed because it is too large Load Diff

1133
pseudo/N.BLYP.UPF Normal file

File diff suppressed because it is too large Load Diff

1147
pseudo/O.BLYP.UPF Normal file

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,15 @@ cpmd2upf: cpmd2upf.o $(OBJS) nclib.o
oldcp2upf: oldcp2upf.o $(OBJS) nclib.o oldcp2upf: oldcp2upf.o $(OBJS) nclib.o
$(LD) -o $@ oldcp2upf.o nclib.o write_upf.o $(LFLAGS) $(LD) -o $@ oldcp2upf.o nclib.o write_upf.o $(LFLAGS)
fpmd2upf.x : fpmd2upf.o
$(LNK) -o $@ $(LNKFLAGS) fpmd2upf.o \
../Modules/*.o ../flib/ptools.a ../flib/flib.a ../clib/clib.a $(LIB)
read_upf: read_upf:
$(LD) -o $@ read_upf.o $(LFLAGS) $(LD) -o $@ read_upf.o $(LFLAGS)
clean: clean_:
rm -f *2upf *.o *.mod *.d *.F90 rm -f *2upf *.o *.mod *.d *.F90
any2upf.o: $(OBJS) any2upf.o: $(OBJS)

1373
upftools/fpmd2upf.f90 Normal file

File diff suppressed because it is too large Load Diff