! ! Copyright (C) 2001-2013 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, ! or http://www.gnu.org/copyleft/gpl.txt . ! ! !this routine calculate the terms \psi_i(r)\_psi_v(sc)(r) !and write them on disk on global G grid subroutine semicore(n_semicore, num_nbnds,ispin) !NOT_TO_BE_INCLUDED_START USE io_global, ONLY : stdout, ionode,ionode_id USE io_files, ONLY : diropn,prefix,tmp_dir use pwcom USE wavefunctions, ONLY : evc USE kinds, ONLY : DP USE gvect, ONLY : ngm_g, ig_l2g, gstart USE mp, ONLY : mp_sum, mp_barrier, mp_bcast USE mp_wave, ONLY : mergewf,splitwf USE mp_pools, ONLY : intra_pool_comm, inter_pool_comm, intra_pool_comm USE mp_world, ONLY : world_comm, mpime, nproc USE fft_base, ONLY : dfftp, dffts USE fft_interfaces, ONLY : fwfft, invfft USE wavefunctions, ONLY : psic USE wvfct, ONLY : et implicit none INTEGER, EXTERNAL :: find_free_unit INTEGER, INTENT(in) :: n_semicore!number of semicore states INTEGER, INTENT(in) :: num_nbnds!total KS states considered INTEGER, INTENT(in) :: ispin!spin channel REAL(kind=DP), ALLOCATABLE :: psi_sc(:,:) COMPLEX(kind=DP), ALLOCATABLE :: prod(:), prod_g(:,:), prod_g_tot(:) INTEGER :: iv, iun, ii INTEGER :: npwx_g !fft trasform semicore states to R space allocate(psi_sc(dfftp%nnr,n_semicore)) allocate(prod(dfftp%nnr), prod_g(npw,2),prod_g_tot(ngm_g)) do iv=1,n_semicore,2 psic(:)=(0.d0,0.d0) if(iv