Commit d0706224 authored by giannozz's avatar giannozz
Browse files

Version number centralized in Modules/version.f90, updated to 1.3.0

Auxiliary programs in pwtools/: equation of state (ev.x),
distances/angles (dist.x), k-point generation (kpoints.x).
D3 fixes (maybe). Misc cleanup.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@291 c92efa57-630b-4861-b058-cf58834340f0
parent a042e7a1
......@@ -577,11 +577,6 @@ CONTAINS
! --------------------------------------------------------
! print out heading
!
write(6,400)
write(6,410)
write(6,420)
write(6,410)
write(6,400)
write(6,500) nbeg_ , nomore_ , iprint_ , ndr_ , ndw_
write(6,505) delt_
write(6,510) emass_ , emaec_
......@@ -676,12 +671,6 @@ CONTAINS
write(6,700) iprsta_
!
400 format('************************************', &
& '************************************')
410 format('**** ', &
& ' ****')
420 format('**** ab-initio molecular dynamics: ', &
& ' car-parrinello vanderbilt bhs ****')
500 format(// &
& ' nbeg=',i3,' nomore=',i7,3x,' iprint=',i4,/ &
& ' reads from',i3,' writes on',i3)
......
......@@ -92,6 +92,7 @@ end module para_mod
!
use para_mod
use mp, only: mp_start, mp_env
use global_version
!
implicit none
......@@ -108,11 +109,11 @@ end module para_mod
if ( nproc > maxproc) &
& call errore('startup',' too many processors ',nproc)
!
if (me.lt.10) then
if (me < 10) then
write(node,'(i1,2x)') me
else if (me.lt.100) then
else if (me < 100) then
write(node,'(i2,1x)') me
else if (me.lt.1000) then
else if (me < 1000) then
write(node,'(i3)') me
else
call errore('startup','wow, >1000 nodes !!',nproc)
......@@ -121,6 +122,14 @@ end module para_mod
! only the first processor writes
!
if ( me == 1 ) then
write(6,'(72("*"))')
write(6,'(4("*"),64x,4("*"))')
write(6,'(4("*")," CPV: variable-cell Car-Parrinello ", &
& "molecular dynamics ",4("*"))')
write(6,'(4("*")," using ultrasoft Vanderbilt ", &
& "pseudopotentials - v.",a6,8x,4("*"))') version_number
write(6,'(4("*"),64x,4("*"))')
write(6,'(72("*"))')
write(6,'(/5x,''Parallel version (MPI)'')')
write(6,'(5x,''Number of processors in use: '',i4)') nproc
else
......
......@@ -53,6 +53,7 @@ subroutine bcast_d3_input
call mp_bcast (fildrho, root)
call mp_bcast (fild0rho, root)
call mp_bcast (tmp_dir, root)
call mp_bcast (prefix, root)
#endif
return
end subroutine bcast_d3_input
......@@ -27,7 +27,7 @@ subroutine d3_readin
! counters
character(len=256) :: outdir
namelist / inputph / ethr_ph, amass, iverbosity, outdir, filpun, &
namelist / inputph / ethr_ph, amass, iverbosity, outdir, prefix, &
fildyn, fildrho, fild0rho, q0mode_todo, wraux, recv, istop, &
testflag, testint, testreal
! convergence threshold
......@@ -58,7 +58,7 @@ subroutine d3_readin
ethr_ph = 1.d-5
iverbosity = 0
outdir = './'
filpun = ' '
prefix = 'pwscf'
fildyn = 'd3dyn'
fildrho = ' '
fild0rho = ' '
......@@ -91,15 +91,11 @@ subroutine d3_readin
!
! Check all namelist variables
!
if (ethr_ph.le.0.d0) call errore (' d3_readin', ' Wrong ethr_ph ', &
1)
if (iverbosity.ne.0.and.iverbosity.ne.1) call errore ('d3_readin', ' Wrong &
&iverbosity ', 1)
if (fildyn.eq.' ') call errore ('d3_readin', ' Wrong fildyn ', 1)
if (filpun.eq.' ') call errore ('d3_readin', ' Wrong filpun ', 1)
if (ethr_ph.le.0.d0) call errore (' d3_readin', ' Wrong ethr_ph ', 1)
if (iverbosity.ne.0.and.iverbosity.ne.1) &
call errore ('d3_readin', ' Wrong iverbosity ', 1)
if (fildrho.eq.' ') call errore ('d3_readin', ' Wrong fildrho ', 1)
if (fild0rho.eq.' ') call errore ('d3_readin', ' Wrong fild0rho ', &
1)
if (fild0rho.eq.' ') call errore ('d3_readin', ' Wrong fild0rho ', 1)
!
! reads the q point
!
......
......@@ -15,8 +15,9 @@ program d3toten
use phcom
use d3com
use io
use global_version
implicit none
character :: cdate * 9, ctime * 9, version * 12
character(len=9) :: cdate, ctime, code = 'D3TOTEN'
integer :: nu_i, nu_i0, irecv
real (kind=DP) :: t0, t1, get_clock
......@@ -28,10 +29,7 @@ program d3toten
call init_clocks (.true.)
call start_clock ('D3TOTEN')
version = 'D3TOTEN1.2.1'
call startup (nd_nmbr, version)
write (6, '(/5x,"UltraSoft (Vanderbilt) ", &
& "Pseudopotentials")')
call startup (nd_nmbr, code, version_number)
!
! Initialization routines
!
......
......@@ -10,12 +10,13 @@
program pwscf
!-----------------------------------------------------------------------
!
! Plane Wave Self-Consistent Field c
! Plane Wave Self-Consistent Field
!
use pwcom
use io
use global_version
implicit none
character :: version * 12
character(len=9) :: code = 'PWSCF'
external date_and_tim
! use ".false." to disable all clocks except the total cpu time clock
! use ".true." to enable clocks
......@@ -23,9 +24,8 @@ program pwscf
call init_clocks (.true.)
call start_clock ('PWSCF')
version = 'PWSCF 1.2.1'
gamma_only =.true.
call startup (nd_nmbr, version)
call startup (nd_nmbr, code, version_number)
call init_run
istep = 0
do while (istep.lt.nstep)
......
......@@ -15,28 +15,21 @@ program cg_raman
use io
use cgcom
use mp, only: mp_end
use global_version
#ifdef __PARA
use para
#endif
implicit none
real(kind=DP), allocatable :: deps_dtau(:,:,:,:), dynout(:,:)
real(kind=DP), allocatable :: w2(:)
!
character(len=9) :: cdate, ctime, code = 'RAMAN'
logical :: exst
integer :: i
character(len=9) cdate, ctime
character(len=12), parameter:: version='RAMAN V. -1'
external date_and_tim
!
call init_clocks(.true.)
call start_clock('raman')
#ifdef __PARA
call startup( nd_nmbr, version )
#else
nd_nmbr=' '
call date_and_tim(cdate,ctime)
write (6,9000) version,cdate,ctime
#endif
call startup( nd_nmbr, code, version_number )
!
gamma_only = .true.
call cg_readin
......
......@@ -55,7 +55,7 @@ cp: modules libs
links:
test -d bin || mkdir bin
( cd bin/ ; ln -fs ../PW/pw.x ../PW/memory.x ../PH/ph.x ../D3/d3.x ../Gamma/pwg.x ../Gamma/phcg.x ../CPV/cp.x ../FPMD/par2.x ../PP/average.x ../PP/bands.x ../PP/chdens.x ../PP/dos.x ../PP/plotrho.x ../PP/pp.x ../PP/projwfc.x ../PP/voronoy.x ../PP/plotband.x ../pwtools/band_plot.x ../pwtools/dynmat.x ../pwtools/fqha.x ../pwtools/matdyn.x ../pwtools/q2r.x ../pwtools/dist.x . )
( cd bin/ ; ln -fs ../PW/pw.x ../PW/memory.x ../PH/ph.x ../D3/d3.x ../Gamma/pwg.x ../Gamma/phcg.x ../CPV/cp.x ../FPMD/par2.x ../PP/average.x ../PP/bands.x ../PP/chdens.x ../PP/dos.x ../PP/plotrho.x ../PP/pp.x ../PP/projwfc.x ../PP/voronoy.x ../PP/plotband.x ../pwtools/band_plot.x ../pwtools/dynmat.x ../pwtools/fqha.x ../pwtools/matdyn.x ../pwtools/q2r.x ../pwtools/dist.x ../pwtools/ev.x ../pwtools/kpoints.x . )
clean:
( cd PW ; make clean_ ) ; \
......
......@@ -36,7 +36,8 @@ read_namelists.o \
read_cards.o \
berry_phase.o \
energies.o \
io_files.o
io_files.o \
version.o
#
include ../make.rules
#
......
!
! Copyright (C) 2003 PWSCF 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 global_version
character (len=6) :: version_number = '1.3.0'
END MODULE global_version
......@@ -21,9 +21,10 @@ program phonon
use parameters, only : DP
use phcom
use io
use global_version
implicit none
character :: cdate * 9, ctime * 9, version * 12
character (len=9) :: cdate, ctime, code = 'PHONON'
external date_and_tim
! call sigcatch( )
......@@ -33,8 +34,7 @@ program phonon
call init_clocks (.true.)
call start_clock ('PHONON')
version = 'PHONON 1.2.1'
call startup (nd_nmbr, version)
call startup (nd_nmbr, code, version_number)
write (6, '(/5x,"Ultrasoft (Vanderbilt) Pseudopotentials")')
!
! and begin with the initialization part
......
......@@ -885,8 +885,8 @@ subroutine plot_3d (alat, at, nat, tau, atm, ityp, ngm, g, rhog, &
do ipol=1,3
dipol(ipol)=dipol(ipol) / suma * omega * alat
enddo
print '(/5x,"Min, Max, Total, Abs charge: ",4f10.6)', rhomin, rhomax, &
rhotot, rhoabs
print '(/5x,"Min, Max, Total, Abs charge: ",2f10.6,2x,2f10.4)',&
rhomin, rhomax, rhotot, rhoabs
if (output_format == 4) then
!
......
......@@ -11,13 +11,12 @@ subroutine start_postproc (nodenumber)
!
! Wrapper routine for postprocessing initialization
!
#include "machine.h"
use global_version
implicit none
character(len=3) :: nodenumber
character(len=12):: version = 'POSTPROC-121'
character(len=9) :: code = 'POST-PROC'
!
nodenumber = ' '
call startup (nodenumber, version)
call startup (nodenumber, code, version_number)
#ifdef __PARA
call init_pool
#endif
......
......@@ -7,7 +7,8 @@
!
!
!-----------------------------------------------------------------------
subroutine hexsym (at, is, isname, nrot) !-----------------------------------------------------------------------
subroutine hexsym (at, is, isname, nrot)
!-----------------------------------------------------------------------
!
! Provides symmetry operations for Hexagonal and Trigonal lattices.
! The c axis is assumed to be along the z axis
......
......@@ -13,10 +13,12 @@ program pwmemory
use pwcom
use io
use mp, only : mp_end
use global_version
implicit none
logical :: lgamma
character(len=9) :: code = 'memory'
!
call startup (nd_nmbr, 'memory 1.2.1')
call startup (nd_nmbr, code, version_number)
!
call iosys
call setup
......
......@@ -10,12 +10,13 @@
program pwscf
!-----------------------------------------------------------------------
!
! Plane Wave Self-Consistent Field c
! Plane Wave Self-Consistent Field
!
use pwcom
use io
use global_version
implicit none
character :: version * 12
character(len=9) :: code = 'PWSCF'
external date_and_tim
! use ".false." to disable all clocks except the total cpu time clock
! use ".true." to enable clocks
......@@ -23,9 +24,8 @@ program pwscf
call init_clocks (.true.)
call start_clock ('PWSCF')
version = 'PWSCF 1.2.1'
gamma_only =.false.
call startup (nd_nmbr, version)
call startup (nd_nmbr, code, version_number)
call init_run
istep = 0
do while (istep.lt.nstep)
......
......@@ -8,7 +8,7 @@
!
#include "machine.h"
!-----------------------------------------------------------------------
subroutine startup (nd_nmbr, version)
subroutine startup (nd_nmbr, code, version)
!-----------------------------------------------------------------------
!
! This subroutine initializes MPI
......@@ -45,7 +45,7 @@ subroutine startup (nd_nmbr, version)
use mp, only: mp_start, mp_env, mp_barrier, mp_bcast
implicit none
character :: nd_nmbr * 3, version * 12
character :: nd_nmbr*3, code*9, version*6
integer :: gid
......@@ -149,7 +149,7 @@ subroutine startup (nd_nmbr, version)
# endif
if (me == 1) then
call date_and_tim (cdate, ctime)
write (6, 9000) version, cdate, ctime
write (6, 9000) code, version, cdate, ctime
write (6, '(/5x,"Parallel version (MPI)")')
write (6, '(5x,"Number of processors in use: ",i4)') nproc
if (npool /= 1) &
......@@ -162,11 +162,11 @@ subroutine startup (nd_nmbr, version)
nd_nmbr = ' '
call date_and_tim (cdate, ctime)
write (6, 9000) version, cdate, ctime
write (6, 9000) code, version, cdate, ctime
#endif
9000 format (/5x,'Program ',a12,' starts ...',/5x, &
9000 format (/5x,'Program ',a9,' v.',a6,' starts ...',/5x, &
& 'Today is ',a9,' at ',a9)
!
......
The current (development) version is available using anonymous CVS.
Define environmental variables:
setenv CVS_RSH ssh
setenv CVSROOT :pserver:cvsanon@democritos.sissa.it:/home/cvs
(tcsh/csh) or
export CVS_RSH=ssh
export CVSROOT=:pserver:cvsanon@democritos.sissa.it:/home/cvs
(sh/bash). Then:
cvs login
(password: cvsanon). For the first code download:
cvs co O-sesame
for the entire repository (the code appears in directory O-sesame/).
Alternatively, "cvs co pwscf", or "cp", or "fpmd" will download only
PWscf, CP, FPMD, respectively, in directories with the same name.
For updating the code to the current version:
cvs update -d
in the directory containing the distribution.
PLEASE NOTE: re-run "./configure" if files have been moved/added/removed
since the last checkout, otherwise "make" may not work properly due to
obsolete or missing dependencies. Do not blindly re-use a "make.sys" file
from a preceding version: it may no longer work.
PLEASE ALSO NOTE: the development version may not work properly, and
sometimes not even compile properly. Use at your own risk.
......@@ -113,8 +113,6 @@ FPMD:
- Documentation is nonexistent
- version number
CPV:
- Documentation needs serious improvements
......@@ -126,4 +124,3 @@ CPV:
- replace calls to zero, ssum, csum, blas copy, scal, with f90
- version number
......@@ -8,7 +8,7 @@
#include "../include/opt_param.h"
! OPTIMIZED DRIVER FOR MATRIX TRASPOSITIN
! OPTIMIZED DRIVER FOR MATRIX TRASPOSITION
!
! written by Carlo Cavazzoni
!
......
......@@ -17,7 +17,7 @@ MODULES = ../Modules/parameters.o ../Modules/kind.o ../Modules/fft_scalar.o
#
# Targets
#
all: band_plot.x q2r.x matdyn.x dynmat.x fqha.x dist.x
all: band_plot.x q2r.x matdyn.x dynmat.x fqha.x dist.x ev.x kpoints.x
band_plot.x: band_plot.o
$(LD) -o band_plot.x band_plot.o $(LDFLAGS)
......@@ -37,5 +37,11 @@ dynmat.x: dynmat.o rigid.o
fqha.x: fqha.o
$(LD) -o fqha.x fqha.o $(LDFLAGS)
ev.x: ev.o
$(LD) -o ev.x ev.o ../PW/random.o ../PW/error.o
kpoints.x: kpoints.o
$(LD) -o kpoints.x kpoints.o $(PWOBJS) $(MODULES) $(LDFLAGS)
clean_:
rm -f *.x *.o *~ *.F90 *.mod *.d *.i work.pc
!
! Copyright (C) 2003 PWSCF 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 .
!
!----------------------------------------------------------------------
program dist
!----------------------------------------------------------------------
......@@ -7,8 +14,15 @@
!
! Input file:
! first line contains nat, ibrav, celldm(1-6)
! followed by card ATOMIC_POSITIONS
! followed by cards with atomic positions
! if (ibrav.eq.0) :
! card CELL_PARAMETERS
! a(1,1) a(2,1) a(3,1)
! a(1,2) a(2,2) a(3,2)
! a(1,3) a(2,3) a(3,3)
! [ alat units if celldm(1) was specified, a.u. if celldm(1)=0 ]
! end if
! card ATOMIC_POSITIONS
! cards with atomic positions
! See documentation of pw.x input for more details
!
implicit none
......@@ -22,16 +36,16 @@
character*80 filename, line
character*1 capital, other_cell(ndistx)
real*8 at(3,3), bg(3,3), celldm(6), omega, d(ndistx)
real rr(3,nax), dr(3), dd, dn1, dn2, dn3, dmin, dmax, scale
real angolo(nnx*(nnx-1)/2), drv(3), drn(3,nnx), temp, rtemp(3)
real fact /0.529177/, pi/3.1415926/
logical matches
real*8 tau(3,nax), dr(3), dd, dn1, dn2, dn3, dmin, dmax, scale
real*8 angolo(nnx*(nnx-1)/2), drv(3), drn(3,nnx), temp, rtemp(3)
real*8 fact /0.529177/, pi/3.1415926/
logical crys, matches
external capital, matches, iargc
!
!
i=iargc()
if (i.eq.0) then
print '('' input file > '',$)'
print '(''input file > '',$)'
read(5,'(a)',end=20,err=20) filename
else if(i.eq.1) then
call getarg(1,filename)
......@@ -43,16 +57,40 @@
print '('' file not found '')'
stop
end if
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Begin data reading
read(1,*) nat, ibrav, celldm
if (nat.le.0.or.nat.gt.nax) stop ' nat!'
if (ibrav.le.0.or.ibrav.gt.14) stop ' ibrav!'
call latgen(ibrav,celldm,at(1,1),at(1,2),at(1,3),omega)
do i=1,3
at(i,1) = at(i,1)/celldm(1)
at(i,2) = at(i,2)/celldm(1)
at(i,3) = at(i,3)/celldm(1)
end do
if (ibrav.lt.0.or.ibrav.gt.14) stop ' ibrav!'
if (ibrav.eq.0) then
! read cell unit vectors from input
read(1,'(a)') line
do i=1,len(line)
line(i:i) = capital(line(i:i))
end do
if (matches('CELL_PARAMETERS',line)) then
READ (1,*) ( ( at(i,n), i=1,3 ), n=1,3 )
else
stop ' expecting card CELL_PARAMETERS'
end if
!
if (celldm (1).eq.0.d0) then
! input at are in atomic units: define alat
celldm (1) = sqrt(at(1,1)**2+at(1,2)**2+at(1,3)**2)
do i=1,3
at(i,1) = at(i,1)/celldm(1)
at(i,2) = at(i,2)/celldm(1)
at(i,3) = at(i,3)/celldm(1)
end do
end if
else
! generate cell unit vectors
call latgen(ibrav,celldm,at(1,1),at(1,2),at(1,3),omega)
do i=1,3
at(i,1) = at(i,1)/celldm(1)
at(i,2) = at(i,2)/celldm(1)
at(i,3) = at(i,3)/celldm(1)
end do
end if
call recips(at(1,1),at(1,2),at(1,3),bg(1,1),bg(1,2),bg(1,3))
!
read(1,'(a)') line
......@@ -61,25 +99,29 @@
end do
if (matches('ATOMIC_POSITIONS',line)) then
if ( matches('ALAT', line) ) then
scale = 1.0
scale = 1.d0
crys = .false.
else if ( matches('BOHR', line) ) then
scale = celldm(1)
crys = .false.
else if ( matches('CRYSTAL', line) ) then
stop 'option crystal not implemented'
scale = 1.d0
crys = .true.
else if ( matches('ANGSTROM', line) ) then
scale = celldm(1) * fact
crys = .false.
else
scale = 1.0
scale = 1.d0
crys = .false.
end if
else
read(line,*) scale
end if
if (scale.le.0.d0 .or. scale.gt.1000.d0) stop ' scale ! '
if (scale.le.0.0) stop ' scale ! '
fact=fact*celldm(1)
nsp = 0
do na=1,nat
read(1,*) atm1, (rr(i,na),i=1,3)
read(1,*) atm1, (tau(i,na),i=1,3)
do n = 1, nsp
if ( atm1 .eq. atm(n) ) then
ityp(na) = n
......@@ -91,13 +133,19 @@
atm(nsp) = atm1
ityp(na) = nsp
10 continue
do i=1,3
rr(i,na)=rr(i,na)/scale
end do
enddo
if (crys) then
call cryst_to_cart ( nat , tau, at, 1)