From 545a48b5d2e4509e99bb7ec7fc464c369842a483 Mon Sep 17 00:00:00 2001 From: giannozz Date: Mon, 21 Jul 2003 13:35:53 +0000 Subject: [PATCH] Fixed recently introduced memory leak, some cleanup, removed useless "include mpif.h" git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@266 c92efa57-630b-4861-b058-cf58834340f0 --- Makefile | 2 +- PH/io_pattern.f90 | 3 --- PH/set_irr_mode.f90 | 17 ++++------------- PH/set_irr_nosym.f90 | 18 +++++------------- PW/cft3s.f90 | 1 - PW/output_tau.f90 | 1 + PW/psymrho.f90 | 4 +--- PW/setup.f90 | 11 +---------- TODO | 9 ++++++--- pwtools/dist.f | 2 +- 10 files changed, 20 insertions(+), 48 deletions(-) diff --git a/Makefile b/Makefile index 8fc7f29f8..884124637 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ cp: modules libs ( cd CPV; make all ) links: - ( 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 . ) + ( 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 . ) clean: ( cd PW ; make clean_ ) ; \ diff --git a/PH/io_pattern.f90 b/PH/io_pattern.f90 index e861788e7..459d9e0ec 100644 --- a/PH/io_pattern.f90 +++ b/PH/io_pattern.f90 @@ -14,9 +14,6 @@ subroutine io_pattern (fildrho,nirr,npert,u,iflag) use para #endif implicit none -#ifdef __PARA - include 'mpif.h' -#endif ! ! the i/o variables first ! diff --git a/PH/set_irr_mode.f90 b/PH/set_irr_mode.f90 index b5fead719..73c7a5383 100644 --- a/PH/set_irr_mode.f90 +++ b/PH/set_irr_mode.f90 @@ -8,8 +8,8 @@ ! !--------------------------------------------------------------------- subroutine set_irr_mode (nat, at, bg, xq, s, invs, nsym, rtau, & - irt, irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, npert, nirr, gi, & - gimq, iverbosity, modenum) + irt, irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, & + npert, nirr, gi, gimq, iverbosity, modenum) !--------------------------------------------------------------------- ! ! This routine computes the symmetry matrix of the mode defined @@ -20,13 +20,7 @@ subroutine set_irr_mode (nat, at, bg, xq, s, invs, nsym, rtau, & ! #include "machine.h" use parameters, only : DP -#ifdef __PARA - use para -#endif implicit none -#ifdef __PARA - include 'mpif.h' -#endif ! ! first the dummy variables ! @@ -56,7 +50,7 @@ subroutine set_irr_mode (nat, at, bg, xq, s, invs, nsym, rtau, & ! output: [S(irotq)*q - q] ! output: [S(irotmq)*q + q] - complex(kind=DP) :: u (3 * nat, 3 * nat), t (max_irr_dim, max_irr_dim, 48, 3 * nat), & + complex(kind=DP) :: u(3*nat, 3*nat), t(max_irr_dim, max_irr_dim, 48, 3*nat),& tmq (max_irr_dim, max_irr_dim, 3 * nat) ! output: the pattern vectors ! output: the symmetry matrices @@ -66,10 +60,7 @@ subroutine set_irr_mode (nat, at, bg, xq, s, invs, nsym, rtau, & ! ! here the local variables ! - real(kind=DP) :: tpi - - parameter (tpi = 2.0d0 * 3.14159265358979d0) - + real(kind=DP), parameter :: tpi = 2.0d0 * 3.14159265358979d0 integer :: na, imode, jmode, ipert, jpert, nsymtot, imode0, irr, & ipol, jpol, isymq, irot, sna diff --git a/PH/set_irr_nosym.f90 b/PH/set_irr_nosym.f90 index f2f46565b..d9067c5b2 100644 --- a/PH/set_irr_nosym.f90 +++ b/PH/set_irr_nosym.f90 @@ -7,25 +7,17 @@ ! !--------------------------------------------------------------------- subroutine set_irr_nosym (nat, at, bg, xq, s, invs, nsym, rtau, & - irt, irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, npert, nirr, gi, & - gimq, iverbosity) + irt, irgq, nsymq, minus_q, irotmq, t, tmq, max_irr_dim, u, & + npert, nirr, gi, gimq, iverbosity) !--------------------------------------------------------------------- ! ! This routine substitute set_irr when there are no symmetries. ! The irreducible representations are all one dimensional and ! we set them to the displacement of a single atom in one direction ! - ! - ! #include "machine.h" -use parameters, only : DP -#ifdef __PARA -use para -#endif -implicit none -#ifdef __PARA -include 'mpif.h' -#endif + use parameters, only : DP + implicit none ! ! first the dummy variables ! @@ -53,7 +45,7 @@ include 'mpif.h' ! output: [S(irotq)*q - q] ! output: [S(irotmq)*q + q] - complex(kind=DP) :: u (3 * nat, 3 * nat), t (max_irr_dim, max_irr_dim, 48, 3 * nat), & + complex(kind=DP) :: u(3*nat, 3*nat), t(max_irr_dim, max_irr_dim, 48, 3*nat),& tmq (max_irr_dim, max_irr_dim, 3 * nat) ! output: the pattern vectors ! output: the symmetry matrices diff --git a/PW/cft3s.f90 b/PW/cft3s.f90 index 732a70f24..6b9cf0f76 100644 --- a/PW/cft3s.f90 +++ b/PW/cft3s.f90 @@ -57,7 +57,6 @@ subroutine cft3s (f, n1, n2, n3, nx1, nx2, nx3, sign) integer :: n1, n2, n3, nx1, nx2, nx3, sign complex (kind=DP) :: f ( nxxs ) ! - include 'mpif.h' integer :: mc, i, j, ii, iproc, k, nppx complex (kind=DP), allocatable :: aux (:) integer :: planes ( nx1 ) diff --git a/PW/output_tau.f90 b/PW/output_tau.f90 index e66c41e7e..fc33e9e4f 100644 --- a/PW/output_tau.f90 +++ b/PW/output_tau.f90 @@ -47,5 +47,6 @@ subroutine output_tau write (6,'(a3,3x,3f14.9)') atm(ityp(na)), (tau_out(i,na), i=1,3) enddo write (6, '(/)') + deallocate(tau_out) return end subroutine output_tau diff --git a/PW/psymrho.f90 b/PW/psymrho.f90 index 9ef5f4758..34de8ba21 100644 --- a/PW/psymrho.f90 +++ b/PW/psymrho.f90 @@ -7,8 +7,7 @@ ! ! !----------------------------------------------------------------------- -subroutine psymrho (rho, nrx1, nrx2, nrx3, nr1, nr2, nr3, nsym, s, & - ftau) +subroutine psymrho (rho, nrx1, nrx2, nrx3, nr1, nr2, nr3, nsym, s, ftau) !----------------------------------------------------------------------- ! p-symmetrize the charge density. ! @@ -17,7 +16,6 @@ subroutine psymrho (rho, nrx1, nrx2, nrx3, nr1, nr2, nr3, nsym, s, & use para use parameters, only : DP implicit none - include 'mpif.h' integer :: nrx1, nrx2, nrx3, nr1, nr2, nr3, nsym, s, ftau real (kind=DP) :: rho (nxx) diff --git a/PW/setup.f90 b/PW/setup.f90 index f617755cf..98c237929 100644 --- a/PW/setup.f90 +++ b/PW/setup.f90 @@ -50,7 +50,7 @@ subroutine setup ! real(kind=DP), parameter :: rcut = 10.d0, eps = 1.0d-12 ! - integer :: na, ir, nt, input_nks, nrot, iter, ierr, irot, isym, & + integer :: na, ir, nt, nrot, iter, ierr, irot, isym, & ipol, jpol, tipo logical :: minus_q integer, external ::n_atom_wfc, set_Hubbard_l @@ -245,8 +245,6 @@ subroutine setup end if end if ! - input_nks = nks - ! ! allocate space for irt ! allocate (irt( 48, nat)) @@ -286,13 +284,6 @@ subroutine setup ntetra = 0 end if ! - ! In a non scf calculation we check if k-points are compatible - ! with the symmetry of the crystal but do not change them - ! - if ( iswitch == -1 .and. input_nks.ne.nks .and. .not.ltetra ) then - write (6, '(5x,"Warning: missing inequivalent points")') - nks = input_nks - endif if (iswitch <= -2) call set_kplusq (xk, wk, xqq, nks, npk) if (lsda) then diff --git a/TODO b/TODO index 65e4440f6..0196725dd 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -TODO LIST - 11 July 2003 +TODO LIST - 16 July 2003 INSTALLATION @@ -60,8 +60,7 @@ PW - add possibility to read atomic positions from file -- read a, b, c, cosab, cosbc, cosac instead of celldm - Use more standard choices for crystal axis +- Use more standard choices for crystal axis - fix problem with j'_l(x)Y_lm(x) for x -> 0 and l=1 @@ -90,6 +89,10 @@ POSTPROCESSING - dos, projected dos, etc: input data should be more uniform +- non scf calculations: there must be an option to distinguish + the case of a few selected k-points (bands) from the case of + a grid of k-points covering the entire BZ (DOS, STM): nosym? + PH - Tone: ntyp in input needed for phonon GUI ? diff --git a/pwtools/dist.f b/pwtools/dist.f index 11cb734d3..30510321c 100644 --- a/pwtools/dist.f +++ b/pwtools/dist.f @@ -59,7 +59,7 @@ do i=1,len(line) line(i:i) = capital(line(i:i)) end do - if (matches('ATOMIC_SPECIES',line)) then + if (matches('ATOMIC_POSITIONS',line)) then if ( matches('ALAT', line) ) then scale = 1.0 else if ( matches('BOHR', line) ) then