diff --git a/atomic/all_electron.f90 b/atomic/all_electron.f90 index e3f788a5c..c0369f92f 100644 --- a/atomic/all_electron.f90 +++ b/atomic/all_electron.f90 @@ -15,7 +15,7 @@ subroutine all_electron(ild,ic) ! ! use kinds, only : DP - use radial_grids, only: ndmx + use radial_grids use ld1inc, only: isic, grid, zeta, rho, enne, vpot, vxt, enl, & deld, encl, etot, ecxc, evxt, ehrt, epseu, ekin, & vnl, vh, lsd, nspin, nlcc, vdw, nn, ll, oc, nwf, & diff --git a/atomic/ld1.f90 b/atomic/ld1.f90 index b213510de..46efe7ee8 100644 --- a/atomic/ld1.f90 +++ b/atomic/ld1.f90 @@ -18,7 +18,9 @@ program ld1 ! USE mp_global, ONLY : mp_startup, mp_global_end USE environment, ONLY : environment_start - USE ld1inc, ONLY : iswitch, write_coulomb + USE ld1inc, ONLY : iswitch, write_coulomb, grid + use radial_grids, ONLY : deallocate_radial_grid + ! implicit none CHARACTER (LEN=9) :: code = 'LD1' @@ -61,6 +63,7 @@ program ld1 else call errore('ld1','iswitch not implemented',1) endif + call deallocate_radial_grid( grid ) call mp_global_end() diff --git a/atomic/ld1_writeout.f90 b/atomic/ld1_writeout.f90 index 8b702f208..4958ccda9 100644 --- a/atomic/ld1_writeout.f90 +++ b/atomic/ld1_writeout.f90 @@ -1,5 +1,5 @@ ! -! Copyright (C) 2004 PWSCF group +! Copyright (C) 2004-2010 Quantum ESPRESSO 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, @@ -14,7 +14,7 @@ subroutine ld1_writeout ! a multiprojector pseudopotential. It can be in the ! Vanderbilt form or in the norm-conserving form ! - use radial_grids, only: ndmx, deallocate_radial_grid + use radial_grids, only: ndmx use io_global, only : stdout, ionode, ionode_id use mp, only : mp_bcast use ld1inc, only : file_pseudopw, upf_v1_format, zed, grid, & @@ -35,7 +35,7 @@ subroutine ld1_writeout logical :: oldformat character (len=20) :: dft_name - if (file_pseudopw == ' ') go to 10 + if (file_pseudopw == ' ') return if (nconf > 1) & call errore('ld1_writeout','more than one test configuration',1) @@ -99,8 +99,6 @@ subroutine ld1_writeout close(iunps) endif ! -10 call deallocate_radial_grid( grid ) - ! return end subroutine ld1_writeout